mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-18 22:23:46 +03:00
Upload
This commit is contained in:
191
gamemodes/ixhl2rp/plugins/infestationcontrol/cl_hooks.lua
Normal file
191
gamemodes/ixhl2rp/plugins/infestationcontrol/cl_hooks.lua
Normal file
@@ -0,0 +1,191 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function PLUGIN:ShouldDrawCrosshair()
|
||||
if (LocalPlayer():GetNetVar("InfestationEditMode")) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local gradient = ix.util.GetMaterial("gui/center_gradient")
|
||||
local entityMat = CreateMaterial("GA0249aSFJ3","VertexLitGeneric",{
|
||||
["$basetexture"] = "models/debug/debugwhite",
|
||||
["$model"] = 1,
|
||||
["$translucent"] = 1,
|
||||
["$alpha"] = 1,
|
||||
["$nocull"] = 1,
|
||||
["$ignorez"] = 1
|
||||
})
|
||||
|
||||
function PLUGIN:HUDPaint()
|
||||
local client = LocalPlayer()
|
||||
local infestationMode = client:GetNetVar("InfestationEditMode")
|
||||
|
||||
if (!infestationMode) then return end
|
||||
|
||||
local width = ScrW()
|
||||
|
||||
surface.SetDrawColor(25, 25, 25, 255)
|
||||
surface.SetMaterial(gradient)
|
||||
|
||||
if (infestationMode == 0) then
|
||||
surface.DrawTexturedRect(0, 30, width, 170)
|
||||
|
||||
draw.SimpleText(L("menuMainTitle"), "ixMediumFont", width * 0.5, 50, ix.config.Get("color"), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuMainEdit"), "ixMonoMediumFont", width * 0.5, 90, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuMainCreate"), "ixMonoMediumFont", width * 0.5, 120, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuMainExit"), "ixMonoMediumFont", width * 0.5, 150, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
|
||||
cam.Start3D()
|
||||
for _, entity in pairs(ents.FindByClass("ix_infestation_prop")) do
|
||||
local clientPos = client:EyePos()
|
||||
local targetPos = entity:GetPos()
|
||||
local distance = clientPos:Distance(targetPos)
|
||||
|
||||
if (!entity:GetInfestation()) then continue end -- I'm sorry for the mess, but I'm not taking any chances.
|
||||
if (!ix.infestation.stored[entity:GetInfestation()]) then continue end
|
||||
if (!ix.infestation.stored[entity:GetInfestation()].type) then continue end
|
||||
if (!ix.infestation.types[ix.infestation.stored[entity:GetInfestation()].type]) then continue end
|
||||
if (!ix.infestation.types[ix.infestation.stored[entity:GetInfestation()].type].color) then continue end
|
||||
|
||||
local color = ix.infestation.types[ix.infestation.stored[entity:GetInfestation()].type].color
|
||||
|
||||
render.SuppressEngineLighting(true)
|
||||
|
||||
if (entity:GetCore()) then
|
||||
render.SetColorModulation(255 / 255, 0 / 255, 0 / 255)
|
||||
else
|
||||
render.SetColorModulation(color.r / 255, color.g / 255, color.b / 255)
|
||||
end
|
||||
|
||||
if (ix.option.Get("cheapBlur", false)) then
|
||||
render.SetBlend(1)
|
||||
else
|
||||
render.SetBlend(math.Remap(math.Clamp(distance, 200, 4000), 200, 8000, 0.05, 1))
|
||||
end
|
||||
|
||||
render.MaterialOverride(entityMat)
|
||||
entity:DrawModel()
|
||||
|
||||
render.MaterialOverride()
|
||||
|
||||
render.SuppressEngineLighting(false)
|
||||
end
|
||||
cam.End3D()
|
||||
elseif (infestationMode == 1) then
|
||||
surface.DrawTexturedRect(0, 30, width, 200)
|
||||
|
||||
draw.SimpleText(L("menuCreateTitle"), "ixMediumFont", width * 0.5, 50, ix.config.Get("color"), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuCreateNotice"), "ixMonoMediumFont", width * 0.5, 90, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuCreateSave"), "ixMonoMediumFont", width * 0.5, 120, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuCreateCore"), "ixMonoMediumFont", width * 0.5, 150, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuCreateExit"), "ixMonoMediumFont", width * 0.5, 180, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
|
||||
cam.Start3D()
|
||||
for _, entity in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (!entity:GetNetVar("infestationProp") or entity:GetNetVar("infestationProp") != client:SteamID()) then continue end
|
||||
|
||||
local clientPos = client:EyePos()
|
||||
local targetPos = entity:GetPos()
|
||||
local distance = clientPos:Distance(targetPos)
|
||||
|
||||
render.SuppressEngineLighting(true)
|
||||
|
||||
if (entity:GetNetVar("infestationCore")) then
|
||||
render.SetColorModulation(255 / 255, 0 / 255, 0 / 255)
|
||||
else
|
||||
render.SetColorModulation(255 / 255, 175 / 255, 0 / 255)
|
||||
end
|
||||
|
||||
if (ix.option.Get("cheapBlur", false)) then
|
||||
render.SetBlend(1)
|
||||
else
|
||||
render.SetBlend(math.Remap(math.Clamp(distance, 200, 4000), 200, 8000, 0.05, 1))
|
||||
end
|
||||
|
||||
render.MaterialOverride(entityMat)
|
||||
entity:DrawModel()
|
||||
|
||||
render.MaterialOverride()
|
||||
|
||||
render.SuppressEngineLighting(false)
|
||||
end
|
||||
cam.End3D()
|
||||
elseif (infestationMode == 2) then
|
||||
surface.DrawTexturedRect(0, 30, width, 140)
|
||||
|
||||
draw.SimpleText(L("menuEditTitle"), "ixMediumFont", width * 0.5, 50, ix.config.Get("color"), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuEditRemove"), "ixMonoMediumFont", width * 0.5, 90, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(L("menuEditExit"), "ixMonoMediumFont", width * 0.5, 120, Color(255, 175, 0, 255), TEXT_ALIGN_CENTER)
|
||||
|
||||
cam.Start3D()
|
||||
for _, entity in pairs(ents.FindByClass("ix_infestation_prop")) do
|
||||
if (entity:GetInfestation() != client:GetNetVar("InfestationEditName")) then continue end
|
||||
|
||||
local clientPos = client:EyePos()
|
||||
local targetPos = entity:GetPos()
|
||||
local distance = clientPos:Distance(targetPos)
|
||||
|
||||
render.SuppressEngineLighting(true)
|
||||
|
||||
if (entity:GetCore()) then
|
||||
render.SetColorModulation(255 / 255, 0 / 255, 0 / 255)
|
||||
else
|
||||
render.SetColorModulation(255 / 255, 175 / 255, 0 / 255)
|
||||
end
|
||||
|
||||
if (ix.option.Get("cheapBlur", false)) then
|
||||
render.SetBlend(1)
|
||||
else
|
||||
render.SetBlend(math.Remap(math.Clamp(distance, 200, 4000), 200, 8000, 0.05, 1))
|
||||
end
|
||||
|
||||
render.MaterialOverride(entityMat)
|
||||
entity:DrawModel()
|
||||
|
||||
render.MaterialOverride()
|
||||
|
||||
render.SuppressEngineLighting(false)
|
||||
end
|
||||
|
||||
for name, data in pairs(ix.infestation.stored) do
|
||||
if (name == client:GetNetVar("InfestationEditName")) then
|
||||
for index, entityData in ipairs(data.entities) do
|
||||
if (index > data.spreadProgress) then
|
||||
local clientPos = client:EyePos()
|
||||
local targetPos = entityData.position
|
||||
local distance = clientPos:Distance(targetPos)
|
||||
|
||||
render.SuppressEngineLighting(true)
|
||||
|
||||
render.SetColorModulation(255 / 255, 255 / 255, 255 / 255)
|
||||
|
||||
if (ix.option.Get("cheapBlur", false)) then
|
||||
render.SetBlend(1)
|
||||
else
|
||||
render.SetBlend(math.Remap(math.Clamp(distance, 200, 4000), 200, 8000, 0.05, 1))
|
||||
end
|
||||
|
||||
render.MaterialOverride(entityMat)
|
||||
render.Model({model = entityData.model, pos = entityData.position, angle = entityData.angles})
|
||||
|
||||
render.MaterialOverride()
|
||||
|
||||
render.SuppressEngineLighting(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
cam.End3D()
|
||||
end
|
||||
end
|
||||
20
gamemodes/ixhl2rp/plugins/infestationcontrol/cl_plugin.lua
Normal file
20
gamemodes/ixhl2rp/plugins/infestationcontrol/cl_plugin.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
net.Receive("ixInfestationZoneCreate", function()
|
||||
vgui.Create("ixInfestationZoneCreate")
|
||||
end)
|
||||
|
||||
net.Receive("ixInfestationZoneNetwork", function()
|
||||
local storedTable = net.ReadTable()
|
||||
|
||||
ix.infestation.stored = storedTable
|
||||
end)
|
||||
@@ -0,0 +1,172 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
local PANEL = {}
|
||||
|
||||
function PANEL:Init()
|
||||
if (IsValid(ix.gui.infestationEdit)) then
|
||||
ix.gui.infestationEdit:Remove()
|
||||
end
|
||||
|
||||
ix.gui.infestationEdit = self
|
||||
self.list = {}
|
||||
self.properties = {}
|
||||
|
||||
self:SetDeleteOnClose(true)
|
||||
self:MakePopup()
|
||||
self:SetTitle(L("infestationNew"))
|
||||
|
||||
-- scroll panel
|
||||
self.canvas = self:Add("DScrollPanel")
|
||||
self.canvas:Dock(FILL)
|
||||
|
||||
-- name entry
|
||||
self.nameEntry = vgui.Create("ixTextEntry")
|
||||
self.nameEntry:SetFont("ixMenuButtonFont")
|
||||
self.nameEntry:SetText(L("infestationNew"))
|
||||
|
||||
local listRow = self.canvas:Add("ixListRow")
|
||||
listRow:SetList(self.list)
|
||||
listRow:SetLabelText(L("infestationName"))
|
||||
listRow:SetRightPanel(self.nameEntry)
|
||||
listRow:Dock(TOP)
|
||||
listRow:SizeToContents()
|
||||
listRow:SetLabelWidth(200)
|
||||
|
||||
-- type entry
|
||||
self.typeEntry = self.canvas:Add("DComboBox")
|
||||
self.typeEntry:Dock(RIGHT)
|
||||
self.typeEntry:SetFont("ixMenuButtonFont")
|
||||
self.typeEntry:SetTextColor(color_white)
|
||||
self.typeEntry.OnSelect = function(panel)
|
||||
panel:SizeToContents()
|
||||
panel:SetWide(panel:GetWide() + 12) -- padding for arrow (nice)
|
||||
end
|
||||
|
||||
for id, data in pairs(ix.infestation.types) do
|
||||
self.typeEntry:AddChoice(data.name, id, id == "erebus")
|
||||
end
|
||||
|
||||
listRow = self.canvas:Add("ixListRow")
|
||||
listRow:SetList(self.list)
|
||||
listRow:SetLabelText(L("infestationType"))
|
||||
listRow:SetRightPanel(self.typeEntry)
|
||||
listRow:Dock(TOP)
|
||||
listRow:SizeToContents()
|
||||
|
||||
self.spreadEntry = vgui.Create("ixTextEntry")
|
||||
self.spreadEntry:SetFont("ixMenuButtonFont")
|
||||
self.spreadEntry:SetText("30")
|
||||
self.spreadEntry.realGetValue = self.spreadEntry.GetValue
|
||||
self.spreadEntry.GetValue = function()
|
||||
return tonumber(self.spreadEntry:realGetValue()) or 30
|
||||
end
|
||||
|
||||
listRow = self.canvas:Add("ixListRow")
|
||||
listRow:SetList(self.list)
|
||||
listRow:SetLabelText(L("infestationSpread"))
|
||||
listRow:SetRightPanel(self.spreadEntry)
|
||||
listRow:Dock(TOP)
|
||||
listRow:SizeToContents()
|
||||
|
||||
-- save button
|
||||
self.saveButton = self:Add("DButton")
|
||||
self.saveButton:SetText(L("infestationSave"))
|
||||
self.saveButton:SizeToContents()
|
||||
self.saveButton:Dock(BOTTOM)
|
||||
self.saveButton.DoClick = function()
|
||||
self:Submit()
|
||||
end
|
||||
|
||||
self:SizeToContents()
|
||||
self:SetWide(ScrW() / 3)
|
||||
self:Center()
|
||||
end
|
||||
|
||||
function PANEL:SizeToContents()
|
||||
local width = 64
|
||||
local height = 50
|
||||
|
||||
for _, v in ipairs(self.canvas:GetCanvas():GetChildren()) do
|
||||
width = math.max(width, v:GetLabelWidth())
|
||||
height = height + v:GetTall()
|
||||
end
|
||||
|
||||
self:SetWide(width + 200)
|
||||
self:SetTall(height + self.saveButton:GetTall())
|
||||
end
|
||||
|
||||
function PANEL:Submit()
|
||||
local name = self.nameEntry:GetValue()
|
||||
|
||||
if (ix.infestation.stored[name]) then
|
||||
LocalPlayer():Notify(L("infestationExists"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local _, type = self.typeEntry:GetSelected()
|
||||
local spread = self.spreadEntry:GetFloat()
|
||||
|
||||
if (spread and isnumber(spread)) then
|
||||
spread = math.Round(spread)
|
||||
|
||||
if (spread <= 0) then
|
||||
LocalPlayer():Notify(L("invalidSpread"))
|
||||
|
||||
return
|
||||
end
|
||||
else
|
||||
LocalPlayer():Notify(L("invalidSpread"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local coreFound = false
|
||||
local infestationProps = {}
|
||||
|
||||
for _, entity in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (entity:GetNetVar("infestationProp") and entity:GetNetVar("infestationProp") == LocalPlayer():SteamID()) then
|
||||
infestationProps[#infestationProps + 1] = true -- Just using it to count.
|
||||
|
||||
if (entity:GetNetVar("infestationCore")) then
|
||||
coreFound = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (#infestationProps < 2) then
|
||||
LocalPlayer():Notify(L("notEnoughProps"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (!coreFound) then
|
||||
LocalPlayer():Notify(L("missingCore"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
net.Start("ixInfestationZoneCreate")
|
||||
net.WriteString(name)
|
||||
net.WriteString(type)
|
||||
net.WriteFloat(spread)
|
||||
net.SendToServer()
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
vgui.Register("ixInfestationZoneCreate", PANEL, "DFrame")
|
||||
|
||||
if (IsValid(ix.gui.infestationEdit)) then
|
||||
ix.gui.infestationEdit:Remove()
|
||||
end
|
||||
@@ -0,0 +1,80 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function EFFECT:Init( data )
|
||||
|
||||
self.Player = data:GetEntity()
|
||||
self.Origin = data:GetOrigin()
|
||||
self.Attachment = data:GetAttachment()
|
||||
self.Forward = data:GetNormal()
|
||||
self.Scale = data:GetScale()
|
||||
self.ColorR = data:GetColor()
|
||||
self.ColorG = data:GetHitBox()
|
||||
self.ColorB = data:GetMagnitude()
|
||||
|
||||
if ( !IsValid( self.Player ) || !IsValid( self.Player:GetActiveWeapon() ) ) then return end
|
||||
|
||||
self.Angle = self.Forward:Angle()
|
||||
self.Position = self:GetTracerShootPos( self.Origin, self.Player:GetActiveWeapon(), self.Attachment )
|
||||
|
||||
if ( self.Position == self.Origin ) then
|
||||
local att = self.Player:GetAttachment( self.Player:LookupAttachment( "anim_attachment_RH" ) )
|
||||
if ( att ) then self.Position = att.Pos + att.Ang:Forward() * -2 end
|
||||
end
|
||||
|
||||
local teh_effect = ParticleEmitter( self.Player:GetPos(), true )
|
||||
if ( !teh_effect ) then return end
|
||||
|
||||
for i = 1, 50 * self.Scale do
|
||||
local particle = teh_effect:Add( "effects/splash4", self.Position )
|
||||
if ( particle ) then
|
||||
local Spread = 0.4
|
||||
particle:SetVelocity( ( Vector( math.sin( math.Rand( 0, 360 ) ) * math.Rand( -Spread, Spread ), math.cos( math.Rand( 0, 360 ) ) * math.Rand( -Spread, Spread ), math.sin( math.random() ) * math.Rand( -Spread, Spread ) ) + self.Forward ) * 750 )
|
||||
|
||||
local ang = self.Angle
|
||||
if ( i / 2 == math.floor( i / 2 ) ) then ang = ( self.Forward * -1 ):Angle() end
|
||||
particle:SetAngles( ang )
|
||||
particle:SetDieTime( 0.25 )
|
||||
particle:SetColor( self.ColorR, self.ColorG, self.ColorB )
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
particle:SetStartSize( 8 )
|
||||
particle:SetEndSize( 0 )
|
||||
particle:SetCollide( 1 )
|
||||
particle:SetCollideCallback( function( particleC, HitPos, normal )
|
||||
particleC:SetAngleVelocity( Angle( 0, 0, 0 ) )
|
||||
particleC:SetVelocity( Vector( 0, 0, 0 ) )
|
||||
particleC:SetPos( HitPos + normal * 0.1 )
|
||||
particleC:SetGravity( Vector( 0, 0, 0 ) )
|
||||
|
||||
local angles = normal:Angle()
|
||||
angles:RotateAroundAxis( normal, particleC:GetAngles().y )
|
||||
particleC:SetAngles( angles )
|
||||
|
||||
particleC:SetLifeTime( 0 )
|
||||
particleC:SetDieTime( 60 )
|
||||
particleC:SetStartSize( 8 )
|
||||
particleC:SetEndSize( 0 )
|
||||
particleC:SetStartAlpha( 128 )
|
||||
particleC:SetEndAlpha( 0 )
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
teh_effect:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
@@ -0,0 +1,111 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetTrigger(true)
|
||||
|
||||
local physicsObject = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake()
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
if (ix.shuttingDown) then return end
|
||||
|
||||
if (self:GetCore()) then
|
||||
local identification = self:GetInfestation()
|
||||
|
||||
if (identification) then
|
||||
local infestation = ix.infestation.stored[identification]
|
||||
|
||||
if (infestation) then
|
||||
PLUGIN:UpdateInfestation(identification, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnSprayed(color)
|
||||
self:SetSprayed(true)
|
||||
self:SetMaterial("models/antlion/antlion_innards")
|
||||
self:SetColor(color)
|
||||
|
||||
timer.Simple(1800, function()
|
||||
if (self and IsValid(self)) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
|
||||
if (self:GetCore()) then
|
||||
local identification = self:GetInfestation()
|
||||
|
||||
if (identification) then
|
||||
local infestation = ix.infestation.stored[identification]
|
||||
|
||||
if (infestation) then
|
||||
PLUGIN:UpdateInfestation(identification, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnHarvested(client, damageType)
|
||||
local OnHarvested = ix.infestation.types[self:GetType()].OnHarvested
|
||||
|
||||
if (OnHarvested) then
|
||||
local success = OnHarvested(self, client, damageType)
|
||||
|
||||
if (success) then
|
||||
self:SetHarvested(true)
|
||||
self:SetColor(Color(127, 127, 127))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
local StartTouch = ix.infestation.types[self:GetType()].StartTouch
|
||||
|
||||
if (StartTouch) then
|
||||
StartTouch(self, entity)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:EndTouch(entity)
|
||||
local EndTouch = ix.infestation.types[self:GetType()].EndTouch
|
||||
|
||||
if (EndTouch) then
|
||||
EndTouch(self, entity)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnTakeDamage(damageInfo)
|
||||
if (!self:GetHarvested() and (damageInfo:GetDamageType() == DMG_SLASH or damageInfo:GetDamageType() == DMG_CLUB)) then
|
||||
local attacker = damageInfo:GetAttacker()
|
||||
|
||||
if (attacker:IsPlayer()) then
|
||||
self:OnHarvested(attacker, damageInfo:GetDamageType())
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,27 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
DEFINE_BASECLASS("base_gmodentity")
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Author = "Aspect™"
|
||||
ENT.PrintName = "Infestation Prop"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Bool", 0, "Harvested")
|
||||
self:NetworkVar("String", 1, "Infestation")
|
||||
self:NetworkVar("String", 2, "Type")
|
||||
self:NetworkVar("Bool", 3, "Core")
|
||||
self:NetworkVar("Bool", 4, "Sprayed")
|
||||
end
|
||||
@@ -0,0 +1,54 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.PopulateEntityInfo = true
|
||||
|
||||
function ENT:OnPopulateEntityInfo(container)
|
||||
local name = container:AddRow("name")
|
||||
name:SetImportant()
|
||||
name:SetText(L("infestationTank"))
|
||||
name:SizeToContents()
|
||||
|
||||
local milk = self:GetChemicalVolume()
|
||||
local success = derma.GetColor("Success", container)
|
||||
local warning = derma.GetColor("Warning", container)
|
||||
|
||||
if (milk >= 75) then
|
||||
backgroundColor = success
|
||||
elseif (milk >= 50) then
|
||||
backgroundColor = Color(75, 119, 190)
|
||||
elseif (milk >= 25) then
|
||||
backgroundColor = warning
|
||||
else
|
||||
backgroundColor = derma.GetColor("Error", container)
|
||||
end
|
||||
|
||||
local tank = container:AddRow("tank")
|
||||
tank:SetText(L("infestationTankVolume") .. milk .. "%")
|
||||
tank:SetBackgroundColor(backgroundColor)
|
||||
tank:SizeToContents()
|
||||
|
||||
local hoseAttached = self:GetHoseAttached() or self:GetHoseConnected()
|
||||
|
||||
local hose = container:AddRow("hose")
|
||||
hose:SetText(hoseAttached and L("hoseAttached") or L("hoseDetached"))
|
||||
hose:SetBackgroundColor(hoseAttached and success or warning)
|
||||
hose:SizeToContents()
|
||||
|
||||
local applicatorAttached = self:GetApplicatorAttached()
|
||||
|
||||
local applicator = container:AddRow("applicator")
|
||||
applicator:SetText(applicatorAttached and L("applicatorAttached") or L("applicatorDetached"))
|
||||
applicator:SetBackgroundColor(applicatorAttached and success or warning)
|
||||
applicator:SizeToContents()
|
||||
end
|
||||
@@ -0,0 +1,109 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function ENT:SpawnFunction(client, trace)
|
||||
if (!trace.Hit) then return end
|
||||
|
||||
local SpawnPosition = trace.HitPos + trace.HitNormal
|
||||
local SpawnAngle = client:EyeAngles()
|
||||
SpawnAngle.p = 0
|
||||
SpawnAngle.y = SpawnAngle.y + 180
|
||||
|
||||
local entity = ents.Create("ix_infestation_tank")
|
||||
entity:SetPos(SpawnPosition)
|
||||
entity:SetAngles(SpawnAngle)
|
||||
entity:Spawn()
|
||||
entity:Activate()
|
||||
|
||||
ix.saveEnts:SaveEntity(entity)
|
||||
PLUGIN:SaveInfestationTanks()
|
||||
|
||||
return entity
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/jq/hlvr/props/xen/combine_foam_tank_set.mdl")
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSkin(1)
|
||||
self:SetBodygroup(self:FindBodygroupByName("Hose"), 1)
|
||||
self:SetBodygroup(self:FindBodygroupByName("Applicator"), 1)
|
||||
|
||||
local physicsObject = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake()
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnOptionSelected(client, option, data)
|
||||
if (option == "Detach Hose") then
|
||||
if (self:GetHoseAttached()) then
|
||||
if (!self:GetApplicatorAttached()) then
|
||||
if (!client:GetCharacter():GetInventory():Add("ic_hose")) then
|
||||
ix.item.Spawn("ic_hose", client)
|
||||
end
|
||||
|
||||
self:SetHoseAttached(false)
|
||||
self:SetBodygroup(self:FindBodygroupByName("Hose"), 1)
|
||||
|
||||
client:NotifyLocalized("hoseDetachedSuccess")
|
||||
else
|
||||
client:NotifyLocalized("hoseDetachedFailure")
|
||||
end
|
||||
else
|
||||
client:NotifyLocalized("noHoseAttached")
|
||||
end
|
||||
elseif (option == "Detach Applicator") then
|
||||
if (self:GetApplicatorAttached()) then
|
||||
if (!client:GetCharacter():GetInventory():Add("applicator")) then
|
||||
ix.item.Spawn("applicator", client)
|
||||
end
|
||||
|
||||
self:SetApplicatorAttached(false)
|
||||
self:SetBodygroup(self:FindBodygroupByName("Applicator"), 1)
|
||||
|
||||
client:NotifyLocalized("applicatorDetachedSuccess")
|
||||
else
|
||||
client:NotifyLocalized("noApplicatorAttached")
|
||||
end
|
||||
elseif (option == "Pack Up") then
|
||||
if (self:GetApplicatorAttached()) then
|
||||
client:NotifyLocalized("packUpFailureApplicator")
|
||||
elseif (self:GetHoseAttached() or self:GetHoseConnected()) then
|
||||
client:NotifyLocalized("packUpFailureHose")
|
||||
else
|
||||
local dataTable = {
|
||||
ChemicalVolume = self:GetChemicalVolume(),
|
||||
ChemicalType = self:GetChemicalType(),
|
||||
TankColor = self:GetColor()
|
||||
}
|
||||
|
||||
if (client:GetCharacter():GetInventory():Add("ic_tank", 1, dataTable)) then
|
||||
self:Remove()
|
||||
|
||||
client:NotifyLocalized("packUpSuccess")
|
||||
else
|
||||
client:NotifyLocalized("packUpFailureInventory")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
DEFINE_BASECLASS("base_gmodentity")
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Author = "Aspect™"
|
||||
ENT.PrintName = "Infestation Control Tank"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Float", 0, "ChemicalVolume")
|
||||
self:NetworkVar("String", 1, "ChemicalType")
|
||||
self:NetworkVar("Bool", 2, "HoseAttached")
|
||||
self:NetworkVar("Bool", 3, "ApplicatorAttached")
|
||||
self:NetworkVar("Bool", 4, "HoseConnected")
|
||||
end
|
||||
|
||||
function ENT:GetEntityMenu(client)
|
||||
local options = {}
|
||||
|
||||
options["Detach Hose"] = true
|
||||
options["Detach Applicator"] = true
|
||||
options["Pack Up"] = true
|
||||
|
||||
return options
|
||||
end
|
||||
@@ -0,0 +1,328 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
-- Original code from https://steamcommunity.com/sharedfiles/filedetails/?id=104607228
|
||||
-- I have only modified this code and I claim no credit for the original ~Aspect
|
||||
|
||||
AddCSLuaFile()
|
||||
--AddCSLuaFile("effects/applicator_effect.lua")
|
||||
|
||||
SWEP.PrintName = "Foam Applicator"
|
||||
SWEP.Author = "Robotboy655 & Aspect™"
|
||||
SWEP.Category = "HL2 RP"
|
||||
|
||||
SWEP.Slot = 5
|
||||
SWEP.SlotPos = 35
|
||||
SWEP.Weight = 1
|
||||
|
||||
SWEP.DrawWeaponInfoBox = false
|
||||
SWEP.UseHands = false
|
||||
|
||||
SWEP.ViewModel = "models/jq/hlvr/props/xen/combine_foam_applicator.mdl"
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.WorldModel = "models/jq/hlvr/props/xen/combine_foam_applicator.mdl"
|
||||
SWEP.HoldType = "smg"
|
||||
|
||||
game.AddAmmoType({name = "applicator"})
|
||||
|
||||
SWEP.MaxAmmo = 500
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = SWEP.MaxAmmo
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "applicator"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.IronSightsPos = Vector(9, 13, -6)
|
||||
SWEP.IronSightsAng = Vector(0, 0, 0)
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:CustomAmmoDisplay()
|
||||
return {Draw = false}
|
||||
end
|
||||
|
||||
local worldModel = ClientsideModel(SWEP.WorldModel)
|
||||
|
||||
worldModel:SetNoDraw(true)
|
||||
|
||||
function SWEP:DrawWorldModel()
|
||||
local owner = self:GetOwner()
|
||||
|
||||
if (IsValid(owner)) then
|
||||
-- Specify a good position
|
||||
local offsetVec = Vector(5, -2.7, -3.4)
|
||||
local offsetAng = Angle(180, 0, 0)
|
||||
|
||||
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand")
|
||||
if (!boneid) then return end
|
||||
|
||||
local matrix = owner:GetBoneMatrix(boneid)
|
||||
if (!matrix) then return end
|
||||
|
||||
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
|
||||
|
||||
worldModel:SetPos(newPos)
|
||||
worldModel:SetAngles(newAng)
|
||||
|
||||
worldModel:SetupBones()
|
||||
else
|
||||
worldModel:SetPos(self:GetPos())
|
||||
worldModel:SetAngles(self:GetAngles())
|
||||
end
|
||||
|
||||
worldModel:DrawModel()
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Ammo1()
|
||||
return 500
|
||||
end
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
|
||||
function SWEP:SetupDataTables()
|
||||
self:NetworkVar("Float", 0, "NextIdle")
|
||||
end
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
self:SetNextPrimaryFire(CurTime() + self:SequenceDuration())
|
||||
|
||||
self:Idle()
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:Holster(weapon)
|
||||
if (CLIENT) then return end
|
||||
|
||||
if (self.Sound) then
|
||||
self.Sound:Stop()
|
||||
self.Sound = nil
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:OnDrop()
|
||||
if (self.Sound) then
|
||||
self.Sound:Stop()
|
||||
self.Sound = nil
|
||||
end
|
||||
|
||||
self.Primary.DefaultClip = 0
|
||||
end
|
||||
|
||||
function SWEP:DoEffect(color)
|
||||
if (!color) then return end
|
||||
|
||||
local effectData = EffectData()
|
||||
|
||||
effectData:SetAttachment(1)
|
||||
effectData:SetEntity(self.Owner)
|
||||
effectData:SetOrigin(self.Owner:GetShootPos())
|
||||
effectData:SetNormal(self.Owner:GetAimVector())
|
||||
effectData:SetColor(color.r)
|
||||
effectData:SetHitBox(color.g) -- Please, don't judge.
|
||||
effectData:SetMagnitude(color.b)
|
||||
effectData:SetScale(1)
|
||||
|
||||
util.Effect("applicator_effect", effectData)
|
||||
end
|
||||
|
||||
function SWEP:DoExtinguish(chemicalID)
|
||||
if (self:Ammo1() < 1) then return end
|
||||
if (!chemicalID) then return end
|
||||
|
||||
local chemicalItem = ix.item.list[chemicalID]
|
||||
if (!chemicalItem) then return end
|
||||
|
||||
local chemicalColor = chemicalItem.chemicalColor
|
||||
if (!chemicalColor) then return end
|
||||
|
||||
if (CLIENT) then
|
||||
if (self.Owner == LocalPlayer()) then self:DoEffect(chemicalColor) end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local trace = self.Owner:GetEyeTrace()
|
||||
local position = trace.HitPos
|
||||
|
||||
for _, entity in pairs(ents.FindInSphere(position, 80)) do
|
||||
if (math.random(0, 100) > 90) then
|
||||
if (IsValid(entity) and entity:GetPos():Distance(self:GetPos()) <= 256 and entity:GetClass() == "ix_infestation_prop" and !entity:GetSprayed()) then
|
||||
local infestation = ix.infestation.types[entity:GetType()]
|
||||
|
||||
if (!infestation or !infestation.chemical or infestation.chemical != chemicalID) then return end
|
||||
|
||||
entity:OnSprayed(chemicalColor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:DoEffect(chemicalColor)
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
local client = self.Owner
|
||||
local character = client:GetCharacter()
|
||||
local inventoryID = character:GetInventory():GetID()
|
||||
local inventory = ix.item.inventories[inventoryID]
|
||||
local CurTime = CurTime()
|
||||
|
||||
local tankEnt
|
||||
|
||||
for _, items in pairs(inventory.slots) do
|
||||
for _, item in pairs(items) do
|
||||
local entity = item:GetData("connected", nil)
|
||||
|
||||
if (entity) then
|
||||
entity = Entity(entity)
|
||||
|
||||
if (entity and IsValid(entity)) then
|
||||
tankEnt = entity
|
||||
|
||||
if (entity:GetChemicalVolume() <= 0) then
|
||||
entity:SetChemicalType("")
|
||||
entity:SetColor(Color(255, 255, 255))
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (!tankEnt) then return end
|
||||
if (self:GetNextPrimaryFire() > CurTime) then return end
|
||||
|
||||
if (IsFirstTimePredicted()) then
|
||||
self:DoExtinguish(tankEnt:GetChemicalType())
|
||||
|
||||
if (SERVER) then
|
||||
if (self.Owner:KeyPressed(IN_ATTACK) or !self.Sound) then
|
||||
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
|
||||
|
||||
self.Sound = CreateSound(self.Owner, Sound("weapons/applicator/fire1.wav"))
|
||||
|
||||
self:Idle()
|
||||
end
|
||||
|
||||
if (self:Ammo1() > 0 and self.Sound) then self.Sound:Play() end
|
||||
end
|
||||
end
|
||||
|
||||
self:SetNextPrimaryFire(CurTime + 0.05)
|
||||
|
||||
local deductTime = self.nextTankDeduction or 0
|
||||
|
||||
if (deductTime <= CurTime) then
|
||||
tankEnt:SetChemicalVolume(tankEnt:GetChemicalVolume() - 1)
|
||||
self.nextTankDeduction = CurTime + 1
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
end
|
||||
|
||||
function SWEP:Reload()
|
||||
end
|
||||
|
||||
function SWEP:PlaySound()
|
||||
self:EmitSound("weapons/applicator/release1.wav", 100, math.random(95, 110))
|
||||
end
|
||||
|
||||
function SWEP:Think()
|
||||
if (self:GetNextIdle() > 0 and CurTime() > self:GetNextIdle()) then
|
||||
self:DoIdleAnimation()
|
||||
self:Idle()
|
||||
end
|
||||
|
||||
if (self:GetNextSecondaryFire() > CurTime() or CLIENT) then return end
|
||||
|
||||
if (self.Sound and self.Sound:IsPlaying() and self:Ammo1() < 1) then
|
||||
self.Sound:Stop()
|
||||
self.Sound = nil
|
||||
self:PlaySound()
|
||||
self:DoIdleAnimation()
|
||||
self:Idle()
|
||||
end
|
||||
|
||||
if (self.Owner:KeyReleased(IN_ATTACK) or (!self.Owner:KeyDown(IN_ATTACK) and self.Sound)) then
|
||||
self:SendWeaponAnim(ACT_VM_SECONDARYATTACK)
|
||||
|
||||
if (self.Sound) then
|
||||
self.Sound:Stop()
|
||||
self.Sound = nil
|
||||
if (self:Ammo1() > 0) then
|
||||
self:PlaySound()
|
||||
if (!game.SinglePlayer()) then self:CallOnClient("PlaySound", "") end
|
||||
end
|
||||
end
|
||||
|
||||
self:SetNextPrimaryFire(CurTime() + self:SequenceDuration())
|
||||
self:SetNextSecondaryFire(CurTime() + self:SequenceDuration())
|
||||
|
||||
self:Idle()
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoIdleAnimation()
|
||||
if (self.Owner:KeyDown(IN_ATTACK) and self:Ammo1() > 0) then self:SendWeaponAnim(ACT_VM_IDLE_1) return end
|
||||
if (self.Owner:KeyDown(IN_ATTACK) and self:Ammo1() < 1) then self:SendWeaponAnim(ACT_VM_IDLE_EMPTY) return end
|
||||
|
||||
self:SendWeaponAnim(ACT_VM_IDLE)
|
||||
end
|
||||
|
||||
function SWEP:Idle()
|
||||
self:SetNextIdle(CurTime() + self:GetAnimationTime())
|
||||
end
|
||||
|
||||
function SWEP:GetAnimationTime()
|
||||
local time = self:SequenceDuration()
|
||||
|
||||
if (time == 0 and IsValid(self.Owner) and !self.Owner:IsNPC() and IsValid(self.Owner:GetViewModel())) then
|
||||
time = self.Owner:GetViewModel():SequenceDuration()
|
||||
end
|
||||
|
||||
return time
|
||||
end
|
||||
@@ -0,0 +1,63 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
INFESTATION.name = "Erebus-Class Strain"
|
||||
INFESTATION.color = Color(106, 168, 79)
|
||||
INFESTATION.reading = {0, 35}
|
||||
INFESTATION.chemical = "ic_hydrocarbon_foam"
|
||||
|
||||
INFESTATION.StartTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
if (client:IsInfestationProtected()) then return end
|
||||
|
||||
if (timer.Exists("erebus_touch_" .. client:SteamID64())) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", true)
|
||||
|
||||
timer.Create("erebus_touch_" .. client:SteamID64(), 5, 1, function()
|
||||
if (client:GetNetVar("TouchingInfestation")) then
|
||||
client:GetCharacter():SetSpecialBoost("agility", -5, true)
|
||||
client:GetCharacter():SetSpecialBoost("intelligence", -5, true)
|
||||
client:GetCharacter():SetSpecialBoost("perception", -5, true)
|
||||
client:GetCharacter():SetSpecialBoost("strength", -5, true)
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
INFESTATION.EndTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
|
||||
INFESTATION.OnHarvested = function(self, client, damageType)
|
||||
local inventory = client:GetCharacter():GetInventory()
|
||||
local container = inventory:HasItem("junk_jar")
|
||||
|
||||
if (container) then
|
||||
if (math.random(0, 10) > 3) then
|
||||
container:Remove()
|
||||
inventory:Add("ic_erebus_mucus")
|
||||
|
||||
client:NotifyLocalized("mucusCollectSuccess")
|
||||
else
|
||||
client:NotifyLocalized("mucusCollectFailureLuck")
|
||||
end
|
||||
|
||||
return true
|
||||
else
|
||||
client:NotifyLocalized("mucusCollectFailureJar")
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
INFESTATION.name = "Nosos-Class Strain"
|
||||
INFESTATION.color = Color(255, 0, 0)
|
||||
INFESTATION.reading = {40, 80}
|
||||
INFESTATION.chemical = "ic_caustic_solution"
|
||||
|
||||
INFESTATION.StartTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
if (client:IsInfestationProtected()) then return end
|
||||
|
||||
if (timer.Exists("erebus_touch_" .. client:SteamID64())) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", true)
|
||||
|
||||
timer.Create("nosos_touch_" .. client:SteamID64(), 5, 1, function()
|
||||
if (client:GetNetVar("TouchingInfestation")) then
|
||||
client:GetCharacter():SetSpecialBoost("agility", -10, false)
|
||||
client:GetCharacter():SetSpecialBoost("intelligence", -10, false)
|
||||
client:GetCharacter():SetSpecialBoost("perception", -10, false)
|
||||
client:GetCharacter():SetSpecialBoost("strength", -10, false)
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
INFESTATION.EndTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
@@ -0,0 +1,56 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
INFESTATION.name = "Thanarok-Class Strain"
|
||||
INFESTATION.color = Color(0, 0, 0)
|
||||
INFESTATION.reading = {70, 100}
|
||||
INFESTATION.chemical = "ic_thermo_radio_solution"
|
||||
|
||||
INFESTATION.StartTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
if (client:IsInfestationProtected()) then return end
|
||||
|
||||
if (timer.Exists("erebus_touch_" .. client:SteamID64())) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", true)
|
||||
|
||||
timer.Create("thanarok_touch_" .. client:SteamID64(), 5, 1, function()
|
||||
if (client:GetNetVar("TouchingInfestation")) then
|
||||
client:TakeDamage(25, self, self)
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
INFESTATION.EndTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
|
||||
INFESTATION.OnHarvested = function(self, client, damageType)
|
||||
if (damageType == DMG_SLASH) then
|
||||
if (math.random(0, 10) > 9) then
|
||||
if (!client:GetCharacter():GetInventory():Add("ic_thanarok_embryo")) then
|
||||
ix.item.Spawn("ic_thanarok_embryo", client)
|
||||
end
|
||||
|
||||
client:NotifyLocalized("thanarokCollectSuccess")
|
||||
else
|
||||
client:NotifyLocalized("thanarokCollectFailureLuck")
|
||||
end
|
||||
else
|
||||
client:NotifyLocalized("thanarokCollectFailureWrongTool")
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,56 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
INFESTATION.name = "Thanatos-Class Strain"
|
||||
INFESTATION.color = Color(0, 0, 0)
|
||||
INFESTATION.reading = {70, 100}
|
||||
INFESTATION.chemical = "ic_anti_xenian_viviral"
|
||||
|
||||
INFESTATION.StartTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
if (client:IsInfestationProtected()) then return end
|
||||
|
||||
if (timer.Exists("erebus_touch_" .. client:SteamID64())) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", true)
|
||||
|
||||
timer.Create("thanatos_touch_" .. client:SteamID64(), 5, 1, function()
|
||||
if (client:GetNetVar("TouchingInfestation")) then
|
||||
client:TakeDamage(25, self, self)
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
INFESTATION.EndTouch = function(self, client)
|
||||
if (!client:IsPlayer()) then return end
|
||||
|
||||
client:SetNetVar("TouchingInfestation", false)
|
||||
end
|
||||
|
||||
INFESTATION.OnHarvested = function(self, client, damageType)
|
||||
if (damageType == DMG_SLASH) then
|
||||
if (math.random(0, 10) > 9) then
|
||||
if (!client:GetCharacter():GetInventory():Add("ic_thanatos_embryo")) then
|
||||
ix.item.Spawn("ic_thanatos_embryo", client)
|
||||
end
|
||||
|
||||
client:NotifyLocalized("thanatosCollectSuccess")
|
||||
else
|
||||
client:NotifyLocalized("thanatosCollectFailureLuck")
|
||||
end
|
||||
else
|
||||
client:NotifyLocalized("thanatosCollectFailureWrongTool")
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
INFESTATION.name = "Xipe-Class Strain"
|
||||
INFESTATION.color = Color(256, 128, 4)
|
||||
INFESTATION.reading = {25, 50}
|
||||
INFESTATION.chemical = "ic_cryogenic_liquid"
|
||||
|
||||
INFESTATION.OnHarvested = function(self, client, damageType)
|
||||
if (math.random(0, 10) > 5) then
|
||||
if (!client:GetCharacter():GetInventory():Add("ic_cluster_hive")) then
|
||||
ix.item.Spawn("ic_cluster_hive", client)
|
||||
end
|
||||
|
||||
client:NotifyLocalized("xipeCollectSuccess")
|
||||
else
|
||||
client:NotifyLocalized("xipeCollectFailureLuck")
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -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 Control"
|
||||
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
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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 = "Pomarańczowy Uniform Hazmat"
|
||||
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
|
||||
ITEM.description = "Pomarańczowy uniform Hazmat zapewniający bezpieczeństwo przed niebezpiecznymi substancjami i gazami."
|
||||
ITEM.category = "Infestation Control"
|
||||
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/hazmat_worker_citizen.mdl"
|
||||
ITEM.newSkin = 1
|
||||
ITEM.isPPE = true
|
||||
ITEM.isGasmask = true
|
||||
@@ -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 = "Biały Uniform Hazmat"
|
||||
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
|
||||
ITEM.description = "Biały uniform Hazmat zapewniający bezpieczeństwo przed niebezpiecznymi substancjami i gazami."
|
||||
ITEM.category = "Infestation Control"
|
||||
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/hazmat_worker_citizen.mdl"
|
||||
ITEM.newSkin = 2
|
||||
ITEM.isPPE = true
|
||||
ITEM.isGasmask = true
|
||||
@@ -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 = "Żółty Uniform Hazmat"
|
||||
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
|
||||
ITEM.description = "Żółty uniform Hazmat zapewniający bezpieczeństwo przed niebezpiecznymi substancjami i gazami."
|
||||
ITEM.category = "Infestation Control"
|
||||
ITEM.replacement = "models/hlvr/characters/hazmat_worker/npc/hazmat_worker_citizen.mdl"
|
||||
ITEM.newSkin = 0
|
||||
ITEM.isPPE = true
|
||||
ITEM.isGasmask = true
|
||||
@@ -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 Control"
|
||||
ITEM.colorAppendix = {
|
||||
["blue"] = "itemHarvestedCrafted",
|
||||
["red"] = "itemSus"
|
||||
}
|
||||
@@ -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 Control"
|
||||
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 = "Odłącz",
|
||||
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
|
||||
@@ -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 Control"
|
||||
ITEM.colorAppendix = {
|
||||
["blue"] = "itemHarvestedHeadcrab",
|
||||
["red"] = "itemSus"
|
||||
}
|
||||
@@ -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 Control"
|
||||
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
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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 Control"
|
||||
ITEM.colorAppendix = {
|
||||
["blue"] = "itemHarvested",
|
||||
["red"] = "itemSus"
|
||||
}
|
||||
@@ -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 Control"
|
||||
|
||||
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
|
||||
@@ -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 Control"
|
||||
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
|
||||
@@ -0,0 +1,124 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
LANGUAGE = {
|
||||
infestationNew = "Nowa Strefa Skażenia",
|
||||
infestationName = "Nazwa Strefy",
|
||||
infestationType = "Typ Strefy",
|
||||
infestationSpread = "Szybkość Rozrostu",
|
||||
infestationSave = "Zapis Strefe Skażenia",
|
||||
infestationExists = "Ta Strefa Skażenia już istnieje!",
|
||||
invalidSpread = "Wpisana wartość szybkości rozrostu jest niepoprawna!",
|
||||
notEnoughProps = "Nie znaleziony wystarczająco propów Skażenia!",
|
||||
missingCore = "Nie znaleziono ogniska Skażenia!",
|
||||
infestationTank = "Zbiornik na chemikalia",
|
||||
infestationTankVolume = "Zawartość zbiornika: ",
|
||||
hoseAttached = "Wąż podłączony",
|
||||
hoseDetached = "Wąż odłączony",
|
||||
applicatorAttached = "Aplikator podłączony",
|
||||
applicatorDetached = "Aplikator odłączony",
|
||||
hoseDetachedSuccess = "Odłączyłeś wąż od zbiornika.",
|
||||
hoseDetachedFailure = "Musisz odłączyć aplikator przed odłączeniem węża!",
|
||||
noHoseAttached = "Do zbiornika nie ma podłączonego węża!",
|
||||
applicatorDetachedSuccess = "Odłączyłeś aplikator od zbiornika.",
|
||||
noApplicatorAttached = "Do zbiornika nie ma podłączonego aplikatora!",
|
||||
packUpFailureApplicator = "Musisz odłączyć aplikator przed zabraniem zbiornika!",
|
||||
packUpFailureHose = "Musisz odłączyć wąż przed zabraniem zbiornika!",
|
||||
packUpFailureInventory = "Nie masz wystarczająco miejsca w ekwipunku aby zabrać ten zbiornik!",
|
||||
packUpSuccess = "Podnosisz zbiornik i zabierasz go ze sobą. ...Jak?",
|
||||
mucusCollectSuccess = "Zebrałeś trochę Śluzu z Erebusa z narośli i schowałeś go do Plastikowego Słoika.",
|
||||
mucusCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z narośli!",
|
||||
mucusCollectFailureJar = "Potrzebujesz Pusty Słoik aby zebrać tą narośl!",
|
||||
thanatosCollectSuccess = "Odciąłeś mały, pełen warstw kawałek narośli. Delikatnie pulsuje.",
|
||||
thanatosCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli",
|
||||
thanatosCollectFailureWrongTool = "Użyłeś tępego narzędzia i ta część narośli została zniszczona!",
|
||||
thanarokCollectSuccess = "Odciąłeś mały, pełen warstw kawałek narośli. Delikatnie pulsuje.",
|
||||
thanarokCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli!",
|
||||
thanarokCollectFailureWrongTool = "Użyłeś tępego narzędzia i ta część narośli została zniszczona!",
|
||||
xipeCollectSuccess = "Odciąłeś kawałek Gniazdo-Plastra z tej narośli.",
|
||||
xipeCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli!",
|
||||
tankFilled = "Wlałeś %s do zbiornika.",
|
||||
tankFull = "Zbiornik jest pełen!",
|
||||
tankDifferentChemical = "Zbiornik wypełniony jest już inną substancją chemiczną!",
|
||||
invalidTank = "Musisz celować na prawidłowy zbiornik!",
|
||||
applicatorAttachFailureAttached = "Do zbiornika przyczepiony jest inny aplikator!",
|
||||
applicatorAttachFailureNoHose = "Do zbiornika musi być podłączony wąż zanim podłączysz aplikator!",
|
||||
applicatorAttachSuccess = "Podłączyłeś aplikator do zbiornika.",
|
||||
applicatorEquipFailureNoHose = "Wąż nie jest podłączony!",
|
||||
hoseAttachFailureAttached = "Do tego zbiornika przyczepiony jest inny wąż!",
|
||||
hoseAttachSuccess = "Podłączyłeś pomarańczowy wąż do zbiornika.",
|
||||
hoseConnectFailureConnected = "Do tego zbiornika podłączony jest inny wąż!",
|
||||
hoseConnectFailureMultipleHoses = "Możesz nosić tylko jeden podłączony wąż w danym momencie!",
|
||||
hoseConnectSuccess = "Podłączyłeś pomarańczowy wąż do zbiornika.",
|
||||
hoseDisconnectFailureApplicator = "Musisz odłożyć aplikator przed odłączeniem węża!",
|
||||
hoseDisconnectSuccess = "Odłączyłeś pomarańczowy wąż od zbiornika.",
|
||||
hoseDisconnectForced = "Pomarańczowy wąż odłączył się od zbiornika ponieważ zbyt daleko się od niego oddaliłeś!",
|
||||
tankDeploySuccess = "Postawiłeś zbiornik. To musiało być wycięczające.",
|
||||
tankDeployFailureDistance = "Nie możesz upuścić zbiornika tak daleko od siebie!",
|
||||
none = "Żaden",
|
||||
empty = "Pusty",
|
||||
chemicalType = "Typ substancji: ",
|
||||
chemicalVolume = "Wypełnienie zbiornika: ",
|
||||
reading = "Odczyt: ",
|
||||
menuMainTitle = "Tryb edycji Skażenia - Menu",
|
||||
menuMainEdit = "Aby edytować istniejąca już strefe skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuMainCreate = "Aby stworzyć nową strefe skażenia, naciśnij CTRL + SHIFT + LEWY PRZYCISK MYSZKI",
|
||||
menuMainExit = "Aby wyjść z trybu edycji skażenia, naciśnij CTRL + SHIFT + ALT",
|
||||
menuCreateTitle = "Tryb edycji Skażenia - Stwórz strefę skażenia",
|
||||
menuCreateNotice = "Jakikolwiek zrespiony prop zostanie uznany za skażony",
|
||||
menuCreateSave = "Aby zapisać zmiany i stworzyć strefę skażenia, naciśnij CTRL + SHIFT + LEWY PRZYCISK MYSZKI",
|
||||
menuCreateCore = "Aby określić prop ogniskiem skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuCreateExit = "Aby wyjść i anulować wszystkie zmiany, naciśnij CTRL + SHIFT + ALT",
|
||||
menuEditTitle = "Tryb edycji Skażenia - Edytuj strefę skażenia",
|
||||
menuEditRemove = "Aby całkowicie usunąć strefę skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuEditExit = "Aby wyjść i anulować wszystkie zmiany, naciśnij CTRL + SHIFT + ALT",
|
||||
cmdInfestationEdit = "Włącz tryb edycji stref skażenia.",
|
||||
noPetFlags = "Tryb edycji Skażenia wymaga posiadania flag, których nie posiadasz!",
|
||||
invalidZone = "To nie jest prawidłowa strefa skażenia!",
|
||||
invalidInfestationProp = "To nie jest prawidłowy prop skażenia!",
|
||||
zoneRemoved = "Strefa Skażenia usunięta.",
|
||||
zoneCreated = "Strefa Skażenia \"%s\" utworzona pomyślnie.",
|
||||
viviralItemName = "Czynnik anty-Xenowy",
|
||||
viviralItemDesc = "Zsyntetyzowany wirus stworzony specjalnie do wyniszczania struktur komórkowych organizmów z Xen. Jest to nadzwyczaj potężne narzędzie do walki ze skażeniami z Xen, ale również bardzo groźne - kontakt z człowiekiem powoduje niewydolność wielonarządową w ciągu dwóch minut. By uniknąć wybuchu epidemii, wirus został przystosowany tak, by uległ rozpadowi trzy minuty po opuszczeniu specjalnego pojemnika.",
|
||||
thermoradioItemName = "Roztwór termo-radioaktywny",
|
||||
thermoradioItemDesc = "Całkowite przeciwieństwo płynu kriogenicznego, wykorzystujące zarówno mieszankę tworzącą efekt EKSTREMALNEGO ciepła, jak i odrobinę radioaktywnych chemikaliów, aby stworzyć ostateczne, ale bardzo niebezpieczne i śmiertelne rozwiązanie dla szczepu Thanarok. Przebywanie w strefach oczyszczonych tym roztworem może prowadzić do zatrucia promieniowaniem, w zależności od użytej ilości, śmierci w przypadku bezpośredniego rozpylenia lub spożycia.",
|
||||
causticItemName = "Roztwór żrący",
|
||||
causticItemDesc = "Bardzo groźne połączenie różnych żrących związków chemicznych, które używane jest do stapiania skażeń z Xen. Z wyżej wymienioną substancją należy obchodzić się bardzo ostrożnie - roztwór może szybko przeżreć się przez skórę, tkankę mięśniową oraz kości.",
|
||||
cryogenicItemname = "Płyn kriogeniczny",
|
||||
cryogenicItemDesc = "Zsyntetyzowany i upłynniony gaz o bardzo niskich temperaturach, zdolny do zamrożenia wszystkiego czego dotknie w ciągu zaledwie kilku sekund. Kontakt z substancją może wywołać odmrożenie narażonej części ciała prawie natychmiast po zetknięciu się z płynem.",
|
||||
hydrocarbonItemName = "Płyn z pianą węglowodorową",
|
||||
hydrocarbonItemDesc = "Silnie oddziałująca mieszanina chemikaliów i węglowodorów stworzona, by wytępić uciążliwą narośl z Xen oraz skażenia poprzez niezwykle prędko nabierającą temperaturę pianę. Należy ostrożnie obchodzić się z substancją, gdyż może ona doprowadzić do poważnych poparzeń.",
|
||||
coarctateItemName = "Wydzielina z Coarctate",
|
||||
coarctateItemDesc = "Klejąca i śmierdząca substancja płynna. Dla niektórych może wydawać się, że ma jakieś zastosowanie w medycynie.",
|
||||
itemCrafted = "Ten przedmiot może zostać wytworzony przy użyciu umiejętności wytwarzania.",
|
||||
itemSus = "CP będzie coś podejrzewać jeżeli znajdą przy tobie ten przedmiot.",
|
||||
itemHarvestedCrafted = "Ten przedmiot może zostać zebrany ze strefy skażenia i można wykorzystać go przy wytwarzaniu.",
|
||||
erebusItemName = "Śluz z Erebusa",
|
||||
erebusItemDesc = "Oślizgła, klejąca się zielona substancja płynna o wielu zastosowaniach, przechowywana w słoiku.",
|
||||
applicatorItemName = "Aplikator piany",
|
||||
applicatorItemDesc = "Jest to duże urządzenie, które pochłania substancje i chemikalia służące do walki ze skażeniem, przetwarzając je w pianę, którą później jest w stanie ‘wystrzelić’ aby pokryć nią duży obszar. Zależnie od użytego czynnika piana ta zmieni się w ciecz, a jej efekty widoczne będą po paru sekundach, jednakże cały proces może zająć nawet do kilku minut.",
|
||||
clusterItemName = "Gniazdo-Plaster",
|
||||
clusterItemDesc = "Zgrupowane skupisko struktur podobnych do plastra miodu. Bardzo suche w dotyku.",
|
||||
hoseItemName = "Pomarańczowy wąż",
|
||||
hoseItemDesc = "Długi, pomarańczowy wąż. Na obu końcach posiada zawory.",
|
||||
nososItemName = "Serce Nosos",
|
||||
nososItemDesc = "Bardzo żylasta, podobna do jedwabiu kula, która wydaje się dalej funkcjonować ze względu na jej ciągłe ruchy..",
|
||||
itemHarvestedHeadcrab = "Ten przedmiot może zostać pozyskany z żywego Headcraba",
|
||||
tankItemName = "Zbiornik na chemikalia",
|
||||
tankItemDesc = "Duży zbiornik na chemikalia przeciwko skażeniu. Jak ty to w ogóle możesz unieść?!",
|
||||
thanatosItemName = "Embrion Thanatos",
|
||||
thanatosItemDesc = "Niebywale gruba otoczka chroni nieznany żywy organizm znajdujący się w środku.",
|
||||
thanarokItemName = "Embrion Thanarok",
|
||||
thanarokItemDesc = "Prawie niemożliwa do zniszczenia substacja skrywająca się pod wieloma warstwami materiału ochronnego.",
|
||||
itemHarvested = "Ten przedmiot może zostać zebrany ze strefy skażenia.",
|
||||
detectorItemName = "Detektor Skażenia",
|
||||
detectorItemDesc = "Żółty detektor skażenia. Na wyświetlaczu zobaczyć można różne odczyty."
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
LANGUAGE = {
|
||||
infestationNew = "Nowa Strefa Skażenia",
|
||||
infestationName = "Nazwa Strefy",
|
||||
infestationType = "Typ Strefy",
|
||||
infestationSpread = "Szybkość Rozrostu",
|
||||
infestationSave = "Zapis Strefe Skażenia",
|
||||
infestationExists = "Ta Strefa Skażenia już istnieje!",
|
||||
invalidSpread = "Wpisana wartość szybkości rozrostu jest niepoprawna!",
|
||||
notEnoughProps = "Nie znaleziony wystarczająco propów Skażenia!",
|
||||
missingCore = "Nie znaleziono ogniska Skażenia!",
|
||||
infestationTank = "Zbiornik na chemikalia",
|
||||
infestationTankVolume = "Zawartość zbiornika: ",
|
||||
hoseAttached = "Wąż podłączony",
|
||||
hoseDetached = "Wąż odłączony",
|
||||
applicatorAttached = "Aplikator podłączony",
|
||||
applicatorDetached = "Aplikator odłączony",
|
||||
hoseDetachedSuccess = "Odłączyłeś wąż od zbiornika.",
|
||||
hoseDetachedFailure = "Musisz odłączyć aplikator przed odłączeniem węża!",
|
||||
noHoseAttached = "Do zbiornika nie ma podłączonego węża!",
|
||||
applicatorDetachedSuccess = "Odłączyłeś aplikator od zbiornika.",
|
||||
noApplicatorAttached = "Do zbiornika nie ma podłączonego aplikatora!",
|
||||
packUpFailureApplicator = "Musisz odłączyć aplikator przed zabraniem zbiornika!",
|
||||
packUpFailureHose = "Musisz odłączyć wąż przed zabraniem zbiornika!",
|
||||
packUpFailureInventory = "Nie masz wystarczająco miejsca w ekwipunku aby zabrać ten zbiornik!",
|
||||
packUpSuccess = "Podnosisz zbiornik i zabierasz go ze sobą. ...Jak?",
|
||||
mucusCollectSuccess = "Zebrałeś trochę Śluzu z Erebusa z narośli i schowałeś go do Plastikowego Słoika.",
|
||||
mucusCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z narośli!",
|
||||
mucusCollectFailureJar = "Potrzebujesz Pusty Słoik aby zebrać tą narośl!",
|
||||
thanatosCollectSuccess = "Odciąłeś mały, pełen warstw kawałek narośli. Delikatnie pulsuje.",
|
||||
thanatosCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli",
|
||||
thanatosCollectFailureWrongTool = "Użyłeś tępego narzędzia i ta część narośli została zniszczona!",
|
||||
thanarokCollectSuccess = "Odciąłeś mały, pełen warstw kawałek narośli. Delikatnie pulsuje.",
|
||||
thanarokCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli!",
|
||||
thanarokCollectFailureWrongTool = "Użyłeś tępego narzędzia i ta część narośli została zniszczona!",
|
||||
xipeCollectSuccess = "Odciąłeś kawałek Gniazdo-Plastra z tej narośli.",
|
||||
xipeCollectFailureLuck = "Nie udało ci się zebrać czegokolwiek z tej narośli!",
|
||||
tankFilled = "Wlałeś %s do zbiornika.",
|
||||
tankFull = "Zbiornik jest pełen!",
|
||||
tankDifferentChemical = "Zbiornik wypełniony jest już inną substancją chemiczną!",
|
||||
invalidTank = "Musisz celować na prawidłowy zbiornik!",
|
||||
applicatorAttachFailureAttached = "Do zbiornika przyczepiony jest inny aplikator!",
|
||||
applicatorAttachFailureNoHose = "Do zbiornika musi być podłączony wąż zanim podłączysz aplikator!",
|
||||
applicatorAttachSuccess = "Podłączyłeś aplikator do zbiornika.",
|
||||
applicatorEquipFailureNoHose = "Wąż nie jest podłączony!",
|
||||
hoseAttachFailureAttached = "Do tego zbiornika przyczepiony jest inny wąż!",
|
||||
hoseAttachSuccess = "Podłączyłeś pomarańczowy wąż do zbiornika.",
|
||||
hoseConnectFailureConnected = "Do tego zbiornika podłączony jest inny wąż!",
|
||||
hoseConnectFailureMultipleHoses = "Możesz nosić tylko jeden podłączony wąż w danym momencie!",
|
||||
hoseConnectSuccess = "Podłączyłeś pomarańczowy wąż do zbiornika.",
|
||||
hoseDisconnectFailureApplicator = "Musisz odłożyć aplikator przed odłączeniem węża!",
|
||||
hoseDisconnectSuccess = "Odłączyłeś pomarańczowy wąż od zbiornika.",
|
||||
hoseDisconnectForced = "Pomarańczowy wąż odłączył się od zbiornika ponieważ zbyt daleko się od niego oddaliłeś!",
|
||||
tankDeploySuccess = "Postawiłeś zbiornik. To musiało być wycięczające.",
|
||||
tankDeployFailureDistance = "Nie możesz upuścić zbiornika tak daleko od siebie!",
|
||||
none = "Żaden",
|
||||
empty = "Pusty",
|
||||
chemicalType = "Typ substancji: ",
|
||||
chemicalVolume = "Wypełnienie zbiornika: ",
|
||||
reading = "Odczyt: ",
|
||||
menuMainTitle = "Tryb edycji Skażenia - Menu",
|
||||
menuMainEdit = "Aby edytować istniejąca już strefe skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuMainCreate = "Aby stworzyć nową strefe skażenia, naciśnij CTRL + SHIFT + LEWY PRZYCISK MYSZKI",
|
||||
menuMainExit = "Aby wyjść z trybu edycji skażenia, naciśnij CTRL + SHIFT + ALT",
|
||||
menuCreateTitle = "Tryb edycji Skażenia - Stwórz strefę skażenia",
|
||||
menuCreateNotice = "Jakikolwiek zrespiony prop zostanie uznany za skażony",
|
||||
menuCreateSave = "Aby zapisać zmiany i stworzyć strefę skażenia, naciśnij CTRL + SHIFT + LEWY PRZYCISK MYSZKI",
|
||||
menuCreateCore = "Aby określić prop ogniskiem skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuCreateExit = "Aby wyjść i anulować wszystkie zmiany, naciśnij CTRL + SHIFT + ALT",
|
||||
menuEditTitle = "Tryb edycji Skażenia - Edytuj strefę skażenia",
|
||||
menuEditRemove = "Aby całkowicie usunąć strefę skażenia, naciśnij CTRL + SHIFT + PRAWY PRZYCISK MYSZKI",
|
||||
menuEditExit = "Aby wyjść i anulować wszystkie zmiany, naciśnij CTRL + SHIFT + ALT",
|
||||
cmdInfestationEdit = "Włącz tryb edycji stref skażenia.",
|
||||
noPetFlags = "Tryb edycji Skażenia wymaga posiadania flag, których nie posiadasz!",
|
||||
invalidZone = "To nie jest prawidłowa strefa skażenia!",
|
||||
invalidInfestationProp = "To nie jest prawidłowy prop skażenia!",
|
||||
zoneRemoved = "Strefa Skażenia usunięta.",
|
||||
zoneCreated = "Strefa Skażenia \"%s\" utworzona pomyślnie.",
|
||||
viviralItemName = "Czynnik anty-Xenowy",
|
||||
viviralItemDesc = "Zsyntetyzowany wirus stworzony specjalnie do wyniszczania struktur komórkowych organizmów z Xen. Jest to nadzwyczaj potężne narzędzie do walki ze skażeniami z Xen, ale również bardzo groźne - kontakt z człowiekiem powoduje niewydolność wielonarządową w ciągu dwóch minut. By uniknąć wybuchu epidemii, wirus został przystosowany tak, by uległ rozpadowi trzy minuty po opuszczeniu specjalnego pojemnika.",
|
||||
thermoradioItemName = "Roztwór termo-radioaktywny",
|
||||
thermoradioItemDesc = "Całkowite przeciwieństwo płynu kriogenicznego, wykorzystujące zarówno mieszankę tworzącą efekt EKSTREMALNEGO ciepła, jak i odrobinę radioaktywnych chemikaliów, aby stworzyć ostateczne, ale bardzo niebezpieczne i śmiertelne rozwiązanie dla szczepu Thanarok. Przebywanie w strefach oczyszczonych tym roztworem może prowadzić do zatrucia promieniowaniem, w zależności od użytej ilości, śmierci w przypadku bezpośredniego rozpylenia lub spożycia.",
|
||||
causticItemName = "Roztwór żrący",
|
||||
causticItemDesc = "Bardzo groźne połączenie różnych żrących związków chemicznych, które używane jest do stapiania skażeń z Xen. Z wyżej wymienioną substancją należy obchodzić się bardzo ostrożnie - roztwór może szybko przeżreć się przez skórę, tkankę mięśniową oraz kości.",
|
||||
cryogenicItemname = "Płyn kriogeniczny",
|
||||
cryogenicItemDesc = "Zsyntetyzowany i upłynniony gaz o bardzo niskich temperaturach, zdolny do zamrożenia wszystkiego czego dotknie w ciągu zaledwie kilku sekund. Kontakt z substancją może wywołać odmrożenie narażonej części ciała prawie natychmiast po zetknięciu się z płynem.",
|
||||
hydrocarbonItemName = "Płyn z pianą węglowodorową",
|
||||
hydrocarbonItemDesc = "Silnie oddziałująca mieszanina chemikaliów i węglowodorów stworzona, by wytępić uciążliwą narośl z Xen oraz skażenia poprzez niezwykle prędko nabierającą temperaturę pianę. Należy ostrożnie obchodzić się z substancją, gdyż może ona doprowadzić do poważnych poparzeń.",
|
||||
coarctateItemName = "Wydzielina z Coarctate",
|
||||
coarctateItemDesc = "Klejąca i śmierdząca substancja płynna. Dla niektórych może wydawać się, że ma jakieś zastosowanie w medycynie.",
|
||||
itemCrafted = "Ten przedmiot może zostać wytworzony przy użyciu umiejętności wytwarzania.",
|
||||
itemSus = "CP będzie coś podejrzewać jeżeli znajdą przy tobie ten przedmiot.",
|
||||
itemHarvestedCrafted = "Ten przedmiot może zostać zebrany ze strefy skażenia i można wykorzystać go przy wytwarzaniu.",
|
||||
erebusItemName = "Śluz z Erebusa",
|
||||
erebusItemDesc = "Oślizgła, klejąca się zielona substancja płynna o wielu zastosowaniach, przechowywana w słoiku.",
|
||||
applicatorItemName = "Aplikator piany",
|
||||
applicatorItemDesc = "Jest to duże urządzenie, które pochłania substancje i chemikalia służące do walki ze skażeniem, przetwarzając je w pianę, którą później jest w stanie ‘wystrzelić’ aby pokryć nią duży obszar. Zależnie od użytego czynnika piana ta zmieni się w ciecz, a jej efekty widoczne będą po paru sekundach, jednakże cały proces może zająć nawet do kilku minut.",
|
||||
clusterItemName = "Gniazdo-Plaster",
|
||||
clusterItemDesc = "Zgrupowane skupisko struktur podobnych do plastra miodu. Bardzo suche w dotyku.",
|
||||
hoseItemName = "Pomarańczowy wąż",
|
||||
hoseItemDesc = "Długi, pomarańczowy wąż. Na obu końcach posiada zawory.",
|
||||
nososItemName = "Serce Nosos",
|
||||
nososItemDesc = "Bardzo żylasta, podobna do jedwabiu kula, która wydaje się dalej funkcjonować ze względu na jej ciągłe ruchy..",
|
||||
itemHarvestedHeadcrab = "Ten przedmiot może zostać pozyskany z żywego Headcraba",
|
||||
tankItemName = "Zbiornik na chemikalia",
|
||||
tankItemDesc = "Duży zbiornik na chemikalia przeciwko skażeniu. Jak ty to w ogóle możesz unieść?!",
|
||||
thanatosItemName = "Embrion Thanatos",
|
||||
thanatosItemDesc = "Niebywale gruba otoczka chroni nieznany żywy organizm znajdujący się w środku.",
|
||||
thanarokItemName = "Embrion Thanarok",
|
||||
thanarokItemDesc = "Prawie niemożliwa do zniszczenia substacja skrywająca się pod wieloma warstwami materiału ochronnego.",
|
||||
itemHarvested = "Ten przedmiot może zostać zebrany ze strefy skażenia.",
|
||||
detectorItemName = "Detektor Skażenia",
|
||||
detectorItemDesc = "Żółty detektor skażenia. Na wyświetlaczu zobaczyć można różne odczyty."
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ix.infestation = ix.infestation or {}
|
||||
ix.infestation.stored = ix.infestation.stored or {}
|
||||
ix.infestation.types = {}
|
||||
|
||||
function ix.infestation.LoadFromDir(path)
|
||||
for _, v in ipairs(file.Find(path .. "/*.lua", "LUA")) do
|
||||
local niceName = v:sub(4, -5)
|
||||
|
||||
ix.infestation.RegisterInfestationType(niceName, path .. "/" .. v, false, nil)
|
||||
end
|
||||
end
|
||||
|
||||
function ix.infestation.RegisterInfestationType(uniqueID, path, luaGenerated, infestationTable)
|
||||
INFESTATION = {index = table.Count(ix.infestation.types) + 1}
|
||||
if (!luaGenerated and path) then
|
||||
ix.util.Include(path, "shared")
|
||||
elseif (luaGenerated and infestationTable) then
|
||||
table.Merge(INFESTATION, infestationTable)
|
||||
end
|
||||
|
||||
INFESTATION.name = INFESTATION.name or "Nieznany"
|
||||
INFESTATION.color = INFESTATION.color or Color(255, 175, 0)
|
||||
INFESTATION.reading = INFESTATION.reading or {0, 0}
|
||||
INFESTATION.chemical = INFESTATION.chemical or nil
|
||||
INFESTATION.uniqueID = INFESTATION.uniqueID or uniqueID
|
||||
|
||||
ix.infestation.types[INFESTATION.uniqueID] = INFESTATION
|
||||
INFESTATION = nil
|
||||
end
|
||||
|
||||
function ix.infestation.Get(identifier)
|
||||
return ix.infestation.types[identifier]
|
||||
end
|
||||
|
||||
hook.Add("DoPluginIncludes", "ixInfestation", function(path, pluginTable)
|
||||
ix.infestation.LoadFromDir(path .. "/infestations")
|
||||
end)
|
||||
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local playerMeta = FindMetaTable("Player")
|
||||
local protectiveItems = {
|
||||
["yellow_hazmat_uniform"] = true,
|
||||
["orange_hazmat_uniform"] = true,
|
||||
["white_hazmat_uniform"] = true,
|
||||
["hands_gloves"] = true
|
||||
}
|
||||
|
||||
local protectedFactions = {
|
||||
[FACTION_VORT] = true,
|
||||
[FACTION_CP] = true,
|
||||
[FACTION_HEADCRAB] = true,
|
||||
[FACTION_OTA] = true,
|
||||
}
|
||||
|
||||
function playerMeta:IsInfestationProtected()
|
||||
local items = self:GetCharacter():GetInventory():GetItems()
|
||||
|
||||
if (self:HasActiveCombineSuit()) then return true end
|
||||
|
||||
if (protectedFactions[self:Team()]) then return true end
|
||||
|
||||
for _, v in pairs(items) do
|
||||
local itemTable = ix.item.instances[v.id]
|
||||
|
||||
if (itemTable:GetData("equip") and protectiveItems[itemTable.uniqueID]) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,124 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function PLUGIN:GenerateRecipes() -- Make sure crafting is initialized before we try to add recipes.
|
||||
local RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "rec_leech_adhesive"
|
||||
RECIPE.name = "Klej na bazie pijawek"
|
||||
RECIPE.description = "Klej do sklejania przedmiotów. Bardzo lepki."
|
||||
RECIPE.model = "models/willardnetworks/props/glue.mdl"
|
||||
RECIPE.category = "Komponenty"
|
||||
RECIPE.ingredients = {["ic_erebus_mucus"] = 1, ["ing_raw_leech"] = 3}
|
||||
RECIPE.result = {["comp_adhesive"] = 1}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "crafting"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
|
||||
RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "rec_coarctate_mucus"
|
||||
RECIPE.name = "Śluz Coarctate"
|
||||
RECIPE.description = "Dość lepki i silnie pachnący podobny do śluzu płyn. Dla wprawnego oka może mieć pewne zastosowania medyczne."
|
||||
RECIPE.model = "models/jq/hlvr/props/xenpack/xen_bulb002.mdl"
|
||||
RECIPE.category = "Medycyna"
|
||||
RECIPE.ingredients = {["ic_erebus_mucus"] = 1, ["ic_cluster_hive"] = 1}
|
||||
RECIPE.result = {["ic_coarctate_mucus"] = 1}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "crafting"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
|
||||
RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "break_mucus_alcohol"
|
||||
RECIPE.name = "Ekstraktuj Śluz Erebus"
|
||||
RECIPE.description = "Wyekstraktuj alkohol ze Śluzu Erebus."
|
||||
RECIPE.model = "models/props_lab/jar01a.mdl"
|
||||
RECIPE.category = "Ekstrakcja alkoholowa/chemiczna"
|
||||
RECIPE.subcategory = "Alkohol"
|
||||
RECIPE.station = {"tool_oven", "tool_oven_rusty"}
|
||||
RECIPE.ingredients = {["ic_erebus_mucus"] = 1, ["crafting_water"] = 1}
|
||||
RECIPE.result = {["comp_alcohol"] = 1}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "medicine"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
|
||||
RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "rec_strong_adhesive"
|
||||
RECIPE.name = "Mocny klej"
|
||||
RECIPE.description = "Mocniejszy klej do sklejania przedmiotów ze sobą. Jeszcze bardziej klejący niż zwykły klej."
|
||||
RECIPE.model = "models/willardnetworks/props/spicyglue.mdl"
|
||||
RECIPE.category = "Komponenty"
|
||||
RECIPE.ingredients = {["comp_adhesive"] = 1, ["ic_cluster_hive"] = 1}
|
||||
RECIPE.result = {["comp_adhesive"] = 1}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "crafting"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
|
||||
RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "break_cluster_mucus_chemical"
|
||||
RECIPE.name = "Ekstraktuj Klaster/Śluz Erebus"
|
||||
RECIPE.description = "Ekstraktuj nierafinowane związki chemiczne z tych dwóch obcych substancji."
|
||||
RECIPE.model = "models/jq/hlvr/props/xenpack/xen_bulb002.mdl"
|
||||
RECIPE.category = "Ekstrakcja alkoholowa/chemiczna"
|
||||
RECIPE.subcategory = "Nierafinowane substancje chemiczne"
|
||||
RECIPE.station = {"tool_oven", "tool_oven_rusty"}
|
||||
RECIPE.ingredients = {["ic_erebus_mucus"] = 1, ["ic_cluster_hive"] = 1}
|
||||
RECIPE.result = {["comp_chemicals"] = 2}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "medicine"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
|
||||
RECIPE = ix.recipe:New()
|
||||
RECIPE.uniqueID = "rec_comp_purifier_cluster"
|
||||
RECIPE.name = "Oczyszczalnik"
|
||||
RECIPE.description = "Dziwny pył, który może oczyścić dowolną mieszaninę lub substancję z toksycznych związków."
|
||||
RECIPE.model = "models/willardnetworks/skills/pill_bottle.mdl"
|
||||
RECIPE.category = "Komponenty"
|
||||
RECIPE.ingredients = {["ic_cluster_hive"] = 1, ["comp_chemicals"] = 1}
|
||||
RECIPE.result = {["comp_purifier"] = 1}
|
||||
RECIPE.hidden = false
|
||||
RECIPE.skill = "crafting"
|
||||
RECIPE.level = 0
|
||||
RECIPE.experience = {
|
||||
{level = 0, exp = 120}, -- full xp
|
||||
{level = 10, exp = 60}, -- half xp
|
||||
{level = 15, exp = 0} -- no xp
|
||||
}
|
||||
RECIPE:Register()
|
||||
end
|
||||
101
gamemodes/ixhl2rp/plugins/infestationcontrol/sh_plugin.lua
Normal file
101
gamemodes/ixhl2rp/plugins/infestationcontrol/sh_plugin.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
PLUGIN.name = "Infestation Control"
|
||||
PLUGIN.author = "Aspect™"
|
||||
PLUGIN.description = "Adds a comprehensive Infestation Control system."
|
||||
|
||||
ix.util.Include("cl_hooks.lua")
|
||||
ix.util.Include("cl_plugin.lua")
|
||||
ix.util.Include("sv_hooks.lua")
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
ix.util.Include("meta/sh_player.lua")
|
||||
ix.util.IncludeDir("ixhl2rp/plugins/infestationcontrol/recipes", true)
|
||||
|
||||
ix.container.Register("models/hlvr/combine_hazardprops/combinehazardprops_crate.mdl", {
|
||||
name = "Skrzynia",
|
||||
description = "Żółta skrzynia Kontroli Skażenia.",
|
||||
width = 7,
|
||||
height = 7
|
||||
})
|
||||
|
||||
ix.container.Register("models/hlvr/combine_hazardprops/combinehazardprops_container.mdl", {
|
||||
name = "Kontener Kontroli Skażenia",
|
||||
description = "Żółty kontener Kontroli Skażenia.",
|
||||
width = 6,
|
||||
height = 4
|
||||
})
|
||||
|
||||
ix.container.Register("models/hlvr/combine_hazardprops/combinehazardprops_barrel.mdl", {
|
||||
name = "Beczka Kontroli Skażenia",
|
||||
description = "Żółta beczka Kontroli Skażenia.",
|
||||
width = 4,
|
||||
height = 6
|
||||
})
|
||||
|
||||
ix.container.Register("models/hlvr/combine_hazardprops/combinehazardprops_barrel_lock.mdl", {
|
||||
name = "Zamknięta beczka Kontroli Skażenia",
|
||||
description = "Zamknięta żółta beczka Kontroli Skażenia.",
|
||||
width = 4,
|
||||
height = 6
|
||||
})
|
||||
|
||||
do
|
||||
local COMMAND = {}
|
||||
COMMAND.description = "@cmdInfestationEdit"
|
||||
COMMAND.adminOnly = true
|
||||
|
||||
function COMMAND:OnRun(client)
|
||||
if (!client:GetCharacter():HasFlags("pet")) then
|
||||
return "@noPetFlags"
|
||||
end
|
||||
|
||||
client:SetNetVar("InfestationEditMode", 0)
|
||||
ix.log.Add(client, "infestationLog", client:GetName() .. " (" .. client:SteamID() .. ") " .. " has entered Infestation Edit Mode.")
|
||||
end
|
||||
|
||||
ix.command.Add("InfestationEdit", COMMAND)
|
||||
end
|
||||
|
||||
function PLUGIN:InitializedPlugins()
|
||||
-- Generate medical items - need the medical base to be initialized first before creating them.
|
||||
local ITEM = ix.item.Register("ic_coarctate_mucus", "base_medical", false, nil, true)
|
||||
ITEM.name = "coarctateItemName"
|
||||
ITEM.description = "coarctateItemDesc"
|
||||
ITEM.model = Model("models/jq/hlvr/props/xenpack/xen_bulb002.mdl")
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.category = "Infestation Control"
|
||||
ITEM.colorAppendix = {
|
||||
["blue"] = "itemCrafted",
|
||||
["red"] = "itemSus"
|
||||
}
|
||||
ITEM.healing = {
|
||||
painkillers = 20
|
||||
}
|
||||
|
||||
ITEM = ix.item.Register("ic_erebus_mucus", "base_medical", false, nil, true)
|
||||
ITEM.name = "erebusItemName"
|
||||
ITEM.description = "erebusItemDesc"
|
||||
ITEM.model = Model("models/props_lab/jar01a.mdl")
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.category = "Infestation Control"
|
||||
ITEM.colorAppendix = {
|
||||
["blue"] = "itemHarvestedCrafted",
|
||||
["red"] = "itemSus"
|
||||
}
|
||||
ITEM.healing = {
|
||||
painkillers = 10
|
||||
}
|
||||
|
||||
self:GenerateRecipes()
|
||||
end
|
||||
253
gamemodes/ixhl2rp/plugins/infestationcontrol/sv_hooks.lua
Normal file
253
gamemodes/ixhl2rp/plugins/infestationcontrol/sv_hooks.lua
Normal file
@@ -0,0 +1,253 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function PLUGIN:PlayerSpawnedProp(client, model, entity)
|
||||
if (!client:GetNetVar("InfestationEditMode") or client:GetNetVar("InfestationEditMode") == 0) then return end
|
||||
|
||||
if (client:GetNetVar("InfestationEditMode") == 1) then
|
||||
|
||||
|
||||
elseif (client:GetNetVar("InfestationEditMode") == 2) then
|
||||
|
||||
end
|
||||
|
||||
entity:SetNetVar("infestationProp", client:SteamID())
|
||||
end
|
||||
|
||||
function PLUGIN:RegisterSaveEnts()
|
||||
ix.saveEnts:RegisterEntity("ix_infestation_prop", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
data.model = entity:GetModel()
|
||||
data.harvested = entity:GetHarvested()
|
||||
data.infestation = entity:GetInfestation()
|
||||
data.type = entity:GetType()
|
||||
data.core = entity:GetCore()
|
||||
data.sprayed = entity:GetSprayed()
|
||||
end,
|
||||
OnRestore = function(entity, data) --OnRestore
|
||||
entity:SetModel(data.model)
|
||||
entity:SetHarvested(data.harvested)
|
||||
entity:SetInfestation(data.infestation)
|
||||
entity:SetType(data.type)
|
||||
entity:SetCore(data.core)
|
||||
entity:SetColor(data.harvested and Color(127, 127, 127) or Color(255, 255, 255))
|
||||
entity:SetSprayed(false)
|
||||
end,
|
||||
ShouldSave = function(entity) --ShouldSave
|
||||
if (entity:GetSprayed() or !entity:GetInfestation() or !ix.infestation.stored[entity:GetInfestation()]) then
|
||||
ix.saveEnts:DeleteEntity(entity)
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
ShouldRestore = function(data) --ShouldRestore
|
||||
return !data.sprayed, true
|
||||
end
|
||||
})
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_infestation_tank", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
data.chemVolume = entity:GetChemicalVolume()
|
||||
data.chemType = entity:GetChemicalType()
|
||||
data.hoseAttached = entity:GetHoseAttached()
|
||||
data.applicatorAttached = entity:GetApplicatorAttached()
|
||||
data.hoseConnected = entity:GetHoseConnected()
|
||||
end,
|
||||
OnRestore = function(entity, data) --OnRestore
|
||||
entity:SetChemicalVolume(data.chemVolume)
|
||||
entity:SetChemicalType(data.chemType)
|
||||
entity:SetHoseAttached(data.hoseAttached)
|
||||
entity:SetApplicatorAttached(data.applicatorAttached)
|
||||
entity:SetHoseConnected(false)
|
||||
entity:SetColor(data.color)
|
||||
entity:Spawn()
|
||||
|
||||
entity:SetBodygroup(entity:FindBodygroupByName("Hose"), data.hoseAttached and 0 or 1)
|
||||
entity:SetBodygroup(entity:FindBodygroupByName("Applicator"), data.applicatorAttached and 0 or 1)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
function PLUGIN:SaveData()
|
||||
ix.data.Set("infestationZones", ix.infestation.stored)
|
||||
|
||||
self:SaveInfestationProps()
|
||||
self:SaveInfestationTanks()
|
||||
end
|
||||
|
||||
function PLUGIN:LoadData()
|
||||
local data = ix.data.Get("infestationZones", {})
|
||||
ix.infestation.stored = data
|
||||
|
||||
for name, data in pairs(data) do
|
||||
self:InfestationTimer(name, data.spread)
|
||||
end
|
||||
|
||||
if (!ix.config.Get("SaveEntsOldLoadingEnabled")) then return end
|
||||
for _, data in ipairs(ix.data.Get("infestationProps", {})) do
|
||||
if (data.sprayed) then continue end
|
||||
if (!data.infestation or !ix.infestation.stored[data.infestation]) then continue end
|
||||
|
||||
local entity = ents.Create("ix_infestation_prop")
|
||||
entity:SetModel(data.model)
|
||||
entity:SetPos(data.position)
|
||||
entity:SetAngles(data.angles)
|
||||
entity:SetHarvested(data.harvested)
|
||||
entity:SetInfestation(data.infestation)
|
||||
entity:SetType(data.type)
|
||||
entity:SetCore(data.core)
|
||||
entity:SetSprayed(false)
|
||||
entity:SetColor(data.harvested and Color(127, 127, 127) or Color(255, 255, 255))
|
||||
entity:Spawn()
|
||||
end
|
||||
|
||||
for _, data in ipairs(ix.data.Get("infestationTanks", {})) do
|
||||
local entity = ents.Create("ix_infestation_tank")
|
||||
|
||||
entity:SetPos(data.position)
|
||||
entity:SetAngles(data.angles)
|
||||
entity:SetChemicalVolume(data.chemVolume)
|
||||
entity:SetChemicalType(data.chemType)
|
||||
entity:SetHoseAttached(data.hoseAttached)
|
||||
entity:SetApplicatorAttached(data.applicatorAttached)
|
||||
entity:SetHoseConnected(false)
|
||||
entity:SetColor(data.color)
|
||||
entity:Spawn()
|
||||
|
||||
entity:SetBodygroup(entity:FindBodygroupByName("Hose"), data.hoseAttached and 0 or 1)
|
||||
entity:SetBodygroup(entity:FindBodygroupByName("Applicator"), data.applicatorAttached and 0 or 1)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:PlayerInitialSpawn(client)
|
||||
net.Start("ixInfestationZoneNetwork")
|
||||
net.WriteTable(ix.infestation.stored)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
function PLUGIN:KeyPress(client, key)
|
||||
local editMode = client:GetNetVar("InfestationEditMode")
|
||||
|
||||
if (!editMode) then return end
|
||||
|
||||
if (client:KeyDown(IN_DUCK) and client:KeyDown(IN_SPEED)) then
|
||||
local desiredEditMode = false
|
||||
|
||||
if (editMode == 0) then -- Main menu.
|
||||
if (client:KeyDown(IN_ATTACK)) then -- Create a new infestation zone.
|
||||
desiredEditMode = 1
|
||||
elseif (client:KeyDown(IN_ATTACK2)) then -- Edit an existing infestation zone.
|
||||
local entity = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if (entity and IsValid(entity) and entity:GetClass() == "ix_infestation_prop") then
|
||||
desiredEditMode = 2
|
||||
client:SetNetVar("InfestationEditName", entity:GetInfestation())
|
||||
else
|
||||
client:NotifyLocalized("invalidZone")
|
||||
end
|
||||
elseif (client:KeyDown(IN_WALK)) then -- Exit infestation edit mode.
|
||||
desiredEditMode = nil
|
||||
|
||||
ix.log.Add(client, "infestationLog", client:GetName() .. " (" .. client:SteamID() .. ") has exited Infestation Edit Mode.")
|
||||
end
|
||||
elseif (editMode == 1) then -- Create infestation zone.
|
||||
if (client:KeyDown(IN_ATTACK)) then -- Create a new infestation zone.
|
||||
for _, prop in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (prop:GetNetVar("infestationProp") and prop:GetNetVar("infestationProp") == client:SteamID()) then
|
||||
local physicsObject = prop:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
net.Start("ixInfestationZoneCreate")
|
||||
net.Send(client)
|
||||
elseif (client:KeyDown(IN_ATTACK2)) then -- Define core prop.
|
||||
local entity = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if (entity and IsValid(entity) and entity:GetNetVar("infestationProp") and entity:GetNetVar("infestationProp") == client:SteamID()) then
|
||||
for _, prop in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (prop and IsValid(prop) and prop:GetNetVar("infestationProp") and prop:GetNetVar("infestationProp") == client:SteamID() and prop:GetNetVar("infestationCore")) then
|
||||
prop:SetNetVar("infestationCore", nil)
|
||||
end
|
||||
end
|
||||
|
||||
entity:SetNetVar("infestationCore", true)
|
||||
else
|
||||
client:NotifyLocalized("invalidInfestationProp")
|
||||
end
|
||||
elseif (client:KeyDown(IN_WALK)) then -- Go back to menu.
|
||||
desiredEditMode = 0
|
||||
|
||||
for _, prop in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (prop:GetNetVar("infestationProp") and prop:GetNetVar("infestationProp") == client:SteamID()) then
|
||||
prop:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif (editMode == 2) then -- Edit infestation zone.
|
||||
if (client:KeyDown(IN_ATTACK)) then -- Save changes & open menu.
|
||||
|
||||
-- To be added. Maybe.
|
||||
|
||||
elseif (client:KeyDown(IN_ATTACK2)) then -- Remove infestation zone.
|
||||
local targetInfestation = client:GetNetVar("InfestationEditName")
|
||||
|
||||
self:UpdateInfestation(targetInfestation, nil)
|
||||
|
||||
for _, entity in ipairs(ents.FindByClass("ix_infestation_prop")) do
|
||||
if (entity:GetInfestation() == targetInfestation) then
|
||||
entity:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
self:SaveInfestationProps()
|
||||
desiredEditMode = 0
|
||||
|
||||
client:NotifyLocalized("zoneRemoved")
|
||||
ix.log.Add(client, "infestationLog", client:GetName() .. " (" .. client:SteamID() .. ") removed the \"" .. targetInfestation .. "\" Infestation Zone.")
|
||||
elseif (client:KeyDown(IN_WALK)) then -- Go back to menu.
|
||||
desiredEditMode = 0
|
||||
|
||||
for _, prop in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (prop:GetNetVar("infestationProp") and prop:GetNetVar("infestationProp") == client:SteamID()) then
|
||||
prop:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (desiredEditMode != false) then
|
||||
client:SetNetVar("InfestationEditMode", desiredEditMode) -- Doing it this way purely to make the code a bit easier to read.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:EntityTakeDamage(entity, damageInfo)
|
||||
local client = damageInfo:GetAttacker()
|
||||
|
||||
if ((entity:GetClass() == "npc_headcrab" or entity:GetClass() == "npc_headcrab_black" or entity:GetClass() == "npc_headcrab_fast")
|
||||
and (damageInfo:GetDamageType() == DMG_SLASH or (IsValid(client) and client:IsPlayer() and client:IsVortigaunt() and client:GetActiveWeapon() and IsValid(client:GetActiveWeapon()) and client:GetActiveWeapon():GetClass() == "ix_hands"))
|
||||
and !entity:GetNetVar("heartHarvested")
|
||||
and math.random(0, 10) > 8) then -- I hate this
|
||||
if (!client:GetCharacter():GetInventory():Add("ing_headcrab_meat")) then
|
||||
ix.item.Spawn("ing_headcrab_meat", client)
|
||||
end
|
||||
|
||||
if (!entity or !IsValid(entity)) then return end
|
||||
|
||||
entity:Kill()
|
||||
end
|
||||
end
|
||||
197
gamemodes/ixhl2rp/plugins/infestationcontrol/sv_plugin.lua
Normal file
197
gamemodes/ixhl2rp/plugins/infestationcontrol/sv_plugin.lua
Normal file
@@ -0,0 +1,197 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
util.AddNetworkString("ixInfestationZoneCreate")
|
||||
util.AddNetworkString("ixInfestationZoneNetwork")
|
||||
|
||||
ix.log.AddType("infestationLog", function(_, log)
|
||||
return "[INFESTATION] " .. log
|
||||
end, FLAG_WARNING)
|
||||
|
||||
net.Receive("ixInfestationZoneCreate", function(length, client)
|
||||
local name = net.ReadString()
|
||||
local type = net.ReadString()
|
||||
local spread = net.ReadFloat()
|
||||
|
||||
local infestationInfo = {
|
||||
type = type,
|
||||
spread = spread,
|
||||
spreadProgress = 1,
|
||||
entities = {},
|
||||
paused = false
|
||||
}
|
||||
|
||||
local corePos = Vector(0, 0, 0)
|
||||
local infestationProps = {}
|
||||
|
||||
for _, entity in pairs(ents.FindByClass("prop_physics")) do
|
||||
if (!entity:GetNetVar("infestationProp") or entity:GetNetVar("infestationProp") != client:SteamID()) then continue end
|
||||
|
||||
local entInfo = {
|
||||
model = entity:GetModel(),
|
||||
position = entity:GetPos(),
|
||||
angles = entity:GetAngles(),
|
||||
harvested = false,
|
||||
core = false
|
||||
}
|
||||
|
||||
if (entity:GetNetVar("infestationCore")) then
|
||||
entInfo.core = true
|
||||
corePos = entity:GetPos()
|
||||
end
|
||||
|
||||
infestationProps[#infestationProps + 1] = entInfo
|
||||
|
||||
if (entity:GetNetVar("infestationCore")) then
|
||||
local infestationCore = ents.Create("ix_infestation_prop")
|
||||
infestationCore:SetModel(entity:GetModel())
|
||||
infestationCore:SetPos(entity:GetPos())
|
||||
infestationCore:SetAngles(entity:GetAngles())
|
||||
infestationCore:SetHarvested(false)
|
||||
infestationCore:SetInfestation(name)
|
||||
infestationCore:SetType(type)
|
||||
infestationCore:SetCore(true)
|
||||
infestationCore:SetSprayed(false)
|
||||
infestationCore:Spawn()
|
||||
ix.saveEnts:SaveEntity(infestationCore)
|
||||
end
|
||||
|
||||
entity:Remove()
|
||||
end
|
||||
|
||||
table.sort(infestationProps, function(a, b)
|
||||
return a.position:Distance(corePos) < b.position:Distance(corePos) -- Sort by closest to furthest.
|
||||
end)
|
||||
|
||||
infestationInfo.entities = infestationProps
|
||||
|
||||
PLUGIN:UpdateInfestation(name, infestationInfo)
|
||||
PLUGIN:InfestationTimer(name, spread)
|
||||
|
||||
client:SetNetVar("InfestationEditMode", 0)
|
||||
client:NotifyLocalized("zoneCreated", name)
|
||||
ix.log.Add(client, "infestationLog", client:GetName() .. " (" .. client:SteamID() .. ") created a new " .. type .. "-Class \"" .. name .. "\" Infestation Zone.")
|
||||
end)
|
||||
|
||||
function PLUGIN:SpreadInfestation(identification)
|
||||
local infestationInfo = ix.infestation.stored[identification]
|
||||
|
||||
if (!infestationInfo) then
|
||||
if (timer.Exists("infestation_" .. identification .. "_timer")) then
|
||||
timer.Remove("infestation_" .. identification .. "_timer")
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if (infestationInfo.paused) then
|
||||
if (timer.Exists("infestation_" .. identification .. "_timer")) then
|
||||
timer.Remove("infestation_" .. identification .. "_timer")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local entityInfo = infestationInfo.entities[infestationInfo.spreadProgress + 1]
|
||||
|
||||
if (!entityInfo) then
|
||||
infestationInfo.paused = true
|
||||
|
||||
self:UpdateInfestation(identification, infestationInfo)
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local infestationProp = ents.Create("ix_infestation_prop")
|
||||
infestationProp:SetModel(entityInfo.model)
|
||||
infestationProp:SetPos(entityInfo.position)
|
||||
infestationProp:SetAngles(entityInfo.angles)
|
||||
infestationProp:SetHarvested(entityInfo.harvested)
|
||||
infestationProp:SetInfestation(identification)
|
||||
infestationProp:SetType(infestationInfo.type)
|
||||
infestationProp:SetCore(entityInfo.core)
|
||||
infestationProp:SetSprayed(false)
|
||||
infestationProp:Spawn()
|
||||
ix.saveEnts:SaveEntity(infestationProp)
|
||||
|
||||
infestationInfo.spreadProgress = infestationInfo.spreadProgress + 1
|
||||
|
||||
if (infestationInfo.spreadProgress >= #infestationInfo.entities) then
|
||||
infestationInfo.paused = true
|
||||
end
|
||||
|
||||
self:UpdateInfestation(identification, infestationInfo)
|
||||
end
|
||||
|
||||
function PLUGIN:SaveInfestationProps()
|
||||
local infestationProps = {}
|
||||
|
||||
for _, prop in ipairs(ents.FindByClass("ix_infestation_prop")) do
|
||||
infestationProps[#infestationProps + 1] = {
|
||||
model = prop:GetModel(),
|
||||
position = prop:GetPos(),
|
||||
angles = prop:GetAngles(),
|
||||
harvested = prop:GetHarvested(),
|
||||
infestation = prop:GetInfestation(),
|
||||
type = prop:GetType(),
|
||||
core = prop:GetCore(),
|
||||
sprayed = prop:GetSprayed()
|
||||
}
|
||||
end
|
||||
|
||||
ix.data.Set("infestationProps", infestationProps)
|
||||
end
|
||||
|
||||
function PLUGIN:UpdateInfestation(identification, data)
|
||||
ix.infestation.stored[identification] = data
|
||||
|
||||
ix.data.Set("infestationZones", ix.infestation.stored)
|
||||
|
||||
net.Start("ixInfestationZoneNetwork")
|
||||
net.WriteTable(ix.infestation.stored)
|
||||
net.Broadcast()
|
||||
|
||||
ix.saveEnts:SaveClass("ix_infestation_prop")
|
||||
self:SaveInfestationProps()
|
||||
end
|
||||
|
||||
function PLUGIN:InfestationTimer(identification, time)
|
||||
if (timer.Exists("infestation_" .. identification .. "_timer")) then
|
||||
timer.Adjust("infestation_" .. identification .. "_timer", time, 0, function()
|
||||
self:SpreadInfestation(identification)
|
||||
end)
|
||||
else
|
||||
timer.Create("infestation_" .. identification .. "_timer", time, 0, function()
|
||||
self:SpreadInfestation(identification)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:SaveInfestationTanks()
|
||||
local data = {}
|
||||
|
||||
for _, tank in ipairs(ents.FindByClass("ix_infestation_tank")) do
|
||||
data[#data + 1] = {
|
||||
position = tank:GetPos(),
|
||||
angles = tank:GetAngles(),
|
||||
chemVolume = tank:GetChemicalVolume(),
|
||||
chemType = tank:GetChemicalType(),
|
||||
hoseAttached = tank:GetHoseAttached(),
|
||||
applicatorAttached = tank:GetApplicatorAttached(),
|
||||
hoseConnected = tank:GetHoseConnected(),
|
||||
color = tank:GetColor()
|
||||
}
|
||||
end
|
||||
|
||||
ix.data.Set("infestationTanks", data)
|
||||
end
|
||||
Reference in New Issue
Block a user