grenade back to old damage, but from now on explosions assume they are not closer to a gear's center than the gear's radius
authorsheepluva
Mon, 11 Apr 2011 01:30:43 +0200
changeset 5139 090a8b8d1083
parent 5138 f991f87969ff
child 5140 932307228d05
grenade back to old damage, but from now on explosions assume they are not closer to a gear's center than the gear's radius
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
--- a/hedgewars/GSHandlers.inc	Mon Apr 11 00:35:53 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Mon Apr 11 01:30:43 2011 +0200
@@ -380,7 +380,7 @@
     dec(Gear^.Timer);
     if Gear^.Timer = 1000 then // might need adjustments
         case Gear^.Kind of 
-            gtGrenade: makeHogsWorry(Gear^.X, Gear^.Y, 47);
+            gtGrenade: makeHogsWorry(Gear^.X, Gear^.Y, 50);
             gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20);
             gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75);
             gtHellishBomb: makeHogsWorry(Gear^.X, Gear^.Y, 90);
@@ -404,7 +404,7 @@
     if Gear^.Timer = 0 then
     begin
         case Gear^.Kind of 
-            gtGrenade: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 47, Gear^.Hedgehog, EXPLAutoSound);
+            gtGrenade: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
             gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, Gear^.Hedgehog, EXPLAutoSound);
             gtClusterBomb: 
                 begin
--- a/hedgewars/uGears.pas	Mon Apr 11 00:35:53 2011 +0200
+++ b/hedgewars/uGears.pas	Mon Apr 11 01:30:43 2011 +0200
@@ -1242,7 +1242,7 @@
                 gtStructure: begin
 // Run the calcs only once we know we have a type that will need damage
                         if hwRound(hwAbs(Gear^.X-fX)+hwAbs(Gear^.Y-fY)) < dmgBase then
-                            dmg:= dmgBase - hwRound(Distance(Gear^.X - fX, Gear^.Y - fY));
+                            dmg:= dmgBase - max(hwRound(Distance(Gear^.X - fX, Gear^.Y - fY)),Gear^.Radius);
                         if dmg > 1 then
                             begin
                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);