- Fix sounds when the turn is skipped
authorunc0rr
Fri, 25 Apr 2008 13:51:01 +0000
changeset 871 f1bf00b7fd5a
parent 870 dd418d9c18c5
child 872 d5f32e2dc166
- Fix sounds when the turn is skipped - Fix max step kills stats
doc/SoundsMapping.txt
hedgewars/CCHandlers.inc
hedgewars/uConsole.pas
hedgewars/uStats.pas
--- a/doc/SoundsMapping.txt	Fri Apr 25 13:12:52 2008 +0000
+++ b/doc/SoundsMapping.txt	Fri Apr 25 13:51:01 2008 +0000
@@ -6,7 +6,7 @@
  + bye bye - before your hedgehog blows up because its health reaches 0
 Come on then -  when you havent done anything for a certain amount of time, telling you to take your go
 Hello - when you havent done anything for a certain amount of time, telling you to take your go
-Coward - when you end your go without attacking
+ + Coward - when you end your go without attacking
 cut it out   -  when your hedgehog takes a very low amount of damage
  + Enemy down - when you reduce enemys health to 0
 Excellent - when you do a high amount of damage
--- a/hedgewars/CCHandlers.inc	Fri Apr 25 13:12:52 2008 +0000
+++ b/hedgewars/CCHandlers.inc	Fri Apr 25 13:51:01 2008 +0000
@@ -370,7 +370,7 @@
 procedure chSkip(var s: shortstring);
 begin
 if not CurrentTeam^.ExtDriven then SendIPC(',');
-PlaySound(sndBoring, false);
+uStats.Skipped;
 TurnTimeLeft:= 0
 end;
 
--- a/hedgewars/uConsole.pas	Fri Apr 25 13:12:52 2008 +0000
+++ b/hedgewars/uConsole.pas	Fri Apr 25 13:51:01 2008 +0000
@@ -36,7 +36,7 @@
 implementation
 {$J+}
 uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uLand,
-     uRandom, uAmmos, uTriggers, GL, uSound;
+     uRandom, uAmmos, uTriggers, GL, uStats;
 const cLineWidth: LongInt = 0;
       cLinesCount = 256;
 
--- a/hedgewars/uStats.pas	Fri Apr 25 13:12:52 2008 +0000
+++ b/hedgewars/uStats.pas	Fri Apr 25 13:51:01 2008 +0000
@@ -34,6 +34,7 @@
 
 procedure AmmoUsed(am: TAmmoType);
 procedure HedgehogDamaged(Gear: PGear);
+procedure Skipped;
 procedure TurnReaction;
 procedure SendStats;
 
@@ -48,6 +49,8 @@
     AmmoUsedCount : Longword = 0;
     AmmoDamagingUsed : boolean = false;
     FinishedTurnsTotal: LongInt = -1;
+    SkippedTurns: LongWord = 0;
+    isTurnSkipped: boolean = false;
 
 procedure HedgehogDamaged(Gear: PGear);
 begin
@@ -69,6 +72,12 @@
 inc(DamageTotal, Gear^.Damage)
 end;
 
+procedure Skipped;
+begin
+inc(SkippedTurns);
+isTurnSkipped:= true
+end;
+
 procedure TurnReaction;
 var Gear: PGear;
     i, t: LongInt;
@@ -103,6 +112,8 @@
 	PlaySound(sndMissed, false)
 else if AmmoUsedCount > 0 then
 	// nothing ?
+else if isTurnSkipped then
+	PlaySound(sndBoring, false)
 else
 	PlaySound(sndCoward, false);
 
@@ -117,6 +128,7 @@
 				if StepDamageRecv > MaxStepDamageRecv then MaxStepDamageRecv:= StepDamageRecv;
 				if StepDamageGiven > MaxStepDamageGiven then MaxStepDamageGiven:= StepDamageGiven;
 				if StepKills > MaxStepKills then MaxStepKills:= StepKills;
+				StepKills:= 0;
 				StepDamageRecv:= 0;
 				StepDamageGiven:= 0
 				end;
@@ -126,7 +138,8 @@
 DamageGiven:= 0;
 DamageClan:= 0;
 AmmoUsedCount:= 0;
-AmmoDamagingUsed:= false
+AmmoDamagingUsed:= false;
+isTurnSkipped:= false
 end;
 
 procedure AmmoUsed(am: TAmmoType);