This commit is contained in:
lifestorm
2024-08-04 22:55:00 +03:00
parent 0e770b2b49
commit 94063e4369
7342 changed files with 1718932 additions and 14 deletions

View File

@@ -0,0 +1,53 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chemical"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask1.mdl")
ITEM.description = "A chemical used in Infestation Control."
ITEM.category = "Infestation Xen"
ITEM.width = 1
ITEM.height = 2
ITEM.chemicalColor = Color(255, 255, 255)
ITEM.functions.Insert = {
icon = "icon16/paintcan.png",
OnRun = function(item)
local client = item.player
local trace = client:GetEyeTraceNoCursor()
local target = trace.Entity
if (target:GetClass() == "ix_infestation_tank" and trace.HitPos:Distance(client:GetShootPos()) <= 192) then
local chemicalType = target:GetChemicalType()
if (chemicalType == "" or chemicalType == item.uniqueID) then
if (target:GetChemicalVolume() < 100) then
target:SetChemicalType(item.uniqueID)
target:SetChemicalVolume(math.Clamp(target:GetChemicalVolume() + 25, 0, 100))
target:SetColor(item.chemicalColor)
client:NotifyLocalized("tankFilled", L(item.name, client))
else
client:NotifyLocalized("tankFull")
return false
end
else
client:NotifyLocalized("tankDifferentChemical")
return false
end
else
client:NotifyLocalized("invalidTank")
return false
end
end
}

View File

@@ -0,0 +1,16 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "viviralItemName"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask_big_1.mdl")
ITEM.skin = 2
ITEM.description = "viviralItemDesc"
ITEM.chemicalColor = Color(115, 30, 70)

View File

@@ -0,0 +1,16 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "causticItemName"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask_big_1.mdl")
ITEM.skin = 0
ITEM.description = "causticItemDesc"
ITEM.chemicalColor = Color(150, 195, 125)

View File

@@ -0,0 +1,16 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "cryogenicItemname"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask_big_1.mdl")
ITEM.skin = 3
ITEM.description = "cryogenicItemDesc"
ITEM.chemicalColor = Color(75, 135, 230)

View File

@@ -0,0 +1,16 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "hydrocarbonItemName"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask_big_1.mdl")
ITEM.skin = 1
ITEM.description = "hydrocarbonItemDesc"
ITEM.chemicalColor = Color(255, 150, 0)

View File

@@ -0,0 +1,16 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "thermoradioItemName"
ITEM.model = Model("models/willardnetworks/skills/chemical_flask_big_1.mdl")
ITEM.skin = 2
ITEM.description = "thermoradioItemDesc"
ITEM.chemicalColor = Color(115, 30, 70)

View File

@@ -0,0 +1,18 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Hazmat - Orange"
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
ITEM.description = "Une tenue hazmat orange, capable de protéger son porteur contre les produits chimiques et les gaz dangereux."
ITEM.category = "Infestation Xen"
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/wneo_hazmat_worker.mdl"
ITEM.newSkin = 2
ITEM.isPPE = true

View File

@@ -0,0 +1,18 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Hazmat - Blanche"
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
ITEM.description = "Une tenue hazmat blanche, capable de protéger son porteur contre les produits chimiques et les gaz dangereux."
ITEM.category = "Infestation Xen"
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/wneo_hazmat_worker.mdl"
ITEM.newSkin = 1
ITEM.isPPE = true

View File

@@ -0,0 +1,18 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Hazmat - Jaune"
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
ITEM.description = "Une tenue hazmat jaune, capable de protéger son porteur contre les produits chimiques et les gaz dangereux."
ITEM.category = "Infestation Xen"
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/wneo_hazmat_worker.mdl"
ITEM.newSkin = 0
ITEM.isPPE = true

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "clusterItemName"
ITEM.model = Model("models/jq/hlvr/props/xenpack/xen_bulb002.mdl")
ITEM.description = "clusterItemDesc"
ITEM.category = "Infestation Xen"
ITEM.colorAppendix = {
["blue"] = "itemHarvestedCrafted",
["red"] = "itemSus"
}

