share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua
changeset 7165 aad1aea05f1e
parent 6505 b005fbba039e
child 7877 b3fb94986255
equal deleted inserted replaced
7164:fad64b97947e 7165:aad1aea05f1e
    61 	ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("You have to destroy 12 targets in 180 seconds"), -amClusterBomb, 5000)
    61 	ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("You have to destroy 12 targets in 180 seconds"), -amClusterBomb, 5000)
    62 	spawnTarget()
    62 	spawnTarget()
    63 
    63 
    64 end
    64 end
    65 
    65 
    66 function onGameTick()
    66 function onGameTick20()
    67 
    67 
    68 	if TurnTimeLeft == 1 and scored < 12 and game_lost == false then
    68 	if TurnTimeLeft < 40 and TurnTimeLeft > 0 and scored < 12 and game_lost == false then
    69 		game_lost = true
    69 		game_lost = true
    70 		ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
    70 		ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
    71 		SetHealth(player, 0)
    71 		SetHealth(player, 0)
    72 		time_goal = 1
    72 		time_goal = 1
    73 	end
    73 	end
    74 
    74 
    75 	if scored == 12 or game_lost then
    75 	if scored == 12 or game_lost then
    76 		if end_timer == 0 then
    76 		if end_timer == 0 then
    77 			EndGame()
    77 			EndGame()
    78 		else
    78 		else
    79 			end_timer = end_timer - 1
    79 			end_timer = end_timer - 20
    80 			TurnTimeLeft = time_goal
    80 			TurnTimeLeft = time_goal
    81 		end
    81 		end
    82 	end
    82 	end
    83 
    83 
    84 end
    84 end
    85 
    85 
    86 function onNewTurn()
    86 function onNewTurn()
    87 	ParseCommand("setweap " .. string.char(amClusterBomb))
    87 	ParseCommand("setweap " .. string.char(amClusterBomb))
    88 end
    88 end
    89 
    89 
    90 function onGearAdd(gear)
    90 --function onGearAdd(gear)
    91 end
    91 --end
    92 
    92 
    93 function onGearDamage(gear, damage)
    93 function onGearDamage(gear, damage)
    94 
    94 
    95 	if GetGearType(gear) == gtTarget then
    95 	if GetGearType(gear) == gtTarget then
    96 		scored = scored + 1
    96 		scored = scored + 1