share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
changeset 12514 d89dabfd07ce
parent 12513 d90db45a0c4f
child 12515 2df340544f25
equal deleted inserted replaced
12513:d90db45a0c4f 12514:d89dabfd07ce
   242 	SendHealthStatsOff()
   242 	SendHealthStatsOff()
   243 end
   243 end
   244 
   244 
   245 function onNewTurn()
   245 function onNewTurn()
   246 	if CurrentHedgehog ~= hero.gear and not heroIsInBattle then
   246 	if CurrentHedgehog ~= hero.gear and not heroIsInBattle then
   247 		TurnTimeLeft = 0
   247 		EndTurn(true)
   248 	elseif CurrentHedgehog == hero.gear and not heroIsInBattle then
   248 	elseif CurrentHedgehog == hero.gear and not heroIsInBattle then
   249 		TurnTimeLeft = -1
   249 		TurnTimeLeft = -1
   250 	elseif (CurrentHedgehog == smuggler2.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 1 then
   250 	elseif (CurrentHedgehog == smuggler2.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 1 then
   251 		AnimSwitchHog(hero.gear)
   251 		AnimSwitchHog(hero.gear)
   252 		TurnTimeLeft = 0
   252 		EndTurn(true)
   253 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then
   253 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then
   254 		AnimSwitchHog(hero.gear)
   254 		AnimSwitchHog(hero.gear)
   255 		TurnTimeLeft = 0
   255 		EndTurn(true)
   256 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler2.gear) and ongoingBattle == 3 then
   256 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler2.gear) and ongoingBattle == 3 then
   257 		AnimSwitchHog(hero.gear)
   257 		AnimSwitchHog(hero.gear)
   258 		TurnTimeLeft = 0
   258 		EndTurn(true)
   259 	elseif CurrentHedgehog == ally.gear then
   259 	elseif CurrentHedgehog == ally.gear then
   260 		TurnTimeLeft = 0
   260 		EndTurn(true)
   261 	end
   261 	end
   262 end
   262 end
   263 
   263 
   264 function onGameTick()
   264 function onGameTick()
   265 	AnimUnWait()
   265 	AnimUnWait()
   406 	lose()
   406 	lose()
   407 end
   407 end
   408 
   408 
   409 function heroAtFirstBattle(gear)
   409 function heroAtFirstBattle(gear)
   410 	AnimCaption(hero.gear, loc("A smuggler! Prepare for battle"), 5000)
   410 	AnimCaption(hero.gear, loc("A smuggler! Prepare for battle"), 5000)
   411 	TurnTimeLeft = 0
   411 	EndTurn(true)
   412 	heroIsInBattle = true
   412 	heroIsInBattle = true
   413 	ongoingBattle = 1
   413 	ongoingBattle = 1
   414 	AnimSwitchHog(smuggler1.gear)
   414 	AnimSwitchHog(smuggler1.gear)
   415 	TurnTimeLeft = 0
   415 	EndTurn(true)
   416 end
   416 end
   417 
   417 
   418 function heroFleeFirstBattle(gear)
   418 function heroFleeFirstBattle(gear)
   419 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   419 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   420 	TurnTimeLeft = 0
   420 	EndTurn(true)
   421 	heroIsInBattle = false
   421 	heroIsInBattle = false
   422 	ongoingBattle = 0
   422 	ongoingBattle = 0
   423 end
   423 end
   424 
   424 
   425 function heroAtCheckpoint2(gear)
   425 function heroAtCheckpoint2(gear)
   443 function heroAtThirdBattle(gear)
   443 function heroAtThirdBattle(gear)
   444 	heroIsInBattle = true
   444 	heroIsInBattle = true
   445 	ongoingBattle = 3
   445 	ongoingBattle = 3
   446 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   446 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   447 	AnimSwitchHog(smuggler3.gear)
   447 	AnimSwitchHog(smuggler3.gear)
   448 	TurnTimeLeft = 0
   448 	EndTurn(true)
   449 end
   449 end
   450 
   450 
   451 function crateDestroyed(gear)
   451 function crateDestroyed(gear)
   452 	lose()
   452 	lose()
   453 end
   453 end
   506 
   506 
   507 --------------- OTHER FUNCTIONS ------------------
   507 --------------- OTHER FUNCTIONS ------------------
   508 
   508 
   509 function startMission()
   509 function startMission()
   510 	AnimSwitchHog(ally.gear)
   510 	AnimSwitchHog(ally.gear)
   511 	TurnTimeLeft = 0
   511 	EndTurn(true)
   512 end
   512 end
   513 
   513 
   514 function secondBattle()
   514 function secondBattle()
   515 	-- second battle
   515 	-- second battle
   516 	if heroIsInBattle and ongoingBattle == 1 then
   516 	if heroIsInBattle and ongoingBattle == 1 then
   518 	end
   518 	end
   519 	heroIsInBattle = true
   519 	heroIsInBattle = true
   520 	ongoingBattle = 2
   520 	ongoingBattle = 2
   521 	AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   521 	AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   522 	AnimSwitchHog(smuggler2.gear)
   522 	AnimSwitchHog(smuggler2.gear)
   523 	TurnTimeLeft = 0
   523 	EndTurn(true)
   524 end
   524 end
   525 
   525 
   526 function saveCheckPointLocal(cpoint)
   526 function saveCheckPointLocal(cpoint)
   527 	-- save checkpoint
   527 	-- save checkpoint
   528 	saveCheckpoint(cpoint)
   528 	saveCheckpoint(cpoint)