New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
authornemo
Tue, 02 Jun 2009 18:27:15 +0000
changeset 2143 ad05f6b2d1c0
parent 2142 48ed98cfd119
child 2144 c76a2f7bd452
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on game events
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLocale.pas
hedgewars/uStats.pas
hedgewars/uVisualGears.pas
share/hedgewars/Data/Graphics/Bubbles.png
share/hedgewars/Data/Graphics/ExplPart.png
share/hedgewars/Data/Locale/de.txt
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Sounds/baseballbat.ogg
share/hedgewars/Data/Sounds/steam.ogg
--- a/hedgewars/GSHandlers.inc	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Tue Jun 02 18:27:15 2009 +0000
@@ -92,7 +92,9 @@
 begin
 AllInactive:= false;
 Gear^.Y:= Gear^.Y + cDrownSpeed;
-if hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear)
+if hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear);
+// Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
+if Random(1000) < 10 then AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1207,6 +1209,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepFlame(Gear: PGear);
+var i: Integer;
 begin
 AllInactive:= false;
 
@@ -1221,8 +1224,13 @@
 	Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 640;
 	Gear^.Y:= Gear^.Y + Gear^.dY;
 	
-	if not (hwRound(Gear^.Y) < cWaterLine) then
+	if (hwRound(Gear^.Y) > cWaterLine) then
 		begin
+		for i:= 0 to 3 do
+			begin
+			AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam);
+			PlaySound(sndVaporize, false, nil);
+			end;
 		DeleteGear(Gear);
 		exit
 		end
--- a/hedgewars/HHHandlers.inc	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/HHHandlers.inc	Tue Jun 02 18:27:15 2009 +0000
@@ -160,7 +160,10 @@
                                  CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtWhip, 0, SignAs(_1, dX), - _0_8, 0);
                                  PlaySound(sndWhipCrack, false, nil)
                                  end;
-                  amBaseballBat: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtShover, 0, xx * _0_5, yy * _0_5, 0);
+                  amBaseballBat: begin
+								 CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtShover, 0, xx * _0_5, yy * _0_5, 0);
+								 PlaySound(sndBaseballBat, false, nil);
+								 end;
                     amParachute: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtParachute, 0, _0, _0, 0);
                     amAirAttack: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 0, _0, _0, 0);
                    amMineStrike: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 1, _0, _0, 0);
@@ -725,5 +728,5 @@
 	with PHedgehog(Gear^.Hedgehog)^ do
 		if Team^.hasGone then TeamGoneEffect(Team^);
 	doStepHedgehogDriven(Gear)
-	end
+	end;
 end;
--- a/hedgewars/uConsts.pas	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/uConsts.pas	Tue Jun 02 18:27:15 2009 +0000
@@ -63,7 +63,7 @@
             sprSpeechCorner, sprSpeechEdge, sprSpeechTail, 
             sprThoughtCorner, sprThoughtEdge, sprThoughtTail, 
             sprShoutCorner, sprShoutEdge, sprShoutTail,
-            sprSniperRifle);
+            sprSniperRifle, sprBubbles);
 
 	TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag, // 3
 			gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope, // 8
@@ -76,7 +76,7 @@
 			gtHellishBomb, gtEvilTrace, gtWaterUp, gtDrill, gtBallGun, gtBall,gtRCPlane, gtSniperRifleShot);
 
 	TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
-			vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble);
+			vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble, vgtSteam);
 
 	TGearsType = set of TGearType;
 
@@ -90,7 +90,7 @@
 			sndCake, sndOw1, sndOw4, sndFirePunch1, sndFirePunch2,
 			sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6,
 			sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack,
-			sndRideOfTheValkyries, sndDenied, sndPlaced);
+			sndRideOfTheValkyries, sndDenied, sndPlaced, sndBaseballBat, sndVaporize);
 
 	TAmmoType  = (amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
 			amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -548,7 +548,9 @@
 			(FileName:'ShoutTail';Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  30; Height: 37; saveSurf: true), // sprShoutTail
 			(FileName:'amSniperRifle';Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  128; Height: 32; saveSurf: false) // sprSniperRifle
+			Width:  128; Height: 32; saveSurf: false), // sprSniperRifle
+			(FileName:     'Bubbles'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  16; Height: 16; saveSurf: false) // sprBubbles
 			);
 
 	Wavez: array [TWave] of record
@@ -620,7 +622,9 @@
 			(FileName:            'whipcrack.ogg'; Path: ptSounds),// sndWhipCrack
 			(FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds),// sndRideOfTheValkyries
 			(FileName:               'denied.ogg'; Path: ptSounds),// sndDenied
