share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
changeset 14618 3d4044b4aa3e
parent 14617 bd15c8551318
child 14619 efa2bdeadd79
equal deleted inserted replaced
14617:bd15c8551318 14618:3d4044b4aa3e
   197 	AddAmmo(hero.gear, amBazooka, 3)
   197 	AddAmmo(hero.gear, amBazooka, 3)
   198 	AddAmmo(hero.gear, amParachute, 1)
   198 	AddAmmo(hero.gear, amParachute, 1)
   199 	AddAmmo(hero.gear, amGrenade, 6)
   199 	AddAmmo(hero.gear, amGrenade, 6)
   200 	AddAmmo(hero.gear, amDEagle, 4)
   200 	AddAmmo(hero.gear, amDEagle, 4)
   201 	AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1)))
   201 	AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1)))
   202 	AddAmmo(hero.gear, amSkip, 0)
       
   203 
   202 
   204 	AddAnim(dialog01)
   203 	AddAnim(dialog01)
   205 
   204 
   206 	SendHealthStatsOff()
   205 	SendHealthStatsOff()
   207 end
   206 end
   230 function onAmmoStoreInit()
   229 function onAmmoStoreInit()
   231 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
   230 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
   232 	SetAmmo(amRope, 0, 0, 0, 1)
   231 	SetAmmo(amRope, 0, 0, 0, 1)
   233 	SetAmmo(amPortalGun, 0, 0, 0, 1)
   232 	SetAmmo(amPortalGun, 0, 0, 0, 1)
   234 	SetAmmo(amGirder, 0, 0, 0, 3)
   233 	SetAmmo(amGirder, 0, 0, 0, 3)
       
   234 	-- Give skip to all.
       
   235 	-- Skip intentionally kept for player so they can wait for
       
   236 	-- better wind conditions.
   235 	SetAmmo(amSkip, 9, 0, 0, 1)
   237 	SetAmmo(amSkip, 9, 0, 0, 1)
   236 end
   238 end
   237 
   239 
   238 function onGearAdd(gear)
   240 function onGearAdd(gear)
   239 	if GetGearType(gear) == gtRope then
   241 	if GetGearType(gear) == gtRope then
   275 	if gear == hero.gear then
   277 	if gear == hero.gear then
   276 		hero.dead = true
   278 		hero.dead = true
   277 	elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then
   279 	elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then
   278 		heroIsInBattle = false
   280 		heroIsInBattle = false
   279 		SetTeamPassive(teamB.name, true)
   281 		SetTeamPassive(teamB.name, true)
   280 		AddAmmo(hero.gear, amSkip, 0)
       
   281 		ongoingBattle = 0
   282 		ongoingBattle = 0
   282 	end
   283 	end
   283 end
   284 end
   284 
   285 
   285 function onPrecise()
   286 function onPrecise()
   384 	end
   385 	end
   385 	SetGearMessage(hero.gear, 0)
   386 	SetGearMessage(hero.gear, 0)
   386 	SetTeamPassive(teamB.name, false)
   387 	SetTeamPassive(teamB.name, false)
   387 	heroIsInBattle = true
   388 	heroIsInBattle = true
   388 	EndTurn(true)
   389 	EndTurn(true)
   389 	AddAmmo(hero.gear, amSkip, 100)
       
   390 	ongoingBattle = 1
   390 	ongoingBattle = 1
   391 	AnimSwitchHog(smuggler1.gear)
   391 	AnimSwitchHog(smuggler1.gear)
   392 	EndTurn(true)
   392 	EndTurn(true)
   393 	SetGearVelocity(hero.gear, dx, dy)
   393 	SetGearVelocity(hero.gear, dx, dy)
   394 end
   394 end
   396 function heroFleeFirstBattle(gear)
   396 function heroFleeFirstBattle(gear)
   397 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   397 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   398 	SetTeamPassive(teamB.name, true)
   398 	SetTeamPassive(teamB.name, true)
   399 	heroIsInBattle = false
   399 	heroIsInBattle = false
   400 	EndTurn(true)
   400 	EndTurn(true)
   401 	AddAmmo(hero.gear, amSkip, 0)
       
   402 	ongoingBattle = 0
   401 	ongoingBattle = 0
   403 end
   402 end
   404 
   403 
   405 function heroAtBattlePoint1(gear)
   404 function heroAtBattlePoint1(gear)
   406 	secondBattle()
   405 	secondBattle()
   411 end
   410 end
   412 
   411 
   413 function heroAtThirdBattle(gear)
   412 function heroAtThirdBattle(gear)
   414 	heroIsInBattle = true
   413 	heroIsInBattle = true
   415 	SetTeamPassive(teamB.name, false)
   414 	SetTeamPassive(teamB.name, false)
   416 	AddAmmo(hero.gear, amSkip, 100)
       
   417 	ongoingBattle = 3
   415 	ongoingBattle = 3
   418 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   416 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   419 	local dx, dy = GetGearVelocity(hero.gear)
   417 	local dx, dy = GetGearVelocity(hero.gear)
   420 	-- Hog gets scared and falls from rope
   418 	-- Hog gets scared and falls from rope
   421 	if isOnRope() then
   419 	if isOnRope() then
   509 		dy = div(dy, 3)
   507 		dy = div(dy, 3)
   510 	end
   508 	end
   511 	SetGearMessage(hero.gear, 0)
   509 	SetGearMessage(hero.gear, 0)
   512 	heroIsInBattle = true
   510 	heroIsInBattle = true
   513 	SetTeamPassive(teamB.name, false)
   511 	SetTeamPassive(teamB.name, false)
   514 	AddAmmo(hero.gear, amSkip, 100)
       
   515 	ongoingBattle = 2
   512 	ongoingBattle = 2
   516 	AnimSay(smuggler2.gear, loc("This seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   513 	AnimSay(smuggler2.gear, loc("This seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   517 	AnimSwitchHog(smuggler2.gear)
   514 	AnimSwitchHog(smuggler2.gear)
   518 	EndTurn(true)
   515 	EndTurn(true)
   519 	SetGearVelocity(hero.gear, dx, dy)
   516 	SetGearVelocity(hero.gear, dx, dy)