# HG changeset patch # User Wuzzy # Date 1518717784 -3600 # Node ID c819675d4f4f7cc2db306a1d4ec6a1e85e36ccf7 # Parent d92c364f004de42bed26702250f3a2352585b553 TrophyRace: Hide mission panel when player shoots rope diff -r d92c364f004d -r c819675d4f4f share/hedgewars/Data/Maps/TrophyRace/map.lua --- a/share/hedgewars/Data/Maps/TrophyRace/map.lua Thu Feb 15 18:56:00 2018 +0100 +++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua Thu Feb 15 19:03:04 2018 +0100 @@ -97,9 +97,11 @@ lasthog = nil end -function onHogAttack() +function onHogAttack(ammoType) if TurnTimeLeft == 0 then killHog() + elseif ammoType == amRope then + HideMission() end end @@ -131,10 +133,10 @@ if not reached and x > goal_area[1] and x < goal_area[1] + goal_area[3] and y > goal_area[2] and y < goal_area[2] + goal_area[4] then -- hog is within goal rectangle reached = true local ttime = GameTime-startTime - --give it a sound;) + -- give it a sound ;) if ttime < besttime then PlaySound (sndHomerun) - else + elseif ttime > worsttime then PlaySound (sndHellish) end for i = 0, numhhs - 1 do @@ -205,17 +207,8 @@ times[numhhs] = 0 numhhs = numhhs + 1 end --- elseif GetGearType(gear) == gtRope then -- rope is shot end ---function onGearDelete(gear) --- if GetGearType(gear) == gtRope then -- rope deletion - hog didn't manage to rerope --- --TurnTimeLeft = 0 -- end turn or not? hm... --- lasthog = CurrentHedgehog --- --- end ---end - function onAchievementsDeclaration() for team,time in pairs(bestTimes) do DeclareAchievement("rope race", team, "TrophyRace", time)