Added poisoned eggs
authormbait
Sat, 27 Mar 2010 08:59:10 +0000
changeset 3100 5fe9c4ac4c99
parent 3099 cc13b42ab593
child 3101 e128eff95fca
Added poisoned eggs
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uGears.pas
hedgewars/uTeams.pas
--- a/hedgewars/GSHandlers.inc	Sat Mar 27 05:45:45 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Mar 27 08:59:10 2010 +0000
@@ -2909,7 +2909,7 @@
 	doStepFallingGear(Gear);
 	if (Gear^.State and gstCollision) <> 0 then
 	begin
-		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound);
+		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound + EXPLPoisoned);
 		DeleteGear(Gear);
 		exit
 	end;
--- a/hedgewars/HHHandlers.inc	Sat Mar 27 05:45:45 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Mar 27 08:59:10 2010 +0000
@@ -336,6 +336,7 @@
                     end;
      posCaseHealth: begin
                     inc(HH^.Health, Gear^.Health);
+										PHedgehog(HH^.Hedgehog)^.Poisoned := false;
                     str(Gear^.Health, s);
                     s:= '+' + s;
                     AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
--- a/hedgewars/uGears.pas	Sat Mar 27 05:45:45 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 08:59:10 2010 +0000
@@ -580,27 +580,32 @@
        i: LongWord;
     flag: Boolean;
 begin
-Gear:= GearsList;
+	Gear:= GearsList;
 
-while Gear <> nil do
-    begin
-    if Gear^.Kind = gtHedgehog then
-        begin
-        inc(Gear^.Damage, min(cHealthDecrease, max(0,Gear^.Health - 1 - Gear^.Damage)));
-        if PHedgehog(Gear^.Hedgehog)^.King then
-            begin
-            flag:= false;
-            team:= PHedgehog(Gear^.Hedgehog)^.Team;
-            for i:= 0 to Pred(team^.HedgehogsNumber) do
-                if (team^.Hedgehogs[i].Gear <> nil) and 
-                   (not team^.Hedgehogs[i].King) and 
-                   (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage) then flag:= true;
-            if not flag then inc(Gear^.Damage, min(5, max(0,Gear^.Health - 1 - Gear^.Damage)))
-            end
-        end;
+	while Gear <> nil do
+	begin
+		if Gear^.Kind = gtHedgehog then
+			begin
+        if PHedgehog(Gear^.Hedgehog)^.Poisoned then
+          inc(Gear^.Damage, min(5, max(0,Gear^.Health - 1 - Gear^.Damage)));
+				inc(Gear^.Damage, min(cHealthDecrease, max(0,Gear^.Health - 1 - Gear^.Damage)));
+				if PHedgehog(Gear^.Hedgehog)^.King then
+				begin
+					flag:= false;
+					team:= PHedgehog(Gear^.Hedgehog)^.Team;
+					for i:= 0 to Pred(team^.HedgehogsNumber) do
+						if (team^.Hedgehogs[i].Gear <> nil) and 
+							(not team^.Hedgehogs[i].King) and 
+							(team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage) 
+						then begin
+								flag:= true;
+						end;
+					if not flag then inc(Gear^.Damage, min(5, max(0,Gear^.Health - 1 - Gear^.Damage)))
+				end;
+			end;
 
-    Gear:= Gear^.NextGear
-    end;
+		Gear:= Gear^.NextGear
+	end;
 end;
 
 procedure ProcessGears;
@@ -1815,8 +1820,12 @@
                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
                                 Gear^.Active:= true;
                                 FollowGear:= Gear
-                                end
-                            end
+														end;
+
+													if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) then
+														PHedgehog(Gear^.Hedgehog)^.Poisoned := true;
+							end;
+
                         end;
                 gtGrave: begin
 // Run the calcs only once we know we have a type that will need damage
--- a/hedgewars/uTeams.pas	Sat Mar 27 05:45:45 2010 +0000
+++ b/hedgewars/uTeams.pas	Sat Mar 27 08:59:10 2010 +0000
@@ -55,7 +55,7 @@
             King: boolean;  // Flag for a bunch of hedgehog attributes
             Unplaced: boolean;  // Flag for hog placing mode
             Timer: Longword;
-			Poisoned: boolean;
+            Poisoned: boolean;
             end;
 
     TTeam = record
@@ -365,6 +365,7 @@
           begin
           Hedgehogs[0].King:= true;
           Hedgehogs[0].Hat:= 'crown';
+					Hedgehogs[0].Poisoned := false;
           h:= Hedgehogs[0].Gear^.Health;
           Hedgehogs[0].Gear^.Health:= hwRound(int2hwFloat(th)*_0_375);
           if Hedgehogs[0].Gear^.Health > h then