share/hedgewars/Data/Missions/Scenario/User_Mission_-_The_Great_Escape.lua
author Wuzzy <Wuzzy2@mail.ru>
Thu, 22 Feb 2018 01:03:40 +0100
changeset 13059 2d0f3e12fcad
parent 12938 e65aa3c3d4e6
child 13065 aed0374bbd8a
permissions -rw-r--r--
SimpleMission: Add support for failure texts in the stats screen
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7889
diff changeset
     1
HedgewarsScriptLoad("/Scripts/Locale.lua")
7889
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     2
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     3
local player = nil
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     4
local enemy = nil
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     5
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     6
function onGameInit()
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     7
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     8
	Map = "Castle"
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
     9
	Theme = "Nature"
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    10
	Seed = 0
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    11
	GameFlags = gfInfAttack
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    12
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    13
	TurnTime = 45 * 1000
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    14
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    15
	CaseFreq = 0
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    16
	MinesNum = 0
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    17
	Explosives = 0
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    18
12591
7510fe66bfbb Change graves of teams in missions for greater variety
Wuzzy <almikes@aol.com>
parents: 12363
diff changeset
    19
	AddTeam(loc("Hero Team"), 14483456, "star", "Island", "Default", "cm_swordshield")
7889
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    20
	player = AddHog(loc("Good Dude"), 0, 80, "NoHat") --NoHat
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    21
12591
7510fe66bfbb Change graves of teams in missions for greater variety
Wuzzy <almikes@aol.com>
parents: 12363
diff changeset
    22
	AddTeam(loc("Bad Team"), 	1175851, "dragonball", "Island", "Default", "cm_dragonrb")
11266
6e1aa1144a2b - Finally added rus localization for all User Missions
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    23
	enemy = AddHog(loc("Bad Guy"), 1, 40, "NoHat")
7889
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    24
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    25
end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    26
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    27
function onGameStart()
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    28
12231
3ec0261e01f0 Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
    29
ShowMission(loc("The Great Escape"), loc("Scenario"), loc("Elimate your captor.") .. "|" .. loc("Mines time: 0 seconds"), -amGrenade, 0)
7889
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    30
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    31
------ GIRDER LIST ------
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    32
PlaceGirder(1042,564,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    33
PlaceGirder(1028,474,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    34
PlaceGirder(1074,474,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    35
PlaceGirder(1050,385,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    36
PlaceGirder(1175,731,7)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    37
PlaceGirder(1452,905,2)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    38
PlaceGirder(1522,855,4)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    39
PlaceGirder(1496,900,3)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    40
PlaceGirder(1682,855,4)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    41
PlaceGirder(1773,887,2)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    42
PlaceGirder(1647,901,1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    43
PlaceGirder(1871,883,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    44
PlaceGirder(1871,723,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    45
PlaceGirder(1774,768,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    46
PlaceGirder(1773,767,6)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    47
PlaceGirder(1821,904,1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    48
PlaceGirder(1822,802,3)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    49
PlaceGirder(1820,723,1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    50
PlaceGirder(1782,678,4)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    51
PlaceGirder(1822,661,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    52
PlaceGirder(1822,644,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    53
PlaceGirder(1742,644,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    54
PlaceGirder(1742,661,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    55
PlaceGirder(1694,676,2)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    56
PlaceGirder(1903,635,0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    57
------ HEALTH CRATE LIST ------
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    58
SpawnHealthCrate(1476,169)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    59
SpawnHealthCrate(1551,177)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    60
SpawnHealthCrate(1586,200)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    61
SpawnHealthCrate(1439,189)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    62
SpawnHealthCrate(1401,211)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    63
SpawnHealthCrate(1633,210)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    64
------ MINE LIST ------
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    65
tempG = AddGear(1010,680,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    66
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    67
tempG = AddGear(1031,720,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    68
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    69
tempG = AddGear(1039,748,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    70
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    71
tempG = AddGear(1051,777,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    72
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    73
tempG = AddGear(1065,796,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    74
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    75
tempG = AddGear(1094,800,gtMine, 0, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    76
SetTimer(tempG, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    77
------ REPOSITION LIST ------
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    78
SetGearPosition(player,1050,534)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    79
SetGearPosition(enemy,1512,158)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    80
SetHealth(player, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    81
SetHealth(enemy, 1)
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    82
------ CRATE LIST ------
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    83
SpawnSupplyCrate(1632,943,amShotgun)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    84
SpawnSupplyCrate(1723,888,amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    85
SpawnSupplyCrate(1915,599,amGrenade)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    86
SpawnSupplyCrate(1416,913,amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    87
SpawnSupplyCrate(1227,640,amPickHammer)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    88
SpawnSupplyCrate(1519,945,amParachute)
7889
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    89
------ END LOADING DATA ------
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    90
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    91
end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    92
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    93
function onGameTick()
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    94
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    95
	if TurnTimeLeft == TurnTime-1 then
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    96
		SetWind(100)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    97
	end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    98
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
    99
end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   100
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   101
function onGearDelete(gear)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   102
	if (GetGearType(gear) == gtCase) and (CurrentHedgehog == player) then
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   103
		if GetHealth(gear) > 0 then
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   104
			AddGear(GetX(gear), GetY(gear), gtGrenade, 0, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   105
		end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   106
	elseif gear == player then
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   107
		ShowMission(loc("The Great Escape"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   108
	elseif gear == enemy then
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   109
		ShowMission(loc("The Great Escape"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   110
	end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   111
end
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   112
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   113
function onAmmoStoreInit()
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   114
	SetAmmo(amGrenade, 1, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   115
	SetAmmo(amParachute, 1, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   116
	SetAmmo(amFirePunch, 0, 0, 0, 3)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   117
	SetAmmo(amPickHammer, 0, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   118
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   119
	SetAmmo(amShotgun, 0, 0, 0, 1)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   120
	SetAmmo(amSkip, 9, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7877
diff changeset
   121
end