share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
changeset 9758 3b8058b251b8
parent 9642 8a691e0f117a
child 9810 54c0fdec4600
equal deleted inserted replaced
9757:9be28be004d4 9758:3b8058b251b8
    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 the game your 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 = {
    77 	MinesNum = 0
    77 	MinesNum = 0
    78 	MinesTime = 1
    78 	MinesTime = 1
    79 	Explosives = 0
    79 	Explosives = 0
    80 	Map = "fruit03_map"
    80 	Map = "fruit03_map"
    81 	Theme = "Fruit"
    81 	Theme = "Fruit"
    82 	
    82 
    83 	-- Hog Solo
    83 	-- Hog Solo
    84 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
    84 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
    85 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
    85 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
    86 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    86 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    87 	-- enemies
    87 	-- enemies
    89 					"fr_pumpkin", "Gasmask", "NinjaFull", "NinjaStraight", "NinjaTriangle" }
    89 					"fr_pumpkin", "Gasmask", "NinjaFull", "NinjaStraight", "NinjaTriangle" }
    90 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
    90 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
    91 	for i=1,table.getn(enemiesEven) do
    91 	for i=1,table.getn(enemiesEven) do
    92 		enemiesEven[i].gear = AddHog(enemiesEven[i].name, 1, 100, hats[math.random(1,table.getn(hats))])
    92 		enemiesEven[i].gear = AddHog(enemiesEven[i].name, 1, 100, hats[math.random(1,table.getn(hats))])
    93 		AnimSetGearPosition(enemiesEven[i].gear, enemiesEven[i].x, enemiesEven[i].y)
    93 		AnimSetGearPosition(enemiesEven[i].gear, enemiesEven[i].x, enemiesEven[i].y)
    94 	end	
    94 	end
    95 	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
    95 	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
    96 	for i=1,table.getn(enemiesOdd) do
    96 	for i=1,table.getn(enemiesOdd) do
    97 		enemiesOdd[i].gear = AddHog(enemiesOdd[i].name, 1, 100, hats[math.random(1,table.getn(hats))])
    97 		enemiesOdd[i].gear = AddHog(enemiesOdd[i].name, 1, 100, hats[math.random(1,table.getn(hats))])
    98 		AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y)
    98 		AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y)
    99 	end
    99 	end
   100 	
   100 
   101 	initCheckpoint("fruit03")
   101 	initCheckpoint("fruit03")
   102 	
   102 
   103 	AnimInit()
   103 	AnimInit()
   104 	AnimationSetup()
   104 	AnimationSetup()
   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
   116 	AddAmmo(hero.gear, amTeleport, 2)
   116 	AddAmmo(hero.gear, amTeleport, 2)
   117 	AddAmmo(hero.gear, amSniperRifle, 2)
   117 	AddAmmo(hero.gear, amSniperRifle, 2)
   118 	AddAmmo(hero.gear, amWatermelon, 2)
   118 	AddAmmo(hero.gear, amWatermelon, 2)
   119 	--enemies ammo
   119 	--enemies ammo
   123 	AddAmmo(enemiesOdd[1].gear, amGrenade, 5)
   123 	AddAmmo(enemiesOdd[1].gear, amGrenade, 5)
   124 	AddAmmo(enemiesEven[1].gear, amDEagle, 100)
   124 	AddAmmo(enemiesEven[1].gear, amDEagle, 100)
   125 	AddAmmo(enemiesEven[1].gear, amSniperRifle, 100)
   125 	AddAmmo(enemiesEven[1].gear, amSniperRifle, 100)
   126 	AddAmmo(enemiesEven[1].gear, amWatermelon, 1)
   126 	AddAmmo(enemiesEven[1].gear, amWatermelon, 1)
   127 	AddAmmo(enemiesEven[1].gear, amGrenade, 5)
   127 	AddAmmo(enemiesEven[1].gear, amGrenade, 5)
   128 	
   128 
   129 	SendHealthStatsOff()
   129 	SendHealthStatsOff()
   130 	AddAnim(dialog01)
   130 	AddAnim(dialog01)
   131 end
   131 end
   132 
   132 
   133 function onNewTurn()
   133 function onNewTurn()
   169 	end
   169 	end
   170 end
   170 end
   171 
   171 
   172 function onPrecise()
   172 function onPrecise()
   173 	if GameTime > 3000 then
   173 	if GameTime > 3000 then
   174 		SetAnimSkip(true)   
   174 		SetAnimSkip(true)
   175 	end
   175 	end
   176 end
   176 end
   177 
   177 
   178 -------------- EVENTS ------------------
   178 -------------- EVENTS ------------------
   179 
   179 
   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, loc("You complete the mission in "..TotalRounds.." rounds"))
   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 ------------------
   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}})
   247 end
   247 end
   248 
   248 
   249 ------------------ Other Functions -------------------
   249 ------------------ Other Functions -------------------
   250 
   250 
   251 function turnHogs()
   251 function turnHogs()