ClimeHome: Show messages when cake is nearby and when reaching home
authorWuzzy <Wuzzy2@mail.ru>
Sat, 10 Mar 2018 03:27:18 +0100
changeset 13160 25de976a7b9a
parent 13159 44351ea57b71
child 13161 26f0c3669b4e
ClimeHome: Show messages when cake is nearby and when reaching home
ChangeLog.txt
share/hedgewars/Data/Locale/de.lua
share/hedgewars/Data/Locale/stub.lua
share/hedgewars/Data/Maps/ClimbHome/map.lua
--- a/ChangeLog.txt	Sat Mar 10 01:46:51 2018 +0100
+++ b/ChangeLog.txt	Sat Mar 10 03:27:18 2018 +0100
@@ -54,6 +54,7 @@
  + Capture the Flag: Show team scores and score graph in stats screen
  + HedgeEditor: Show cursor coordinates in top left corner
  + Control: Always remove TimeBox and Resurrector
+ + Climb Home: Show messages when a fire cake is nearby and when you're inside home
  * Battalion: Some texts in the mission panel were wrong and misleading
  * Construction Mode: Remove drill strike if added by weapon scheme (it's broken)
  * Construction Mode, Racer, HedgeEditor: No longer play Incoming voice for building stuff, fix other sound problems
--- a/share/hedgewars/Data/Locale/de.lua	Sat Mar 10 01:46:51 2018 +0100
+++ b/share/hedgewars/Data/Locale/de.lua	Sat Mar 10 03:27:18 2018 +0100
@@ -526,6 +526,7 @@
 ["Don't eliminate Captain Lime before collecting the last crate!"]="Eliminiere Leutnant Limone nicht, bevor du die letzte Kiste eingesammelt hast!",
 ["Don't hit me, you fools!"] = "Nicht auf mich, ihr Idioten!", -- A_Space_Adventure:moon01
 ["Don't hit yourself!"] = "Triff nicht dich selbst!", -- Basic_Training_-_Bazooka
+["Don't touch the flames!"] = "Berühr nicht die Flammen!", -- ClimbHome
 ["Don't you dare harming our tribe!"] = "Wag es nicht, unserem Stamm wehzutun!", -- A_Classic_Fairytale:queen
 ["Double Kill!"]="Doppelmord!",
 ["Double kill!"] = "Zweierschlächter!", -- Mutant
@@ -2554,6 +2555,7 @@
 ["Wario"] = "Wario", -- 
 ["Warming Up"] = "Aufwärmübungen", -- Basic_Training_-_Grenade
 ["Warning: Deletition Mode Active"]="Achtung: Löschmodus aktiv",
+["Warning: Fire cake detected"]="Achtung: Feuertorte gesichtet", -- ClimbHome
 ["Warning: Never ever leave the flying saucer while in water!"] = "Achtung: Verlasse niemals die fliegende Untertasse im Wasser!", -- Basic_Training_-_Flying_Saucer
 ["WARNING: Sabotage detected!"]="ACHTUNG: Sabotage erkannt!",
 ["Warrior"]="Krieger",
@@ -2599,6 +2601,7 @@
 ["We have to protect the village!"]="Wir müssen das Dorf schützen!",
 ["We have to unite and defeat those cylergs!"]="Wir müssen uns zusammentun, und diese Cylergs besiegen!",
 ["Welcome Hog Solo, surprised to see me?"]="Hallo, Igel Einsam! Bist du überrascht, mich zu sehen?",
+["Welcome home! Please take a seat"] = "Willkommen zu Hause! Bitte nimm Platz", -- ClimbHome
 ["Welcome, Leaks A Lot!"]="Willkommen, Undichte Stelle!",
 ["Welcome to the Death Planet!"]="Willkommen auf dem Todesplaneten!",
 ["Welcome to the Desert Planet!"]="Willkommen auf dem Wüstenplaneten!",
--- a/share/hedgewars/Data/Locale/stub.lua	Sat Mar 10 01:46:51 2018 +0100
+++ b/share/hedgewars/Data/Locale/stub.lua	Sat Mar 10 03:27:18 2018 +0100
@@ -484,6 +484,7 @@
 --      ["Don't eliminate Captain Lime before collecting the last crate!"] = "", -- A_Space_Adventure:fruit02
 --      ["Don't hit me, you fools!"] = "", -- A_Space_Adventure:moon01
 --      ["Don't hit yourself!"] = "", -- Basic_Training_-_Bazooka
+--      ["Don't touch the flames!"] = "", -- ClimbHome
 --      ["Don't you dare harming our tribe!"] = "", -- A_Classic_Fairytale:queen
 --      ["Double Kill!"] = "",
 --      ["Double kill!"] = "", -- Mutant
@@ -2388,6 +2389,7 @@
 --      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Wario"] = "", -- 
 --      ["Warming Up"] = "", -- Basic_Training_-_Grenade
+--      ["Warning: Fire cake detected"] = "", -- ClimbHome
 --      ["Warning: Never ever leave the flying saucer while in water!"] = "", -- Basic_Training_-_Flying_Saucer
 --      ["WARNING: Sabotage detected!"] = "", -- Continental_supplies
 --      ["Warrior"] = "", -- Battalion
@@ -2430,6 +2432,7 @@
 --      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
 --      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Welcome Hog Solo, surprised to see me?"] = "", -- A_Space_Adventure:death01
+--      ["Welcome home! Please take a seat"] = "", -- ClimbHome
 --      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Welcome to the Death Planet!"] = "", -- A_Space_Adventure:cosmos
 --      ["Welcome to the Desert Planet!"] = "", -- A_Space_Adventure:cosmos
--- a/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sat Mar 10 01:46:51 2018 +0100
+++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sat Mar 10 03:27:18 2018 +0100
@@ -26,8 +26,11 @@
 local HogsAreInvulnerable = false
 local WaterRise = nil
 local Cake = nil
+local CakeWarning = false
+local CakeFireWarning = false
 local CakeTries = 0
 local addCake = true
+local takeASeat = false
 local Stars = {}
 local tauntNoo = false
 local jokeAwardNavy = nil
@@ -110,10 +113,11 @@
 
 function onGearDelete(gear)
     if gear == MrMine then
-        AddCaption(loc("Once you set off the proximity trigger, Mr. Mine is not your friend"), 0xFFFFFFFF, capgrpMessage)
+        AddCaption(loc("Once you set off the proximity trigger, Mr. Mine is not your friend"), 0xFFFFFFFF, capgrpMessage2)
         MrMine = nil
     elseif GetGearType(gear) == gtCake then
         Cake = nil
+        CakeWarning = false
     elseif GetGearType(gear) == gtHedgehog then
 	onGameTick20()
 	onGearDamage(gear, 0)
@@ -181,6 +185,7 @@
     YouWon = false
     YouLost = false
     tauntNoo = false
+    takeASeat = false
     recordBroken = false
     currTeam = GetHogTeamName(CurrentHedgehog)
     if CurrentHedgehog ~= nil then
@@ -224,6 +229,7 @@
 --end
 
 function FireBoom(x,y,d) -- going to add for rockets too
+    PlaySound(sndExplosion)
     AddVisualGear(x,y,vgtExplosion,0,false)
     -- should approximate circle by removing corners
     --if BoomFire == nil then BoomFire = {} end
@@ -317,9 +323,19 @@
             local cx,cy = GetGearPosition(Cake)
             if y < cy-1500 then DeleteGear(Cake) end
 
-            if Cake ~= nil and GetHealth(Cake) < 999980 and gearIsInCircle(CurrentHedgehog,cx,cy,450) then
-                FireBoom(cx,cy,200) -- todo animate
-                DeleteGear(Cake)
+            if Cake ~= nil and GetHealth(Cake) < 999980 then
+                if not CakeWarning and gearIsInCircle(CurrentHedgehog,cx,cy,1350) then
+                    AddCaption(loc("Warning: Fire cake detected"))
+                    CakeWarning = true
+                end
+                if gearIsInCircle(CurrentHedgehog,cx,cy,450) then
+                    if not CakeFireWarning then
+                        AddCaption(loc("Don't touch the flames!"))
+                        CakeFireWarning = true
+                    end
+                    FireBoom(cx,cy,200) -- todo animate
+                    DeleteGear(Cake)
+                end
             end
         end
         if band(GetState(CurrentHedgehog),gstHHDriven) == 0 then
@@ -413,7 +429,7 @@
             end
             -- FIXME: Hog is also in winning box if it just walks into the chair from the left, touching it. Intentional?
             if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) then
