This commit is contained in:
lifestorm
2024-08-05 18:40:29 +03:00
parent 9f505a0646
commit c6d9b6f580
8044 changed files with 1853472 additions and 21 deletions

View File

@@ -0,0 +1,65 @@
--[[
| 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/
--]]
EFFECT = {}
function EFFECT:Init(data)
self.Position = data:GetOrigin()
self.Emitter = ParticleEmitter(self.Position)
self.LifeTime = 2
self.EndTime = CurTime() + self.LifeTime
for i = 1, 50 do
local particle = self.Emitter:Add("effects/spark", self.Position)
if particle then
particle:SetVelocity(VectorRand() * 100)
particle:SetLifeTime(0)
particle:SetDieTime(math.Rand(0.5, 1.5))
particle:SetStartAlpha(255)
particle:SetEndAlpha(0)
particle:SetStartSize(25)
particle:SetEndSize(0)
particle:SetRoll(math.Rand(0, 360))
particle:SetRollDelta(math.Rand(-2, 2))
particle:SetColor(104, 160, 176)
particle:SetAirResistance(50)
particle:SetGravity(Vector(0, 0, -100))
end
end
self.Radius = 200
self.Damage = 5
self.Owner = data:GetEntity()
net.Start("ixTeslaDamage")
net.WriteVector(self.Position)
net.WriteFloat(self.Radius)
net.WriteFloat(self.Damage)
net.WriteEntity(self.Owner)
net.SendToServer()
end
function EFFECT:Think()
if CurTime() > self.EndTime then
self.Emitter:Finish()
return false
end
return true
end
function EFFECT:Render()
if LocalPlayer():IsAdmin() and LocalPlayer():GetMoveType() == MOVETYPE_NOCLIP then
render.SetColorMaterial()
render.DrawSphere(self.Position, self.Radius, 30, 30, Color(255, 165, 0, 100))
end
end
effects.Register(EFFECT, "tesla_effect")

View File

