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

View File

@@ -0,0 +1,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

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 = "Réservoir"
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

View File

@@ -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