share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
changeset 14488 7bb7e5e54f70
parent 14401 6c21bd8547dd
child 14626 ab6be7d200b0
equal deleted inserted replaced
14487:d72fb761aa59 14488:7bb7e5e54f70
    37 	[dialog01] = {missionName, loc("Ready for Battle?"),
    37 	[dialog01] = {missionName, loc("Ready for Battle?"),
    38 		loc("Captain Lime offered his help if you assist him in battle.").."|"..
    38 		loc("Captain Lime offered his help if you assist him in battle.").."|"..
    39 		loc("What do you want to do?").."| |"..
    39 		loc("What do you want to do?").."| |"..
    40 		loc("Fight: Press [Attack]").."|"..
    40 		loc("Fight: Press [Attack]").."|"..
    41 		loc("Flee: Press [Jump]"), 1, 9999000, true},
    41 		loc("Flee: Press [Jump]"), 1, 9999000, true},
    42 	[dialog02] = {missionName, loc("Battle Starts Now!"), loc("You have chosen to fight!").."|"..loc("Lead the Green Bananas to battle and eliminate all the enemies!"), 1, 5000},
    42 	[dialog02] = {missionName, loc("Battle Starts Now!"), loc("You have chosen to fight!").."|"..loc("Lead your allies to battle and eliminate all the enemies!"), 1, 5000},
    43 	[dialog03] = {missionName, loc("Time to run!"), loc("You have chosen to flee.").."|"..loc("You have to reach the left-most place on the map."), 1, 5000},
    43 	[dialog03] = {missionName, loc("Time to run!"), loc("You have chosen to flee.").."|"..loc("You have to reach the left-most place on the map."), 1, 5000},
    44 	["fight"] = {missionName, loc("Ready for Battle?"), loc("You have chosen to fight!"), 1, 2000},
    44 	["fight"] = {missionName, loc("Ready for Battle?"), loc("You have chosen to fight!"), 1, 2000},
    45 	["flee"] = {missionName, loc("Ready for Battle?"), loc("You have chosen to flee."), 1, 2000},
    45 	["flee"] = {missionName, loc("Ready for Battle?"), loc("You have chosen to flee."), 1, 2000},
    46 	["flee_final"] = {missionName, loc("Time to run!"), loc("Knock off the enemies from the left-most place of the map!") .. "|" .. loc("Stay there to flee!"), 1, 6000},
    46 	["flee_final"] = {missionName, loc("Time to run!"), loc("Knock off the enemies from the left-most place of the map!") .. "|" .. loc("Stay there to flee!"), 1, 6000},
    47 }
    47 }
   117 	WaterRise = 0
   117 	WaterRise = 0
   118 	HealthCaseAmount = 50
   118 	HealthCaseAmount = 50
   119 	Map = "fruit01_map"
   119 	Map = "fruit01_map"
   120 	Theme = "Fruit"
   120 	Theme = "Fruit"
   121 
   121 
   122 	-- Hog Solo
   122 	-- Hero
   123 	AddTeam(teamA.name, teamA.color, "Simple", "Island", "Default", "hedgewars")
   123 	teamA.name = AddMissionTeam(teamA.color)
   124 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   124 	hero.gear = AddMissionHog(100)
       
   125 	hero.name = GetHogName(hero.gear)
   125 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   126 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   126 	HogTurnLeft(hero.gear, true)
   127 	HogTurnLeft(hero.gear, true)
   127 	-- Captain Lime
   128 	-- Captain Lime
   128 	AddTeam(teamD.name, teamD.color, "Cherry", "Island", "Default", "congo-brazzaville")
   129 	teamD.name = AddTeam(teamD.name, teamD.color, "Cherry", "Island", "Default", "congo-brazzaville")
   129 	green1.gear = AddHog(green1.name, 0, 200, "war_desertofficer")
   130 	green1.gear = AddHog(green1.name, 0, 200, "war_desertofficer")
   130 	AnimSetGearPosition(green1.gear, green1.x, green1.y)
   131 	AnimSetGearPosition(green1.gear, green1.x, green1.y)
   131 	-- Green Bananas
   132 	-- Green Bananas
   132 	AddTeam(teamB.name, teamB.color, "Cherry", "Island", "Default", "congo-brazzaville")
   133 	teamB.name = AddTeam(teamB.name, teamB.color, "Cherry", "Island", "Default", "congo-brazzaville")
   133 	green2.gear = AddHog(green2.name, 0, 100, "war_britmedic")
   134 	green2.gear = AddHog(green2.name, 0, 100, "war_britmedic")
   134 	AnimSetGearPosition(green2.gear, green2.x, green2.y)
   135 	AnimSetGearPosition(green2.gear, green2.x, green2.y)
   135 	HogTurnLeft(green2.gear, true)
   136 	HogTurnLeft(green2.gear, true)
   136 	green3.gear = AddHog(green3.name, 0, 100, "hair_red")
   137 	green3.gear = AddHog(green3.name, 0, 100, "hair_red")
   137 	AnimSetGearPosition(green3.gear, green3.x, green3.y)
   138 	AnimSetGearPosition(green3.gear, green3.x, green3.y)
   141 	HogTurnLeft(green4.gear, true)
   142 	HogTurnLeft(green4.gear, true)
   142 	green5.gear = AddHog(green5.name, 0, 100, "war_sovietcomrade2")
   143 	green5.gear = AddHog(green5.name, 0, 100, "war_sovietcomrade2")
   143 	AnimSetGearPosition(green5.gear, green5.x, green5.y)
   144 	AnimSetGearPosition(green5.gear, green5.x, green5.y)
   144 	HogTurnLeft(green5.gear, true)
   145 	HogTurnLeft(green5.gear, true)
   145 	-- Yellow Watermelons
   146 	-- Yellow Watermelons
   146 	AddTeam(teamC.name, teamC.color, "Flower", "Island", "Default", "cm_mog")
   147 	teamC.name = AddTeam(teamC.name, teamC.color, "Flower", "Island", "Default", "cm_mog")
   147 	yellow1.gear = AddHog(yellow1.name, 1, 100, "war_desertgrenadier2")
   148 	yellow1.gear = AddHog(yellow1.name, 1, 100, "war_desertgrenadier2")
   148 	AnimSetGearPosition(yellow1.gear, yellow1.x, yellow1.y)
   149 	AnimSetGearPosition(yellow1.gear, yellow1.x, yellow1.y)
   149 	-- the rest of the Yellow Watermelons
   150 	-- the rest of the Yellow Watermelons
   150 	local yellowHats = { "fr_apple", "fr_banana", "fr_lemon", "fr_orange" }
   151 	local yellowHats = { "fr_apple", "fr_banana", "fr_lemon", "fr_orange" }
   151 	for i=1,7 do
   152 	for i=1,7 do
   358 end
   359 end
   359 
   360 
   360 function battleWin(gear)
   361 function battleWin(gear)
   361 	-- add stats
   362 	-- add stats
   362 	saveVariables()
   363 	saveVariables()
   363 	SendStat(siGameResult, loc("Green Bananas won!"))
   364 	SendStat(siGameResult, string.format(loc("%s won!"), teamB.name))
   364 	SendStat(siCustomAchievement, loc("You have eliminated all visible enemy hedgehogs!"))
   365 	SendStat(siCustomAchievement, loc("You have eliminated all visible enemy hedgehogs!"))
   365 	sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name})
   366 	sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name})
   366 	EndGame()
   367 	EndGame()
   367 end
   368 end
   368 
   369 
   369 function escapeWin(gear)
   370 function escapeWin(gear)
   370 	RemoveEventFunc(heroOnLaunchPadWithEnemies)
   371 	RemoveEventFunc(heroOnLaunchPadWithEnemies)
   371 	-- add stats
   372 	-- add stats
   372 	saveVariables()
   373 	saveVariables()
   373 	SendStat(siGameResult, loc("Hog Solo escaped successfully!"))
   374 	SendStat(siGameResult, string.format(loc("%s escaped successfully!"), hero.name))
   374 	SendStat(siCustomAchievement, loc("You have reached the take-off area successfully!"))
   375 	SendStat(siCustomAchievement, loc("You have reached the take-off area successfully!"))
   375 	sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name})
   376 	sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name})
   376 	EndGame()
   377 	EndGame()
   377 end
   378 end
   378 
   379 
   415 		startBattle()
   416 		startBattle()
   416 	end
   417 	end
   417 end
   418 end
   418 
   419 
   419 function AnimationSetup()
   420 function AnimationSetup()
   420 	-- DIALOG 01 - Start, Captain Lime talks explains to Hog Solo
   421 	-- DIALOG 01 - Start, Captain Lime talks and explains stuff to hero
   421 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   422 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   422 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 1000}})
   423 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 1000}})
   423 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere on the Planet of Fruits a terrible war is about to begin ..."), 5000}})
   424 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere on the Planet of Fruits a terrible war is about to begin ..."), 5000}})
   424 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I was told that as the leader of the king's guard, no one knows this world better than you!"), SAY_SAY, 5000}})
   425 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I was told that as the leader of the king's guard, no one knows this world better than you!"), SAY_SAY, 5000}})
   425 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("So, I kindly ask for your help."), SAY_SAY, 3000}})
   426 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("So, I kindly ask for your help."), SAY_SAY, 3000}})
   426 	table.insert(dialog01, {func = AnimWait, args = {green1.gear, 2000}})
   427 	table.insert(dialog01, {func = AnimWait, args = {green1.gear, 2000}})
   427 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("You couldn't have come to a worse time, Hog Solo!"), SAY_SAY, 3000}})
   428 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, string.format(loc("You couldn't have come to a worse time, %s!"), hero.name), SAY_SAY, 3000}})
   428 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("The clan of the Red Strawberry wants to take over the dominion and overthrow King Pineapple."), SAY_SAY, 5000}})
   429 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("The clan of the Red Strawberry wants to take over the dominion and overthrow King Pineapple."), SAY_SAY, 5000}})
   429 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Under normal circumstances we could easily defeat them but we have kindly sent most of our men to the Kingdom of Sand to help with the annual dusting of the king's palace."), SAY_SAY, 8000}})
   430 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Under normal circumstances we could easily defeat them but we have kindly sent most of our men to the Kingdom of Sand to help with the annual dusting of the king's palace."), SAY_SAY, 8000}})
   430 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("However, the army of Yellow Watermelons is about to attack any moment now."), SAY_SAY, 4000}})
   431 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, string.format(loc("However, the army of %s is about to attack any moment now."), teamC.name), SAY_SAY, 4000}})
   431 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}})
   432 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}})
   432 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}})
   433 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}})
   433 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   434 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   434 	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
   435 	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
   435 	table.insert(dialog01, {func = AfterDialog01, args = {}})
   436 	table.insert(dialog01, {func = AfterDialog01, args = {}})
   436 	-- DIALOG 02 - Hero selects to fight
   437 	-- DIALOG 02 - Hero selects to fight
   437 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   438 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   438 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("You choose well, Hog Solo!"), SAY_SAY, 3000}})
   439 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, string.format(loc("You choose well, %s!"), hero.name), SAY_SAY, 3000}})
   439 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("I have only 3 hogs available and they are all cadets."), SAY_SAY, 4000}})
   440 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("I have only 3 hogs available and they are all cadets."), SAY_SAY, 4000}})
   440 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("As you are more experienced, I want you to lead them to battle."), SAY_SAY, 4000}})
   441 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("As you are more experienced, I want you to lead them to battle."), SAY_SAY, 4000}})
   441 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Of course, I will observe the battle and intervene if necessary."), SAY_SAY, 5000}})
   442 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Of course, I will observe the battle and intervene if necessary."), SAY_SAY, 5000}})
   442 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 4500}})
   443 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 4500}})
   443 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("No problem, Captain!"), SAY_SAY, 2000}})
   444 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("No problem, Captain!"), SAY_SAY, 2000}})
   462 
   463 
   463 ------------- OTHER FUNCTIONS ---------------
   464 ------------- OTHER FUNCTIONS ---------------
   464 
   465 
   465 function startBattle()
   466 function startBattle()
   466 	AnimSetInputMask(0xFFFFFFFF)
   467 	AnimSetInputMask(0xFFFFFFFF)
   467 	-- Hog Solo weapons
   468 	-- Hero weapons
   468 	AddAmmo(hero.gear, amRope, 2)
   469 	AddAmmo(hero.gear, amRope, 2)
   469 	AddAmmo(hero.gear, amBazooka, 3)
   470 	AddAmmo(hero.gear, amBazooka, 3)
   470 	AddAmmo(hero.gear, amParachute, 1)
   471 	AddAmmo(hero.gear, amParachute, 1)
   471 	AddAmmo(hero.gear, amGrenade, 6)
   472 	AddAmmo(hero.gear, amGrenade, 6)
   472 	AddAmmo(hero.gear, amDEagle, 4)
   473 	AddAmmo(hero.gear, amDEagle, 4)
   476 	EndTurn(true)
   477 	EndTurn(true)
   477 end
   478 end
   478 
   479 
   479 function gameLost()
   480 function gameLost()
   480 	if chooseToBattle then
   481 	if chooseToBattle then
   481 		SendStat(siGameResult, loc("The Green Bananas lost, try again!"))
   482 		SendStat(siGameResult, string.format(loc("%s lost, try again!"), teamB.name))
   482 		SendStat(siCustomAchievement, loc("You have to eliminate all the visible enemies."))
   483 		SendStat(siCustomAchievement, loc("You have to eliminate all the visible enemies."))
   483 		SendStat(siCustomAchievement, loc("5 additional enemies will be spawned during the game."))
   484 		SendStat(siCustomAchievement, loc("5 additional enemies will be spawned during the game."))
   484 		SendStat(siCustomAchievement, loc("You are in control of all the active ally units."))
   485 		SendStat(siCustomAchievement, loc("You are in control of all the active ally units."))
   485 		SendStat(siCustomAchievement, loc("The ally units share their ammo."))
   486 		SendStat(siCustomAchievement, loc("The ally units share their ammo."))
   486 		SendStat(siCustomAchievement, loc("Try to keep as many allies alive as possible."))
   487 		SendStat(siCustomAchievement, loc("Try to keep as many allies alive as possible."))
   487 	else
   488 	else
   488 		SendStat(siGameResult, loc("Hog Solo couldn't escape, try again!"))
   489 		SendStat(siGameResult, string.format(loc("%s couldn't escape, try again!"), hero.name))
   489 		SendStat(siCustomAchievement, loc("You have to get to the left-most land and remove any enemy hog from there."))
   490 		SendStat(siCustomAchievement, loc("You have to get to the left-most land and remove any enemy hog from there."))
   490 		SendStat(siCustomAchievement, loc("You will play every 3 turns."))
   491 		SendStat(siCustomAchievement, loc("You will play every 3 turns."))
   491 	end
   492 	end
   492 	sendSimpleTeamRankings({teamC.name, teamA.name, teamD.name, teamB.name})
   493 	sendSimpleTeamRankings({teamC.name, teamA.name, teamD.name, teamB.name})
   493 	EndGame()
   494 	EndGame()