-			(FileName:               'placed.ogg'; Path: ptSounds) // sndPlaced
+			(FileName:               'placed.ogg'; Path: ptSounds),// sndPlaced
+			(FileName:          'baseballbat.ogg'; Path: ptSounds),// sndBaseballBat
+			(FileName:                'steam.ogg'; Path: ptSounds) // sndVaporize
 			);
 
 	Ammoz: array [TAmmoType] of record
--- a/hedgewars/uGears.pas	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/uGears.pas	Tue Jun 02 18:27:15 2009 +0000
@@ -1719,7 +1719,8 @@
      0..6: begin
         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
         FollowGear^.Health:= 25;
-        FollowGear^.Pos:= posCaseHealth
+        FollowGear^.Pos:= posCaseHealth;
+		AddCaption(GetEventString(eidNewHealthPack), $FFFFFF, capgrpGameState);
         end;
      7..13: begin
         t:= 0;
@@ -1740,7 +1741,8 @@
                   dec(t, Ammoz[i].Probability)
               end;
             FollowGear^.Pos:= posCaseAmmo;
-            FollowGear^.State:= Longword(i)
+            FollowGear^.State:= Longword(i);
+			AddCaption(GetEventString(eidNewAmmoPack), $FFFFFF, capgrpGameState);
             end
         end;
      14..19: begin
@@ -1762,7 +1764,8 @@
                   dec(t, Ammoz[i].Probability)
               end;
             FollowGear^.Pos:= posCaseUtility;
-            FollowGear^.State:= Longword(i)
+            FollowGear^.State:= Longword(i);
+			AddCaption(GetEventString(eidNewUtilityPack), $FFFFFF, capgrpGameState);
             end
         end;
      end;
--- a/hedgewars/uLocale.pas	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/uLocale.pas	Tue Jun 02 18:27:15 2009 +0000
@@ -31,10 +31,10 @@
 	TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
 			sidConfirm, sidSuddenDeath);
 			
-	TEventId = (eidDied, eidDrowned, eidRoundStart);
+	TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
+			eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf);
 
 const MAX_EVENT_STRINGS = 100;
-
 var trammo: array[TAmmoStrId] of string;
     trmsg: array[TMsgStrId] of string;
 
@@ -53,11 +53,13 @@
 var s: shortstring;
     f: textfile;
     a, b, c: LongInt;
-    e: TEventId;
+	first: array[TEventId] of boolean;
 begin
 
 // clear event locales
-for e:= Low(TEventId) to High(TEventId) do trevt_n[e]:= 0;
+//for a:= 0 to ord(High(TEventId)) do trevt_n[TEventId(a)]:= 0;
+
+for a:= ord(Low(TEventId)) to ord(High(TEventId)) do first[TEventId(a)]:= true;
 
 {$I-}
 Assign(f, FileName);
@@ -80,7 +82,12 @@
 		0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammo[TAmmoStrId(b)]:= s;
 		1: if (b >=0) and (b <= ord(High(TMsgStrId))) then trmsg[TMsgStrId(b)]:= s;
 		2: if (b >=0) and (b <= ord(High(TEventId))) then begin
-			TryDo(trevt_n[TEventId(b)] < MAX_EVENT_STRINGS, 'Too many event strings', true);
+			TryDo(trevt_n[TEventId(b)] < MAX_EVENT_STRINGS, 'Too many event strings in ' + inttostr(a) + ':' + inttostr(b), false);
+			if first[TEventId(b)] then
+				begin
+				trevt_n[TEventId(b)]:= 0;
+				first[TEventId(b)]:= false;
+				end;
 			trevt[TEventId(b)][trevt_n[TEventId(b)]]:= s;
 			inc(trevt_n[TEventId(b)]);
 			end;
--- a/hedgewars/uStats.pas	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/uStats.pas	Tue Jun 02 18:27:15 2009 +0000
@@ -43,7 +43,7 @@
 	FinishedTurnsTotal: LongInt = -1;
 
 implementation
-uses uTeams, uSound, uMisc;
+uses uTeams, uSound, uMisc, uLocale, uWorld;
 var DamageGiven : Longword = 0;
 	DamageClan  : Longword = 0;
 	DamageTotal : Longword = 0;
@@ -106,8 +106,10 @@
 		PlaySound(sndFirstBlood, false, CurrentTeam^.voicepack)
 
 	else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
-		PlaySound(sndStupid, false, PreviousTeam^.voicepack)
-
+		begin
+		PlaySound(sndStupid, false, PreviousTeam^.voicepack);
+		if DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), $FFFFFF, capgrpGameState);
+		end
 	else if DamageClan <> 0 then
 		if DamageTotal > DamageClan then
 			if random(2) = 0 then
