Remove king invulnerability, disable everything but teleport instead.
authornemo
Sun, 31 Jan 2010 19:24:22 +0000
changeset 2730 f56592281526
parent 2729 c216de4d0c93
child 2731 9f5548ce70e4
Remove king invulnerability, disable everything but teleport instead.
hedgewars/GSHandlers.inc
hedgewars/uAmmos.pas
hedgewars/uGears.pas
hedgewars/uTeams.pas
--- a/hedgewars/GSHandlers.inc	Sun Jan 31 16:35:18 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Jan 31 19:24:22 2010 +0000
@@ -93,12 +93,14 @@
 if(Gear^.Invulnerable) then exit;
 if _0_4 < Gear^.dY then
 	begin
+	dmg:= ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear);
+    if dmg < 1 then exit;
+
 	if _0_6 < Gear^.dY then
 		PlaySound(sndOw4, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack)
 	else
 		PlaySound(sndOw1, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
 
-	dmg:= ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear);
     ApplyDamage(Gear, dmg);
 	end
 end;
--- a/hedgewars/uAmmos.pas	Sun Jan 31 16:35:18 2010 +0000
+++ b/hedgewars/uAmmos.pas	Sun Jan 31 19:24:22 2010 +0000
@@ -107,6 +107,8 @@
             end;
         ammos[a]:= cnt;
         if shoppa then Ammoz[a].NumberInCase:= 1;  // FIXME - TEMPORARY remove when crate number in case editor is added
+
+        if ((GameFlags and gfKing) <> 0) and (a <> amTeleport) then Ammoz[a].SkipTurns:= 1;
         end else
         ammos[a]:= AMMO_INFINITE
     end;
--- a/hedgewars/uGears.pas	Sun Jan 31 16:35:18 2010 +0000
+++ b/hedgewars/uGears.pas	Sun Jan 31 19:24:22 2010 +0000
@@ -721,7 +721,7 @@
                      end;
 
                   if (Gear <> nil) then
-                     if ((GameFlags and gfInvulnerable) = 0) and (not King or (TotalRounds >= 0))  then // King is protected for one round
+                     if (GameFlags and gfInvulnerable) = 0 then
                         Gear^.Invulnerable:= false;
                   end;
 end;
--- a/hedgewars/uTeams.pas	Sun Jan 31 16:35:18 2010 +0000
+++ b/hedgewars/uTeams.pas	Sun Jan 31 19:24:22 2010 +0000
@@ -312,7 +312,6 @@
          King:= true;
          Hat:= 'crown';
          Gear^.Health:= hwRound(int2hwFloat(Gear^.Health)*_1_5);
-         Gear^.Invulnerable:= true
          end
       end;