-                AddCaption(loc("Victory!"))
+                AddCaption(loc("Victory!"), 0xFFFFFFFF, capgrpGameState)
                 ShowMission(loc("Climb Home"),
                             loc("Made it!"),
                             string.format(loc("Ahhh, home, sweet home. Made it in %d seconds."), roundedFinishTime),
@@ -448,7 +464,7 @@
                     (not MrMine or (MrMine and band(GetState(MrMine), gstAttacking) == 0)) then
                 -- Player managed to reach home in multiplayer.
                 -- Stop hog, disable controls, celebrate victory and continue the game after 4 seconds.
-                AddCaption(string.format(loc("%s climbed home in %d seconds!"), GetHogName(CurrentHedgehog), roundedFinishTime))
+                AddCaption(string.format(loc("%s climbed home in %d seconds!"), GetHogName(CurrentHedgehog), roundedFinishTime), 0xFFFFFFFF, capgrpGameState)
                 SendStat(siCustomAchievement, string.format(loc("%s (%s) reached home in %.3f seconds."), GetHogName(CurrentHedgehog), GetHogTeamName(CurrentHedgehog), finishTime))
                 makeMultiPlayerWinnerStat(CurrentHedgehog)
                 PlaySound(sndVictory, CurrentHedgehog)
@@ -473,6 +489,11 @@
             else
                 SendStat(siClanHealth, tostring(getActualHeight(y)), GetHogTeamName(CurrentHedgehog))
             end
+            -- If player is inside home, tell player to take a seat.
+            if not takeASeat and gearIsInBox(CurrentHedgehog, 1765, 131, 244, 189) then
+                AddCaption(loc("Welcome home! Please take a seat"))
+                takeASeat = true
+            end
     
             -- play taunts
             if not YouWon and not YouLost then