share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
changeset 12517 193b5882429d
parent 12516 90569bd07627
child 12518 94bba599efd3
equal deleted inserted replaced
12516:90569bd07627 12517:193b5882429d
   273 		return true
   273 		return true
   274 	end
   274 	end
   275 	return false
   275 	return false
   276 end
   276 end
   277 
   277 
       
   278 function onGearDelete(gear)
       
   279 	if GetGearType(gear) == gtCase and band(GetGearMessage(gear), gmDestroy) ~= 0 then
       
   280 		heroAtSaucerPosition()
       
   281 	end
       
   282 end
       
   283 
   278 function onHeroOutOfGuardSight(gear)
   284 function onHeroOutOfGuardSight(gear)
   279 	if GetHealth(hero.gear) and GetX(gear) < 3100 and GetY(gear) > saucerY-25 and StoppedGear(gear) and not guard1.keepTurning then
   285 	if GetHealth(hero.gear) and GetX(gear) < 3100 and GetY(gear) > saucerY-25 and StoppedGear(gear) and not guard1.keepTurning then
   280 		return true
   286 		return true
   281 	end
   287 	end
   282 	return false
   288 	return false
   345 	AnimSay(gear,loc("Now I have to climb these trees"), SAY_SAY, 4000)
   351 	AnimSay(gear,loc("Now I have to climb these trees"), SAY_SAY, 4000)
   346 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   352 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   347 end
   353 end
   348 
   354 
   349 function heroAtSaucerPosition(gear)
   355 function heroAtSaucerPosition(gear)
   350 	EndTurn(true)
   356 	if not saucerAcquired then
   351 	-- save check point
   357 		EndTurn(true)
   352 	SaveCampaignVar("CosmosCheckPoint", "2")
   358 		-- save check point
   353 	checkPointReached = 2
   359 		SaveCampaignVar("CosmosCheckPoint", "2")
   354 	AddAnim(dialog02)
   360 		checkPointReached = 2
   355 	-- check if he was spotted by the guard
   361 		AddAnim(dialog02)
   356 	if guard1.turn and GetX(hero.gear) > saucerX-150 then
   362 		-- check if he was spotted by the guard
   357 		guard1.keepTurning = false
   363 		if guard1.turn and GetX(hero.gear) > saucerX-150 then
   358 		AddAnim(dialog03)
   364 			guard1.keepTurning = false
       
   365 			AddAnim(dialog03)
       
   366 		end
       
   367 		saucerAcquired = true
   359 	end
   368 	end
   360 end
   369 end
   361 
   370 
   362 function heroOutOfGuardSight(gear)
   371 function heroOutOfGuardSight(gear)
   363 	guard1.keepTurning = true
   372 	guard1.keepTurning = true