mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
78 lines
3.4 KiB
Lua
78 lines
3.4 KiB
Lua
--[[
|
|
| 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/
|
|
--]]
|
|
|
|
/*--------------------------------------------------
|
|
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
|
|
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
|
|
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
|
|
--------------------------------------------------*/
|
|
AddCSLuaFile()
|
|
|
|
ENT.Type = "anim"
|
|
ENT.Base = "obj_vj_projectile_base"
|
|
ENT.PrintName = "Archer Spit"
|
|
ENT.Author = "DrVrej"
|
|
ENT.Contact = "http://steamcommunity.com/groups/vrejgaming"
|
|
ENT.Information = "Projectiles for my addons"
|
|
ENT.Category = "Projectiles"
|
|
|
|
if CLIENT then
|
|
local Name = "Archer Spit"
|
|
local LangName = "obj_vj_hlr1_archerspit"
|
|
language.Add(LangName, Name)
|
|
killicon.Add(LangName,"HUD/killicons/default",Color(255,80,0,255))
|
|
language.Add("#"..LangName, Name)
|
|
killicon.Add("#"..LangName,"HUD/killicons/default",Color(255,80,0,255))
|
|
end
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
if !SERVER then return end
|
|
|
|
ENT.Model = {"models/vj_hlr/opfor/pitdrone_spike.mdl"} -- The models it should spawn with | Picks a random one from the table
|
|
ENT.DoesDirectDamage = true -- Should it do a direct damage when it hits something?
|
|
ENT.DirectDamage = 20 -- How much damage should it do when it hits something
|
|
ENT.DirectDamageType = DMG_ACID -- Damage type
|
|
ENT.DecalTbl_DeathDecals = {"VJ_HLR_Spit_Acid"}
|
|
ENT.SoundTbl_Idle = {"vj_hlr/hl1_npc/bullchicken/bc_acid1.wav", "vj_hlr/hl1_npc/bullchicken/bc_acid2.wav"}
|
|
ENT.SoundTbl_OnCollide = {"vj_hlr/hl1_npc/bullchicken/bc_spithit3.wav"}
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function ENT:CustomPhysicsObjectOnInitialize(phys)
|
|
phys:SetMass(1)
|
|
phys:EnableGravity(false)
|
|
phys:EnableDrag(false)
|
|
phys:SetBuoyancyRatio(0)
|
|
end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function ENT:CustomOnInitialize()
|
|
self:SetNoDraw(true)
|
|
ParticleEffectAttach("vj_hlr_spore_idle_small", PATTACH_ABSORIGIN_FOLLOW, self, 0)
|
|
end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function ENT:CustomOnThink()
|
|
if self:WaterLevel() == 3 then
|
|
local myPos = self:GetPos()
|
|
effects.BubbleTrail(myPos, myPos + self:GetForward()*400, 6, -500, 100)
|
|
end
|
|
|
|
-- Make it slow down when its out of the water and fall down
|
|
/*if self:WaterLevel() == 0 then
|
|
local phys = self:GetPhysicsObject()
|
|
if IsValid(phys) then
|
|
phys:EnableGravity(true)
|
|
phys:EnableDrag(true)
|
|
phys:SetVelocity(phys:GetVelocity() * 0.3)
|
|
end
|
|
end*/
|
|
end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
local defAng = Angle(0, 0, 0)
|
|
--
|
|
function ENT:DeathEffects(data, phys)
|
|
ParticleEffect("vj_hlr_spore_small", self:GetPos(), defAng)
|
|
end |