share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
author mikade
Tue, 21 Jun 2011 20:49:47 +0200
changeset 5277 09beef0752ab
child 5362 5f0c46e78e50
permissions -rw-r--r--
PianoStrike exploit fix for Capture The Flag. New Gameplay Mode: The Specialists
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     1
----------------------------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     2
-- THE SPECIALISTS MODE 0.2
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     3
-- by mikade
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     4
----------------------------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     5
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     6
-- version history
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     7
-----------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     8
-- version 0.1
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
     9
-----------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    10
-- concept test
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    11
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    12
----------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    13
-- version 0.2
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    14
----------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    15
-- added gfRandomOrder to gameflags
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    16
-- removed some deprecated variables/methods
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    17
-- fixed lack of portal reset
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    18
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    19
--------------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    20
--TO DO
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    21
--------------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    22
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    23
-- add proper gameflag checking, maybe
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    24
-- set crate drops etc.
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    25
-- assuming place hog mode + gfinfattack doesn't get the fix: somehow end turn after teleport
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    26
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    27
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    28
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    29
local numhhs = 0 
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    30
local hhs = {} 
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    31
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    32
local currName 
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    33
local lastName
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    34
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    35
function CreateTeam()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    36
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    37
	currTeam = ""
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    38
	lastTeam = ""
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    39
	z = 0
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    40
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    41
	for i = 0, (numhhs-1) do
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    42
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    43
		currTeam = GetHogTeamName(hhs[i])
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    44
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    45
		if currTeam == lastTeam then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    46
			z = z + 1
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    47
		else
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    48
			z = 1		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    49
		end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    50
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    51
		if z == 1 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    52
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    53
			SetHogName(hhs[i],"Soldier")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    54
			SetHogHat(hhs[i], "Vega")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    55
			SetHealth(hhs[i],200)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    56
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    57
		elseif z == 2 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    58
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    59
			SetHogHat(hhs[i], "Glasses")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    60
			SetHogName(hhs[i],"Engineer")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    61
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    62
		elseif z == 3 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    63
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    64
			SetHogName(hhs[i],"Ninja")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    65
			SetHogHat(hhs[i], "NinjaFull")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    66
			SetHealth(hhs[i],80)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    67
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    68
		elseif z == 4 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    69
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    70
			SetHogName(hhs[i],"Demo")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    71
			SetHogHat(hhs[i], "Skull")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    72
			SetHealth(hhs[i],200)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    73
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    74
		elseif z == 5 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    75
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    76
			SetHogName(hhs[i],"Sniper")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    77
			SetHogHat(hhs[i], "Sniper")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    78
			SetHealth(hhs[i],120)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    79
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    80
		elseif z == 6 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    81
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    82
			SetHogName(hhs[i],"Saint")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    83
			SetHogHat(hhs[i], "angel")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    84
			SetHealth(hhs[i],300)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    85
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    86
		elseif z == 7 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    87
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    88
			SetHogName(hhs[i],"Pyro")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    89
			SetHogHat(hhs[i], "Gasmask")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    90
			SetHealth(hhs[i],150)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    91
		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    92
		elseif z == 8 then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    93
		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    94
			SetHogName(hhs[i],"Loon")			
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    95
			SetHogHat(hhs[i], "clown")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    96
			SetHealth(hhs[i],100)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    97
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    98
		end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    99
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   100
		lastTeam = GetHogTeamName(hhs[i])
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   101
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   102
	end	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   103
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   104
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   105
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   106
function ResetAllAmmo()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   107
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   108
	AddAmmo(CurrentHedgehog, amBazooka, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   109
	AddAmmo(CurrentHedgehog, amGrenade, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   110
	AddAmmo(CurrentHedgehog, amShotgun, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   111
	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   112
	AddAmmo(CurrentHedgehog, amGirder, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   113
	AddAmmo(CurrentHedgehog, amBlowTorch, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   114
	AddAmmo(CurrentHedgehog, amPickHammer, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   115
	AddAmmo(CurrentHedgehog, amSwitch, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   116
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   117
	AddAmmo(CurrentHedgehog, amRope, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   118
	AddAmmo(CurrentHedgehog, amParachute, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   119
	AddAmmo(CurrentHedgehog, amFirePunch, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   120
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   121
	AddAmmo(CurrentHedgehog, amDynamite, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   122
	AddAmmo(CurrentHedgehog, amDrill, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   123
	AddAmmo(CurrentHedgehog, amMine, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   124
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   125
	AddAmmo(CurrentHedgehog, amSniperRifle, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   126
	AddAmmo(CurrentHedgehog, amDEagle, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   127
	AddAmmo(CurrentHedgehog, amPortalGun, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   128
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   129
	AddAmmo(CurrentHedgehog, amSeduction, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   130
	AddAmmo(CurrentHedgehog, amResurrector, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   131
	AddAmmo(CurrentHedgehog, amInvulnerable, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   132
	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   133
	AddAmmo(CurrentHedgehog, amFlamethrower, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   134
	AddAmmo(CurrentHedgehog, amMolotov, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   135
	AddAmmo(CurrentHedgehog, amNapalm, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   136
	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   137
	AddAmmo(CurrentHedgehog, amBaseballBat, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   138
	AddAmmo(CurrentHedgehog, amGasBomb, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   139
	AddAmmo(CurrentHedgehog, amKamikaze, 0)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   140
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   141
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   142
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   143
function AssignAmmo()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   144
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   145
	ResetAllAmmo()	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   146
	n = GetHogName(CurrentHedgehog)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   147
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   148
	AddAmmo(CurrentHedgehog, amSkip,100)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   149
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   150
	if n == "Soldier" then 
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   151
		AddAmmo(CurrentHedgehog, amBazooka,1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   152
		AddAmmo(CurrentHedgehog, amGrenade,1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   153
		AddAmmo(CurrentHedgehog, amShotgun,1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   154
	elseif n == "Engineer" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   155
		AddAmmo(CurrentHedgehog, amGirder, 2)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   156
		AddAmmo(CurrentHedgehog, amBlowTorch, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   157
		AddAmmo(CurrentHedgehog, amPickHammer, 1)	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   158
		AddAmmo(CurrentHedgehog, amSwitch, 2)	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   159
	elseif n == "Ninja" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   160
		AddAmmo(CurrentHedgehog, amRope, 100)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   161
		AddAmmo(CurrentHedgehog, amParachute, 100)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   162
		AddAmmo(CurrentHedgehog, amFirePunch, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   163
	elseif n == "Demo" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   164
		AddAmmo(CurrentHedgehog, amDynamite, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   165
		AddAmmo(CurrentHedgehog, amMine, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   166
		AddAmmo(CurrentHedgehog, amDrill, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   167
	elseif n == "Sniper" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   168
		AddAmmo(CurrentHedgehog, amSniperRifle, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   169
		AddAmmo(CurrentHedgehog, amDEagle, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   170
		AddAmmo(CurrentHedgehog, amPortalGun, 2)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   171
	elseif n == "Saint" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   172
		AddAmmo(CurrentHedgehog, amSeduction, 100)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   173
		AddAmmo(CurrentHedgehog, amResurrector, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   174
		AddAmmo(CurrentHedgehog, amInvulnerable, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   175
	elseif n == "Pyro" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   176
		AddAmmo(CurrentHedgehog, amFlamethrower, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   177
		AddAmmo(CurrentHedgehog, amMolotov, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   178
		AddAmmo(CurrentHedgehog, amNapalm, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   179
	elseif n == "Loon" then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   180
		AddAmmo(CurrentHedgehog, amBaseballBat, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   181
		AddAmmo(CurrentHedgehog, amGasBomb, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   182
		AddAmmo(CurrentHedgehog, amKamikaze, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   183
	end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   184
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   185
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   186
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   187
function onGameInit()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   188
	GameFlags = gfRandomOrder + gfResetWeps + gfInfAttack + gfPlaceHog
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   189
	Delay = 10
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   190
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   191
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   192
function onGameStart()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   193
   	
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   194
	CreateTeam()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   195
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   196
	ShowMission	(
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   197
				loc("THE SPECIALISTS"),
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   198
				loc("a Hedgewars mini-game"),
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   199
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   200
				loc("Eliminate the enemy specialists.") .. "|" ..
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   201
				" " .. "|" ..
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   202
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   203
				loc("Game Modifiers: ") .. "|" ..
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   204
				loc("Per-Hog Ammo") .. "|" ..				
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   205
				loc("Weapons Reset") .. "|" ..				
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   206
				loc("Unlimited Attacks") .. "|" ..
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   207
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   208
				"", 4, 4000
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   209
				)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   210
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   211
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   212
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   213
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   214
function onNewTurn()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   215
	currName = GetHogName(CurrentHedgehog)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   216
	lastName = GetHogName(CurrentHedgehog)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   217
	AssignAmmo()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   218
	AddAmmo(CurrentHedgehog, amSwitch, 1)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   219
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   220
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   221
function onGameTick()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   222
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   223
	if (CurrentHedgehog ~= nil) then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   224
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   225
		currName = GetHogName(CurrentHedgehog)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   226
		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   227
		if currName ~= lastName then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   228
			AddCaption(loc("Switched to ") .. currName .. "!")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   229
			AssignAmmo()		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   230
		end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   231
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   232
		lastName = currName
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   233
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   234
	end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   235
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   236
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   237
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   238
function onGearAdd(gear)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   239
    
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   240
	if GetGearType(gear) == gtHedgehog then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   241
		hhs[numhhs] = gear
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   242
		numhhs = numhhs + 1
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   243
	end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   244
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   245
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   246
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   247
function onGearDelete(gear)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   248
--
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   249
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   250
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   251
function onAmmoStoreInit()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   252
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   253
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   254
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   255
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   256