share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
changeset 11692 68eddcdc9f26
parent 9831 afa4e3e04cc5
child 11892 0526a26ddd6e
equal deleted inserted replaced
11646:42d7f5dbd8dc 11692:68eddcdc9f26
    11 ----------------- VARIABLES --------------------
    11 ----------------- VARIABLES --------------------
    12 -- globals
    12 -- globals
    13 local missionName = loc("Precise shooting")
    13 local missionName = loc("Precise shooting")
    14 local timeLeft = 10000
    14 local timeLeft = 10000
    15 local lastWeaponUsed = amSniperRifle
    15 local lastWeaponUsed = amSniperRifle
    16 local challengeObjectives = loc("Use your available weapons in order to eliminate the enemies").."|"..
    16 local challengeObjectives = loc("Use your available weapons in order to eliminate the enemies.").."|"..
    17 	loc("You can only use the Sniper Rifle or the Watermelon bomb").."|"..
    17 	loc("You can only use the sniper rifle or the watermelon bomb.").."|"..
    18 	loc("You'll have only 2 watermelon bombs during the game").."|"..
    18 	loc("You'll have only 2 watermelon bombs during the game.").."|"..
    19 	loc("You'll get an extra Sniper Rifle every time you kill an enemy hog with a limit of max 4 rifles").."|"..
    19 	loc("You'll get an extra sniper rifle every time you kill an enemy hog with a limit of max 4 rifles.").."|"..
    20 	loc("You'll get an extra Teleport every time you kill an enemy hog with a limit of max 2 teleports").."|"..
    20 	loc("You'll get an extra teleport every time you kill an enemy hog with a limit of max 2 teleports.").."|"..
    21 	loc("The first turn will last 25 sec and every other turn 15 sec").."|"..
    21 	loc("The first turn will last 25 sec and every other turn 15 sec.").."|"..
    22 	loc("If you skip a turn then the turn time left will be added to your next turn").."|"..
    22 	loc("If you skip a turn then the turn time left will be added to your next turn.").."|"..
    23 	loc("Some parts of the land are indestructible")
    23 	loc("Some parts of the land are indestructible.")
    24 -- dialogs
    24 -- dialogs
    25 local dialog01 = {}
    25 local dialog01 = {}
    26 -- mission objectives
    26 -- mission objectives
    27 local goals = {
    27 local goals = {
    28 	[dialog01] = {missionName, loc("Challenge Objectives"), challengeObjectives, 1, 4500},
    28 	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
    29 }
    29 }
    30 -- hogs
    30 -- hogs
    31 local hero = {
    31 local hero = {
    32 	name = loc("Hog Solo"),
    32 	name = loc("Hog Solo"),
    33 	x = 1100,
    33 	x = 1100,
   105 end
   105 end
   106 
   106 
   107 function onGameStart()
   107 function onGameStart()
   108 	AnimWait(hero.gear, 3000)
   108 	AnimWait(hero.gear, 3000)
   109 	FollowGear(hero.gear)
   109 	FollowGear(hero.gear)
   110 	ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0)
   110 	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
   111 
   111 
   112 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   112 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   113 	AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0)
   113 	AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0)
   114 
   114 
   115 	--hero ammo
   115 	--hero ammo
   201 
   201 
   202 -------------- ACTIONS ------------------
   202 -------------- ACTIONS ------------------
   203 
   203 
   204 function heroDeath(gear)
   204 function heroDeath(gear)
   205 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   205 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   206 	SendStat(siCustomAchievement, loc("You have to eliminate all the enemies"))
   206 	SendStat(siCustomAchievement, loc("You have to eliminate all the enemies."))
   207 	SendStat(siCustomAchievement, loc("Read the Challenge Objectives from within the mission for more details"))
   207 	SendStat(siCustomAchievement, loc("Read the challenge objectives from within the mission for more details."))
   208 	SendStat(siPlayerKills,'1',teamB.name)
   208 	SendStat(siPlayerKills,'1',teamB.name)
   209 	SendStat(siPlayerKills,'0',teamA.name)
   209 	SendStat(siPlayerKills,'0',teamA.name)
   210 	EndGame()
   210 	EndGame()
   211 end
   211 end
   212 
   212 
   213 function heroWin(gear)
   213 function heroWin(gear)
   214 	saveBonus(2, 1)
   214 	saveBonus(2, 1)
   215 	SendStat(siGameResult, loc("Congratulations, you won!"))
   215 	SendStat(siGameResult, loc("Congratulations, you won!"))
   216 	SendStat(siCustomAchievement, loc("You complete the mission in "..TotalRounds.." rounds"))
   216 	SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), TotalRounds))
   217 	SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission"))
   217 	SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission."))
   218 	SendStat(siPlayerKills,'1',teamA.name)
   218 	SendStat(siPlayerKills,'1',teamA.name)
   219 	EndGame()
   219 	EndGame()
   220 end
   220 end
   221 
   221 
   222 -------------- ANIMATIONS ------------------
   222 -------------- ANIMATIONS ------------------
   230 
   230 
   231 function AnimationSetup()
   231 function AnimationSetup()
   232 	-- DIALOG 01 - Start, game instructions
   232 	-- DIALOG 01 - Start, game instructions
   233 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   233 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   234 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   234 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   235 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Fruit Planet Hog Solo got lost..."), 5000}})
   235 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Fruit Planet Hog Solo got lost ..."), 5000}})
   236 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("...and got ambushed by the Red Strawberries"), 5000}})
   236 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("... and got ambushed by the Red Strawberries"), 5000}})
   237 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use your available weapons in order to eliminate the enemies"), 5000}})
   237 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use your available weapons in order to eliminate the enemies"), 5000}})
   238 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You can only use the Sniper Rifle or the Watermelon bomb"), 5000}})
   238 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You can only use the sniper rifle or the watermelon bomb"), 5000}})
   239 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only 2 watermelon bombs during the game"), 5000}})
   239 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only 2 watermelon bombs during the game"), 5000}})
   240 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra Sniper Rifle every time you kill an enemy hog with a limit of max 4 rifles"), 5000}})
   240 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra sniper rifle every time you kill an enemy hog with a limit of max 4 rifles"), 5000}})
   241 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra Teleport every time you kill an enemy hog with a limit of max 2 teleports"), 5000}})
   241 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra teleport every time you kill an enemy hog with a limit of max 2 teleports"), 5000}})
   242 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("The first turn will last 25 sec and every other turn 15 sec"), 5000}})
   242 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("The first turn will last 25 sec and every other turn 15 sec"), 5000}})
   243 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you skip the game your time left will be added to your next turn"), 5000}})
   243 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you skip the game your time left will be added to your next turn"), 5000}})
   244 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Some parts of the land are indestructible"), 5000}})
   244 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Some parts of the land are indestructible"), 5000}})
   245 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   245 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   246 	table.insert(dialog01, {func = startBattle, args = {hero.gear}})
   246 	table.insert(dialog01, {func = startBattle, args = {hero.gear}})