View File

@@ -0,0 +1,256 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "hoseItemName"
ITEM.model = Model("models/jq/hlvr/props/xen/combine_foam_hose.mdl")
ITEM.description = "hoseItemDesc"
ITEM.category = "Infestation Xen"
ITEM.skin = 1
ITEM.exRender = true
ITEM.width = 4
ITEM.height = 1
ITEM.iconCam = {
pos = Vector(178.91, 88.39, 13.04),
ang = Angle(3.85, 205.44, 0),
fov = 17.03
}
-- Inventory drawing
if (CLIENT) then
-- Draw camo if it is available.
function ITEM:PaintOver(item, w, h)
if (item:GetData("connected", false)) then
surface.SetDrawColor(110, 255, 110, 100)
surface.DrawRect(w - 14, h - 14, 8, 8)
end
end
else
-- Doing all this because the hose model has no physics model.
function ITEM:OnEntityCreated(itemEntity)
itemEntity:SetModel("models/squad/sf_plates/sf_plate3x3.mdl")
itemEntity:DrawShadow(false)
itemEntity:SetColor(Color(255, 255, 255, 0))
itemEntity:SetRenderMode(RENDERMODE_TRANSCOLOR)
itemEntity:PhysicsInit(SOLID_VPHYSICS)
itemEntity:SetSolid(SOLID_VPHYSICS)
local physObj = itemEntity:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:EnableMotion(true)
physObj:Wake()
end
itemEntity.tube = ents.Create("prop_dynamic")
itemEntity.tube:DrawShadow(true)
itemEntity.tube:SetParent(itemEntity)
itemEntity.tube:SetModel("models/jq/hlvr/props/xen/combine_foam_hose.mdl")
itemEntity.tube:SetSkin(1)
local forward, right, up = itemEntity:GetForward(), itemEntity:GetRight(), itemEntity:GetUp()
itemEntity.tube:SetAngles(itemEntity:GetAngles())
itemEntity.tube:SetPos(itemEntity:GetPos() + forward * 18 + right * - 20 + up * 5)
itemEntity.tube:Spawn()
itemEntity:DeleteOnRemove(itemEntity.tube)
end
end
function ITEM:CanTransfer(oldInventory, newInventory)
if (newInventory and self:GetData("connected", false)) then
return false
end
return true
end
ITEM.functions.Attach = {
icon = "icon16/basket_put.png",
OnRun = function(item)
local client = item.player
local trace = client:GetEyeTraceNoCursor()
local target = trace.Entity
if (target:GetClass() == "ix_infestation_tank" and trace.HitPos:Distance(client:GetShootPos()) <= 192) then
if (target:GetDTBool(4) or target:GetDTBool(2)) then
client:NotifyLocalized("hoseAttachFailureAttached")
return false
end
if (item:GetData("connected", false)) then
ix.item.PerformInventoryAction(client, "ConnectDis", item.id, item.invID)
end
target:SetBodygroup(target:FindBodygroupByName("Hose"), 0)
target:SetDTBool(2, true)
client:NotifyLocalized("hoseAttachSuccess")
else
client:NotifyLocalized("invalidTank")
return false
end
end,
OnCanRun = function(item)
return !IsValid(item.entity)
end
}
ITEM.functions.Connect = {
icon = "icon16/link.png",
OnRun = function(item)
local client = item.player
local trace = client:GetEyeTraceNoCursor()
local target = trace.Entity
if (target:GetClass() == "ix_infestation_tank" and trace.HitPos:Distance(client:GetShootPos()) <= 192) then
if (target:GetDTBool(4) or target:GetDTBool(2)) then
client:NotifyLocalized("hoseConnectFailureConnected")
return false
end
local inventoryID = client:GetCharacter():GetInventory():GetID()
local inventory = ix.item.inventories[inventoryID]
local hasOtherHoseConnected = false
for _, items in pairs(inventory.slots) do
for _, item in pairs(items) do
if (item.uniqueID == "hose" and item:GetData("connected", false)) then
hasOtherHoseConnected = true
break
end
end
end
if (hasOtherHoseConnected) then
client:NotifyLocalized("hoseConnectFailureMultipleHoses")
return false
end
item:SetData("connected", target:EntIndex())
target:SetDTBool(4, true)
client:NotifyLocalized("hoseConnectSuccess")
local rope = constraint.Rope(client, target, 0, 0, Vector(0, 0, 20), Vector(0, 0, 0), 0, 750, 1, 4, "cable/combine_foam_tank_hose_rope")
rope:CallOnRemove("RopeBroken", function(entity)
if (item.functions.ConnectDis.OnCanRun(item)) then
item.functions.ConnectDis.OnRun(item, true, client)
end
end)
client:SetNetVar("tankHose", rope)
else
client:NotifyLocalized("invalidTank")
end
return false
end,
OnCanRun = function(item)
return !item:GetData("connected", false) and !IsValid(item.entity)
end
}
ITEM.functions.ConnectDis = { -- Sorry
name = "Disconnect",
icon = "icon16/link_break.png",
OnRun = function(item, forceUnequip, activator)
local client = item.player
if (forceUnequip == true) then
client = activator
end
local character
local inventory
-- This is retarded but better safe than sorry.
if (client) then
character = client:GetCharacter()
if (character) then
inventory = character:GetInventory()
if (!inventory) then
return false
end
else
return false
end
else
return false
end
if (client:HasWeapon("weapon_applicator")) then
if (forceUnequip == true) then
local applicator = inventory:HasItem("applicator")
if (applicator) then
ix.item.PerformInventoryAction(client, "EquipUn", applicator.id, applicator.invID)
end
else
client:NotifyLocalized("hoseDisconnectFailureApplicator")
return false
end
end
local target = item:GetData("connected", false)
if (target and isnumber(target)) then
target = Entity(target)
if (target and target:IsValid()) then
target:SetDTBool(4, false)
end
end
item:SetData("connected", false)
if (forceUnequip != true) then
client:NotifyLocalized("hoseDisconnectSuccess")
else
client:NotifyLocalized("hoseDisconnectForced")
end
local rope = client:GetNetVar("tankHose")
if (rope and IsValid(rope)) then
rope:Remove()
end
client:SetNetVar("tankHose", nil)
return false
end,
OnCanRun = function(item)
return item:GetData("connected", false) and !IsValid(item.entity)
end
}
function ITEM:OnLoadout()
local connected = self:GetData("connected", false)
if (connected and isnumber(connected)) then
connected = Entity(connected)
if (connected and connected:IsValid()) then
connected:SetDTBool(4, false)
end
end
self:SetData("connected", false)
end

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "nososItemName"
ITEM.model = Model("models/jq/hlvr/props/infestationv2/xen_v2_fungus.mdl")
ITEM.description = "nososItemDesc"
ITEM.category = "Infestation Xen"
ITEM.colorAppendix = {
["blue"] = "itemHarvestedHeadcrab",
["red"] = "itemSus"
}