@@ -119,7 +121,6 @@
 				PlaySound(sndSameTeam, false, vpHurtSameClan)
 			else
 				PlaySound(sndTraitor, false, vpHurtSameClan)
-
 	else if DamageGiven <> 0 then
 		if Kills > 0 then
 			PlaySound(sndEnemyDown, false, CurrentTeam^.voicepack)
@@ -131,7 +132,10 @@
 	else if (AmmoUsedCount > 0) and not isTurnSkipped then
 		// nothing ?
 	else if isTurnSkipped then
-		PlaySound(sndBoring, false, PreviousTeam^.voicepack)
+		begin
+		PlaySound(sndBoring, false, PreviousTeam^.voicepack);
+		AddCaption(Format(GetEventString(eidTurnSkipped), CurrentHedgehog^.Name), $FFFFFF, capgrpGameState);
+		end
 	else
 		PlaySound(sndCoward, false, PreviousTeam^.voicepack);
 	end;
--- a/hedgewars/uVisualGears.pas	Mon Jun 01 20:38:45 2009 +0000
+++ b/hedgewars/uVisualGears.pas	Tue Jun 02 18:27:15 2009 +0000
@@ -59,7 +59,7 @@
 	vobVelocity, vobFallSpeed: LongInt;
 
 implementation
-uses uWorld, uMisc, uStore, uTeams;
+uses uWorld, uMisc, uStore, uTeams, uSound;
 const cExplFrameTicks = 110;
 
 procedure AddDamageTag(X, Y, Damage, Color: LongWord);
@@ -140,14 +140,22 @@
 end;
 
 procedure doStepFire(Gear: PVisualGear; Steps: Longword);
+var i: Integer;
 begin
 Gear^.X:= Gear^.X + Gear^.dX * Steps;
 
 Gear^.Y:= Gear^.Y + Gear^.dY * Steps;// + cGravity * (Steps * Steps);
 Gear^.dY:= Gear^.dY + cGravity * Steps;
 
-if Gear^.FrameTicks <= Steps then
-	DeleteVisualGear(Gear)
+if (Gear^.FrameTicks <= Steps) or (hwRound(Gear^.Y) > cWaterLine) then
+	begin
+	if hwRound(Gear^.Y) > cWaterLine then for i:= 0 to 3 do
+		begin
+		AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam);
+		PlaySound(sndVaporize, false, nil);
+		end;
+	DeleteVisualGear(Gear);
+	end
 else
 	dec(Gear^.FrameTicks, Steps)
 end;
@@ -162,6 +170,32 @@
 	dec(Gear^.FrameTicks, Steps)
 end;
 
+procedure doStepBubble(Gear: PVisualGear; Steps: Longword);
+begin
+	Gear^.X:= Gear^.X + (cWindSpeed * 100 + Gear^.dX) * Steps;
+	Gear^.Y:= Gear^.Y - cDrownSpeed * Steps;
+	
+	if (Gear^.FrameTicks <= Steps) or (hwRound(Gear^.Y) < cWaterLine) then
+		DeleteVisualGear(Gear)
+	else
+		dec(Gear^.FrameTicks, Steps)
+end;
+
+procedure doStepSteam(Gear: PVisualGear; Steps: Longword);
+begin
+	Gear^.X:= Gear^.X + (cWindSpeed * 100 + Gear^.dX) * Steps;
+	Gear^.Y:= Gear^.Y - cDrownSpeed * Steps;
+
+	if Gear^.FrameTicks <= Steps then
+		if Gear^.Frame = 0 then DeleteVisualGear(Gear)
+		else
+			begin
+			if Random(2) = 0 then dec(Gear^.Frame);
+			Gear^.FrameTicks:= cExplFrameTicks
+			end
+		else dec(Gear^.FrameTicks, Steps)
+end;
+
 ////////////////////////////////////////////////////////////////////////////////
 const cSorterWorkTime = 640;
 var thexchar: array[0..cMaxTeams] of
@@ -291,7 +325,9 @@
 			@doStepFire,
 			@doStepSmallDamage,
 			@doStepTeamHealthSorter,
-			@doStepSpeechBubble
+			@doStepSpeechBubble,
+			@doStepBubble,
+			@doStepSteam
 		);
 
 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
@@ -366,6 +402,26 @@
 	vgtSmallDamageTag: begin
 				Result^.FrameTicks:= 1100
 				end;
