share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
branchspacecampaign
changeset 9438 77dde6234fec
parent 9436 07fe70ba7dcd
child 9441 00f07e32313a
equal deleted inserted replaced
9436:07fe70ba7dcd 9438:77dde6234fec
     7 
     7 
     8 -- TODO
     8 -- TODO
     9 -- maybe use same name in missionName and frontend mission name..
     9 -- maybe use same name in missionName and frontend mission name..
    10 -- in this map I have to track the weapons the player has in checkpoints
    10 -- in this map I have to track the weapons the player has in checkpoints
    11 -- GENERAL NOTE: change hats :D
    11 -- GENERAL NOTE: change hats :D
       
    12 -- Idea: game will be successfully end when the 2 lower crates are collected
       
    13 -- it would be more defficult (and sadistic) if one should collect *all* the crates
    12 
    14 
    13 HedgewarsScriptLoad("/Scripts/Locale.lua")
    15 HedgewarsScriptLoad("/Scripts/Locale.lua")
    14 HedgewarsScriptLoad("/Scripts/Animate.lua")
    16 HedgewarsScriptLoad("/Scripts/Animate.lua")
    15 
    17 
    16 ----------------- VARIABLES --------------------
    18 ----------------- VARIABLES --------------------
   141 	
   143 	
   142 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   144 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   143 	AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1)
   145 	AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1)
   144 	AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1)
   146 	AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1)
   145 	AddEvent(onHeroAtCheckpoint4, {hero.gear}, heroAtCheckpoint4, {hero.gear}, 0)
   147 	AddEvent(onHeroAtCheckpoint4, {hero.gear}, heroAtCheckpoint4, {hero.gear}, 0)
       
   148 	AddEvent(onHeroAtThirdBattle, {hero.gear}, heroAtThirdBattle, {hero.gear}, 0)
   146 	
   149 	
   147 	-- smugglers ammo
   150 	-- smugglers ammo
   148 	AddAmmo(smuggler1.gear, amBazooka, 2)
   151 	AddAmmo(smuggler1.gear, amBazooka, 2)
   149 	AddAmmo(smuggler1.gear, amGrenade, 2)
   152 	AddAmmo(smuggler1.gear, amGrenade, 2)
   150 	AddAmmo(smuggler1.gear, amDEagle, 2)
   153 	AddAmmo(smuggler1.gear, amDEagle, 2)
   224 		AnimSwitchHog(hero.gear)
   227 		AnimSwitchHog(hero.gear)
   225 		TurnTimeLeft = 0
   228 		TurnTimeLeft = 0
   226 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then
   229 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then
   227 		AnimSwitchHog(hero.gear)
   230 		AnimSwitchHog(hero.gear)
   228 		TurnTimeLeft = 0
   231 		TurnTimeLeft = 0
       
   232 	elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler2.gear) and ongoingBattle == 3 then
       
   233 		AnimSwitchHog(hero.gear)
       
   234 		TurnTimeLeft = 0
   229 	elseif CurrentHedgehog == ally.gear then
   235 	elseif CurrentHedgehog == ally.gear then
   230 		TurnTimeLeft = 0
   236 		TurnTimeLeft = 0
   231 	end
   237 	end
   232 	WriteLnToConsole("CURRENT HEDGEHOG IS "..CurrentHedgehog)
   238 	WriteLnToConsole("CURRENT HEDGEHOG IS "..CurrentHedgehog)
   233 end
   239 end
   306 end
   312 end
   307 
   313 
   308 function onHeroAtCheckpoint4(gear)
   314 function onHeroAtCheckpoint4(gear)
   309 	if not hero.dead and GetX(hero.gear) > 1110 and GetX(hero.gear) < 1300
   315 	if not hero.dead and GetX(hero.gear) > 1110 and GetX(hero.gear) < 1300
   310 			and GetY(hero.gear) > 1100 and GetY(hero.gear) < 1220 then
   316 			and GetY(hero.gear) > 1100 and GetY(hero.gear) < 1220 then
       
   317 		return true
       
   318 	end
       
   319 	return false
       
   320 end
       
   321 
       
   322 function onHeroAtThirdBattle(gear)
       
   323 	if not hero.dead and GetX(hero.gear) > 2000 and GetX(hero.gear) < 2200
       
   324 			and GetY(hero.gear) > 1430 and GetY(hero.gear) < 1670 then
   311 		return true
   325 		return true
   312 	end
   326 	end
   313 	return false
   327 	return false
   314 end
   328 end
   315 
   329 
   351 	saveCheckPoint("3")
   365 	saveCheckPoint("3")
   352 end
   366 end
   353 
   367 
   354 function heroAtCheckpoint4(gear)
   368 function heroAtCheckpoint4(gear)
   355 	saveCheckPoint("4")
   369 	saveCheckPoint("4")
       
   370 end
       
   371 
       
   372 function heroAtThirdBattle(gear)
       
   373 	heroIsInBattle = true
       
   374 	ongoingBattle = 3
       
   375 	AnimSay(smuggler3.gear, loc("Who's there! I'll get you..."), SAY_SHOUT, 5000)	
       
   376 	AnimSwitchHog(smuggler3.gear)
       
   377 	TurnTimeLeft = 0
   356 end
   378 end
   357 
   379 
   358 -------------- ANIMATIONS ------------------
   380 -------------- ANIMATIONS ------------------
   359 
   381 
   360 function Skipanim(anim)
   382 function Skipanim(anim)