share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
changeset 12624 2b529ddf1b01
parent 12594 fa837afff629
child 12905 a9e4e8fa852c
equal deleted inserted replaced
12623:2d68c113fc8d 12624:2b529ddf1b01
   193 	AddAmmo(hero.gear, amBazooka, 3)
   193 	AddAmmo(hero.gear, amBazooka, 3)
   194 	AddAmmo(hero.gear, amParachute, 1)
   194 	AddAmmo(hero.gear, amParachute, 1)
   195 	AddAmmo(hero.gear, amGrenade, 6)
   195 	AddAmmo(hero.gear, amGrenade, 6)
   196 	AddAmmo(hero.gear, amDEagle, 4)
   196 	AddAmmo(hero.gear, amDEagle, 4)
   197 	AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1)))
   197 	AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1)))
       
   198 	AddAmmo(hero.gear, amSkip, 0)
   198 
   199 
   199 	AddAnim(dialog01)
   200 	AddAnim(dialog01)
   200 
   201 
   201 	SendHealthStatsOff()
   202 	SendHealthStatsOff()
   202 end
   203 end
   284 	end
   285 	end
   285 	if gear == hero.gear then
   286 	if gear == hero.gear then
   286 		hero.dead = true
   287 		hero.dead = true
   287 	elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then
   288 	elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then
   288 		heroIsInBattle = false
   289 		heroIsInBattle = false
       
   290 		AddAmmo(hero.gear, amSkip, 0)
   289 		ongoingBattle = 0
   291 		ongoingBattle = 0
   290 	end
   292 	end
   291 end
   293 end
   292 
   294 
   293 function onPrecise()
   295 function onPrecise()
   389 		dx = div(dx, 3)
   391 		dx = div(dx, 3)
   390 		dy = div(dy, 3)
   392 		dy = div(dy, 3)
   391 	end
   393 	end
   392 	EndTurn(true)
   394 	EndTurn(true)
   393 	heroIsInBattle = true
   395 	heroIsInBattle = true
       
   396 	AddAmmo(hero.gear, amSkip, 100)
   394 	ongoingBattle = 1
   397 	ongoingBattle = 1
   395 	AnimSwitchHog(smuggler1.gear)
   398 	AnimSwitchHog(smuggler1.gear)
   396 	EndTurn(true)
   399 	EndTurn(true)
   397 	SetGearVelocity(hero.gear, dx, dy)
   400 	SetGearVelocity(hero.gear, dx, dy)
   398 end
   401 end
   399 
   402 
   400 function heroFleeFirstBattle(gear)
   403 function heroFleeFirstBattle(gear)
   401 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   404 	AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000)
   402 	EndTurn(true)
   405 	EndTurn(true)
   403 	heroIsInBattle = false
   406 	heroIsInBattle = false
       
   407 	AddAmmo(hero.gear, amSkip, 0)
   404 	ongoingBattle = 0
   408 	ongoingBattle = 0
   405 end
   409 end
   406 
   410 
   407 function heroAtBattlePoint1(gear)
   411 function heroAtBattlePoint1(gear)
   408 	secondBattle()
   412 	secondBattle()
   412 	secondBattle()
   416 	secondBattle()
   413 end
   417 end
   414 
   418 
   415 function heroAtThirdBattle(gear)
   419 function heroAtThirdBattle(gear)
   416 	heroIsInBattle = true
   420 	heroIsInBattle = true
       
   421 	AddAmmo(hero.gear, amSkip, 100)
   417 	ongoingBattle = 3
   422 	ongoingBattle = 3
   418 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   423 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000)
   419 	local dx, dy = GetGearVelocity(hero.gear)
   424 	local dx, dy = GetGearVelocity(hero.gear)
   420 	-- Hog gets scared and falls from rope
   425 	-- Hog gets scared and falls from rope
   421 	if isOnRope() then
   426 	if isOnRope() then
   506 		HogSay(hero.gear, loc("Gasp!"), SAY_SHOUT)
   511 		HogSay(hero.gear, loc("Gasp!"), SAY_SHOUT)
   507 		dx = div(dx, 3)
   512 		dx = div(dx, 3)
   508 		dy = div(dy, 3)
   513 		dy = div(dy, 3)
   509 	end
   514 	end
   510 	heroIsInBattle = true
   515 	heroIsInBattle = true
       
   516 	AddAmmo(hero.gear, amSkip, 100)
   511 	ongoingBattle = 2
   517 	ongoingBattle = 2
   512 	AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   518 	AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000)
   513 	AnimSwitchHog(smuggler2.gear)
   519 	AnimSwitchHog(smuggler2.gear)
   514 	EndTurn(true)
   520 	EndTurn(true)
   515 	SetGearVelocity(hero.gear, dx, dy)
   521 	SetGearVelocity(hero.gear, dx, dy)