Add revenge taunt
authorWuzzy <Wuzzy2@mail.ru>
Sun, 28 Oct 2018 02:24:06 +0200
changeset 14055 f9281c294a4c
parent 14045 03a5d9f0bcc9
child 14056 ecfd13128100
Add revenge taunt
ChangeLog.txt
hedgewars/uSound.pas
hedgewars/uStats.pas
hedgewars/uTeams.pas
hedgewars/uTypes.pas
share/hedgewars/Data/Sounds/voices/British/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Classic/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Default/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Default_uk/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Mobster/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Pirate/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Robot/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Russian/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Singer/CMakeLists.txt
share/hedgewars/Data/Sounds/voices/Surfer/CMakeLists.txt
--- a/ChangeLog.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/ChangeLog.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -7,7 +7,7 @@
  + Rework team rankings
  + Tied teams now rank equally
  + Help button in main menu
- + 14 new hedgehog taunts
+ + 15 new hedgehog taunts
  + Many new Lua API features
  * Functionality of controllers restored
  * Fix at least 2 crashes
@@ -54,7 +54,7 @@
  + New default brown clan color for better contrast
  + Allow to change volume during pause
  + Add sounds: flamethrower, landspray, idle freezer, shorykuen hit
- + Add taunts: Amazing, Brilliant, Bugger, Drat, Excellent, Fire, Gonnagetyou, Grenade, Ohdear, Runaway, Solong, Thisoneismine, Whatthe, Watchthis
+ + Add taunts: Amazing, Brilliant, Bugger, Drat, Excellent, Fire, Gonnagetyou, Grenade, Ohdear, Revenge, Runaway, Solong, Thisoneismine, Whatthe, Watchthis
  * Fix extreme amounts of droplets when shooting with minigun into ocean world edge
  * Fix some flakes disappearing in world wrap worlds while moving camera
  * Fix invisible projectile timer, attack bar, target on other side of wrap world edge
--- a/hedgewars/uSound.pas	Sun Oct 28 00:49:00 2018 +0200
+++ b/hedgewars/uSound.pas	Sun Oct 28 02:24:06 2018 +0200
@@ -319,7 +319,8 @@
             (FileName:            'Excellent.ogg'; Path: ptVoices; AltPath: ptNone),// sndExcellent
             (FileName:                 'Fire.ogg'; Path: ptVoices; AltPath: ptNone),// sndFire
             (FileName:            'Watchthis.ogg'; Path: ptVoices; AltPath: ptNone),// sndWatchThis
-            (FileName:              'Runaway.ogg'; Path: ptVoices; AltPath: ptNone) // sndRunAway
+            (FileName:              'Runaway.ogg'; Path: ptVoices; AltPath: ptNone),// sndRunAway
+            (FileName:              'Revenge.ogg'; Path: ptVoices; AltPath: ptNone) // sndRevenge
             );
 
 
--- a/hedgewars/uStats.pas	Sun Oct 28 00:49:00 2018 +0200
+++ b/hedgewars/uStats.pas	Sun Oct 28 02:24:06 2018 +0200
@@ -95,7 +95,21 @@
 if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
     vpHurtSameClan:= CurrentHedgehog^.Team^.voicepack
 else
+    begin
     vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack;
+    if (not killed) then
+        begin
+        // Check if attacker got revenge
+        if (Attacker^.RevengeHog <> nil) and (Attacker^.RevengeHog = Gear^.Hedgehog) then
+            begin
+            Attacker^.stats.GotRevenge:= true;
+            Attacker^.RevengeHog:= nil;
+            end
+        // If not, victim remembers their attacker to plan *their* revenge
+        else
+            Gear^.Hedgehog^.RevengeHog:= Attacker;
+        end
+    end;
 
 //////////////////////////
 
@@ -262,12 +276,15 @@
             AddVoice(sndEnemyDown, CurrentTeam^.voicepack)
         // 0 kills, only damage or poison
         else
