Engine:
authorsmxx
Sat, 27 Mar 2010 15:48:59 +0000
changeset 3112 f1bbe35ddb83
parent 3111 38e0f05afbdb
child 3113 2829ea0dd47c
Engine: * Added visible poison effect * Updated homing bee in hand animation
hedgewars/HHHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uTeams.pas
--- a/hedgewars/HHHandlers.inc	Sat Mar 27 15:41:21 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Mar 27 15:48:59 2010 +0000
@@ -336,7 +336,7 @@
                     end;
      posCaseHealth: begin
                     inc(HH^.Health, Gear^.Health);
-										PHedgehog(HH^.Hedgehog)^.Poisoned := false;
+                    PHedgehog(HH^.Hedgehog)^.Effects[hePoisoned] := false;
                     str(Gear^.Health, s);
                     s:= '+' + s;
                     AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
--- a/hedgewars/uConsts.pas	Sat Mar 27 15:41:21 2010 +0000
+++ b/hedgewars/uConsts.pas	Sat Mar 27 15:48:59 2010 +0000
@@ -172,6 +172,8 @@
             PrevTexture, NextTexture: PTexture;
             end;
 
+    THogEffect = (heInvulnerable, hePoisoned);
+
     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
 const sfMax = 1000;
 
--- a/hedgewars/uGears.pas	Sat Mar 27 15:41:21 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 15:48:59 2010 +0000
@@ -585,7 +585,7 @@
 	begin
 		if Gear^.Kind = gtHedgehog then
 			begin
-            if PHedgehog(Gear^.Hedgehog)^.Poisoned then
+            if PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] 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
@@ -917,6 +917,14 @@
 
 sx:= hwRound(Gear^.X) + 1 + WorldDx;
 sy:= hwRound(Gear^.Y) - 3 + WorldDy;
+
+if HH^.Effects[hePoisoned] then
+    begin
+    glColor4f(0.25, 1, 0, 0.25);
+    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
+    glColor4f(1, 1, 1, 1)
+    end;
+
 if ((Gear^.State and gstWinner) <> 0) and
    ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
     begin
@@ -1247,8 +1255,7 @@
                                   cWaterLine+WorldDy,
                                   LongInt(leftX)+WorldDx)
                 end;
-            //amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
-            amBee: DrawRotatedF(sprHandBee, hx, hy, 0, hwSign(Gear^.dX), aangle);
+            amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
         end;
 
         case amt of
@@ -1429,6 +1436,13 @@
         end
     end;
 
+if HH^.Effects[hePoisoned] then
+    begin
+    glColor4f(0.25, 1, 0, 0.5);
+    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
+    glColor4f(1, 1, 1, 1)
+    end;
+
 if Gear^.Invulnerable then
     begin
     glColor4f(1, 1, 1, 0.25 + abs(1 - ((RealTicks div 2) mod 1500) / 750));
@@ -1819,11 +1833,10 @@
                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
                                 Gear^.Active:= true;
                                 FollowGear:= Gear
-														end;
-
-													if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) then
-														PHedgehog(Gear^.Hedgehog)^.Poisoned := true;
-							end;
+                                end;
+                            if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) then
+                                PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned] := true;
+                            end;
 
                         end;
                 gtGrave: begin
--- a/hedgewars/uTeams.pas	Sat Mar 27 15:41:21 2010 +0000
+++ b/hedgewars/uTeams.pas	Sat Mar 27 15:48:59 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;
+            Effects: Array[THogEffect] of boolean;
             end;
 
     TTeam = record
@@ -365,7 +365,7 @@
           begin
           Hedgehogs[0].King:= true;
           Hedgehogs[0].Hat:= 'crown';
-					Hedgehogs[0].Poisoned := false;
+          Hedgehogs[0].Effects[hePoisoned] := false;
           h:= Hedgehogs[0].Gear^.Health;
           Hedgehogs[0].Gear^.Health:= hwRound(int2hwFloat(th)*_0_375);
           if Hedgehogs[0].Gear^.Health > h then