View File

@@ -0,0 +1,74 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "tankItemName"
ITEM.model = Model("models/hlvr/combine_hazardprops/combinehazardprops_hoover.mdl")
ITEM.description = "tankItemDesc"
ITEM.category = "Infestation Xen"
ITEM.width = 6
ITEM.height = 4
ITEM.functions.drop = {
icon = "icon16/world.png",
OnRun = function(itemTable)
local client = itemTable.player
local trace = client:GetEyeTraceNoCursor()
if (trace.HitPos:Distance(client:GetShootPos()) <= 192) then
local tank = ents.Create("ix_infestation_tank")
tank:SetPos(trace.HitPos)
tank:SetChemicalType(itemTable:GetData("ChemicalType", ""))
tank:SetChemicalVolume(itemTable:GetData("ChemicalVolume", 0))
tank:SetColor(itemTable:GetData("TankColor", Color(255, 255, 255)))
tank:Spawn()
ix.saveEnts:SaveEntity(tank)
client:EmitSound("npc/zombie/foot_slide" .. math.random(1, 3) .. ".wav", 75, math.random(90, 120), 1)
client:NotifyLocalized("tankDeploySuccess")
local currentItems = client:GetNetVar("visibleItems", {})
if (currentItems["tankItemName"]) then
currentItems["tankItemName"] = nil
end
client:SetNetVar("visibleItems", currentItems)
else
client:NotifyLocalized("tankDeployFailureDistance")
return false
end
end,
OnCanRun = function(itemTable)
return !IsValid(itemTable.entity)
end
}
if (CLIENT) then
function ITEM:PopulateTooltip(tooltip)
local type = self:GetData("ChemicalType")
local volume = self:GetData("ChemicalVolume")
type = ix.item.list[type] and ix.item.list[type].name or L("none")
volume = volume and volume .. "%" or L("empty")
local panel = tooltip:AddRowAfter("name", "type")
panel:SetBackgroundColor(derma.GetColor("Information", tooltip))
panel:SetText(L("chemicalType") .. type)
panel:SizeToContents()
panel = tooltip:AddRowAfter("type", "volume")
panel:SetBackgroundColor(derma.GetColor("Warning", tooltip))
panel:SetText(L("chemicalVolume") .. volume)
panel:SizeToContents()
end
end

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "thanarokItemName"
ITEM.model = Model("models/jq/hlvr/props/infestation/p1/xen_swelling.mdl")
ITEM.description = "thanarokItemDesc"
ITEM.category = "Infestation Control"
ITEM.colorAppendix = {
["blue"] = "itemHarvested",
["red"] = "itemSus"
}

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "thanatosItemName"
ITEM.model = Model("models/jq/hlvr/props/infestation/p1/xen_swelling.mdl")
ITEM.description = "thanatosItemDesc"
ITEM.category = "Infestation Xen"
ITEM.colorAppendix = {
["blue"] = "itemHarvested",
["red"] = "itemSus"
}

