share/hedgewars/Data/Missions/Training/portal.lua
author Wuzzy <almikes@aol.com>
Mon, 18 Apr 2016 17:25:52 +0200
changeset 11673 991c790da01e
parent 11672 7652eeb0fc7f
child 11674 66ddc8c5ecd7
permissions -rw-r--r--
Clean up portal mission code It's a mess!
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 = {}
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
     5
local player 
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
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    11
	GameFlags = gfInfAttack +gfBorder +gfDisableWind +gfSolidLand 
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
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    19
	
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    20
	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: 11249
diff changeset
    21
	player = AddHog(loc("Subject 1"), 0, 10, "Terminator_Glasses")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    22
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    23
	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: 11249
diff changeset
    24
	enemy1 = AddHog(loc("Lucifer"), 1, 200, "InfernalHorns")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    25
	enemy2 = AddHog(loc("Voldemort"), 1, 150, "WizardHat")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    26
	enemy3 = AddHog(loc("Zombi"), 1, 100, "Zombi")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    27
	enemy4 = AddHog(loc("Predator"), 1, 14, "anzac")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    28
	enemy5 = AddHog(loc("Oneye"), 1, 50, "cyclops")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    29
	enemy6 = AddHog(loc("Razac"), 1, 50, "Evil")
11249
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    30
	enemy7 = AddHog(loc("C-2"), 1, 50, "cyborg1")
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    31
	enemy8 = AddHog(loc("Rider"), 1, 50, "scif_SparkssHelmet")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    32
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    33
	AddTeam(loc("Badmad"), 0xFF0402, "skull", "Island", "Default", "cm_pentagram")
