share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
changeset 12514 d89dabfd07ce
parent 12513 d90db45a0c4f
child 12515 2df340544f25
equal deleted inserted replaced
12513:d90db45a0c4f 12514:d89dabfd07ce
   192 		SpawnAmmoCrate(bazookaX, weaponsY, amBazooka)
   192 		SpawnAmmoCrate(bazookaX, weaponsY, amBazooka)
   193 		SpawnUtilityCrate(parachuteX, weaponsY, amParachute)
   193 		SpawnUtilityCrate(parachuteX, weaponsY, amParachute)
   194 		SpawnAmmoCrate(grenadeX, weaponsY, amGrenade)
   194 		SpawnAmmoCrate(grenadeX, weaponsY, amGrenade)
   195 		SpawnAmmoCrate(deserteagleX, weaponsY, amDEagle)
   195 		SpawnAmmoCrate(deserteagleX, weaponsY, amDEagle)
   196 		AddEvent(onWeaponsPlatform, {hero.gear}, weaponsPlatform, {hero.gear}, 0)
   196 		AddEvent(onWeaponsPlatform, {hero.gear}, weaponsPlatform, {hero.gear}, 0)
   197 		TurnTimeLeft = 0
   197 		EndTurn(true)
   198 		AddAnim(dialog01)
   198 		AddAnim(dialog01)
   199 	elseif checkPointReached == 2 then
   199 	elseif checkPointReached == 2 then
   200 		AddAmmo(hero.gear, amBazooka, 3)
   200 		AddAmmo(hero.gear, amBazooka, 3)
   201 		AddAmmo(hero.gear, amParachute, 1)
   201 		AddAmmo(hero.gear, amParachute, 1)
   202 		AddAmmo(hero.gear, amGrenade, 6)
   202 		AddAmmo(hero.gear, amGrenade, 6)
   203 		AddAmmo(hero.gear, amDEagle, 4)
   203 		AddAmmo(hero.gear, amDEagle, 4)
   204 		SetWind(60)
   204 		SetWind(60)
   205 		GameFlags = bor(GameFlags,gfDisableWind)
   205 		GameFlags = bor(GameFlags,gfDisableWind)
   206 		weaponsAcquired = true
   206 		weaponsAcquired = true
   207 		afterDialog02 = true
   207 		afterDialog02 = true
   208 		TurnTimeLeft = 0
   208 		EndTurn(true)
   209 		AddAnim(dialog02)
   209 		AddAnim(dialog02)
   210 	end
   210 	end
   211 	-- this event check goes here to be executed after the onWeaponsPlatform check
   211 	-- this event check goes here to be executed after the onWeaponsPlatform check
   212 	AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0)
   212 	AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0)
   213 
   213 
   228 		return
   228 		return
   229 	end
   229 	end
   230 	ExecuteAfterAnimations()
   230 	ExecuteAfterAnimations()
   231 	CheckEvents()
   231 	CheckEvents()
   232 	if CurrentHedgehog ~= hero.gear and not battleZone then
   232 	if CurrentHedgehog ~= hero.gear and not battleZone then
   233 		TurnTimeLeft = 0
   233 		EndTurn(true)
   234 	end
   234 	end
   235 end
   235 end
   236 
   236 
   237 function onNewTurn()
   237 function onNewTurn()
   238 	-- rounds start if hero got his weapons or got near the enemies
   238 	-- rounds start if hero got his weapons or got near the enemies
   239 	if not weaponsAcquired and not battleZoneReached and CurrentHedgehog ~= hero.gear then
   239 	if not weaponsAcquired and not battleZoneReached and CurrentHedgehog ~= hero.gear then
   240 		TurnTimeLeft = 0
   240 		EndTurn(true)
   241 	elseif weaponsAcquired and not battleZoneReached and CurrentHedgehog ~= hero.gear and afterDialog02 then
   241 	elseif weaponsAcquired and not battleZoneReached and CurrentHedgehog ~= hero.gear and afterDialog02 then
   242 		battleZone(hero.gear)
   242 		battleZone(hero.gear)
   243 	elseif not weaponsAcquired and not battleZoneReached and CurrentHedgehog == hero.gear then
   243 	elseif not weaponsAcquired and not battleZoneReached and CurrentHedgehog == hero.gear then
   244 		TurnTimeLeft = -1
   244 		TurnTimeLeft = -1
   245 	elseif CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear
   245 	elseif CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear
   246 		or CurrentHedgehog == paoth3.gear or CurrentHedgehog == paoth4.gear then
   246 		or CurrentHedgehog == paoth3.gear or CurrentHedgehog == paoth4.gear then
   247 		TurnTimeLeft = 0
   247 		EndTurn(true)
   248 	elseif CurrentHedgehog == professor.gear then
   248 	elseif CurrentHedgehog == professor.gear then
   249 		AnimSwitchHog(hero.gear)
   249 		AnimSwitchHog(hero.gear)
   250 		TurnTimeLeft = 0
   250 		EndTurn(true)
   251 	end
   251 	end
   252 end
   252 end
   253 
   253 
   254 function onPrecise()
   254 function onPrecise()
   255 	if GameTime > 3000 then
   255 	if GameTime > 3000 then
   318 -------------- ACTIONS ------------------
   318 -------------- ACTIONS ------------------
   319 
   319 
   320 function weaponsPlatform(gear)
   320 function weaponsPlatform(gear)
   321 	saveCheckpoint("2")
   321 	saveCheckpoint("2")
   322 	SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   322 	SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   323 	TurnTimeLeft = 0
   323 	EndTurn(true)
   324 	weaponsAcquired = true
   324 	weaponsAcquired = true
   325 	SetWind(60)
   325 	SetWind(60)
   326 	GameFlags = bor(GameFlags,gfDisableWind)
   326 	GameFlags = bor(GameFlags,gfDisableWind)
   327 	AddAmmo(hero.gear, amRope, 0)
   327 	AddAmmo(hero.gear, amRope, 0)
   328 	if GetX(hero.gear) < 1900 then
   328 	if GetX(hero.gear) < 1900 then
   337 	SendStat(siPlayerKills,'0',teamD.name)
   337 	SendStat(siPlayerKills,'0',teamD.name)
   338 	EndGame()
   338 	EndGame()
   339 end
   339 end
   340 
   340 
   341 function battleZone(gear)
   341 function battleZone(gear)
   342 	TurnTimeLeft = 0
   342 	EndTurn(true)
   343 	battleZoneReached = true
   343 	battleZoneReached = true
   344 	if weaponsAcquired then
   344 	if weaponsAcquired then
   345 		AddAnim(dialog04)
   345 		AddAnim(dialog04)
   346 	else
   346 	else
   347 		AddAnim(dialog03)
   347 		AddAnim(dialog03)
   454 ------------------- custom "animation" functions --------------------------
   454 ------------------- custom "animation" functions --------------------------
   455 
   455 
   456 function startCombat()
   456 function startCombat()
   457 	-- use this so minion3 will gain control
   457 	-- use this so minion3 will gain control
   458 	AnimSwitchHog(minion3.gear)
   458 	AnimSwitchHog(minion3.gear)
   459 	TurnTimeLeft = 0
   459 	EndTurn(true)
   460 end
   460 end
   461 
   461 
   462 function setAfterDialog02()
   462 function setAfterDialog02()
   463 	afterDialog02 = true
   463 	afterDialog02 = true
   464 end
   464 end