View File

@@ -0,0 +1,53 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "detectorItemName"
ITEM.model = Model("models/hlvr/combine_hazardprops/combinehazardprops_detector.mdl")
ITEM.description = "detectorItemDesc"
ITEM.category = "Infestation Xen"
ITEM.functions.Calibrate = {
icon = "icon16/monitor_link.png",
OnRun = function(itemTable)
local client = itemTable.player
local reading = nil
for _, entity in ipairs(ents.FindInSphere(client:GetPos(), 192)) do
if (entity:GetClass() == "ix_infestation_prop") then
local readingData = ix.infestation.types[ix.infestation.stored[entity:GetInfestation()].type].reading
reading = math.random(readingData[1], readingData[2]) .. ", " .. math.random(readingData[1], readingData[2]) .. ", " .. math.random(readingData[1], readingData[2])
break
end
end
client:EmitSound("helix/ui/press.wav")
if (reading) then
ix.util.EmitQueuedSounds(client, {"player/geiger" .. math.random(1, 3) .. ".wav", "player/geiger" .. math.random(1, 3) .. ".wav", "player/geiger" .. math.random(1, 3) .. ".wav"})
end
itemTable:SetData("reading", reading)
return false
end
}
if (CLIENT) then
function ITEM:PopulateTooltip(tooltip)
local reading = self:GetData("reading", "0, 0, 0")
local panel = tooltip:AddRowAfter("name", "reading")
panel:SetBackgroundColor(derma.GetColor("Warning", tooltip))
panel:SetText(L("reading") .. reading)
panel:SizeToContents()
end
end

View File

