share/hedgewars/Data/Missions/Scenario/User_Mission_-_Bamboo_Thicket.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 21 Jan 2019 19:49:38 +0100
changeset 14670 e7b2542c4d28
parent 14503 d4aa64f51c9f
child 14953 ff4003a90ff8
permissions -rw-r--r--
More spawn height tweaking in missions
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
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7877
diff changeset
     2
HedgewarsScriptLoad("/Scripts/Locale.lua")
13501
cbda0f842364 Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents: 13061
diff changeset
     3
HedgewarsScriptLoad("/Scripts/Achievements.lua")
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     4
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     5
local player = nil 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     6
local enemy = nil
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     7
local firedShell = false
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     8
local turnNumber = 0
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
     9
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    10
local hhs = {}
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    11
local numhhs = 0
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    12
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    13
function onGameInit()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    14
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    15
	Seed = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    16
	TurnTime = 20000 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    17
	CaseFreq = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    18
	MinesNum = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    19
	Explosives = 0 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    20
	Map = "Bamboo" 
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    21
	Theme = "Bamboo"
12224
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12078
diff changeset
    22
	-- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12078
diff changeset
    23
	HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12078
diff changeset
    24
	WaterRise = 0
13061
8d2087c85b8d Fix incorrect wind bar in some missions
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
    25
	GameFlags = gfDisableWind
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    26
14503
d4aa64f51c9f Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
    27
	AddMissionTeam(-1)
d4aa64f51c9f Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
    28
	player = AddMissionHog(10)
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    29
			
13583
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13501
diff changeset
    30
	AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_cyborg")
5823
mikade
parents: 5449
diff changeset
    31
	enemy = AddHog(loc("Unit 835"), 1, 10, "cyborg1")
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    32
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    33
	SetGearPosition(player,142,656)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    34
	SetGearPosition(enemy,1824,419)
5427
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
end
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
function onGameStart()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    39
12078
99bfd35b3924 Fix misleading scenario desciptions regarding time limit / no time limit
Wuzzy <almikes@aol.com>
parents: 12077
diff changeset
    40
	ShowMission(loc("Bamboo Thicket"), loc("Scenario"), loc("Eliminate the enemy."), -amBazooka, 0)
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    41
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12771
diff changeset
    42
	-- CRATE LIST.
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12771
diff changeset
    43
	SpawnSupplyCrate(891,852,amBazooka)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12771
diff changeset
    44
	SpawnSupplyCrate(962,117,amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12771
diff changeset
    45
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12771
diff changeset
    46
	SpawnSupplyCrate(403,503,amParachute)
5427
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
	AddAmmo(enemy, amGrenade, 100)
13061
8d2087c85b8d Fix incorrect wind bar in some missions
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
    49
8d2087c85b8d Fix incorrect wind bar in some missions
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
    50
	SetWind(100)
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    51
		
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    52
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    53
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    54
function onNewTurn()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    55
	turnNumber = turnNumber + 1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    56
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    57
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    58
function onAmmoStoreInit()
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    59
	SetAmmo(amSkip, 9, 0, 0, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    60
	SetAmmo(amGirder, 4, 0, 0, 0)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    61
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    62
	SetAmmo(amParachute, 0, 0, 0, 2)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    63
	SetAmmo(amBazooka, 0, 0, 0, 2)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    64
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    65
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    66
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    67
function onGearAdd(gear)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    68
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    69
	if GetGearType(gear) == gtHedgehog then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    70
		hhs[numhhs] = gear
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    71
		numhhs = numhhs + 1
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    72
	elseif GetGearType(gear) == gtShell then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    73
		firedShell = true
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    74
	end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    75
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    76
end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    77
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    78
function onGearDelete(gear)
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    79
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    80
	if (gear == enemy) then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    81
		
14485
ead8928a59f8 Report mission victory for most missions
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
    82
		SaveMissionVar("Won", "true")
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    83
		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
    84
		
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    85
		if (turnNumber < 6) and (firedShell == false) then
13501
cbda0f842364 Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents: 13061
diff changeset
    86
			awardAchievement(loc("Energetic Engineer"))
5427
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    87
		end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    88
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    89
	elseif gear == player then
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    90
		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
    91
	end
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    92
3817b7e6c871 New mission. Hopefully easier than most of my other missions. :D
mikade
parents:
diff changeset
    93
end