11249
41799450378a - Rus localization for portal mission
antonc27 <antonc27@mail.ru>
parents: 8043
diff changeset
    34
	enemy9 = AddHog(loc("C-1"), 1, 50, "cyborg2")
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    35
	enemy10 = AddHog(loc("Hidden"), 1, 40, "bushhider")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    36
	enemy11 = AddHog(loc("Ronald"), 1, 70, "clown")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    37
	enemy12 = AddHog(loc("Phosphat"), 1, 50, "chef")
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
    38
	enemy13 = AddHog(loc("Lestat"), 1, 30, "vampirichog")
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    39
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    40
	SetGearPosition(player, 350, 1820)
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
    41
	SetGearPosition(enemy1, 2037, 1313)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    42
	SetGearPosition(enemy2, 1369, 1605)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    43
	SetGearPosition(enemy3, 1750, 1937)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    44
	SetGearPosition(enemy4, 3125, 89)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    45
	SetGearPosition(enemy5, 743, 900)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    46
	SetGearPosition(enemy6, 130, 360)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    47
	SetGearPosition(enemy7, 1333, 640)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    48
	SetGearPosition(enemy8, 1355, 200)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    49
	SetGearPosition(enemy9, 2680, 225)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    50
	SetGearPosition(enemy10, 2970, 800)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    51
	SetGearPosition(enemy11, 4050, 1964)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    52
	SetGearPosition(enemy12, 2666, 950)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    53
	SetGearPosition(enemy13, 3306, 1205)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    54
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    55
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    56
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    57
function onAmmoStoreInit()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    58
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    59
	SetAmmo(amFirePunch, 0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    60
	SetAmmo(amParachute, 0, 0, 0, 2)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    61
	SetAmmo(amGirder, 0, 0, 0, 3)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    62
	SetAmmo(amTeleport, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    63
	SetAmmo(amLaserSight,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    64
	SetAmmo(amHellishBomb,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    65
	SetAmmo(amGrenade,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    66
	SetAmmo(amRope,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    67
	SetAmmo(amDEagle,0,0,0,1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    68
	SetAmmo(amExtraTime,0,0,0,2)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    69
	SetAmmo(amSkip,9,0,0,0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    70
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    71
	SetAmmo(amPickHammer, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    72
	SetAmmo(amSnowball, 0, 0, 0, 1)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    73
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    74
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    75
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    76
function onGameStart()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    77
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    78
	MineArray[0] = AddGear(840, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    79
	MineArray[1] = AddGear(900, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    80
	MineArray[2] = AddGear(1000, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    81
	MineArray[3] = AddGear(1100, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    82
	MineArray[4] = AddGear(1140, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    83
	MineArray[5] = AddGear(1170, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    84
	MineArray[6] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    85
	MineArray[7] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    86
	MineArray[8] = AddGear(1230, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    87
	MineArray[9] = AddGear(1280, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    88
	MineArray[10] = AddGear(1302, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    89
	MineArray[11] = AddGear(1350, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    90
	MineArray[12] = AddGear(1383, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    91
	MineArray[13] = AddGear(1400, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    92
	MineArray[14] = AddGear(1423, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    93
	MineArray[15] = AddGear(1470, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    94
	MineArray[16] = AddGear(1480, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    95
	MineArray[17] = AddGear(1311, 1847, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    96
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    97
	MineArray[18] = AddGear(840, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    98
	MineArray[19] = AddGear(900, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
    99
	MineArray[20] = AddGear(1000, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   100
	MineArray[21] = AddGear(1100, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   101
	MineArray[22] = AddGear(1140, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   102
	MineArray[23] = AddGear(1170, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   103
	MineArray[24] = AddGear(1200, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   104
	MineArray[25] = AddGear(1230, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   105
	MineArray[26] = AddGear(1280, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   106
	MineArray[27] = AddGear(1302, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   107
	MineArray[28] = AddGear(1350, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   108
	MineArray[29] = AddGear(1383, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   109
	MineArray[30] = AddGear(1400, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   110
	MineArray[31] = AddGear(1423, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   111
	MineArray[32] = AddGear(1470, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   112
	MineArray[33] = AddGear(1480, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   113
	MineArray[34] = AddGear(1311, 1785, gtMine, 0, 0, 0, 0)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   114
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   115
	MineArray[35] = AddGear(4029, 89, gtMine, 0, 0, 0, 120)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   116
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   117
	for i = 0,#MineArray do
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   118
		SetTimer(MineArray[i],050)
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   119
		SetState(MineArray[i],544)
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   120
	end
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   121
	--needed this MineArray cause timer didn't work, its was always 3sec, i wanna instant mines
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   122
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   123
	--UTILITY CRATE--
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   124
	parachute = SpawnUtilityCrate(1670, 1165, amParachute)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   125
	girder = SpawnUtilityCrate(2101, 1297, amGirder)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   126
	SpawnUtilityCrate(3965, 625, amBlowTorch)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   127
	SpawnUtilityCrate(2249, 93, amBlowTorch)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   128
	SpawnUtilityCrate(2181, 829, amBlowTorch)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   129
	SpawnUtilityCrate(1820, 567, amBlowTorch)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   130
	SpawnUtilityCrate(1375, 900, amTeleport)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   131
	SpawnUtilityCrate(130, 600, amPickHammer)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   132
	SpawnUtilityCrate(1660,1820, amLaserSight)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   133
	SpawnUtilityCrate(4070,1840, amLaserSight)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   134
	
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   135
	
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   136
	--AMMO CRATE--
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   137
	portalgun = SpawnAmmoCrate(505, 1943, amPortalGun, 1000)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   138
	extratime = SpawnAmmoCrate(4020, 785, amExtraTime, 2)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   139
	SpawnAmmoCrate(425, 613, amSnowball)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   140
	SpawnAmmoCrate(861, 633, amHellishBomb)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   141
	SpawnAmmoCrate(2510, 623, amSnowball)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   142
	SpawnAmmoCrate(2900, 1600, amGrenade)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   143
	SpawnAmmoCrate(2680, 320, amGrenade)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   144
	SpawnAmmoCrate(2650, 80, amDEagle)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   145
	SpawnAmmoCrate(3000, 100, amDEagle)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   146
	SpawnAmmoCrate(2900, 1400, amRope)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   147
	SpawnAmmoCrate(4025, 1117, amFirePunch)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   148
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   149
	--HEALTH CRATE--
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   150
	SpawnHealthCrate(2000, 780)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   151
	
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   152
	--GIRDER--
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   153
	PlaceGirder(3363, 1323, 4)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   154
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   155
	ShowMission (loc("Portal Mind Challenge"), loc("Mission"), 
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   156
		loc("Defeat all enemies!") .. "|" .. loc("In this mission you have infinite time."),
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   157
		-amPortalGun, 5000)
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   158
	HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   159
	
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   160
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   161
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   162
function onGameTick()
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   163
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   164
	if (player ~= nil)  then
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   165
		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   166
			adviceGiven = true
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   167
			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
   168
		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   169
			adviceGiven2 = true
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   170
			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: 11672
diff changeset
   171
		end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   172
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   173
	
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   174
end
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   175
	
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   176
function onGearDelete(gear)
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   177
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   178
	if gear == portalgun then
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   179
		HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   180
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   181
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   182
	if gear == girder then 
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   183
		HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   184
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   185
	
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   186
	if gear == parachute then
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   187
		HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   188
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   189
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   190
	if gear == extratime then
11672
7652eeb0fc7f Clean up strings, hats, flags and graves in Portal mission
Wuzzy <almikes@aol.com>
parents: 11249
diff changeset
   191
		HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   192
	end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   193
	
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   194
	if gear == player then
11673
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   195
		player = nil
991c790da01e Clean up portal mission code
Wuzzy <almikes@aol.com>
parents: 11672
diff changeset
   196
	end
7904
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   197
end
4f338a9ea76d portal challenge
sphrix
parents:
diff changeset
   198