share/hedgewars/Data/Missions/Challenge/User_Mission_-_RCPlane_Challenge.lua
changeset 13065 a297e06d1607
parent 12344 877f55c77a3f
child 13066 ad75ed9a1e15
equal deleted inserted replaced
13064:6766b900ab13 13065:a297e06d1607
    51 
    51 
    52                                 loc("Collect or destroy all the health crates.") .. "|" ..
    52                                 loc("Collect or destroy all the health crates.") .. "|" ..
    53                                 loc("Compete to use as few planes as possible!") .. "|" ..
    53                                 loc("Compete to use as few planes as possible!") .. "|" ..
    54 								"", -amRCPlane, 4000
    54 								"", -amRCPlane, 4000
    55                                 )
    55                                 )
       
    56 	SetTeamLabel(loc("Wannabe Flyboys"), "0")
    56 
    57 
    57 	PlaceGirder(2192, 508, 6)
    58 	PlaceGirder(2192, 508, 6)
    58 	PlaceGirder(2192, 670, 6)
    59 	PlaceGirder(2192, 670, 6)
    59 	PlaceGirder(2193, 792, 2)
    60 	PlaceGirder(2193, 792, 2)
    60 	PlaceGirder(2100, 825, 4)
    61 	PlaceGirder(2100, 825, 4)
   330 function onGearAdd(gear)
   331 function onGearAdd(gear)
   331 
   332 
   332 	if GetGearType(gear) == gtRCPlane then
   333 	if GetGearType(gear) == gtRCPlane then
   333 		RCGear = gear
   334 		RCGear = gear
   334 		planesUsed = planesUsed + 1
   335 		planesUsed = planesUsed + 1
       
   336 		SetTeamLabel(loc("Wannabe Flyboys"), tostring(planesUsed))
   335 		planeTimer = 0
   337 		planeTimer = 0
   336 		missiles = 0
   338 		missiles = 0
   337 	end
   339 	end
   338 
   340 
   339 	if GetGearType(gear) == gtCase then
   341 	if GetGearType(gear) == gtCase then
   350 	if GetGearType(gear) == gtRCPlane then
   352 	if GetGearType(gear) == gtRCPlane then
   351 
   353 
   352 		RCGear = nil
   354 		RCGear = nil
   353 		planeUhOh = false
   355 		planeUhOh = false
   354 		missiles = 0
   356 		missiles = 0
   355 		AddCaption(string.format(loc("Planes used: %d"), planesUsed))
       
   356 
   357 
   357 		if(planeTimer < 2000 and crateStreak == 0) then
   358 		if(planeTimer < 2000 and crateStreak == 0) then
   358 			nextComment = sndStupid
   359 			nextComment = sndStupid
   359 			commentTimer = math.min(2000-planeTimer, 800)
   360 			commentTimer = math.min(2000-planeTimer, 800)
   360 		elseif(planeTimer < 5000 and crateStreak == 0) then
   361 		elseif(planeTimer < 5000 and crateStreak == 0) then