share/hedgewars/Data/Missions/Scenario/portal.lua
author sheepluva
Wed, 16 May 2018 10:11:00 +0200
branchui-scaling
changeset 13388 32a1696ca93a
parent 13035 958c6ff056de
child 13583 141cdfe0f3ca
permissions -rw-r--r--
WIP: make chat resizing faster hold shift for pixel-precise size changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7904
diff changeset
     1
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7904
diff changeset
     2
HedgewarsScriptLoad("/Scripts/Utils.lua")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     3
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     4
local MineArray = {}
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
     5
local player
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     6
local adviceGiven = false
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     7
local adviceGiven2 = false
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     8
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     9
function onGameInit()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    10
	Seed = 0 -- The base number for the random number generator
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
    11
	GameFlags = gfInfAttack +gfBorder +gfDisableWind +gfSolidLand
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    12
	TurnTime = 1500000 -- The time the player has to move each round (in ms)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    13
	CaseFreq = 0 -- The frequency of crate drops
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    14
	MinesNum = 0 -- The number of mines being placed
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    15
	Explosives = 0 -- The number of explosives being placed
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    16
	Delay = 10 -- The delay between each round
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    17
	Map = "portal" -- The map to be played
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    18
	Theme = "Hell" -- The theme to be used
11669
66ddc8c5ecd7 Disable Sudden Death in portal mission
Wuzzy <almikes@aol.com>
parents: 11668
diff changeset
    19
	-- Disable Sudden Death
66ddc8c5ecd7 Disable Sudden Death in portal mission
Wuzzy <almikes@aol.com>
parents: 11668
diff changeset
    20
	HealthDecrease = 0
66ddc8c5ecd7 Disable Sudden Death in portal mission
Wuzzy <almikes@aol.com>
parents: 11668
diff changeset
    21
	WaterRise = 0
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
    22
11667
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    23
	AddTeam(loc("Subjects"), 0xFFFF01, "Simple", "Island", "Default", "cm_test")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    24
	player = AddHog(loc("Subject 1"), 0, 10, "Terminator_Glasses")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    25
11667
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    26
	AddTeam(loc("Hell Army"), 0xFF0402, "skull", "Island", "Default", "cm_hellish")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    27
	enemy1 = AddHog(loc("Lucifer"), 1, 200, "InfernalHorns")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    28
	enemy2 = AddHog(loc("Voldemort"), 1, 150, "WizardHat")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    29
	enemy3 = AddHog(loc("Zombi"), 1, 100, "Zombi")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    30
	enemy4 = AddHog(loc("Predator"), 1, 14, "anzac")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    31
	enemy5 = AddHog(loc("Oneye"), 1, 50, "cyclops")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    32
	enemy6 = AddHog(loc("Razac"), 1, 50, "Evil")
11245
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    33
	enemy7 = AddHog(loc("C-2"), 1, 50, "cyborg1")
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    34
	enemy8 = AddHog(loc("Rider"), 1, 50, "scif_SparkssHelmet")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    35
11667
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    36
	AddTeam(loc("Badmad"), 0xFF0402, "skull", "Island", "Default", "cm_pentagram")
11245
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    37
	enemy9 = AddHog(loc("C-1"), 1, 50, "cyborg2")
