share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
branchspacecampaign
changeset 9506 adc05ca2cb10
parent 9504 cdba61cfba93
child 9508 c23bff98e3d2
equal deleted inserted replaced
9504:cdba61cfba93 9506:adc05ca2cb10
   250 	end
   250 	end
   251 	return win
   251 	return win
   252 end
   252 end
   253 
   253 
   254 function onEscapeWin(gear)
   254 function onEscapeWin(gear)
   255 	if not hero.dead and GetX(hero.gear) < 170 and GetY(hero.gear > 1980) and StoppedGear(hero.gear) then
   255 	if not hero.dead and GetX(hero.gear) < 170 and GetY(hero.gear) > 1980 and StoppedGear(hero.gear) then
   256 		return true
   256 		return true
   257 	end
   257 	end
   258 	return false
   258 	return false
   259 end
   259 end
   260 
   260 
   292 		chooseToBattle = true		
   292 		chooseToBattle = true		
   293 		AddEvent(onGreen1Death, {green1.gear}, green1Death, {green1.gear}, 0)
   293 		AddEvent(onGreen1Death, {green1.gear}, green1Death, {green1.gear}, 0)
   294 		AddEvent(onBattleWin, {hero.gear}, battleWin, {hero.gear}, 0)
   294 		AddEvent(onBattleWin, {hero.gear}, battleWin, {hero.gear}, 0)
   295 		AddAnim(dialog02)
   295 		AddAnim(dialog02)
   296 	elseif GetX(hero.gear) > hero.x then
   296 	elseif GetX(hero.gear) > hero.x then
       
   297 		HogTurnLeft(hero.gear, true)
   297 		AddEvent(onEscapeWin, {hero.gear}, escapeWin, {hero.gear}, 0)
   298 		AddEvent(onEscapeWin, {hero.gear}, escapeWin, {hero.gear}, 0)
   298 		local greenTeam = { green2, green3, green4 }
   299 		local greenTeam = { green2, green3, green4 }
   299 		for i=1,3 do
   300 		for i=1,3 do
   300 			SetHogLevel(greenTeam[i].gear, 1)
   301 			SetHogLevel(greenTeam[i].gear, 1)
   301 		end
   302 		end