@@ -0,0 +1,152 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "applicatorItemName"
ITEM.model = Model("models/jq/hlvr/props/xen/combine_foam_applicator.mdl")
ITEM.description = "applicatorItemDesc"
ITEM.category = "Infestation Xen"
ITEM.class = "weapon_applicator"
ITEM.weaponCategory = "primary"
ITEM.exRender = true
ITEM.width = 5
ITEM.height = 2
ITEM.iconCam = {
pos = Vector(0, 200, 0),
ang = Angle(0, 270, 0),
fov = 12.05
}
-- Inventory drawing
if (CLIENT) then
-- Draw camo if it is available.
function ITEM:PaintOver(item, w, h)
if (item:GetData("equip", false)) then
surface.SetDrawColor(110, 255, 110, 100)
surface.DrawRect(w - 14, h - 14, 8, 8)
end
end
end
ITEM.functions.Attach = {
icon = "icon16/basket_put.png",
OnRun = function(item)
local client = item.player
local trace = client:GetEyeTraceNoCursor()
local target = trace.Entity
if (target:GetClass() == "ix_infestation_tank" and trace.HitPos:Distance(client:GetShootPos()) <= 192) then
if (target:GetApplicatorAttached()) then
client:NotifyLocalized("applicatorAttachFailureAttached")
return false
end
if (!target:GetHoseAttached()) then
client:NotifyLocalized("applicatorAttachFailureNoHose")
return false
end
target:SetBodygroup(target:FindBodygroupByName("Applicator"), 0)
target:SetApplicatorAttached(true)
client:NotifyLocalized("applicatorAttachSuccess")
else
client:NotifyLocalized("invalidTank")
return false
end
end,
OnCanRun = function(item)
return !item:GetData("connected", false) and !IsValid(item.entity)
end
}
function ITEM:Equip(client, bNoSelect, bNoSound)
if (!client:GetNetVar("tankHose", nil)) then
client:NotifyLocalized("applicatorEquipFailureNoHose")
return false
end
local items = client:GetCharacter():GetInventory():GetItems()
client.carryWeapons = client.carryWeapons or {}
for _, v in pairs(items) do
if (v.id != self.id) then
local itemTable = ix.item.instances[v.id]
if (!itemTable) then
client:NotifyLocalized("tellAdmin", "wid!xt")
return false
else
if (itemTable.isWeapon and client.carryWeapons[self.weaponCategory] and itemTable:GetData("equip")) then
client:NotifyLocalized("weaponSlotFilled", self.weaponCategory)
return false
end
end
end
end
if (client:HasWeapon(self.class)) then
client:StripWeapon(self.class)
end
local weapon = client:Give(self.class, !self.isGrenade)
if (IsValid(weapon)) then
local ammoType = weapon:GetPrimaryAmmoType()
client.carryWeapons[self.weaponCategory] = weapon
if (!bNoSelect) then
client:SelectWeapon(weapon:GetClass())
end
if (!bNoSound) then
client:EmitSound(self.useSound, 80)
end
-- Remove default given ammo.
if (client:GetAmmoCount(ammoType) == weapon:Clip1() and self:GetData("ammo", 0) == 0) then
client:RemoveAmmo(weapon:Clip1(), ammoType)
end
-- assume that a weapon with -1 clip1 and clip2 would be a throwable (i.e hl2 grenade)
-- TODO: figure out if this interferes with any other weapons
if (weapon:GetMaxClip1() == -1 and weapon:GetMaxClip2() == -1 and client:GetAmmoCount(ammoType) == 0) then
client:SetAmmo(1, ammoType)
end
self:SetData("equip", true)
if (self.isGrenade) then
weapon:SetClip1(1)
client:SetAmmo(0, ammoType)
else
weapon:SetClip1(self:GetData("ammo", 0))
end
weapon.ixItem = self
if (self.OnEquipWeapon) then
self:OnEquipWeapon(client, weapon)
end
else
print(Format("[Helix] Cannot equip weapon - %s does not exist!", self.class))
end
end
function ITEM:OnLoadout()
self:SetData("equip", false)
end