share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
author mikade
Wed, 20 Jul 2011 17:46:19 +0200
changeset 5427 3817b7e6c871
child 5449 a03d0acd7f06
permissions -rw-r--r--
New mission. Hopefully easier than most of my other missions. :D Features: Deadly AI accuracy, and "Energetic Engineer" achievement.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     2
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     3
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     4
local player = nil 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     5
local enemy = nil
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     6
local firedShell = false
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     7
local turnNumber = 0
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     8
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     9
local hhs = {}
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    10
local numhhs = 0
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    11
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    12
function onGameInit()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    13
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    14
	Seed = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    15
	TurnTime = 20000 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    16
	CaseFreq = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    17
	MinesNum = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    18
	Explosives = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    19
	Map = "Bamboo" 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    20
	Theme = "Bamboo"
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    21
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    22
	AddTeam(loc("Pathetic Resistance"), 14483456, "Simple", "Island", "Default")
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    23
	player = AddHog("Ikeda", 0, 10, "StrawHat")
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    24
			
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    25
	AddTeam(loc("Cybernetic Empire"), 	1175851, "Simple", "Island", "Default")
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    26
	enemy = AddHog(loc("Unit 835"), 5, 10, "cyborg")
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    27
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    28
	SetGearPosition(player,1166,1680)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    29
	SetGearPosition(enemy,2848,1443)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    30
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    31
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    32
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    33
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    34
function onGameStart()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    35
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    36
	ShowMission(loc("Bamboo Thicket"), loc("User Challenge"), loc("Eliminate the enemy before the time runs out"), -amBazooka, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    37
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    38
	--WEAPON CRATE LIST. WCRATES: 1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    39
	SpawnAmmoCrate(1915,1876,amBazooka)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    40
	--UTILITY CRATE LIST. UCRATES: 2
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    41
	SpawnUtilityCrate(1986,1141,amBlowTorch)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    42
	SpawnUtilityCrate(1427,1527,amParachute)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    43
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    44
	AddAmmo(enemy, amGrenade, 100)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    45
		
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    46
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    47
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    48
function onNewTurn()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    49
	SetWind(100)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    50
	turnNumber = turnNumber + 1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    51
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    52
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    53
function onAmmoStoreInit()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    54
	SetAmmo(amSkip, 9, 0, 0, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    55
	SetAmmo(amGirder, 4, 0, 0, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    56
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    57
	SetAmmo(amParachute, 0, 0, 0, 2)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    58
	SetAmmo(amBazooka, 0, 0, 0, 2)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    59
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    60
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    61
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    62
function onGearAdd(gear)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    63
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    64
	if GetGearType(gear) == gtHedgehog then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    65
		hhs[numhhs] = gear
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    66
		numhhs = numhhs + 1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    67
	elseif GetGearType(gear) == gtShell then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    68
		firedShell = true
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    69
	end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    70
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    71
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    72
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    73
function onGearDelete(gear)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    74
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    75
	if (gear == enemy) then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    76
		
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    77
		ShowMission(loc("Bamboo Thicket"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    78
		
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    79
		if (turnNumber < 6) and (firedShell == false) then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    80
			AddCaption(loc("Achievement Unlocked") .. ": " .. loc("Energetic Engineer"),0xffba00ff,capgrpMessage2)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    81
		end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    82
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    83
	elseif gear == player then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    84
		ShowMission(loc("Bamboo Thicket"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    85
	end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    86
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    87
end