share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
author mikade
Sun, 03 Jul 2011 22:47:57 +0200
changeset 5382 d5321b22aed2
parent 5362 5f0c46e78e50
child 5457 48fe8e03a9cf
permissions -rw-r--r--
Altered switch behavior on '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
----------------------------------
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
     2
-- THE SPECIALISTS MODE 0.4
5277
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
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    19
----------------
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    20
-- version 0.3
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    21
----------------
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    22
-- added switching on start
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    23
-- removed switch from engineer weaponset
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    24
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    25
----------------
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    26
-- version 0.4
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    27
----------------
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    28
-- Attempted to:
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    29
-- fix potential switch explit
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    30
-- improve user feedback on start
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    31
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    32
--------------------
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    33
--TO DO
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
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    36
-- add proper gameflag checking, maybe
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    37
-- set crate drops etc.
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    38
-- add alternative switch
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    39
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    40
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    41
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    42
local numhhs = 0
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    43
local hhs = {}
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    44
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    45
local currName
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    46
local lastName
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    47
local started = false
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
    48
local switchStage = 0
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    49
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    50
function CreateTeam()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    51
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    52
        currTeam = ""
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    53
        lastTeam = ""
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    54
        z = 0
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    55
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    56
        for i = 0, (numhhs-1) do
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    57
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    58
                currTeam = GetHogTeamName(hhs[i])
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    59
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    60
                if currTeam == lastTeam then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    61
                        z = z + 1
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    62
                else
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    63
                        z = 1
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    64
                end
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    65
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    66
                if z == 1 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    67
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    68
                        SetHogName(hhs[i],"Soldier")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    69
                        SetHogHat(hhs[i], "Vega")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    70
                        SetHealth(hhs[i],200)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    71
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    72
                elseif z == 2 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    73
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    74
                        SetHogHat(hhs[i], "Glasses")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    75
                        SetHogName(hhs[i],"Engineer")
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    76
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    77
                elseif z == 3 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    78
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    79
                        SetHogName(hhs[i],"Ninja")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    80
                        SetHogHat(hhs[i], "NinjaFull")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    81
                        SetHealth(hhs[i],80)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    82
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    83
                elseif z == 4 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    84
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    85
                        SetHogName(hhs[i],"Demo")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    86
                        SetHogHat(hhs[i], "Skull")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    87
                        SetHealth(hhs[i],200)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    88
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    89
                elseif z == 5 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    90
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    91
                        SetHogName(hhs[i],"Sniper")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    92
                        SetHogHat(hhs[i], "Sniper")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    93
                        SetHealth(hhs[i],120)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    94
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    95
                elseif z == 6 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
    96
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    97
                        SetHogName(hhs[i],"Saint")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    98
                        SetHogHat(hhs[i], "angel")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
    99
                        SetHealth(hhs[i],300)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   100
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   101
                elseif z == 7 then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   102
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   103
                        SetHogName(hhs[i],"Pyro")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   104
                        SetHogHat(hhs[i], "Gasmask")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   105
                        SetHealth(hhs[i],150)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   106
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   107
                elseif z == 8 then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   108
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   109
                        SetHogName(hhs[i],"Loon")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   110
                        SetHogHat(hhs[i], "clown")
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   111
                        SetHealth(hhs[i],100)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   112
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   113
                end
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   114
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   115
                lastTeam = GetHogTeamName(hhs[i])
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   116
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   117
        end
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   118
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   119
end
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
function ResetAllAmmo()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   122
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   123
        AddAmmo(CurrentHedgehog, amBazooka, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   124
        AddAmmo(CurrentHedgehog, amGrenade, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   125
        AddAmmo(CurrentHedgehog, amShotgun, 0)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   126
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   127
        AddAmmo(CurrentHedgehog, amGirder, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   128
        AddAmmo(CurrentHedgehog, amBlowTorch, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   129
        AddAmmo(CurrentHedgehog, amPickHammer, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   130
        AddAmmo(CurrentHedgehog, amSwitch, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   131
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   132
        AddAmmo(CurrentHedgehog, amRope, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   133
        AddAmmo(CurrentHedgehog, amParachute, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   134
        AddAmmo(CurrentHedgehog, amFirePunch, 0)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   135
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   136
        AddAmmo(CurrentHedgehog, amDynamite, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   137
        AddAmmo(CurrentHedgehog, amDrill, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   138
        AddAmmo(CurrentHedgehog, amMine, 0)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   139
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   140
        AddAmmo(CurrentHedgehog, amSniperRifle, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   141
        AddAmmo(CurrentHedgehog, amDEagle, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   142
        AddAmmo(CurrentHedgehog, amPortalGun, 0)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   143
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   144
        AddAmmo(CurrentHedgehog, amSeduction, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   145
        AddAmmo(CurrentHedgehog, amResurrector, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   146
        AddAmmo(CurrentHedgehog, amInvulnerable, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   147
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   148
        AddAmmo(CurrentHedgehog, amFlamethrower, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   149
        AddAmmo(CurrentHedgehog, amMolotov, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   150
        AddAmmo(CurrentHedgehog, amNapalm, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   151
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   152
        AddAmmo(CurrentHedgehog, amBaseballBat, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   153
        AddAmmo(CurrentHedgehog, amGasBomb, 0)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   154
        AddAmmo(CurrentHedgehog, amKamikaze, 0)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   155
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   156
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   157
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   158
function AssignAmmo()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   159
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   160
        ResetAllAmmo()
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   161
        n = GetHogName(CurrentHedgehog)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   162
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   163
        AddAmmo(CurrentHedgehog, amSkip,100)
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   164
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   165
        if n == "Soldier" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   166
                AddAmmo(CurrentHedgehog, amBazooka,1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   167
                AddAmmo(CurrentHedgehog, amGrenade,1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   168
                AddAmmo(CurrentHedgehog, amShotgun,1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   169
        elseif n == "Engineer" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   170
                AddAmmo(CurrentHedgehog, amGirder, 2)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   171
                AddAmmo(CurrentHedgehog, amBlowTorch, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   172
                AddAmmo(CurrentHedgehog, amPickHammer, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   173
        elseif n == "Ninja" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   174
                AddAmmo(CurrentHedgehog, amRope, 100)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   175
                AddAmmo(CurrentHedgehog, amParachute, 100)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   176
                AddAmmo(CurrentHedgehog, amFirePunch, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   177
        elseif n == "Demo" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   178
                AddAmmo(CurrentHedgehog, amDynamite, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   179
                AddAmmo(CurrentHedgehog, amMine, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   180
                AddAmmo(CurrentHedgehog, amDrill, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   181
        elseif n == "Sniper" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   182
                AddAmmo(CurrentHedgehog, amSniperRifle, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   183
                AddAmmo(CurrentHedgehog, amDEagle, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   184
                AddAmmo(CurrentHedgehog, amPortalGun, 2)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   185
        elseif n == "Saint" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   186
                AddAmmo(CurrentHedgehog, amSeduction, 100)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   187
                AddAmmo(CurrentHedgehog, amResurrector, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   188
                AddAmmo(CurrentHedgehog, amInvulnerable, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   189
        elseif n == "Pyro" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   190
                AddAmmo(CurrentHedgehog, amFlamethrower, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   191
                AddAmmo(CurrentHedgehog, amMolotov, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   192
                AddAmmo(CurrentHedgehog, amNapalm, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   193
        elseif n == "Loon" then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   194
                AddAmmo(CurrentHedgehog, amBaseballBat, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   195
                AddAmmo(CurrentHedgehog, amGasBomb, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   196
                AddAmmo(CurrentHedgehog, amKamikaze, 1)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   197
        end
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   198
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   199
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   200
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   201
function onGameInit()
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   202
        GameFlags = gfRandomOrder + gfResetWeps + gfInfAttack + gfPlaceHog
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   203
        Delay = 10
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   204
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   205
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   206
function onGameStart()
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   207
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   208
        CreateTeam()
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   209
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   210
        ShowMission     (
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   211
                                loc("THE SPECIALISTS"),
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   212
                                loc("a Hedgewars mini-game"),
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   213
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   214
                                loc("Eliminate the enemy specialists.") .. "|" ..
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   215
                                " " .. "|" ..
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   216
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   217
                                loc("Game Modifiers: ") .. "|" ..
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   218
                                loc("Per-Hog Ammo") .. "|" ..
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   219
                                loc("Weapons Reset") .. "|" ..
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   220
                                loc("Unlimited Attacks") .. "|" ..
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   221
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   222
                                "", 4, 4000
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   223
                                )
5277
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
end
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
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   228
function onNewTurn()
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   229
        currName = GetHogName(CurrentHedgehog)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   230
        lastName = GetHogName(CurrentHedgehog)
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   231
        AssignAmmo()
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   232
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   233
        ---------------
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   234
        --switch
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   235
        started = false
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   236
        switchStage = 0
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   237
        --AddAmmo(CurrentHedgehog, amSwitch, 1)
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   238
	---------------
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   239
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   240
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   241
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   242
function onGameTick()
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   243
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   244
	if (CurrentHedgehog ~= nil) then
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   245
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   246
		currName = GetHogName(CurrentHedgehog)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   247
		
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   248
		if (currName ~= lastName) and (switchStage > 100) then
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   249
			AddCaption(loc("Switched to ") .. currName .. "!")
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   250
			AssignAmmo()		
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   251
		end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   252
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   253
		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) and (switchStage < 100) then			
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   254
			
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   255
			AddCaption(loc("Prepare yourself") .. ", " .. currName .. "!") 
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   256
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   257
			switchStage = switchStage + 1	
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   258
			
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   259
			if switchStage == 1 then
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   260
				AddAmmo(CurrentHedgehog, amSwitch, 1)
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   261
				
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   262
			elseif switchStage == 2 then
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   263
				ParseCommand("setweap " .. string.char(amSwitch))
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   264
			elseif switchStage == 3 then
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   265
				SetGearMessage(CurrentHedgehog,gmAttack) 
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   266
			elseif switchStage == 4 then
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   267
				switchStage = 110
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   268
				AddAmmo(CurrentHedgehog, amSwitch, 0)
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   269
			end
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   270
		end		
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   271
		
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   272
		lastName = currName
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   273
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   274
	end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   275
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   276
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   278
function onGearAdd(gear)
5382
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   279
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   280
        if GetGearType(gear) == gtHedgehog then
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   281
                hhs[numhhs] = gear
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   282
                numhhs = numhhs + 1
d5321b22aed2 Altered switch behavior on 'The Specialists'.
mikade
parents: 5362
diff changeset
   283
        end
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   284
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   285
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   286
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   287
function onGearDelete(gear)
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   288
--
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   289
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   290
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   291
function onAmmoStoreInit()
5362
5f0c46e78e50 Enable autoswitch on turn start for The Specialists Mode.
mikade
parents: 5277
diff changeset
   292
--
5277
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   293
end
09beef0752ab PianoStrike exploit fix for Capture The Flag.
mikade
parents:
diff changeset
   294