share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.lua
author belphegorr <szabibibi@gmail.com>
Mon, 23 Jul 2012 19:15:59 +0300
changeset 7263 644eabbc9218
parent 5827 a416f1070fdf
child 8043 da083f8d95e6
permissions -rw-r--r--
Added a new function: AddNewEvent, which only adds an event to the list if it doesn't already exist. Kept the old one as it might me useful to be able to add an event more than once.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     1
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
     2
loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     3
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     4
local weapons = { amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amMine, amDEagle, amDynamite, amFirePunch, amWhip, amPickHammer, amBaseballBat, amMortar, amCake, amSeduction, amWatermelon, amHellishBomb, amDrill, amBallgun, amRCPlane, amSniperRifle, amMolotov, amBirdy, amBlowTorch, amGasBomb, amFlamethrower, amSMine, amKamikaze }
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     5
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     6
--                      G,C,B,B,S,M,D,D,F,W,P,B,M,C,S,W,H,D,B,R,S,M,B,B,G,F,S,K
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     7
local weapons_values = {1,1,1,2,1,1,1,2,1,1,1,2,1,3,1,3,3,2,3,3,1,1,2,1,1,2,2,1}
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     8
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
     9
local airweapons = { amAirAttack, amMineStrike, amNapalm, amDrillStrike }
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    10
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    11
--                         A,M,N,D
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    12
local airweapons_values = {2,2,2,2}
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    13
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    14
local utilities = { amTeleport, amGirder, amSwitch, amLowGravity, amResurrector, amRope, amParachute, amJetpack, amPortalGun, amSnowball }
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    15
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    16
--                        T,G,S,L,R,R,P,J,P,S
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    17
local utilities_values = {1,2,2,1,2,2,1,2,2,2}
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    18
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    19
function randomAmmo()
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    20
    local n = 3   --"points" to be allocated on weapons
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    21
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    22
    --pick random weapon and subtract cost
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    23
    local r = GetRandom(table.maxn(weapons_values)) + 1
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    24
    local picked_items = {}
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    25
    table.insert(picked_items, weapons[r])
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    26
    n = n - weapons_values[r]
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    27
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    28
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    29
    --choose any weapons or utilities to use up remaining n
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    30
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    31
    while n > 0 do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    32
        local items = {}
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    33
        local items_values = {}
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    34
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    35
        for i, w in pairs(weapons_values) do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    36
            local used = false
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    37
            if w <= n then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    38
                --check that this weapon hasn't been given already
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    39
                for j, k in pairs(picked_items) do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    40
                    if weapons[i] == k then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    41
                        used = true
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    42
                    end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    43
                end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    44
                if not used then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    45
                    table.insert(items_values, w)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    46
                    table.insert(items, weapons[i])
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    47
                end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    48
            end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    49
        end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    50
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    51
        for i, w in pairs(utilities_values) do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    52
            local used = false
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    53
            if w <= n then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    54
                --check that this weapon hasn't been given already
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    55
                for j, k in pairs(picked_items) do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    56
                    if utilities[i] == k then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    57
                        used = true
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    58
                    end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    59
                end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    60
                if not used then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    61
                    table.insert(items_values, w)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    62
                    table.insert(items, utilities[i])
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    63
                end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    64
            end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    65
        end
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    66
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    67
        local r = GetRandom(table.maxn(items_values)) + 1
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    68
        table.insert(picked_items, items[r])
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    69
        n = n - items_values[r]
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    70
    end
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
    71
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    72
    return picked_items
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    73
end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    74
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    75
function assignAmmo(hog)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    76
    local name = GetHogTeamName(hog)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    77
    local processed = getTeamValue(name, "processed")
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    78
    if processed == nil or not processed then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    79
        local ammo = getTeamValue(name, "ammo")
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    80
        if ammo == nil then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    81
            ammo = randomAmmo()
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    82
            setTeamValue(name, "ammo", ammo)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    83
        end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    84
        for i, w in pairs(ammo) do
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    85
            AddAmmo(hog, w)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    86
        end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    87
        setTeamValue(name, "processed", true)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    88
    end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    89
end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    90
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    91
function reset(hog)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    92
    setTeamValue(GetHogTeamName(hog), "processed", false)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    93
end
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    94
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    95
function onGameInit()
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    96
    GameFlags = band(bor(GameFlags, gfResetWeps), bnot(gfPerHogAmmo))
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
    97
    Goals = loc("Each turn you get 1-3 random weapons")
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    98
end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
    99
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   100
function onGameStart()
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   101
    trackTeams()
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   102
    if MapHasBorder() == false then
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   103
        for i, w in pairs(airweapons) do
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   104
            table.insert(weapons, w)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   105
        end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   106
        for i, w in pairs(airweapons_values) do
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   107
            table.insert(weapons_values, w)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   108
        end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   109
    end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   110
end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   111
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   112
function onAmmoStoreInit()
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   113
    SetAmmo(amSkip, 9, 0, 0, 0)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5141
diff changeset
   114
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   115
    SetAmmo(amExtraDamage, 0, 1, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   116
    SetAmmo(amInvulnerable, 0, 1, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   117
    SetAmmo(amExtraTime, 0, 1, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   118
    SetAmmo(amLaserSight, 0, 1, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   119
    SetAmmo(amVampiric, 0, 1, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   120
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   121
    for i, w in pairs(utilities) do
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   122
        SetAmmo(w, 0, 0, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   123
    end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   124
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   125
    for i, w in pairs(weapons) do
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   126
        SetAmmo(w, 0, 0, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   127
    end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   128
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   129
    for i, w in pairs(airweapons) do
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   130
        SetAmmo(w, 0, 0, 0, 1)
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   131
    end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   132
end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   133
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   134
function onNewTurn()
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   135
    runOnGears(assignAmmo)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   136
    runOnGears(reset)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   137
    setTeamValue(GetHogTeamName(CurrentHedgehog), "ammo", nil)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   138
end
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   139
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   140
function onGearAdd(gear)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   141
    if GetGearType(gear) == gtHedgehog then
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   142
        trackGear(gear)
5127
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   143
    end
b0b6f17a6a3c added Balanced Random Weapon gameplay script
claymore
parents:
diff changeset
   144
end
5141
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   145
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   146
function onGearDelete(gear)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   147
    trackDeletion(gear)
2fb6555011d3 cleared up Random Weapons and implemented remembering of weapons in Balanced Random Weapons too, also seems to work
Henek
parents: 5127
diff changeset
   148
end