Use more sounds
authorunc0rr
Fri, 25 Apr 2008 13:12:52 +0000
changeset 870 dd418d9c18c5
parent 869 daddcd31ef34
child 871 f1bf00b7fd5a
Use more sounds
doc/SoundsMapping.txt
hedgewars.kdevelop
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uStats.pas
--- a/doc/SoundsMapping.txt	Thu Apr 24 20:53:35 2008 +0000
+++ b/doc/SoundsMapping.txt	Fri Apr 25 13:12:52 2008 +0000
@@ -16,7 +16,7 @@
 gonna get you - when you take a medium amount of damage
 Grenade - when a grenade lands nearby your hedgehog
 hmm - plays sometimes when it's your go, your hedgehog is  thinking about what it should do
-Hurry - timer is getting low
+ + Hurry - timer is getting low
  + ill get you - said after taking a medium amount of damage
  + Incoming - on airstrike
 Just you wait - said after your team takes a certain amount of damage
--- a/hedgewars.kdevelop	Thu Apr 24 20:53:35 2008 +0000
+++ b/hedgewars.kdevelop	Fri Apr 25 13:12:52 2008 +0000
@@ -26,7 +26,7 @@
     <run>
       <directoryradio>executable</directoryradio>
       <customdirectory>/</customdirectory>
-      <mainprogram></mainprogram>
+      <mainprogram>bin/hedgewars</mainprogram>
       <programargs></programargs>
       <terminal>false</terminal>
       <autocompile>true</autocompile>
@@ -269,9 +269,9 @@
   </cppsupportpart>
   <kdevdocumentation>
     <projectdoc>
-      <docsystem></docsystem>
-      <docurl></docurl>
-      <usermanualurl></usermanualurl>
+      <docsystem/>
+      <docurl/>
+      <usermanualurl/>
     </projectdoc>
   </kdevdocumentation>
   <ctagspart>
--- a/hedgewars/uConsts.pas	Thu Apr 24 20:53:35 2008 +0000
+++ b/hedgewars/uConsts.pas	Fri Apr 25 13:12:52 2008 +0000
@@ -63,7 +63,7 @@
                    sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
                    sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye,
                    sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret,
-                   sndEnemyDown);
+                   sndEnemyDown, sndCoward, sndHurry);
 
      TAmmoType  = (amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
                    amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch,
@@ -409,7 +409,9 @@
                 (FileName:'Reinforcements.ogg'; Path: ptVoices; id: nil; lastChan: 0),// sndReinforce
                 (FileName:       'Traitor.ogg'; Path: ptVoices; id: nil; lastChan: 0),// sndTraitor
                 (FileName:'Youllregretthat.ogg';Path: ptVoices; id: nil; lastChan: 0),// sndRegret
-                (FileName:     'Enemydown.ogg'; Path: ptVoices; id: nil; lastChan: 0) // sndEnemyDown
+                (FileName:     'Enemydown.ogg'; Path: ptVoices; id: nil; lastChan: 0),// sndEnemyDown
+                (FileName:        'Coward.ogg'; Path: ptVoices; id: nil; lastChan: 0),// sndCoward
+                (FileName:         'Hurry.ogg'; Path: ptVoices; id: nil; lastChan: 0) // sndHurry
                 );
 
       Ammoz: array [TAmmoType] of record
--- a/hedgewars/uGears.pas	Thu Apr 24 20:53:35 2008 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 25 13:12:52 2008 +0000
@@ -442,9 +442,15 @@
         end;
 
 if TurnTimeLeft > 0 then
-      if CurrentHedgehog^.Gear <> nil then
-         if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
-            and not isInMultiShoot then dec(TurnTimeLeft);
+		if CurrentHedgehog^.Gear <> nil then
+			if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
+				and not isInMultiShoot then
+				begin
+				if (TurnTimeLeft = 5000)
+					and (CurrentHedgehog^.Gear <> nil)
+					and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then PlaySound(sndHurry, false);
+				dec(TurnTimeLeft)
+				end;
 
 if (not CurrentTeam^.ExtDriven) and
    ((GameTicks and $FFFF) = $FFFF) then
--- a/hedgewars/uStats.pas	Thu Apr 24 20:53:35 2008 +0000
+++ b/hedgewars/uStats.pas	Fri Apr 25 13:12:52 2008 +0000
@@ -47,6 +47,7 @@
     KillsTotal  : LongWord = 0;
     AmmoUsedCount : Longword = 0;
     AmmoDamagingUsed : boolean = false;
+    FinishedTurnsTotal: LongInt = -1;
 
 procedure HedgehogDamaged(Gear: PGear);
 begin
@@ -72,6 +73,9 @@
 var Gear: PGear;
     i, t: LongInt;
 begin
+inc(FinishedTurnsTotal);
+if FinishedTurnsTotal = 0 then exit;
+
 inc(CurrentHedgehog^.stats.FinishedTurns);
 
 if (DamageGiven = DamageTotal) and (DamageTotal > 0) then
@@ -96,7 +100,12 @@
 		PlaySound(sndRegret, false)
 
 else if AmmoDamagingUsed then
-	PlaySound(sndMissed, false);
+	PlaySound(sndMissed, false)
+else if AmmoUsedCount > 0 then
+	// nothing ?
+else
+	PlaySound(sndCoward, false);
+
 
 for t:= 0 to Pred(TeamsCount) do
 	with TeamsArray[t]^ do