share/hedgewars/Data/Maps/ClimbHome/map.lua
changeset 13643 690cc84e9fd6
parent 13170 98a0edb4bb5a
child 13664 85506d95977d
equal deleted inserted replaced
13642:3d14950641a4 13643:690cc84e9fd6
   111     end
   111     end
   112 end
   112 end
   113 
   113 
   114 function onGearDelete(gear)
   114 function onGearDelete(gear)
   115     if gear == MrMine then
   115     if gear == MrMine then
   116         AddCaption(loc("Once you set off the proximity trigger, Mr. Mine is not your friend"), 0xFFFFFFFF, capgrpMessage2)
   116         AddCaption(loc("Once you set off the proximity trigger, Mr. Mine is not your friend"), capcolDefault, capgrpMessage2)
   117         MrMine = nil
   117         MrMine = nil
   118     elseif GetGearType(gear) == gtCake then
   118     elseif GetGearType(gear) == gtCake then
   119         Cake = nil
   119         Cake = nil
   120         CakeWarning = false
   120         CakeWarning = false
   121     elseif GetGearType(gear) == gtHedgehog then
   121     elseif GetGearType(gear) == gtHedgehog then
   427                 makeSinglePlayerLoserStats()
   427                 makeSinglePlayerLoserStats()
   428                 YouLost = true
   428                 YouLost = true
   429             end
   429             end
   430             -- FIXME: Hog is also in winning box if it just walks into the chair from the left, touching it. Intentional?
   430             -- FIXME: Hog is also in winning box if it just walks into the chair from the left, touching it. Intentional?
   431             if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) then
   431             if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) then
   432                 AddCaption(loc("Victory!"), 0xFFFFFFFF, capgrpGameState)
   432                 AddCaption(loc("Victory!"), capcolDefault, capgrpGameState)
   433                 ShowMission(loc("Climb Home"),
   433                 ShowMission(loc("Climb Home"),
   434                             loc("Made it!"),
   434                             loc("Made it!"),
   435                             string.format(loc("Ahhh, home, sweet home. Made it in %d seconds."), roundedFinishTime),
   435                             string.format(loc("Ahhh, home, sweet home. Made it in %d seconds."), roundedFinishTime),
   436                             -amRope, 0)
   436                             -amRope, 0)
   437                 PlaySound(sndVictory,CurrentHedgehog)
   437                 PlaySound(sndVictory,CurrentHedgehog)
   462             if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) and
   462             if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) and
   463                     -- Delay victory if MrMine is triggered
   463                     -- Delay victory if MrMine is triggered
   464                     (not MrMine or (MrMine and band(GetState(MrMine), gstAttacking) == 0)) then
   464                     (not MrMine or (MrMine and band(GetState(MrMine), gstAttacking) == 0)) then
   465                 -- Player managed to reach home in multiplayer.
   465                 -- Player managed to reach home in multiplayer.
   466                 -- Stop hog, disable controls, celebrate victory and continue the game after 4 seconds.
   466                 -- Stop hog, disable controls, celebrate victory and continue the game after 4 seconds.
   467                 AddCaption(string.format(loc("%s climbed home in %d seconds!"), GetHogName(CurrentHedgehog), roundedFinishTime), 0xFFFFFFFF, capgrpGameState)
   467                 AddCaption(string.format(loc("%s climbed home in %d seconds!"), GetHogName(CurrentHedgehog), roundedFinishTime), capcolDefault, capgrpGameState)
   468                 SendStat(siCustomAchievement, string.format(loc("%s (%s) reached home in %.3f seconds."), GetHogName(CurrentHedgehog), GetHogTeamName(CurrentHedgehog), finishTime))
   468                 SendStat(siCustomAchievement, string.format(loc("%s (%s) reached home in %.3f seconds."), GetHogName(CurrentHedgehog), GetHogTeamName(CurrentHedgehog), finishTime))
   469                 makeMultiPlayerWinnerStat(CurrentHedgehog)
   469                 makeMultiPlayerWinnerStat(CurrentHedgehog)
   470                 PlaySound(sndVictory, CurrentHedgehog)
   470                 PlaySound(sndVictory, CurrentHedgehog)
   471 		SetWeapon(amNothing)
   471 		SetWeapon(amNothing)
   472                 SetGearMessage(CurrentHedgehog, band(GetGearMessage(CurrentHedgehog), bnot(gmLeft+gmRight+gmUp+gmDown+gmHJump+gmLJump+gmPrecise)))
   472                 SetGearMessage(CurrentHedgehog, band(GetGearMessage(CurrentHedgehog), bnot(gmLeft+gmRight+gmUp+gmDown+gmHJump+gmLJump+gmPrecise)))