diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs index 7959af05..bb63b9f8 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs @@ -65,6 +65,8 @@ private void m_GridDamageHandler(IMyCubeGrid Entity, DamageEvent DamageEvent) Vector3I? HitPos = Entity.RayCastBlocks(DamageEvent.Projectile.Position, DamageEvent.Projectile.NextMoveStep); if (HitPos != null) { + Entity.Physics.ApplyImpulse(DamageEvent.Projectile.Direction * DamageEvent.Projectile.Definition.Ungrouped.Impulse, DamageEvent.Projectile.Position); + IMySlimBlock block = Entity.GetCubeBlock(HitPos.Value); float damageMult = block.FatBlock == null ? DamageEvent.Projectile.Definition.Damage.SlimBlockDamageMod : DamageEvent.Projectile.Definition.Damage.FatBlockDamageMod; @@ -77,8 +79,9 @@ private void m_GridDamageHandler(IMyCubeGrid Entity, DamageEvent DamageEvent) foreach (var ablock in AoEBlocks) { + float distMult = Vector3.Distance(ablock.Position, block.Position) / DamageEvent.Projectile.Definition.Damage.AreaRadius; // Do less damage at max radius damageMult = ablock.FatBlock == null ? DamageEvent.Projectile.Definition.Damage.SlimBlockDamageMod : DamageEvent.Projectile.Definition.Damage.FatBlockDamageMod; - ablock.DoDamage(DamageEvent.Projectile.Definition.Damage.AreaDamage * damageMult, MyDamageType.Explosion, MyAPIGateway.Utilities.IsDedicated); + ablock.DoDamage(DamageEvent.Projectile.Definition.Damage.AreaDamage * damageMult * distMult, MyDamageType.Explosion, MyAPIGateway.Utilities.IsDedicated); } } } diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileDefinitionManager.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileDefinitionManager.cs index f285c99b..e8742e6b 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileDefinitionManager.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileDefinitionManager.cs @@ -14,7 +14,7 @@ internal class ProjectileDefinitionManager ReloadPowerUsage = 0, Length = 1, Recoil = 0, - Impulse = 0, + Impulse = 1000, }, Damage = new Damage() {