@@ -0,0 +1,24 @@
--[[
| 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 )
end
function EFFECT:Think()
return false
end
function EFFECT:Render()
end
function EFFECT:Render()
end
effects.Register(EFFECT, "purple_smoke")

View File

@@ -0,0 +1,45 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Base Crystal"
ENT.Author = "Base Crystal"
ENT.Spawnable = false
ENT.AdminSpawnable = false
ENT.crystalColor = Color(255,255,255,255)
ENT.isCrystal = true
if (SERVER) then
function ENT:Initialize()
ix.crystals:OnInitialize(self)
end
function ENT:UpdateTransmitState()
return TRANSMIT_ALWAYS;
end;
function ENT:OnTakeDamage(damageInfo)
ix.crystals:OnTakeDamage(self,damageInfo)
end
function ENT:OnRemove()
ix.crystals:OnRemove(self)
end;
function ENT:Use(activator, caller)
ix.crystals:OnUse(self,activator,caller)
end
function ENT:TriggerReaction()
end
end

View File

@@ -0,0 +1,189 @@
--[[
| 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("crystal_base")
ENT.Type = "anim"
ENT.Base = "crystal_base"
ENT.Author = "gb"
ENT.PrintName = "Blue Crystal"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.Category = "Crystals"
ENT.LootCrystal = "blue_crystal"
ENT.loopSound = "ambient/energy/electric_loop.wav"
if (SERVER) then
function ENT:OnInitialize()
self:SetModel("models/props_abandoned/crystals_fixed/crystal_damaged/crystal_cluster_huge_damaged_a.mdl")
self:SetSkin(6)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self:SetSolid(SOLID_VPHYSICS)
local physicsObject = self:GetPhysicsObject()
self:EmitSound(self.loopSound, 60, 100)
if (IsValid(physicsObject)) then
physicsObject:Wake()
physicsObject:EnableMotion(false)
end
local StartLight1 = ents.Create("light_dynamic")
StartLight1:SetKeyValue("brightness", "3")
StartLight1:SetKeyValue("distance", "150")
StartLight1:SetKeyValue("style", 5)
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
StartLight1:SetLocalAngles(self:GetAngles())
StartLight1:Fire("Color", "0 0 176")
StartLight1:SetParent(self)
StartLight1:Spawn()
StartLight1:Activate()
StartLight1:SetParent(self)
StartLight1:Fire("TurnOn", "", 0)
self:DeleteOnRemove(StartLight1)
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 2, 0, function()
if not IsValid(self) then return end
self:CreateBeamRingEffect()
self:CreateTeslaEffect()
end)
end
function ENT:CreateBeamRingEffect()
effects.BeamRingPoint(self:GetPos() + Vector(0, 0, 10), 1, 0, 400, 10, 0, Color(104, 100, 176))
end
function ENT:CreateTeslaEffect()
local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
effectdata:SetEntity(self)
util.Effect("tesla_effect", effectdata)
for i = 1, 10 do
local tesla = ents.Create("point_tesla")
if not IsValid(tesla) then return end
tesla:SetPos(self:GetPos() + VectorRand() * 50)
tesla:SetKeyValue("m_SoundName", "")
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
tesla:SetKeyValue("m_Color", "104 160 176")
tesla:SetKeyValue("m_flRadius", "100")
tesla:SetKeyValue("beamcount_min", "5")
tesla:SetKeyValue("beamcount_max", "8")
tesla:SetKeyValue("thick_min", "2")
tesla:SetKeyValue("thick_max", "4")
tesla:SetKeyValue("lifetime_min", "0.1")
tesla:SetKeyValue("lifetime_max", "0.2")
tesla:SetKeyValue("interval_min", "0.05")
tesla:SetKeyValue("interval_max", "0.1")
tesla:Spawn()
tesla:Activate()
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
tesla:Fire("DoSpark", "", 0)
end
end
function ENT:TriggerReaction(damageInfo)
local attacker = damageInfo:GetAttacker()
if not IsValid(attacker) then return end
local hitPos = damageInfo:GetDamagePosition()
self:EmitSound("physics/glass/glass_impact_bullet1.wav")
local tesla = ents.Create("point_tesla")
if not IsValid(tesla) then return end
local damageInfo = DamageInfo()
damageInfo:SetDamage(5)
damageInfo:SetDamageType(DMG_SHOCK)
damageInfo:SetAttacker(attacker)
damageInfo:SetInflictor(attacker)
attacker:TakeDamageInfo(damageInfo)
tesla:SetPos(hitPos)
tesla:SetKeyValue("m_SoundName", "")
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
tesla:SetKeyValue("m_Color", "104 100 176")
tesla:SetKeyValue("m_flRadius", "100")
tesla:SetKeyValue("beamcount_min", "5")
tesla:SetKeyValue("beamcount_max", "8")
tesla:SetKeyValue("thick_min", "2")
tesla:SetKeyValue("thick_max", "4")
tesla:SetKeyValue("lifetime_min", "0.1")
tesla:SetKeyValue("lifetime_max", "0.2")
tesla:SetKeyValue("interval_min", "0.05")
tesla:SetKeyValue("interval_max", "0.1")
tesla:Spawn()
tesla:Activate()
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
tesla:Fire("DoSpark", "", 0)
timer.Simple(0.5, function()
if IsValid(tesla) then
tesla:Remove()
end
if IsValid(sound) then
sound:Remove()
end
end)
end
function ENT:OnRemove()
self:StopSound(self.loopSound)
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
end
function ENT:OnDestroyed(singularity)
self:Dissolve(1, 100)
timer.Simple(2, function()
if not IsValid(self) then return end
self:EmitSound(table.Random({"vj_hlr/fx/bustglass1.wav","vj_hlr/fx/bustglass2.wav"}), 100)
util.ScreenShake(self:GetPos(), 100, 150, 5, 1250, true)
local data = EffectData()
data:SetOrigin(self:GetPos())
util.Effect("cball_explode", data)
effects.BeamRingPoint(self:GetPos(), 0.2, 12, 1024, 64, 0, Color(104, 100, 176, 32), {
speed = 0,
spread = 0,
delay = 0,
framerate = 2,
material = "sprites/lgtning.vmt"
})
effects.BeamRingPoint(self:GetPos(), 0.5, 12, 1024, 64, 0, Color(104, 100, 176, 64), {
speed = 0,
spread = 0,
delay = 0,
framerate = 2,
material = "sprites/lgtning.vmt"
})
if singularity or ix.config.Get("crystalSingularity", false) then
local singularityPos = self:GetPos() + Vector(0, 0, 50)
local singularityEnt = ents.Create("wn_singularity_blue")
if IsValid(singularityEnt) then
singularityEnt:SetPos(singularityPos)
singularityEnt:Spawn()
end
end
self:Remove()
end)
end
end

View File

@@ -0,0 +1,129 @@
--[[
| 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("crystal_base")
ENT.Type = "anim"
ENT.Base = "crystal_base"
ENT.Author = "gb"
ENT.PrintName = "Purple Crystal"
ENT.Spawnable = false
ENT.AdminSpawnable = false
ENT.Category = "Crystals"
ENT.LootCrystal = "purple_crystal"
ENT.loopSound = "npc/attack_helicopter/aheli_wash_loop3.wav"
if (SERVER) then
function ENT:OnInitialize()
self:SetModel("models/props_abandoned/crystals_fixed/crystal_damaged/crystal_cluster_huge_damaged_b.mdl")
self:SetSkin(7)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self:SetSolid(SOLID_VPHYSICS)
local physicsObject = self:GetPhysicsObject()
self:EmitSound(self.loopSound, 60, 100)
if (IsValid(physicsObject)) then
physicsObject:Wake()
physicsObject:EnableMotion(false)
end
local StartLight1 = ents.Create("light_dynamic")
StartLight1:SetKeyValue("brightness", "3")
StartLight1:SetKeyValue("distance", "150")
StartLight1:SetKeyValue("style", 5)
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
StartLight1:SetLocalAngles(self:GetAngles())
StartLight1:Fire("Color", "0 0 176")
StartLight1:SetParent(self)
StartLight1:Spawn()
StartLight1:Activate()
StartLight1:SetParent(self)
StartLight1:Fire("TurnOn", "", 0)
self:DeleteOnRemove(StartLight1)
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 2, 0, function()
if not IsValid(self) then return end
self:CreateSmokeEffect()
end)
end
function ENT:CreateSmokeEffect()
local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
effectdata:SetEntity(self)
util.Effect("purple_smoke", effectdata)
end
function ENT:TriggerReaction(damageInfo)
local attacker = damageInfo:GetAttacker()
if not IsValid(attacker) then return end
local hitPos = damageInfo:GetDamagePosition()
self:EmitSound("physics/glass/glass_impact_bullet1.wav")
local tesla = ents.Create("point_tesla")
if not IsValid(tesla) then return end
local damageInfo = DamageInfo()
end
function ENT:OnRemove()
self:StopSound(self.loopSound)
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
end
function ENT:OnDestroyed(singularity)
self:Dissolve(1, 100)
timer.Simple(2, function()
if not IsValid(self) then return end
self:EmitSound(table.Random({"vj_hlr/fx/bustglass1.wav","vj_hlr/fx/bustglass2.wav"}), 100)
util.ScreenShake(self:GetPos(), 100, 150, 5, 1250, true)
local data = EffectData()
data:SetOrigin(self:GetPos())
util.Effect("cball_explode", data)
effects.BeamRingPoint(self:GetPos(), 0.2, 12, 1024, 64, 0, Color(104, 100, 176, 32), {
speed = 0,
spread = 0,
delay = 0,
framerate = 2,
material = "sprites/lgtning.vmt"
})
effects.BeamRingPoint(self:GetPos(), 0.5, 12, 1024, 64, 0, Color(104, 100, 176, 64), {
speed = 0,
spread = 0,
delay = 0,
framerate = 2,
material = "sprites/lgtning.vmt"
})
if singularity or ix.config.Get("crystalSingularity", false) then
local singularityPos = self:GetPos() + Vector(0, 0, 50)
local singularityEnt = ents.Create("wn_singularity_blue")
if IsValid(singularityEnt) then
singularityEnt:SetPos(singularityPos)
singularityEnt:Spawn()
end
end
self:Remove()
end)
end
end

View File

@@ -0,0 +1,110 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.Author = "gb"
ENT.PrintName = "Blue Singularity"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.Category = "Crystals"
ENT.LootCrystal = "blue_crystal"
ENT.loopSound = "ambient/energy/force_field_loop1.wav"
if (SERVER) then
function ENT:Initialize()
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
self:SetNoDraw(true)
self:DrawShadow(false)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
ParticleEffectAttach("[8]magic_portal", 1, self, 1)
self:EmitSound(self.loopSound)
local physicsObject = self:GetPhysicsObject()
if (IsValid(physicsObject)) then
physicsObject:Wake()
physicsObject:EnableMotion(false)
end
local StartLight1 = ents.Create("light_dynamic")
StartLight1:SetKeyValue("brightness", "5")
StartLight1:SetKeyValue("distance", "150")
StartLight1:SetKeyValue("style", 5)
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
StartLight1:SetLocalAngles(self:GetAngles())
StartLight1:Fire("Color", "0 0 176")
StartLight1:SetParent(self)
StartLight1:Spawn()
StartLight1:Activate()
StartLight1:SetParent(self)
StartLight1:Fire("TurnOn", "", 0)
self:DeleteOnRemove(StartLight1)
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 1, 0, function()
if not IsValid(self) then return end
self:CreateBeamRingEffect()
self:CreateTeslaEffect()
end)
timer.Create("RemoveEntityTimer" .. self:EntIndex(), 120, 1, function()
if IsValid(self) then
self:Dissolve(1, 300)
end
end)
end
function ENT:CreateBeamRingEffect()
effects.BeamRingPoint(self:GetPos() + Vector(0, 0, 10), 1, 0, 400, 10, 0, Color(104, 100, 176))
end
function ENT:CreateTeslaEffect()
local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
effectdata:SetEntity(self)
util.Effect("tesla_effect", effectdata)
for i = 1, 5 do
local tesla = ents.Create("point_tesla")
if not IsValid(tesla) then return end
tesla:SetPos(self:GetPos() + VectorRand() * 50)
tesla:SetKeyValue("m_SoundName", "")
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
tesla:SetKeyValue("m_Color", "104 160 176")
tesla:SetKeyValue("m_flRadius", "100")
tesla:SetKeyValue("beamcount_min", "5")
tesla:SetKeyValue("beamcount_max", "8")
tesla:SetKeyValue("thick_min", "2")
tesla:SetKeyValue("thick_max", "4")
tesla:SetKeyValue("lifetime_min", "0.1")
tesla:SetKeyValue("lifetime_max", "0.2")
tesla:SetKeyValue("interval_min", "0.05")
tesla:SetKeyValue("interval_max", "0.1")
tesla:Spawn()
tesla:Activate()
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
tesla:Fire("DoSpark", "", 0)
timer.Simple(0.2, function()
if IsValid(tesla) then
tesla:Remove()
end
end)
end
end
function ENT:OnRemove()
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
timer.Remove("RemoveEntityTimer" .. self:EntIndex())
self:StopSound(self.loopSound)
end
end

View File

@@ -0,0 +1,25 @@
--[[
| 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.base = "base_stackable"
ITEM.name = "Crystal Shard Base"
ITEM.description = "A piece of fabric material worn around the arm."
ITEM.model = "models/props_abandoned/crystals_fixed/crystal_scaled/crystal_small_pile_a1.mdl"
ITEM.category = "Crystal Shards"
ITEM.width = 1
ITEM.height = 1
ITEM.rotate = true
ITEM.outlineColor = Color(255, 204, 0, 100)
ITEM.iconCam = {
pos = Vector(0, 0, 200),
ang = Angle(90, 0, 0),
fov = 10.08
}

View File

@@ -0,0 +1,13 @@
--[[
| 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 = "Broken Handheld Radio"
ITEM.model = Model("models/willardnetworks/skills/handheld_radio.mdl")
ITEM.description = "A small plastic makeshift radio. On the edges you can various bits of damage and scorch marks. It is completely inoperable, unable to be used unless fixed or repaired."

View File

@@ -0,0 +1,13 @@
--[[
| 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 = "Blue Crystal Shard"
ITEM.description = "A small shard of a larger blue crystal, it tingles to touch, stroking the nervous system of your body as you connect with its electrical properties."
ITEM.skin = 6

View File

@@ -0,0 +1,57 @@
--[[
| 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
PLUGIN.name = "Crystals"
PLUGIN.description = "A system that allows you to gather crystals!"
PLUGIN.author = "gb"
PLUGIN.version = 0.1
ix.util.Include("sv_hooks.lua")
ix.util.Include("sv_plugin.lua")
ix.config.Add("crystalSingularity", false, "Makes it so that singularities can be generated by crystals.", nil, {
category = "Crystals"
})
ix.config.Add("disableSuits", true, "Makes it so that blue crystals disable combine suits.", nil, {
category = "Crystals"
})
ix.command.Add("DestroyCrystal", {
alias = "BlowUpCrystal",
description = "Destroy the crystal entity you are looking at.",
adminOnly = true,
arguments = {
bit.bor(ix.type.bool, ix.type.optional)
},
OnRun = function(self, client, singularity)
local trace = client:GetEyeTrace()
local ent = trace.Entity
if IsValid(ent) and ent.Base == "crystal_base" then
if ent.OnDestroyed then
if singularity then
ent:OnDestroyed(true)
else
ent:OnDestroyed()
end
client:Notify("Destroyed the crystal entity you were looking at.")
else
client:Notify("The crystal cannot be destroyed.")
end
else
client:Notify("You are not looking at a valid crystal!")
end
end
})

View File

@@ -0,0 +1,123 @@
--[[
| 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
ix.crystals = ix.crystals or {}
--[[
The POWAAAH
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⡶⠀⣸⣇⠀⢶⣄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣠⣾⣿⠃⢠⣿⣿⡄⠘⣿⣷⣄⡀⠀⠀⠀
⠀⢀⣴⣿⣿⣿⡿⠀⣼⣿⣿⣧⠀⢿⣿⣿⣿⣦⡀⠀
⠠⣈⠙⠻⢿⣿⠃⢰⣿⣿⣿⣿⡆⠘⣿⡿⠟⠋⣁⠄
⠀⣿⣿⣶⣤⡀⠀⠉⠉⠉⠉⠉⠉⠀⢀⣤⣶⣿⣿⠀
⠀⢹⣿⣿⣿⣧⠀⣿⣿⣿⣿⣿⣿⠀⣼⣿⣿⣿⡏⠀
⠀⢸⣿⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⣿⡇⠀
⠀⠈⣿⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⣿⠁⠀
⠀⠀⢻⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⡟⠀⠀
⠀⠀⢸⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⡇⠀⠀
⠀⠀⠘⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⠃⠀⠀
⠀⠀⠀⢻⣿⣿⠀⢹⣿⣿⣿⣿⡏⠀⣿⣿⡟⠀⠀⠀
⠀⠀⠀⠀⠙⢿⠀⢸⣿⣿⣿⣿⡇⠀⡿⠋⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀
]]--
hook.Add("EntityRemoved", "StopCrystalSound", function(ent)
if (ent.isCrystal) then
ent:StopSound(ent.loopSound)
end
end)
function ix.crystals:OnTakeDamage(ent, damageInfo)
local player = damageInfo:GetAttacker()
if IsValid(player) and player:IsPlayer() then
ent:TriggerReaction(damageInfo)
if player:GetActiveWeapon():GetClass() == "tfa_nmrih_pickaxe" then
if !ent.oreLeft then
ent.oreLeft = math.random(4, 6);
end
if !ent.strikesRequired then
ent.strikesRequired = math.random(2, 3);
end
ent.strikesRequired = ent.strikesRequired - 1;
if ent.strikesRequired <= 0 then
local entPos = ent:GetPos();
local character = player:GetCharacter()
local inventory = character:GetInventory()
local pickaxe = inventory:HasItem("pickaxe")
if (pickaxe and pickaxe:GetData("equip")) then
pickaxe:DamageDurability(1)
end
if (!character:GetInventory():Add(istable(ent.LootCrystal) and table.Random(ent.LootCrystal) or ent.LootCrystal)) then
ix.item.Spawn(ent.LootCrystal and table.Random(ent.LootCrystal) or ent.LootCrystal, player)
end
player:Notify("You harvest some shards from the crystal.")
ent:EmitSound(table.Random({"vj_hlr/fx/glass1.wav","vj_hlr/fx/glass2.wav","vj_hlr/fx/glass3"}));
ent.oreLeft = ent.oreLeft - 1;
ent.strikesRequired = math.random(4, 6);
end
if ent.oreLeft <= 0 then
ent:EmitSound(table.Random({"vj_hlr/fx/glass1.wav","vj_hlr/fx/glass2.wav","vj_hlr/fx/glass3"}));
ent:OnDestroyed()
end
end
end
end
function ix.crystals:OnUse(ent, activator, caller)
end
function ix.crystals:OnRemove(ent, activator, caller)
end
function ix.crystals:StartEffect(ent)
if ent.loopEffect then
ParticleEffect(ent.loopEffect, ent:GetPos(), Angle(0, 0, 0), ent)
end
local entityID = ent:EntIndex()
timer.Create("EffectTimer_" .. entityID, 1, 0, function()
if not IsValid(ent) then
timer.Remove("EffectTimer_" .. entityID)
return
end
end)
end
function ix.crystals:StopEffect(ent)
local entityID = ent:EntIndex()
if timer.Exists("EffectTimer_" .. entityID) then
timer.Remove("EffectTimer_" .. entityID)
end
end
function ix.crystals:OnInitialize(ent)
ix.crystals:StartEffect(ent)
ent:OnInitialize()
end

View File

@@ -0,0 +1,108 @@
--[[
| 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
if SERVER then
util.AddNetworkString("ixTeslaDamage")
net.Receive("ixTeslaDamage", function(len, ply)
if not ply:IsAdmin() then
return
end
local pos = net.ReadVector()
local radius = net.ReadFloat()
local damage = net.ReadFloat()
local attacker = net.ReadEntity()
if not IsValid(attacker) then
attacker = game.GetWorld()
end
local entities = ents.FindInSphere(pos, radius)
for _, ent in ipairs(entities) do
if IsValid(ent) then
if (ent:GetClass() == "ix_item" or ent:IsRagdoll()) and not ent:IsPlayer() then
ent:Dissolve(1, 2)
ent:EmitSound("ambient/energy/zap1.wav")
end
if ent:IsPlayer() or ent:IsNPC() then
if ent:IsPlayer() then
if ent and ent:HasPPE() then
return
end
if character and character:IsCombine() and ix.config.Get("disableSuits", false) then
local suit = ent:GetActiveCombineSuit()
if suit then
suit:SetData("suitActive", false)
end
end
if character then
local inventory = character:GetInventory()
if inventory then
local radio = inventory:HasItem("handheld_radio") or inventory:HasItem("old_radio")
if radio then
radio:Remove()
if not inventory:Add("broken_radio") then
ix.item.Spawn("broken_radio", ent:GetPos())
end
end
end
end
ent:ScreenFade(SCREENFADE.IN, Color(173, 216, 230, 128), 0.2, 0)
end
local damageInfo = DamageInfo()
damageInfo:SetDamage(damage)
damageInfo:SetDamageType(DMG_SHOCK)
damageInfo:SetAttacker(attacker)
damageInfo:SetInflictor(attacker)
ent:TakeDamageInfo(damageInfo)
local effectPos = ent:GetPos() + VectorRand() * 10
local tesla = ents.Create("point_tesla")
if not IsValid(tesla) then return end
tesla:SetPos(effectPos)
tesla:SetKeyValue("m_SoundName", "ambient/energy/zap1.wav")
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
tesla:SetKeyValue("m_Color", "104 160 176")
tesla:SetKeyValue("m_flRadius", "300")
tesla:SetKeyValue("beamcount_min", "5")
tesla:SetKeyValue("beamcount_max", "8")
tesla:SetKeyValue("thick_min", "2")
tesla:SetKeyValue("thick_max", "4")
tesla:SetKeyValue("lifetime_min", "0.1")
tesla:SetKeyValue("lifetime_max", "0.2")
tesla:SetKeyValue("interval_min", "0.05")
tesla:SetKeyValue("interval_max", "0.1")
tesla:Spawn()
tesla:Activate()
tesla:Fire("DoSpark", "", 0)
timer.Simple(0.2, function()
if IsValid(tesla) then
tesla:Remove()
end
end)
end
end
end
end)
end