Further work on taunts
authorunc0rr
Fri, 27 Jun 2008 17:22:15 +0000
changeset 1034 05f003ad3caa
parent 1033 622c5de38d72
child 1035 6f5842bc481b
Further work on taunts
hedgewars/HHHandlers.inc
hedgewars/uChat.pas
hedgewars/uConsts.pas
hedgewars/uGears.pas
share/hedgewars/Data/Graphics/Hedgehog/Sad.png
--- a/hedgewars/HHHandlers.inc	Thu Jun 26 19:39:26 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Fri Jun 27 17:22:15 2008 +0000
@@ -488,7 +488,7 @@
 		begin
 		Gear^.Timer:= 0;
 		inc(Gear^.Pos);
-		if Gear^.Pos = 12 then
+		if Gear^.Pos = Wavez[TWave(Gear^.Tag)].FramesCount then
 			Gear^.State:= Gear^.State and not gstAnimation
 		end;
 	exit
--- a/hedgewars/uChat.pas	Thu Jun 26 19:39:26 2008 +0000
+++ b/hedgewars/uChat.pas	Fri Jun 27 17:22:15 2008 +0000
@@ -119,11 +119,11 @@
 
 procedure AcceptChatString(s: shortstring);
 begin
-if (s = '/rollup') and not CurrentTeam^.ExtDriven then
+if (s = '/sad') and not CurrentTeam^.ExtDriven then
 	with CurrentHedgehog^.Gear^ do
 		begin
 		Message:= Message or gm_Animate;
-		MsgParam:= Longword(sprKowtow)
+		MsgParam:= Longword(waveSad)
 		end
 else
 	ParseCommand('/say ' + s, true);
--- a/hedgewars/uConsts.pas	Thu Jun 26 19:39:26 2008 +0000
+++ b/hedgewars/uConsts.pas	Fri Jun 27 17:22:15 2008 +0000
@@ -45,7 +45,7 @@
                    sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
                    sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
                    sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
-                   sprHat, sprKamikaze, sprWhip, sprKowtow);
+                   sprHat, sprKamikaze, sprWhip, sprKowtow, sprSad);
 
      TGearType  = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
                    gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
@@ -79,6 +79,8 @@
 
      TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs);
 
+     TWave = (waveRollup, waveSad);
+
      THHFont    = record
                   Handle: PTTF_Font;
                   Height: LongInt;
@@ -400,9 +402,20 @@
                      (FileName:     'amWhip'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
                       Width: 128; Height: 32; saveSurf: false),// sprWhip
                      (FileName:     'Kowtow'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-                      Width:  32; Height: 32; saveSurf: false) // sprWhip
+                      Width:  32; Height: 32; saveSurf: false),// sprKowtow
+                     (FileName:        'Sad'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
+                      Width:  32; Height: 32; saveSurf: false) // sprSad
                      );
 
+	Wavez: array [TWave] of record
+			Sprite: TSprite;
+			FramesCount: Longword;
+			cmd: String[10];
+			end = (
+			(Sprite: sprKowtow; FramesCount: 12; cmd: '/rollup'),
+			(Sprite:    sprSad; FramesCount: 14; cmd: '/sad')
+			);
+
       Soundz: array[TSound] of record
                 FileName: String[19];
                 Path    : TPathType;
--- a/hedgewars/uGears.pas	Thu Jun 26 19:39:26 2008 +0000
+++ b/hedgewars/uGears.pas	Fri Jun 27 17:22:15 2008 +0000
@@ -656,7 +656,7 @@
 
 	if ((Gear^.State and gstAnimation) <> 0) then
 		begin
-		DrawRotatedF(TSprite(Gear^.Tag),
+		DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
 				hwRound(Gear^.X) + 1 + WorldDx,
 				hwRound(Gear^.Y) - 3 + WorldDy,
 				Gear^.Pos,
Binary file share/hedgewars/Data/Graphics/Hedgehog/Sad.png has changed