+	vgtBubble: begin
+				t:= random(1024);
+				sp:= _0_001 * (random(85) + 95);
+				dx.isNegative:= random(2) = 0;
+				dx.QWordValue:= random(100000000);
+				dy:= sp;
+				dy.isNegative:= false;
+				FrameTicks:= 250 + random(1751);
+				Frame:= random(5)
+				end;
+	vgtSteam: begin
+				t:= random(1024);
+				sp:= _0_001 * (random(95) + 70);
+				dx.isNegative:= random(2) = 0;
+				dx.QWordValue:= random(100000000);
+				dy:= sp;
+				dy.isNegative:= false;
+				Frame:= 7 - random(3);
+				FrameTicks:= cExplFrameTicks * 2;
+				end;
 		end;
 
 if VisualGearsList <> nil then
@@ -427,6 +483,8 @@
                 vgtExplPart: DrawSprite(sprExplPart, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 7 - Gear^.Frame);
                 vgtExplPart2: DrawSprite(sprExplPart2, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 7 - Gear^.Frame);
                 vgtFire: DrawSprite(sprFlame, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (RealTicks div 64 + Gear^.Frame) mod 8);
+				vgtBubble: DrawSprite(sprBubbles, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
+				vgtSteam: DrawSprite(sprExplPart, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 7 - Gear^.Frame);
             end;
         case Gear^.Kind of
             vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
Binary file share/hedgewars/Data/Graphics/Bubbles.png has changed
Binary file share/hedgewars/Data/Graphics/ExplPart.png has changed
--- a/share/hedgewars/Data/Locale/de.txt	Mon Jun 01 20:38:45 2009 +0000
+++ b/share/hedgewars/Data/Locale/de.txt	Tue Jun 02 18:27:15 2009 +0000
@@ -1,4 +1,4 @@
-; German locale
+; German locale
 
 00:00=Granate
 00:01=Splittergranate
@@ -55,16 +55,39 @@
 02:00=%1 hat's nicht geschafft!
 02:00=%1 stellt sich tot!
 02:00=%1 scheint schon bessere Tage gesehen zu haben!
+02:00=%1 sieht tote Igel!
+02:00=%1 hat ins Gras gebissen!
 ; Hog (%1) drowned
 02:01=%1 geht auf Tauchstation!
 02:01=%1 sucht nach der Titanic!
 02:01=%1 hat ein nasses Grab gefunden!
 02:01=%1 schwimmt wie ein Stein!
-02:01=%1 hats ich nass gemacht!
+02:01=%1 hat sich nass gemacht!
 02:01=%1 versagt beim Seepferdchen!
-; Match starts
+02:01=%1 ist ein Opfer der Gezeiten!
+; Round starts
 02:02=Auf in die Schlacht!
 02:02=Geladen und entsichert!
 02:02=Jetzt geht's rund!
 02:02=Los geht's!
-
+02:02=Alles angetreten!
+; Round ends (win; unused atm)
+02:03=...
+; Round ends (draw; unused atm)
+02:04=...
+; New health crate
+02:05=Alles Gute kommt von oben!
+02:05=Der Arzt hat's verschrieben ...
+; New ammo crate
+02:06=Nachschub!
+02:06=Zeit zum Nachladen!
+; New utility crate
+02:07=Nützliches?
+02:07=Tooltime!
+; Hog (%1) skips his turn
+02:08=%1 ist so ein Langeweiler ...
+; Hog (%1) hurts himself only
+02:09=%1 sollte besser Zielen üben!
+02:09=%1 scheint sich zu hassen.
+02:09=%1 steht auf der falschen Seite!
+02:09=%1 lebt gefährlich!
\ No newline at end of file
--- a/share/hedgewars/Data/Locale/en.txt	Mon Jun 01 20:38:45 2009 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Tue Jun 02 18:27:15 2009 +0000
@@ -57,6 +57,22 @@
 02:01=%1 plays submarine!
 02:01=%1 mimics the Titanic!
 02:01=%1 swims like a stone!
-; Match starts
+; Round starts
 02:02=Let's fight!
 02:02=Armed and ready!
+; Round ends (win; unused atm)
+02:03=...
+; Round ends (draw; unused atm)
+02:04=...
+; New health crate
+02:05=Incomming aid!
+; New ammo crate
+02:06=More weapons!
+; New utility crate
+02:07=Tooltime!
+; Hog (%1) skips his turn
+02:08=%1 is sooo boring...
+; Hog (%1) hurts himself only
+02:09=%1 should practice aiming!
+02:09=%1 seems to hate himself.
+02:09=%1 is standing on the wrong side!
\ No newline at end of file
Binary file share/hedgewars/Data/Sounds/baseballbat.ogg has changed
Binary file share/hedgewars/Data/Sounds/steam.ogg has changed