share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
author nemo
Mon, 03 Dec 2018 12:43:49 -0500
branch0.9.23
changeset 14383 bdf5840863c6
parent 12430 c461a224ec09
child 12940 39b7b3ed619e
permissions -rw-r--r--
close 0.9.23
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     1
--[[                  ___                   ___
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     2
                    (   )                 (   )
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     3
___ .-. .-. ___  ___ | |_    .---. ___ .-. | |_
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     4
(   )   '   (   )(   (   __) / .-, (   )   (   __)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     5
|  .-.  .-. | |  | | | |   (__) ; ||  .-. .| |
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     6
| |  | |  | | |  | | | | ___ .'`  || |  | || | ___
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     7
| |  | |  | | |  | | | |(   / .'| || |  | || |(   )
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     8
| |  | |  | | |  | | | | | | /  | || |  | || | | |
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
     9
| |  | |  | | |  ; ' | ' | ; |  ; || |  | || ' | |
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    10
| |  | |  | ' `-'  / ' `-' ' `-'  || |  | |' `-' ;
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    11
(___)(___)(___'.__.'   `.__.`.__.'_(___)(___)`.__.
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    12
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    13
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    14
----  Recommended settings:
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    15
----    * one hedgehog per team
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    16
----    * 'Small' one-island map
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    17
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    18
--]]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    19
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    20
HedgewarsScriptLoad("/Scripts/Locale.lua")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    21
HedgewarsScriptLoad("/Scripts/Tracker.lua")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    22
HedgewarsScriptLoad("/Scripts/Params.lua")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    23
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    24
--[[
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    25
    MUTANT SCRIPT
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    26
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    27
    To Do:  -Clean-up this fucking piece of code
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    28
            -Debug
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    29
            -Find a girlfriend
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    30
            -Fix Sheepluva's hat  +[p]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    31
            -Cookies
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    32
-----------------------]]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    33
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    34
local hhs = {}
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    35
local numhhs = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    36
local meh = false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    37
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    38
local gameOver=false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    39
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    40
local mutant = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    41
local mutant_base_health = 200
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    42
local mutant_base_disease = 25
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    43
local disease_timer = 2000
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    44
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    45
local kill_reward = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    46
local mt_hurt=false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    47
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    48
local killsCounter = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    49
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    50
local team_fire_punishment = 3
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    51
local mutant_kill_reward = 2
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    52
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    53
local hh_weapons = { amBazooka, amGrenade, amShotgun, amMine}
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    54
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    55
local mt_weapons = {amWatermelon, amHellishBomb, amBallgun, amRCPlane, amTeleport}
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    56
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    57
local disease=0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    58
local timer=0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    59
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    60
local winScore = 15
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    61
local hogsLimit = 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    62
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    63
local teams = {}
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    64
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    65
local circles = {}
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    66
local circleFrame = -1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    67
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    68
-- Variables for custom achievements
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    69
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    70
-- Most kills in 1 turn
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    71
local recordKills = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    72
local recordKillsHogName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    73
local recordKillsTeamName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    74
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    75
-- Most suicides
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    76
local recordSuicides = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    77
local recordSuicidesHogName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    78
local recordSuicidesTeamName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    79
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    80
-- Most skips
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    81
local recordSkips = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    82
local recordSkipsHogName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    83
local recordSkipsTeamName = nil
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
    84
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    85
-- Most crates collected 
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    86
local recordCrates = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    87
local recordCratesHogName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    88
local recordCratesTeamName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    89
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    90
-- Most deaths
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    91
local recordDeaths = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    92
local recordDeathsHogName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    93
local recordDeathsTeamName = nil
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    94
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    95
-- Total killed hedgehogs
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    96
local totalKills = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    97
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    98
-- Total damage
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
    99
local totalDamage = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   100
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   101
function rules()
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   102
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   103
	local ruleSet = loc("Rules: ") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   104
	loc("Hedgehogs will be revived after their death.") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   105
	string.format(loc("Mines explode after %d s."), div(MinesTime, 1000)) .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   106
	" |"..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   107
	loc("The first hedgehog to kill someone becomes the Mutant.") .. "|" ..
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   108
	loc("The Mutant has super-weapons and a lot of health.") .. "|" ..
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   109
	loc("The Mutant loses health quickly if he doesn't keep scoring kills.") .. "|" ..
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   110
	" |" ..
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   111
	loc("Score points by killing other hedgehogs (see below).") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   112
	loc("The hedgehog with least points (or most deaths) becomes the Bottom Feeder.") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   113
	string.format(loc("The first hedgehog which scores %d or more wins the game."), winScore) .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   114
        " |" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   115
	loc("Scoring: ") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   116
	loc("+2 for becoming the Mutant") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   117
	loc("+1 to the Mutant for killing anyone") .. "|" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   118
	loc("+1 to the Bottom Feeder for killing anyone") .. "|" ..
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   119
	loc("-1 to anyone for a suicide") .. "|" ..
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   120
	loc("Other kills don't give you points.")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   121
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   122
	return ruleSet
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   123
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   124
end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   125
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   126
function showStartingInfo()
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   127
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   128
	ShowMission(loc("Mutant"), loc("A Hedgewars tag game"), rules(), 1, 5000)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   129
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   130
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   131
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   132
function onGameInit()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   133
    TurnTime = 20000
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   134
    WaterRise = 0
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   135
    HealthDecrease = 0
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   136
    EnableGameFlags(gfResetWeps, gfPerHogAmmo)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   137
    HealthCaseProb=0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   138
    HealthCaseAmount=0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   139
    MinesTime=1000
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   140
    CaseFreq = 2
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   141
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   142
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   143
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   144
function limitHogs(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   145
    cnthhs = cnthhs + 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   146
        if cnthhs > 1 then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   147
            hogLimitHit = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   148
            SetEffect(gear, heResurrectable, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   149
            SetGearPosition(gear, -100,LAND_HEIGHT)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   150
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   151
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   152
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   153
function onGameStart()
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   154
    SendHealthStatsOff()
12335
8f693d25be2f Show traditional winning animation in Mutant again
Wuzzy <almikes@aol.com>
parents: 12288
diff changeset
   155
    SendRankingStatsOff()
8f693d25be2f Show traditional winning animation in Mutant again
Wuzzy <almikes@aol.com>
parents: 12288
diff changeset
   156
    SendAchievementsStatsOff()
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   157
    trackTeams()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   158
    teamScan()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   159
    runOnHogs(saveStuff)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   160
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   161
    hogLimitHit = false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   162
    for i=0 , TeamsCount - 1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   163
        cnthhs = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   164
        runOnHogsInTeam(limitHogs, teams[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   165
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   166
    if hogLimitHit then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   167
        AddCaption(loc("Only one hog per team allowed! Excess hogs will be removed"), 0xFFFFFFFF, capgrpGameState)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   168
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   169
    showStartingInfo()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   170
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   171
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   172
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   173
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   174
function giveWeapons(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   175
    if gear == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   176
        AddAmmo(gear, amRope)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   177
        for i=1, #mt_weapons do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   178
            AddAmmo(gear, mt_weapons[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   179
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   180
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   181
    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   182
        for i=1, #hh_weapons do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   183
            AddAmmo(gear,hh_weapons[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   184
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   185
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   186
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   187
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   188
function onAmmoStoreInit()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   189
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   190
    SetAmmo(amSkip, 9, 0, 0, 0)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   191
    SetAmmo(amRope,0,1,0,5)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   192
    SetAmmo(amSnowball,0,1,0,1)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   193
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   194
    for i=1, #hh_weapons do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   195
        SetAmmo(hh_weapons[i], 0, 0, 0, 1)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   196
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   197
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   198
    for i=1, #mt_weapons do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   199
        SetAmmo(mt_weapons[i], 0, 3, 0, 1)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   200
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   201
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   202
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   203
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   204
function drawCircles()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   205
    for i = 0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   206
        if circles[hhs[i]] ~= nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   207
            DeleteVisualGear(circles[hhs[i]])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   208
            circles[hhs[i]] = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   209
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   210
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   211
        if hhs[i] ~= CurrentHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   212
            if mutant == nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   213
                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   214
                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   215
            elseif CurrentHedgehog == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   216
                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   217
                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   218
            elseif getGearValue(CurrentHedgehog, "Feeder") and hhs[i] ~= mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   219
                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   220
                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   221
            elseif hhs[i] == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   222
                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   223
                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   224
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   225
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   226
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   227
    circleFrame = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   228
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   229
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   230
function onNewTurn()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   231
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   232
    trackTeams()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   233
    killsCounter = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   234
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   235
    if mutant == nil then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   236
        AddCaption( loc("First killer will mutate"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   237
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   238
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   239
    checkScore()
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   240
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   241
    for i=0, TeamsCount-1 do
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   242
        SendStat(siClanHealth, getTeamValue(teams[i], "Score"), teams[i])
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   243
    end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   244
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   245
    giveWeapons(CurrentHedgehog)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   246
    drawCircles()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   247
    setAIHints()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   248
    kill_reward= numhhs*10
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   249
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   250
    if CurrentHedgehog == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   251
        mt_hurt=true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   252
        disease= mutant_base_disease - numhhs
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   253
    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   254
        mt_hurt=false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   255
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   256
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   257
    setGearValue(CurrentHedgehog, "Alive", true)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   258
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   259
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   260
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   261
function countBodies()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   262
        if killsCounter == 2 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   263
            AddCaption(loc("Double kill!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   264
        elseif killsCounter == 3 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   265
            AddCaption(loc("Mega kill!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   266
            PlaySound(sndRegret)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   267
        elseif killsCounter == 4 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   268
            AddCaption(loc("Ultra kill!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   269
        elseif killsCounter == 5 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   270
            AddCaption(loc("Monster kill!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   271
            PlaySound(sndIllGetYou)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   272
        elseif killsCounter == 6 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   273
            AddCaption(loc("Ludicrous kill!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   274
            PlaySound(sndNutter)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   275
        elseif killsCounter == 7 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   276
            AddCaption(loc("Holy shit!"), 0xFFFFFFFF, capgrpGameState )
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   277
            PlaySound(sndLaugh)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   278
        elseif killsCounter > 8 then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   279
            AddCaption(loc("Insanity!"), 0xFFFFFFFF, capgrpGameState )
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   280
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   281
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   282
        if killsCounter > recordKills then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   283
            recordKills = killsCounter
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   284
            recordKillsHogName = getGearValue(CurrentHedgehog, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   285
            recordKillsTeamName = GetHogTeamName(CurrentHedgehog)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   286
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   287
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   288
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   289
function onGameTick()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   290
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   291
    if circleFrame > -1 then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   292
        for i = 0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   293
            if circles[hhs[i]] ~= nil and hhs[i]~= nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   294
                hhx, hhy = GetGearPosition(hhs[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   295
                X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(circles[hhs[i]])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   296
                SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25), Timer, Tint)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   297
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   298
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   299
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   300
        circleFrame = circleFrame + 0.06
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   301
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   302
        if circleFrame >= 25 then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   303
            for i = 0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   304
                if circles[hhs[i]] ~= nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   305
                    DeleteVisualGear(circles[hhs[i]])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   306
                    circles[hhs[i]] = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   307
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   308
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   309
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   310
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   311
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   312
    if TurnTimeLeft==0 and mt_hurt then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   313
        mt_hurt = false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   314
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   315
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   316
    if mt_hurt and mutant~=nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   317
        timer = timer + 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   318
            if timer > disease_timer then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   319
                timer = 0
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   320
                SetHealth(mutant, GetHealth(mutant)-disease )
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   321
                AddVisualGear(GetX(mutant), GetY(mutant)-5, vgtHealthTag, disease, true)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   322
                    if GetHealth(mutant)<=0 then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   323
                        SetHealth(mutant,0)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   324
                        mt_hurt= false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   325
                        setGearValue(mutant,"SelfDestruct",true)
12341
c73521104fac Mutant: Fix “Boring” taunt being played when becoming the mutant
Wuzzy <almikes@aol.com>
parents: 12335
diff changeset
   326
                        EndTurn()
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   327
                    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   328
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   329
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   330
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   331
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   332
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   333
function saveStuff(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   334
    setGearValue(gear,"Name",GetHogName(gear))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   335
    setGearValue(gear,"Hat",GetHogHat(gear))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   336
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   337
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   338
function armageddon(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   339
    SetState(gear, gstLoser)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   340
    SetEffect(gear, heResurrectable, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   341
    SetHealth(gear, 0)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   342
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   343
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   344
function updateScore()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   345
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   346
    local showScore = ""
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   347
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   348
    for i=0, TeamsCount-1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   349
        if teams[i]~= nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   350
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   351
            local curr_score = getTeamValue(teams[i], "Score")
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   352
            showScore = showScore .. string.format(loc("%s: %d (deaths: %d)"), teams[i], curr_score, getTeamValue(teams[i], "DeadHogs")) .. "|"
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   353
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   354
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   355
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   356
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   357
    ShowMission(loc("Mutant"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   358
                loc("Scores"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   359
                showScore, 4, 1)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   360
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   361
    HideMission()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   362
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   363
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   364
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   365
function checkScore()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   366
local showScore = ""
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   367
local lowest_score_team = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   368
local min_score=nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   369
local winTeam = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   370
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   371
local only_low_score = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   372
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   373
    for i=0, TeamsCount-1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   374
        if teams[i]~=nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   375
            local curr_score = getTeamValue(teams[i], "Score")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   376
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   377
            runOnHogsInTeam(removeFeeder, teams[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   378
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   379
            showScore = showScore .. string.format(loc("%s: %d (deaths: %d)"), teams[i], curr_score, getTeamValue(teams[i], "DeadHogs")) .. "|"
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   380
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   381
            if curr_score >= winScore then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   382
                gameOver = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   383
                winTeam = teams[i]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   384
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   385
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   386
            if min_score==nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   387
                min_score= curr_score
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   388
                lowest_score_team = teams[i]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   389
            else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   390
                if curr_score <= min_score then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   391
                    if curr_score == min_score then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   392
                        if getTeamValue(teams[i], "DeadHogs") == getTeamValue(lowest_score_team, "DeadHogs") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   393
                            only_low_score = false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   394
                        else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   395
                            if getTeamValue(teams[i], "DeadHogs") > getTeamValue(lowest_score_team, "DeadHogs") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   396
                                lowest_score_team = teams[i]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   397
                            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   398
                            only_low_score = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   399
                        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   400
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   401
                    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   402
                        min_score= curr_score
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   403
                        lowest_score_team = teams[i]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   404
                        only_low_score = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   405
                    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   406
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   407
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   408
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   409
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   410
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   411
    if gameOver then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   412
        SendStat(siGraphTitle, loc("Score graph"))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   413
12341
c73521104fac Mutant: Fix “Boring” taunt being played when becoming the mutant
Wuzzy <almikes@aol.com>
parents: 12335
diff changeset
   414
        EndTurn(true)
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   415
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   416
        teamsSorted = {}
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   417
 
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   418
        for i=0, TeamsCount-1 do
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   419
            if teams[i]~=winTeam then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   420
                runOnHogsInTeam(armageddon, teams[i])
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   421
            end
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   422
            teamsSorted[i+1] = teams[i]
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   423
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   424
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   425
        -- Achievements stuff
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   426
        local achievements = 0
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   427
        --- Most kills per turn
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   428
        if recordKills >= 3 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   429
            SendStat(siMaxStepKills, string.format("%d %s (%s)", recordKills, recordKillsHogName, recordKillsTeamName))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   430
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   431
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   432
        --- Most crates collected
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   433
        if recordCrates >= 5 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   434
            SendStat(siCustomAchievement, string.format(loc("%s (%s) was the greediest hedgehog and collected %d crates."), recordCratesHogName, recordCratesTeamName, recordCrates))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   435
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   436
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   437
        --- Most suicides
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   438
        if recordSuicides >= 5 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   439
            SendStat(siCustomAchievement, string.format(loc("%s (%s) hate life and suicided %d times."), recordSuicidesHogName, recordSuicidesTeamName, recordSuicides))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   440
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   441
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   442
        --- Most deaths
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   443
        if recordDeaths >= 5 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   444
            SendStat(siCustomAchievement, string.format(loc("Poor %s (%s) died %d times."), recordDeathsHogName, recordDeathsTeamName, recordDeaths))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   445
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   446
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   447
        --- Most skips
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   448
        if recordSkips >= 3 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   449
            SendStat(siMaxTurnSkips, string.format("%d %s (%s)", recordSkips, recordSkipsHogName, recordSkipsTeamName))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   450
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   451
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   452
        --- Total damage 
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   453
        if totalDamage >= 900 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   454
            SendStat(siCustomAchievement, string.format(loc("%d damage was dealt in this game."), totalDamage))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   455
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   456
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   457
        --- Total kills
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   458
        if totalKills >= 20 or achievements <= 0 then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   459
            SendStat(siKilledHHs, tostring(totalKills))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   460
            achievements = achievements + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   461
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   462
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   463
        -- Score and stats stuff
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   464
        table.sort(teamsSorted, function(team1, team2) return getTeamValue(team1, "Score") < getTeamValue(team2, "Score") end)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   465
        for i=TeamsCount, 1, -1 do
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   466
            SendStat(siPointType, loc("point(s)"))
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   467
            SendStat(siPlayerKills, getTeamValue(teamsSorted[i], "Score"), teamsSorted[i])
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   468
        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   469
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   470
        ShowMission(    loc("Mutant"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   471
                        loc("Final result"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   472
                        string.format(loc("Winner: %s"), winTeam) .. "| |" .. loc("Scores:") .. " |" ..
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   473
                        showScore, 0, 15000)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   474
    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   475
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   476
    if only_low_score then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   477
        runOnHogsInTeam(setFeeder, lowest_score_team)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   478
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   479
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   480
    if meh == false then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   481
		meh = true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   482
	else
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   483
		ShowMission(    loc("Mutant"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   484
                    loc("Scores"),
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   485
                    showScore, 4, 1)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   486
		HideMission()
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   487
	end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   488
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   489
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   490
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   491
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   492
function backToNormal(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   493
    SetHogName(gear, getGearValue(gear,"Name"))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   494
    SetHogHat(gear, 'NoHat')
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   495
    SetHogHat(gear, getGearValue(gear,"Hat"))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   496
    setGearValue(mutant,"SelfDestruct",false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   497
    mt_hurt=false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   498
    mutant=nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   499
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   500
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   501
function setAIHints()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   502
    for i = 0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   503
        if mutant == nil or hhs[i] == mutant or CurrentHedgehog == mutant or getGearValue(CurrentHedgehog, "Feeder") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   504
            SetGearAIHints(hhs[i], aihUsual)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   505
        else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   506
            SetGearAIHints(hhs[i], aihDoesntMatter)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   507
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   508
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   509
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   510
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   511
function removeFeeder(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   512
    if gear~=nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   513
        setGearValue(gear,"Feeder",false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   514
        if gear~= mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   515
            SetHogName(gear, getGearValue(gear,"Name") )
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   516
            SetHogHat(gear, 'NoHat')
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   517
            SetHogHat(gear, getGearValue(gear,"Hat"))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   518
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   519
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   520
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   521
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   522
function setFeeder(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   523
    if gear~= mutant and gear~= nil then
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   524
        SetHogName(gear, loc("Bottom Feeder"))
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   525
        SetHogHat(gear, 'poke_slowpoke')
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   526
        setGearValue(gear,"Feeder", true)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   527
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   528
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   529
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   530
function setMutantStuff(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   531
    mutant = gear
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   532
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   533
    SetHogName(gear, loc("Mutant"))
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   534
    SetHogHat(gear,'WhySoSerious')
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   535
    SetHealth(gear, ( mutant_base_health + numhhs*25) )
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   536
    SetEffect(gear, hePoisoned, 1)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   537
    setGearValue(mutant,"SelfDestruct",false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   538
    setGearValue(gear, "Feeder", false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   539
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   540
    AddCaption(string.format(loc("%s has mutated! +2 points"), getGearValue(gear, "Name")), GetClanColor(GetHogClan(gear)), capgrpMessage)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   541
12430
c461a224ec09 Mutant: Fix turn skip of next hog after mutating when TurnTimeLeft = 0
Wuzzy <almikes@aol.com>
parents: 12341
diff changeset
   542
    if TurnTimeLeft > 0 then
c461a224ec09 Mutant: Fix turn skip of next hog after mutating when TurnTimeLeft = 0
Wuzzy <almikes@aol.com>
parents: 12341
diff changeset
   543
        EndTurn(true)
c461a224ec09 Mutant: Fix turn skip of next hog after mutating when TurnTimeLeft = 0
Wuzzy <almikes@aol.com>
parents: 12341
diff changeset
   544
    end
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   545
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   546
    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   547
    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   548
    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   549
    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   550
    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   551
    PlaySound(sndSuddenDeath)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   552
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   553
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   554
function teamScan()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   555
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   556
        for i=0, TeamsCount-1 do --nil filling
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   557
        teams[i]=nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   558
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   559
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   560
        for i=0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   561
            for j=0, TeamsCount-1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   562
                if teams[j] ==nil and hhs[i]~=nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   563
                teams[j] = GetHogTeamName(hhs[i])
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   564
                setTeamValue(teams[j], "Score",0)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   565
                setTeamValue(teams[j], "Suicides",0)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   566
                setTeamValue(teams[j], "Skips",0)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   567
                setTeamValue(teams[j], "Crates",0)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   568
                setTeamValue(teams[j], "DeadHogs",0)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   569
                break
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   570
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   571
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   572
                if teams[j] == GetHogTeamName(hhs[i]) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   573
                    break
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   574
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   575
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   576
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   577
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   578
        ---***---
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   579
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   580
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   581
function set_Mutant_and_Score(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   582
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   583
local curr_team = GetHogTeamName(CurrentHedgehog)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   584
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   585
    if gear == CurrentHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   586
        if CurrentHedgehog == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   587
            PlaySound(sndHomerun)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   588
            if getGearValue(gear, "SelfDestruct")==false then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   589
                decreaseTeamValue(curr_team,"Score")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   590
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   591
            backToNormal(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   592
        else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   593
            decreaseTeamValue(curr_team,"Score")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   594
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   595
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   596
    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   597
            if gear == mutant then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   598
                    backToNormal(mutant)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   599
                    if curr_team ~=GetHogTeamName(gear) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   600
                            if  getGearValue(CurrentHedgehog, "Alive") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   601
                            setMutantStuff(CurrentHedgehog)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   602
                            setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   603
                            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   604
                    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   605
                        setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   606
                        increaseTeamValue(curr_team,"Suicides")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   607
                        if(getTeamValue(curr_team, "Suicides") > recordSuicides) then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   608
                            recordSuicides = getTeamValue(curr_team, "Suicides")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   609
                            recordSuicidesHogName = getGearValue(CurrentHedgehog, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   610
                            recordSuicidesTeamName = curr_team
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   611
                        end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   612
                        AddCaption(loc("-1 point"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   613
                    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   614
            else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   615
                if mutant==nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   616
                        if curr_team ~=GetHogTeamName(gear) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   617
                            if getGearValue(CurrentHedgehog, "Alive") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   618
                                    setMutantStuff(CurrentHedgehog)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   619
                                    setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward))
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   620
                            else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   621
                                increaseTeamValue(curr_team,"Score")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   622
                            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   623
                        else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   624
                            setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   625
                            increaseTeamValue(curr_team,"Suicides")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   626
                            if(getTeamValue(curr_team, "Suicides") > recordSuicides) then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   627
                                recordSuicides = getTeamValue(curr_team, "Suicides")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   628
                                recordSuicidesHogName = getGearValue(CurrentHedgehog, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   629
                                recordSuicidesTeamName = curr_team
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   630
                            end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   631
                            AddCaption(loc("-1 point"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   632
                        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   633
                else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   634
                    if curr_team ~=GetHogTeamName(gear) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   635
                        if CurrentHedgehog==mutant and getGearValue(mutant,"SelfDestruct")==false then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   636
                            SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+kill_reward)
12288
a5a7d0c6d3f3 Fix incorrect Mutant score message color
Wuzzy <almikes@aol.com>
parents: 11909
diff changeset
   637
                            AddCaption(loc("+1 point"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
a5a7d0c6d3f3 Fix incorrect Mutant score message color
Wuzzy <almikes@aol.com>
parents: 11909
diff changeset
   638
                            AddCaption(string.format(loc("+%d health"), kill_reward), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage2)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   639
                            increaseTeamValue(curr_team,"Score")
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   640
                        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   641
                        if getGearValue(CurrentHedgehog,"Feeder") then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   642
                            increaseTeamValue(curr_team,"Score")
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   643
                            AddCaption(loc("+1 point"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   644
                        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   645
                    else
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   646
                        setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   647
                        AddCaption(loc("+1 point"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   648
                    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   649
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   650
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   651
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   652
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   653
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   654
function onGearResurrect(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   655
if not gameOver then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   656
    if GetGearType(gear) == gtHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   657
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   658
        increaseTeamValue(GetHogTeamName(gear), "DeadHogs")
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   659
        totalKills = totalKills + 1
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   660
        if(getTeamValue(GetHogTeamName(gear), "DeadHogs") > recordDeaths) then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   661
            recordDeaths = getTeamValue(GetHogTeamName(gear), "DeadHogs")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   662
            recordDeathsHogName = getGearValue(gear, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   663
            recordDeathsTeamName = GetHogTeamName(gear)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   664
        end
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   665
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   666
        if gear==CurrentHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   667
            setGearValue(CurrentHedgehog, "Alive", false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   668
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   669
        set_Mutant_and_Score(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   670
        if gear~=CurrentHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   671
            killsCounter = killsCounter + 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   672
            countBodies()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   673
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   674
        AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   675
        PlaySound(sndWhack)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   676
        updateScore()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   677
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   678
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   679
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   680
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   681
function onGearDamage(gear, damage)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   682
	if not gameOver and GetGearType(gear) == gtHedgehog then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   683
		totalDamage = totalDamage + damage
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   684
	end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   685
end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   686
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   687
function onHogAttack(ammoType)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   688
	-- Record skips for achievement
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   689
	if ammoType == amSkip then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   690
		local team = GetHogTeamName(CurrentHedgehog)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   691
		increaseTeamValue(team, "Skips")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   692
		if(getTeamValue(team, "Skips") > recordSkips) then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   693
			recordSkips = getTeamValue(team, "Skips")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   694
			recordSkipsHogName = getGearValue(CurrentHedgehog, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   695
			recordSkipsTeamName = team
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   696
		end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   697
	end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   698
end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   699
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   700
function onGearAdd(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   701
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   702
    -- Catch hedgehogs for the tracker
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   703
    if GetGearType(gear) == gtHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   704
        trackGear(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   705
        hhs[numhhs] = gear
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   706
        numhhs = numhhs + 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   707
        SetEffect(gear, heResurrectable, 1)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   708
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   709
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   710
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   711
function checkEmptyTeam (teamName)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   712
    for i=0 , #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   713
        if hhs[i]~=nil then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   714
            if teamName == GetHogTeamName(hhs[i]) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   715
                return false
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   716
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   717
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   718
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   719
    return true
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   720
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   721
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   722
function onGearDelete(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   723
    -- Remove hogs that are gone
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   724
    if GetGearType(gear) == gtHedgehog then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   725
        numhhs = numhhs - 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   726
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   727
        local found
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   728
        for i=0, #hhs do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   729
            if hhs[i] == gear then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   730
                found = i
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   731
                break
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   732
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   733
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   734
        for i = found, #hhs - 1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   735
            hhs[i] = hhs[i + 1]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   736
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   737
        hhs[#hhs] = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   738
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   739
        local t_name = GetHogTeamName(gear)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   740
        if checkEmptyTeam(t_name) then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   741
            for i = 0, TeamsCount - 1 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   742
                if teams[i] == t_name then
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   743
                    found = i
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   744
                    break
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   745
                end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   746
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   747
            for i = found, TeamsCount - 2 do
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   748
                teams[i] = teams[i + 1]
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   749
            end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   750
            teams[TeamsCount - 1] = nil
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   751
            TeamsCount = TeamsCount - 1
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   752
        end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   753
        AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   754
        trackDeletion(gear)
11909
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   755
    elseif GetGearType(gear) == gtCase then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   756
        -- Check if a crate has been collected
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   757
        if band(GetGearMessage(gear), gmDestroy) ~= 0 and CurrentHedgehog ~= nil then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   758
            -- Update crate collection achievement
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   759
            increaseTeamValue(GetHogTeamName(CurrentHedgehog), "Crates")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   760
            if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Crates") > recordCrates) then
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   761
                recordCrates = getTeamValue(GetHogTeamName(CurrentHedgehog), "Crates")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   762
                recordCratesHogName = getGearValue(CurrentHedgehog, "Name")
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   763
                recordCratesTeamName = GetHogTeamName(CurrentHedgehog)
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   764
            end
1d2e89be3eb6 Update Mutant script
Wuzzy <almikes@aol.com>
parents: 11237
diff changeset
   765
        end
11015
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   766
    end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   767
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   768
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   769
function onParameters()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   770
    parseParams()
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   771
    winScore = tonumber(params["winscore"]) or winScore
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   772
end
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   773
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   774
--[[
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   775
S T A R R I N G
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   776
    prof - Coding, implementing and evangelism
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   777
    vos  - Initial idea and script improvements
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   778
    mikade - Moving the `how to play` into the game so that people know `how to play`, and whitespace :D
7a905f0070ce CRLF purge
nemo
parents: 10872
diff changeset
   779
--]]