-            // TODO: Play sndExcellent for a high damage shot.
-            // Not done yet because the fallback is sndEnemyDown.
-            if random(2) = 0 then
-                AddVoice(sndRegret, vpHurtEnemy)
+            if CurrentHedgehog^.stats.GotRevenge then
+                AddVoice(sndRevenge, CurrentHedgehog^.Team^.voicepack)
             else
-                AddVoice(sndGonnaGetYou, vpHurtEnemy)
+                // TODO: Maybe play sndExcellent for a high damage shot.
+                // Not done yet because the fallback is sndEnemyDown.
+                if random(2) = 0 then
+                    AddVoice(sndRegret, vpHurtEnemy)
+                else
+                    AddVoice(sndGonnaGetYou, vpHurtEnemy)
 
     // Missed shot
     // A miss is defined as a shot with a damaging weapon with 0 kills, 0 damage, 0 hogs poisoned and 0 targets hit
@@ -308,6 +325,7 @@
                 StepDamageGiven:= 0;
                 StepPoisoned:= false;
                 StepDied:= false;
+                GotRevenge:= false;
                 end;
 
 Kills:= 0;
--- a/hedgewars/uTeams.pas	Sun Oct 28 00:49:00 2018 +0200
+++ b/hedgewars/uTeams.pas	Sun Oct 28 02:24:06 2018 +0200
@@ -708,6 +708,7 @@
     CurrentHedgehog^.Gear:= Gear;
     CurrentHedgehog^.Name:= id;
     CurrentHedgehog^.InitialHealth:= Gear^.Health;
+    CurrentHedgehog^.RevengeHog:= nil;
     CurrHedgehog:= HedgehogsNumber;
     inc(HedgehogsNumber)
     end
--- a/hedgewars/uTypes.pas	Sun Oct 28 00:49:00 2018 +0200
+++ b/hedgewars/uTypes.pas	Sun Oct 28 02:24:06 2018 +0200
@@ -154,7 +154,7 @@
             sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun, sndFlamethrower, sndIceBeamIdle,
             sndLandGun, sndCaseImpact, sndExtraDamage, sndFirePunchHit, sndGrenade, sndThisOneIsMine,
             sndWhatThe, sndSoLong, sndOhDear, sndGonnaGetYou, sndDrat, sndBugger, sndAmazing,
-            sndBrilliant, sndExcellent, sndFire, sndWatchThis, sndRunAway);
+            sndBrilliant, sndExcellent, sndFire, sndWatchThis, sndRunAway, sndRevenge);
 
     // Available ammo types to be used by hedgehogs
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
@@ -342,6 +342,7 @@
         MaxStepDamageGiven,
         MaxStepKills: Longword;
         FinishedTurns: Longword;
+        GotRevenge: boolean;     // True if hog got revenge in this turn
         end;
 
     TTeamStats = record
@@ -412,6 +413,7 @@
             Timer: Longword;
             HealthBarHealth: LongInt;
             Effects: array[THogEffect] of LongInt;
+            RevengeHog: PHedgehog;   // For which hog this hog wants revenge most. For sndRevenge taunt
             end;
 
     TTeam = record
--- a/share/hedgewars/Data/Sounds/voices/British/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/British/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Classic/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Classic/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,9 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+# FIXME: Revenge.ogg is "I'll get you back" but this taunt is meant for
+# successful reveng, not the announcement thereof.
+#Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Default/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Default/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Default_uk/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Default_uk/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Mobster/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Mobster/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Pirate/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Pirate/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Robot/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Robot/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Russian/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Russian/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Singer/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Singer/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg
--- a/share/hedgewars/Data/Sounds/voices/Surfer/CMakeLists.txt	Sun Oct 28 00:49:00 2018 +0200
+++ b/share/hedgewars/Data/Sounds/voices/Surfer/CMakeLists.txt	Sun Oct 28 02:24:06 2018 +0200
@@ -34,6 +34,7 @@
 PoisonCough.ogg
 PoisonMoan.ogg
 Reinforcements.ogg
+Revenge.ogg
 Runaway.ogg
 Sameteam.ogg
 Solong.ogg