share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
branchqmlfrontend
changeset 12855 1b2b84315d27
parent 11843 01f88c3b7b66
parent 12854 28cb18c5e712
child 12856 95d903b976d0
equal deleted inserted replaced
11843:01f88c3b7b66 12855:1b2b84315d27
     1 
       
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
     3 
       
     4 local player = nil 
       
     5 local enemy = nil
       
     6 local firedShell = false
       
     7 local turnNumber = 0
       
     8 
       
     9 local hhs = {}
       
    10 local numhhs = 0
       
    11 
       
    12 function onGameInit()
       
    13 
       
    14 	Seed = 0 
       
    15 	TurnTime = 20000 
       
    16 	CaseFreq = 0 
       
    17 	MinesNum = 0 
       
    18 	Explosives = 0 
       
    19 	Map = "Bamboo" 
       
    20 	Theme = "Bamboo"
       
    21 	SuddenDeathTurns = 99999
       
    22 
       
    23 	AddTeam(loc("Pathetic Resistance"), 14483456, "Simple", "Island", "Default")
       
    24 	player = AddHog(loc("Ikeda"), 0, 10, "StrawHat")
       
    25 			
       
    26 	AddTeam(loc("Cybernetic Empire"), 	1175851, "Simple", "Island", "Default")
       
    27 	enemy = AddHog(loc("Unit 835"), 1, 10, "cyborg1")
       
    28 
       
    29 	SetGearPosition(player,142,656)
       
    30 	SetGearPosition(enemy,1824,419)
       
    31 
       
    32 end
       
    33 
       
    34 
       
    35 function onGameStart()
       
    36 
       
    37 	ShowMission(loc("Bamboo Thicket"), loc("User Challenge"), loc("Eliminate the enemy before the time runs out"), -amBazooka, 0)
       
    38 
       
    39 	--WEAPON CRATE LIST. WCRATES: 1
       
    40 	SpawnAmmoCrate(891,852,amBazooka)
       
    41 	--UTILITY CRATE LIST. UCRATES: 2
       
    42 	SpawnUtilityCrate(962,117,amBlowTorch)
       
    43 	SpawnUtilityCrate(403,503,amParachute)
       
    44 
       
    45 	AddAmmo(enemy, amGrenade, 100)
       
    46 		
       
    47 end
       
    48 
       
    49 function onNewTurn()
       
    50 	SetWind(100)
       
    51 	turnNumber = turnNumber + 1
       
    52 end
       
    53 
       
    54 function onAmmoStoreInit()
       
    55 	SetAmmo(amSkip, 9, 0, 0, 0)
       
    56 	SetAmmo(amGirder, 4, 0, 0, 0)
       
    57 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
       
    58 	SetAmmo(amParachute, 0, 0, 0, 2)
       
    59 	SetAmmo(amBazooka, 0, 0, 0, 2)
       
    60 end
       
    61 
       
    62 
       
    63 function onGearAdd(gear)
       
    64 
       
    65 	if GetGearType(gear) == gtHedgehog then
       
    66 		hhs[numhhs] = gear
       
    67 		numhhs = numhhs + 1
       
    68 	elseif GetGearType(gear) == gtShell then
       
    69 		firedShell = true
       
    70 	end
       
    71 
       
    72 end
       
    73 
       
    74 function onGearDelete(gear)
       
    75 
       
    76 	if (gear == enemy) then
       
    77 		
       
    78 		ShowMission(loc("Bamboo Thicket"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
       
    79 		
       
    80 		if (turnNumber < 6) and (firedShell == false) then
       
    81 			AddCaption(loc("Achievement Unlocked") .. ": " .. loc("Energetic Engineer"),0xffba00ff,capgrpMessage2)
       
    82 		end
       
    83 
       
    84 	elseif gear == player then
       
    85 		ShowMission(loc("Bamboo Thicket"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
       
    86 	end
       
    87 
       
    88 end