11667
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    38
	enemy10 = AddHog(loc("Hidden"), 1, 40, "bushhider")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    39
	enemy11 = AddHog(loc("Ronald"), 1, 70, "clown")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    40
	enemy12 = AddHog(loc("Phosphat"), 1, 50, "chef")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
    41
	enemy13 = AddHog(loc("Lestat"), 1, 30, "vampirichog")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    42
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    43
	SetGearPosition(player, 350, 1820)
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
    44
	SetGearPosition(enemy1, 2037, 1313)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    45
	SetGearPosition(enemy2, 1369, 1605)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    46
	SetGearPosition(enemy3, 1750, 1937)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    47
	SetGearPosition(enemy4, 3125, 89)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    48
	SetGearPosition(enemy5, 743, 900)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    49
	SetGearPosition(enemy6, 130, 360)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    50
	SetGearPosition(enemy7, 1333, 640)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    51
	SetGearPosition(enemy8, 1355, 200)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    52
	SetGearPosition(enemy9, 2680, 225)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    53
	SetGearPosition(enemy10, 2970, 800)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    54
	SetGearPosition(enemy11, 4050, 1964)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    55
	SetGearPosition(enemy12, 2666, 950)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    56
	SetGearPosition(enemy13, 3306, 1205)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    57
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    58
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    59
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    60
function onAmmoStoreInit()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    61
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    62
	SetAmmo(amFirePunch, 0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    63
	SetAmmo(amParachute, 0, 0, 0, 2)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    64
	SetAmmo(amGirder, 0, 0, 0, 3)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    65
	SetAmmo(amTeleport, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    66
	SetAmmo(amLaserSight,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    67
	SetAmmo(amHellishBomb,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    68
	SetAmmo(amGrenade,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    69
	SetAmmo(amRope,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    70
	SetAmmo(amDEagle,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    71
	SetAmmo(amExtraTime,0,0,0,2)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    72
	SetAmmo(amSkip,9,0,0,0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    73
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    74
	SetAmmo(amPickHammer, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    75
	SetAmmo(amSnowball, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    76
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    77
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    78
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    79
function onGameStart()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    80
11671
51c4ea6d7f91 merge portal mission fixes by Wuzzy and restore accidently removed SetWind call
sheepluva
parents: 11670
diff changeset
    81
	SetWind(100)
51c4ea6d7f91 merge portal mission fixes by Wuzzy and restore accidently removed SetWind call
sheepluva
parents: 11670
diff changeset
    82
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    83
	MineArray[0] = AddGear(840, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    84
	MineArray[1] = AddGear(900, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    85
	MineArray[2] = AddGear(1000, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    86
	MineArray[3] = AddGear(1100, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    87
	MineArray[4] = AddGear(1140, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    88
	MineArray[5] = AddGear(1170, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    89
	MineArray[6] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    90
	MineArray[7] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    91
	MineArray[8] = AddGear(1230, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    92
	MineArray[9] = AddGear(1280, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    93
	MineArray[10] = AddGear(1302, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    94
	MineArray[11] = AddGear(1350, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    95
	MineArray[12] = AddGear(1383, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    96
	MineArray[13] = AddGear(1400, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    97
	MineArray[14] = AddGear(1423, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    98
	MineArray[15] = AddGear(1470, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    99
	MineArray[16] = AddGear(1480, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   100
	MineArray[17] = AddGear(1311, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   101
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   102
	MineArray[18] = AddGear(840, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   103
	MineArray[19] = AddGear(900, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   104
	MineArray[20] = AddGear(1000, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   105
	MineArray[21] = AddGear(1100, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   106
	MineArray[22] = AddGear(1140, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   107
	MineArray[23] = AddGear(1170, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   108
	MineArray[24] = AddGear(1200, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   109
	MineArray[25] = AddGear(1230, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   110
	MineArray[26] = AddGear(1280, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   111
	MineArray[27] = AddGear(1302, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   112
	MineArray[28] = AddGear(1350, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   113
	MineArray[29] = AddGear(1383, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   114
	MineArray[30] = AddGear(1400, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   115
	MineArray[31] = AddGear(1423, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   116
	MineArray[32] = AddGear(1470, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   117
	MineArray[33] = AddGear(1480, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   118
	MineArray[34] = AddGear(1311, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   119
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   120
	MineArray[35] = AddGear(4029, 89, gtMine, 0, 0, 0, 120)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   121
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   122
	for i = 0,#MineArray do
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   123
		SetTimer(MineArray[i],050)
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   124
		SetState(MineArray[i],544)
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   125
	end
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   126
	--needed this MineArray cause timer didn't work, its was always 3sec, i wanna instant mines
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   127
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   128
	--CRATES
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   129
	parachute = SpawnSupplyCrate(1670, 1165, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   130
	girder = SpawnSupplyCrate(2101, 1297, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   131
	SpawnSupplyCrate(1375, 900, amTeleport)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   132
	SpawnSupplyCrate(1660,1820, amLaserSight)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   133
	SpawnSupplyCrate(4070,1840, amLaserSight)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   134
	portalgun = SpawnSupplyCrate(505, 1943, amPortalGun, 1000)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   135
	extratime = SpawnSupplyCrate(4020, 785, amExtraTime, 2)
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   136
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   137
	SpawnSupplyCrate(425, 613, amSnowball)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   138
	SpawnSupplyCrate(861, 633, amHellishBomb)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   139
	SpawnSupplyCrate(2510, 623, amSnowball)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   140
	SpawnSupplyCrate(2900, 1600, amGrenade)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   141
	SpawnSupplyCrate(2680, 320, amGrenade)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   142
	SpawnSupplyCrate(2650, 80, amDEagle)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   143
	SpawnSupplyCrate(3000, 100, amDEagle)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   144
	SpawnSupplyCrate(2900, 1400, amRope)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   145
	SpawnSupplyCrate(4025, 1117, amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   146
	SpawnSupplyCrate(3965, 625, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   147
	SpawnSupplyCrate(2249, 93, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   148
	SpawnSupplyCrate(2181, 829, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   149
	SpawnSupplyCrate(1820, 567, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12347
diff changeset
   150
	SpawnSupplyCrate(130, 600, amPickHammer)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   151
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   152
	--HEALTH CRATE--
13035
958c6ff056de Portal mission: Fix health crate spawning inside land
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   153
	SpawnHealthCrate(2000, 880)
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   154
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   155
	--GIRDER--
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   156
	PlaceGirder(3363, 1323, 4)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   157
12077
ce3860c82c8b Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents: 11968
diff changeset
   158
	ShowMission (loc("Portal Mind Challenge"), loc("Scenario"),
12226
3ec0261e01f0 Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents: 12077
diff changeset
   159
		loc("Defeat all enemies!") .. "|" ..
3ec0261e01f0 Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents: 12077
diff changeset
   160
		loc("In this mission you have infinite time.") .. "|" ..
3ec0261e01f0 Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents: 12077
diff changeset
   161
		loc("Mines time: 0 seconds"),
11667
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
   162
		-amPortalGun, 5000)
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11245
diff changeset
   163
	HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   164
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   165
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   166
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   167
function onGameTick()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   168
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   169
	if (player ~= nil)  then
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   170
		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   171
			adviceGiven = true
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   172
			HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   173
		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   174
			adviceGiven2 = true
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   175
			HogSay(player, loc("The anti-portal surface is all over the floor, and I have nothing to kill him. Dropping something could hurt him enough to kill him."), SAY_THINK)
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   176
		end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   177
	end
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   178
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   179
end
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   180
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   181
function onGearDelete(gear)
11670
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   182
	-- Check gear collection
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   183
	if CurrentHedgehog == player and (band(GetGearMessage(gear), gmDestroy) ~= 0) then
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   184
		if gear == portalgun then
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   185
			HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   186
		end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   187
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   188
		if gear == girder then
11670
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   189
			HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   190
		end
11676
7180ddb4bf5b whitespace fix
sheepluva
parents: 11671
diff changeset
   191
11670
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   192
		if gear == parachute then
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   193
			HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   194
		end
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   195
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   196
		if gear == extratime then
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   197
			HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
be57b0e3e289 Portal mission: Fix speech bubbles appearing when crate got destroyed
Wuzzy <almikes@aol.com>
parents: 11669
diff changeset
   198
		end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   199
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   200
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   201
	if gear == player then
11668
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   202
		player = nil
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11667
diff changeset
   203
	end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   204
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   205