Initialize addons

This commit is contained in:
Chev 2021-01-03 16:02:16 -08:00
parent 76f9e702d9
commit c25dfbeb4c
118 changed files with 3207 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,112 @@
ENT.Type = "anim"
ENT.PrintName = "IED"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Spawnable = false
ENT.AdminOnly = true
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true
if SERVER then
AddCSLuaFile("shared.lua")
function ENT:Initialize()
local soundtables = {["song02"] = 23.61, ["song03"] = 37.26, ["song04"] = 13.5, ["song05"] = 14.91, ["song06"] = 19.88}
local rlength, rsound = table.Random(soundtables)
self.nsound = CreateSound(self, "chev/arabicnokiaphone/"..rsound..".ogg")
if self.nsound then
self.nsound:PlayEx(0.4, 100)
timer.Create("LoopNokiaSound", rlength, 0, function()
if self.nsound then
self.nsound:Stop()
self.nsound:PlayEx(0.4, 100)
end
end)
end
self.CanTool = false
self.Owner = self.Entity.Owner
self.Entity:SetModel("models/props_junk/cardboard_box004a.mdl")
self.Entity:PhysicsInit(SOLID_VPHYSICS)
self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
self.Entity:SetSolid(SOLID_VPHYSICS)
self.Entity:DrawShadow(false)
self.Entity:SetCollisionGroup(COLLISION_GROUP_WEAPON)
self.Entity.Boom = false
local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
end
function ENT:Think()
if not IsValid(self) then return end
if not IsValid(self.Entity) then return end
if self.Entity.Boom then
self:Explosion()
end
self.Entity:NextThink(CurTime())
return true
end
function ENT:Explosion()
if not IsValid(self) then return end
if not IsValid(self.Owner) then
timer.Remove("LoopNokiaSound")
self.nsound:Stop()
self.Entity:Remove()
return
end
local effectdata = EffectData()
effectdata:SetOrigin(self.Entity:GetPos())
effectdata:SetNormal(Vector(0,0,1))
effectdata:SetEntity(self.Entity)
effectdata:SetScale(1)
effectdata:SetRadius(67)
effectdata:SetMagnitude(18)
util.Effect("arabicboom", effectdata)
util.Effect("HelicopterMegaBomb", effectdata)
util.Effect("ThumperDust", effectdata)
util.BlastDamage(self.Entity, self.Owner, self.Entity:GetPos(), 500, 170)
util.ScreenShake(self.Entity:GetPos(), 3000, 255, 2.25, 2000)
self.Entity:EmitSound("ambient/explosions/explode_" .. math.random(1, 4) .. ".wav", self.Entity:GetPos(), 100, 100 )
local scorchstart = self.Entity:GetPos() + ((Vector(0,0,1)) * 5)
local scorchend = self.Entity:GetPos() + ((Vector(0,0,-1)) * 5)
timer.Remove("LoopNokiaSound")
self.nsound:Stop()
self.Entity:Remove()
util.Decal("Scorch", scorchstart, scorchend)
end
function ENT:OnTakeDamage( dmginfo )
if (dmginfo:GetInflictor() != self.Entity)
and (dmginfo:GetInflictor():GetClass() != "chev_ied") then
local GoodLuck = math.random(1,10)
if GoodLuck == 1 then
self:Explosion()
end
end
end
end
if CLIENT then
function ENT:Draw()
self.Entity:DrawModel()
end
end

View file

@ -0,0 +1,92 @@
SWEP.PrintName = "Arabic Nokia Phone"
SWEP.Category = "Chev's Weapons"
SWEP.Author = "Chev / M9K"
SWEP.Purpose = "An improvised remote explosive/detonator that plays funny ringtones."
SWEP.Instructions = "Primary: Drop IED.".."\n" .."Secondary: Detonate"
SWEP.Slot = 4
SWEP.SlotPos = 26
SWEP.DrawAmmo = true
SWEP.DrawWeaponInfoBox = true
SWEP.BounceWeaponIcon = false
SWEP.DrawCrosshair = false
SWEP.Weight = 2
SWEP.HoldType = "fist"
SWEP.ViewModelFOV = 75
SWEP.ViewModel = "models/weapons/weapon_ied_arabic.mdl"
SWEP.WorldModel = "models/weapons/weapon_ied_arabic.mdl"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.FiresUnderwater = true
game.AddAmmoType({
name = "arabicfunnyammo",
dmgtype = DMG_BULLET
})
SWEP.Primary.Sound = Sound("Weapon_SLAM.SatchelThrow")
SWEP.Primary.ClipSize = 1
SWEP.Primary.DefaultClip = 4
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "arabicfunnyammo"
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
function SWEP:PrimaryAttack()
if self:CanPrimaryAttack() then
self:TakePrimaryAmmo(1)
self:SetNextPrimaryFire(CurTime() + 1)
self.Weapon:EmitSound(self.Primary.Sound)
local aim = self.Owner:GetAimVector()
local side = aim:Cross(Vector(0,0,1))
local up = side:Cross(aim)
local pos = self.Owner:GetShootPos() + side * -5 + up * -10
if SERVER then
local ied = ents.Create("chev_ied")
if !ied:IsValid() then return false end
ied:SetNWEntity("Owner", self.Owner)
ied:SetAngles(aim:Angle()+Angle(90,0,0))
ied:SetPos(pos)
ied:SetOwner(self.Owner)
/*ied.Owner = self.Owner -- redundancy department of redundancy checking in
ied:SetNWEntity("Owner", self.Owner)*/
ied:Spawn()
local phys = ied:GetPhysicsObject()
phys:ApplyForceCenter(self.Owner:GetAimVector() * 1500)
end
timer.Simple(0.25, function() if not IsValid(self) then return end
if IsValid(self.Owner) and IsValid(self.Weapon) then
if self.Owner:Alive() and self.Owner:GetActiveWeapon():GetClass() == "weapon_ied_arabic" then
self:Reload()
end
end end)
else return
end
end
function SWEP:SecondaryAttack()
for k, v in pairs (ents.FindByClass("chev_ied")) do
if v:GetNWEntity("Owner") == self.Owner then
v.Boom=true
self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
end
end
end
function SWEP:GetViewModelPosition( pos, ang )
pos = pos + ang:Right()*6
pos = pos + ang:Up()*-3.5
pos = pos + ang:Forward()*7
ang:RotateAroundAxis(ang:Up(),0)
ang:RotateAroundAxis(ang:Forward(), -10)
ang:RotateAroundAxis(ang:Right(),00)
return pos, ang
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -0,0 +1,6 @@
"VertexLitGeneric"
{
"$basetexture" "models/weapons/weapon_ied_arabic/cameraphone"
"$bumpmap" "models/weapons/weapon_ied_arabic/cameraphone_n"
"$Selfillum" "1"
}

Binary file not shown.

View file

@ -0,0 +1,72 @@
SWEP.PrintName = "Flying Nimbus"
SWEP.Purpose = "A flying nimbus. Use it to move around!"
SWEP.Base = "weapon_base"
SWEP.Slot = 0
SWEP.SlotPos = 3
SWEP.Category = "Dragon Ball"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.WorldModel = ""
SWEP.ViewModel = ""
SWEP.DrawAmmo = false
SWEP.HoldType = "normal"
game.AddParticles("particles/nimbus/flyingparticles.pcf")
PrecacheParticleSystem("nimbus_smoke") --Precache particles
local NimbusPlayerOnGround = true
function SWEP:Deploy()
timer.Create("NimbusParticleEffect",0.5,0,function()
if SERVER then
if NimbusPlayerOnGround == true then
self.Owner:StopParticles()
else
ParticleEffectAttach("nimbus_smoke",4,self.Owner,self.Owner:LookupAttachment("hips"))
end
end
end)
timer.Create("NimbusParticleResetTimer",24,0,function() self.Owner:StopParticles() end) --Destroy cloud particles after 24 seconds to prevent frame drops1
end
function SWEP:Think()
if self.Owner:IsOnGround() == true then
NimbusPlayerOnGround = true
self:SetHoldType("normal")
else
NimbusPlayerOnGround = false
self:SetHoldType("knife")
end
if self.Owner:KeyDown(IN_JUMP) then
self.Owner:SetVelocity(Vector(0,0,20))
end
end
function SWEP:PrimaryAttack() end
function SWEP:SecondaryAttack() end
function SWEP:Holster()
hook.Remove("OnPlayerHitGround", "NimbusCloudDisableFlight")
timer.Remove("NimbusParticleResetTimer")
timer.Remove("NimbusParticleEffect")
self.Owner:StopParticles()
return true
end
function SWEP:OnRemove()
end

View file

@ -0,0 +1,9 @@
"UnlitGeneric"
{
// Original shader: BaseTimesVertexColorAlphaBlend
"$basetexture" "particles/nimbus/cloud"
"$vertexcolor" "1"
"$vertexalpha" "1"
"$translucent" "1"
//"$no_fullbright" 1
}

View file

@ -0,0 +1,2 @@
player_manager.AddValidModel( "Funny Alien Dancing", "models/player/frog/frog_pm.mdl" );
player_manager.AddValidHands( "Funny Alien Dancing", "models/weapons/frog_hands.mdl", 0, "0000000" )

View file

@ -0,0 +1,37 @@
"VertexlitGeneric"
{
"$basetexture" "models/player/frog/frog_pm/Frog_Base_Color"
"$bumpmap" "models/player/frog/frog_pm/Frog_Base_normal"
"$halflambert" 0
//"$ignorez" 1
"$color2" "[1 1 1]"
"$phong" "1"
"$phongboost" "1"
"$phongfresnelranges" "[0.1 0.2 0.5]"
"$phongexponenttexture" "models/humans/male/group01/players_sheet_phong"
"$rimlight" "1"
"$rimlightexponent" "8"
"$rimlightboost" "2"
"$rimmask" "1"
"Proxies"
{
"Sine"
{
"sinemax" "10"
"sinemin" "1"
"sineperiod" "0.5"
"resultvar" "$rimlightboost"
}
// "PlayerSpeed"
// {
// "scale" "0.003"
// "resultVar" "$color2"
// }
}
}

View file

@ -0,0 +1,36 @@
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Gamer Girl Bath Water Thrown"
if SERVER then AddCSLuaFile() end
ENT.Model = Model("models/manndarinchik/ggbathwater.mdl")
local effectdata = EffectData()
local GlassBreakSounds =
{"physics/glass/glass_impact_bullet1.wav",
"physics/glass/glass_impact_bullet2.wav",
"physics/glass/glass_impact_bullet3.wav",
"physics/glass/glass_impact_bullet4.wav"}
function ENT:Initialize()
self:SetModel(self.Model)
self:SetCollisionGroup(COLLISION_GROUP_NONE)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
end
function ENT:Draw()
self:DrawModel()
end
function ENT:PhysicsCollide(coldata, coll)
effectdata:SetOrigin(coldata.HitPos)
util.Effect("GlassImpact", effectdata)
self:EmitSound(GlassBreakSounds[math.random(#GlassBreakSounds)], 60, 100, 1)
SafeRemoveEntityDelayed(self, 0.01)
end

View file

@ -0,0 +1,119 @@
SWEP.PrintName = "Gamer Girl Bath Water"
SWEP.Purpose = "The Goddess\'s Elixir. Drink it to reach enlightenment!"
SWEP.Instructions = "Primary: Drink\nSecondary: Throw"
SWEP.Author = "\nChev: Coding, partial modelling\nDr. Manndarinchik (GB): Modelling/texturing"
SWEP.Category = "Chev\'s Weapons"
SWEP.Spawnable = true
SWEP.Slot = 1
local bathwatermodel = Model("models/manndarinchik/ggbathwater.mdl")
SWEP.Primary.Ammo = "none"
SWEP.Secondary.Ammo = "none"
SWEP.ViewModel = bathwatermodel
SWEP.WorldModel = bathwatermodel
SWEP.HoldType = "pistol"
SWEP.DrawAmmo = false
function SWEP:Initialize()
self:SetHoldType(self.HoldType)
end
function SWEP:PrimaryAttack() --drink poison
self:EmitSound("chev/ggbathwater/bathwater_drink.ogg")
if SERVER then
local ply = self.Owner
local timername = "BathwaterPoison"..ply:SteamID()
timer.Create(timername, 1.4, 0, function() --ply:SteamID() as SteamID64() provides no value serverside in singleplayer
if IsValid(ply) and ply:Alive() then
ply:ViewPunch(Angle(math.random(-1, -2), 0, 0))
ply:SetHealth(ply:Health() - math.random(2, 4))
if ply:Health() < 3 then
ply:Kill()
ply:ChatPrint("you died after drinking too much bath water")
timer.Remove(timername)
else end
else
timer.Remove(timername)
end
end)
end
self:SetNextPrimaryFire(CurTime() + 20)
end
function SWEP:SecondaryAttack() --throw
if SERVER then
local ent = ents.Create("ent_ggbathwater")
ent:SetPos(self.Owner:EyePos() + self.Owner:GetAimVector() * 16)
ent:SetAngles(self.Owner:EyeAngles())
ent:Spawn()
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
local velocity = self.Owner:GetAimVector() * 3000
phys:ApplyForceCenter(velocity)
phys:AddAngleVelocity(Vector(0, math.random(500, 2000), 0))
end
self.Owner:ViewPunch(Angle(-4, 0, 0))
self:Remove()
end
self:SetNextSecondaryFire(CurTime() + 100)
end
if CLIENT then
function SWEP:DrawWorldModel()
local ply = self:GetOwner()
if IsValid(ply) then
local opos = self:GetPos()
local oang = self:GetAngles()
local bon = ply:LookupBone("ValveBiped.Bip01_R_Hand")
local bp, ba = ply:GetBonePosition(bon or 0)
if bp then opos = bp end
if ba then oang = ba end
opos = opos + oang:Right() * 3.4
opos = opos + oang:Forward() * 6.9
opos = opos + oang:Up() * 0
oang:RotateAroundAxis(oang:Right(), 180)
self:SetupBones()
local mrt = self:GetBoneMatrix(0)
if mrt then
mrt:SetTranslation(opos)
mrt:SetAngles(oang)
self:SetBoneMatrix(0, mrt)
end
end
self:DrawModel()
end
function SWEP:GetViewModelPosition(p, a)
local bpos = Vector(10, 27, -9)
local bang = Vector(-20, 180, 0)
local right = a:Right()
local up = a:Up()
local forward = a:Forward()
a:RotateAroundAxis(right, bang.x)
a:RotateAroundAxis(up, bang.y)
a:RotateAroundAxis(forward, bang.z)
p = p + bpos.x * right
p = p + bpos.y * forward
p = p + bpos.z * up
return p, a
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -0,0 +1,16 @@
VertexLitGeneric
{
"$basetexture" "models\manndarinchik\ggbathwater\bathwater_cap"
"$phong" 1
"$phongexponent" 25
"$phongfresnelranges" "[1 2 5]"
"$lightwarptexture" "models\lightwarps\weapon_lightwarp"
"$phongboost" 1
"$rimlight" 1
"$rimlightexponent" 20
"$rimlightboost" .25
"$envmap" "env_cubemap"
"$envmaptint" "[.25 .25 .25]"
}

View file

@ -0,0 +1,19 @@
VertexLitGeneric
{
"$baseTexture" "models\manndarinchik\ggbathwater\bathwater_glass"
"$bumpmap" "models\manndarinchik\ggbathwater\bathwater_glass_phongmask"
"$additive" "1"
"$envmap" "env_cubemap"
"$envmaptint" "[.3 .3 .2]"
"$phong" "1"
"$phongexponent" "65"
"$phongfresnelranges" "[1 2 4]"
"$lightwarptexture" "models/lightwarps/jarate_lightwarp"
"$phongboost" "6"
"$rimlight" "1"
"$rimlightexponent" "20"
"$rimlightboost" "2"
}

View file

@ -0,0 +1,13 @@
VertexLitGeneric
{
"$basetexture" "models\manndarinchik\ggbathwater\bathwater_liquid"
"$envmap" "env_cubemap"
"$envmaptint" "[1 1 1]"
"$phong" "1"
"$phongexponent" 50
"$phongfresnelranges" "[1 2 3]"
"$lightwarptexture" "models\lightwarps\jarate_lightwarp"
"$phongboost" "1"
}

View file

@ -0,0 +1,263 @@
AddCSLuaFile()
DEFINE_BASECLASS("base_anim")
ENT.PrintName = "Lethal League Baseball"
ENT.Author = "Lua coding: Chev\nBaseball model: Team Reptile"
ENT.Purpose = "The baseball from LL/LLB. Hit it to make it go faster!"
ENT.Category = "Lethal League"
ENT.AutomaticFrameAdvance = true
ENT.Editable = true
ENT.Spawnable = true
ENT.AdminOnly = false
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.BallSize = 18
ENT.ServingPitch = false
ENT.BounceSound = Sound("llb/wall_bounce.ogg")
ENT.HitSound = Sound("llb/medium_hit.ogg")
ENT.StrongHitSound = Sound("llb/strong_hit.ogg")
ENT.KnockoutSound = Sound("llb/knockout.ogg")
ENT.BallOwner = nil
function ENT:SetupDataTables()
self:NetworkVar("Bool", 0, "LockXAxis", {KeyName = "lockx", Edit = {type="Boolean", order=1}})
self:NetworkVar("Bool", 1, "LockYAxis", {KeyName = "locky", Edit = {type="Boolean", order=2}})
self:NetworkVar("Bool", 2, "LockZAxis", {KeyName = "lockz", Edit = {type="Boolean", order=3}})
self:NetworkVar("Bool", 3, "DamagePlayers", {KeyName = "dmgply", Edit = {type="Boolean", order=4}})
end
function ENT:SpawnFunction(ply, tr, ClassName)
if (!tr.Hit) then return end
local ent = ents.Create(ClassName)
ent:SetPos(tr.HitPos + tr.HitNormal * self.BallSize * 2)
ent:Spawn()
ent:Activate()
local phys = ent:GetPhysicsObject()
phys:SetVelocity(Vector(0, 0, 0))
phys:SetAngles(Angle(0, 0, 0))
phys:AddAngleVelocity(Vector(256, 0, 0))
return ent
end
function ENT:Think()
if CLIENT then return end
local phys = self:GetPhysicsObject()
local vel = self:GetVelocity()
if !IsValid(phys) then return end
vel.x = self:GetLockXAxis() and 0 or vel.x
vel.y = self:GetLockYAxis() and 0 or vel.y
vel.z = self:GetLockZAxis() and 0 or vel.z
phys:SetVelocity(Vector(vel.x, vel.y, vel.z))
self:NextThink(CurTime())
return true
end
function ENT:Initialize()
if CLIENT then
//local matname = "LLBBaseball_"..math.Round(SysTime(), 2) * 100
local matname = "LLBBaseball_"..self:EntIndex()
self.BallMaterial = CreateMaterial(matname, "VertexLitGeneric", {
["$basetexture"] = "models/llb/baseball/baseball",
["$surfaceprop"] = "Rubber",
["$selfillumtint"] = "[0 1 0]",
["$selfillum"] = "1",
["$selfillummask"] = "models/llb/baseball/baseball_i",
["$phong"] = "1",
["$phongboost"] = "0.2",
["$phongexponent"] = "5",
["$phongfresnelranges"] = "[0.2 0.8 0.1]",
["$lightwarptexture"] = "models/llb/baseball/lightwarp",
["$nocull"] = "1",
["$rimlight"] = "1",
["$rimlightexponent"] = "5",
["$rimlightboost"] = "3",
["$blendtintbybasealpha"] = "0",
["$blendtintcoloroverbase"] = "0",
["$model"] = "1"
})
self:SetMaterial("!"..matname)
self.BallMaterial:SetVector("$selfillumtint", Vector(1, 0, 0))
end
hook.Add("RenderScreenspaceEffects", "LLBInvertColorsHit", function()
if self.IsInverted then
DrawColorModify({
["$pp_colour_brightness"] = 0,
["$pp_colour_contrast"] = 1,
["$pp_colour_colour"] = -1,
["$pp_colour_addr"] = 0.04
})
end
end)
if CLIENT then return end
self:SetModel("models/llb/baseball.mdl")
self:SetModelScale(0.55)
self:SetCollisionGroup(COLLISION_GROUP_PASSABLE_DOOR)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetTrigger(true)
self.ServingPitch = true
local size = self.BallSize / 2.1
self:PhysicsInitSphere(size, "metal_bouncy")
self:SetCollisionBounds(Vector(-size, -size, -size), Vector(size, size, size))
self.BallTrail = util.SpriteTrail(self, 0, Color(255, 0, 0), false, 17, 17, 0.03, 1/17, "effects/beam_generic01")
local phys = self:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()
phys:EnableGravity(false)
end
hook.Add("KeyPress", "LLBCheckPlayerHitBall", function(ply, key)
if !IsValid(ply) or !IsValid(self) or !IsFirstTimePredicted then return end
if key == IN_ATTACK and ply:GetPos():Distance(self:GetPos()) < 120 then --player will hit the ball if they're within 120 hammer units
local dmginfo = DamageInfo()
dmginfo:SetAttacker(ply)
self:OnTakeDamage(dmginfo)
end
end)
util.AddNetworkString("LLBDrawInvertedColors")
util.AddNetworkString("LLBChangeBallColor")
end
net.Receive("LLBDrawInvertedColors", function()
local ent = net.ReadEntity()
local time = net.ReadFloat()
if !ent:IsDormant() then
ent.IsInverted = true
RunConsoleCommand("pp_texturize", "pp/texturize/invert.png")
timer.Simple(time, function()
ent.IsInverted = false
RunConsoleCommand("pp_texturize", "")
end)
end
end)
net.Receive("LLBChangeBallColor", function()
local ent = net.ReadEntity()
local entowner = net.ReadEntity()
ent.BallOwner = entowner
ent.BallMaterial:SetVector("$selfillumtint", ent.BallOwner:GetPlayerColor())
end)
function ENT:OnRemove()
if SERVER then
hook.Remove("KeyPress", "LLBCheckPlayerHitBall")
else
hook.Remove("RenderScreenspaceEffects", "LLBInvertColorsHit")
end
end
function ENT:PhysicsCollide(data, physobj)
-- Play sound on bounce
if data.DeltaTime > 0.02 then
sound.Play(self.BounceSound, self:GetPos(), 80, 100, 1)
end
end
function ENT:StartTouch(ent)
local speed = self:GetVelocity():Length() ^ 0.8
if ent:IsPlayer() and self.BallOwner != ent and speed > 16 then --damage a player if they touch the ball
if !self:GetDamagePlayers() then return end
local dmginf = DamageInfo()
dmginf:SetDamage(speed/8)
dmginf:SetDamageType(DMG_GENERIC)
dmginf:SetAttacker(self)
dmginf:SetInflictor(self)
dmginf:SetDamageForce(Vector(0, 0, 1))
ent:TakeDamageInfo(dmginf)
util.ScreenShake(self:GetPos(), 2, 30, 0.5, 300)
if ent:Health() > 0 then
sound.Play("llb/takedmg_"..math.random(1, 4)..".ogg", self:GetPos(), 80, 100, 1)
else
local phys = self:GetPhysicsObject() --reset ball speed when a player dies
phys:SetVelocity(Vector(0, 0, 0))
phys:SetAngles(Angle(90, 0, 0))
phys:AddAngleVelocity(-phys:GetAngleVelocity() + Vector(256, 0, 0))
self.ServingPitch = true
sound.Play(self.KnockoutSound, self:GetPos(), 80, 100, 1)
end
end
end
function ENT:OnTakeDamage(dmginfo)
local phys = self:GetPhysicsObject()
local newvel = self:GetVelocity()*1.5
local speed = newvel:Length() ^ 0.8
local att = dmginfo:GetAttacker()
if att:IsPlayer() and att:Alive() then --set the ball owner and ball color on hit
self.BallOwner = att
local plycol = att:GetPlayerColor():ToColor()
local newplycol = math.Round(plycol.r).." "..math.Round(plycol.g).." "..math.Round(plycol.b)
self.BallTrail:Fire("Color", newplycol)
net.Start("LLBChangeBallColor")
net.WriteEntity(self)
net.WriteEntity(self.BallOwner)
net.Broadcast()
end
if att:IsPlayer() and !att:Alive() then return end
local aimvec = att:GetAimVector()
if self:GetVelocity() == Vector(0, 0, 0) and !self.ServingPitch then return end
phys:EnableMotion(false)
if speed > 1000 then --play different sounds based on ball speed
net.Start("LLBDrawInvertedColors")
net.WriteEntity(self)
net.WriteFloat((math.Clamp(0.00205*speed, 0, 1.2)))
net.Broadcast()
sound.Play(self.StrongHitSound, self:GetPos(), 80, 100, 1)
util.ScreenShake(self:GetPos(), 25, 4, 1.3, 300)
elseif speed > 500 then
sound.Play(self.StrongHitSound, self:GetPos(), 80, 100, 1)
util.ScreenShake(self:GetPos(), 20, 4, 1.3, 300)
else
sound.Play(self.HitSound, self:GetPos(), 80, (speed*0.0295+100), 1)
util.ScreenShake(self:GetPos(), 2, 4, 1, 300)
end
timer.Simple((math.Clamp(0.00205*speed, 0, 1.2)), function() --temporarily stop the ball after being hit.
if !IsValid(self) then return end
phys:EnableMotion(true)
if self.ServingPitch then
phys:SetVelocity(aimvec*50*3.4)
self.ServingPitch = false
else
if speed == 0 then return end
phys:SetVelocity(aimvec*speed*3.8) --may need some more testing
end
phys:AddAngleVelocity(Vector(-512, 0, 0))
end)
end
if CLIENT then
function ENT:Draw()
self:DrawModel()
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,25 @@
VertexLitGeneric
{
$basetexture "models/llb/baseball/baseball"
$surfaceprop Rubber
$selfillumtint "[1 0 0]"
$selfillum 1
$selfillummask "models/llb/baseball/baseball_i"
$phong 1
$phongboost 0.2
$phongexponent 5
$phongfresnelranges "[0.2 0.8 0.1]"
$lightwarptexture "models/llb/baseball/lightwarp"
$nocull 1
$rimlight 1
$rimlightexponent 5
$rimlightboost 3
$blendtintbybasealpha "0"
$blendtintcoloroverbase "0"
$model 1
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,188 @@
local function initialize_map_error_commands()
local matable = {} --material table
local matablelen = 0 --length of the material table
local sndtable = {} --sound table
local sndtablelen = 0 --length of the sound table
local imat = Material --shortcut for Material
local stext = FindMetaTable("IMaterial")["SetTexture"] --shortcut for IMaterial.SetTexture
local surface_infos = game.GetWorld():GetBrushSurfaces() --array of SurfaceInfos
local ref = {} --reference hash table
local map_materials = {} --result table - array of IMaterial objects
for k, v in ipairs(surface_infos) do --remove duplicate materials
if v:IsWater() then continue end
path = v:GetMaterial():GetString("$basetexture")
if path and !ref[path] then
map_materials[#map_materials + 1] = v:GetMaterial()
ref[path] = true
end
end
for k, v in ipairs(game.GetWorld():GetMaterials()) do --do worldspawn.GetMaterials to try to get displacement materials
if v and !ref[v] then
map_materials[#map_materials + 1] = imat(v)
ref[v] = true
end
end
MsgC(Color(0, 157, 255), "Found " .. #map_materials .. " map textures\n")
local function get_fps() return GetConVar("fps_max"):GetInt() end
local function init_random_locations()
local tbr = table.remove
local tbi = table.insert
local ff = file.Find
local rfile, rdir = ff("materials/*", "GAME")
for k, v in pairs(rdir) do
if v == "vgui" or v == "skybox" then
tbr(rdir, k)
end
end
for i=1, math.Round(#rdir/2, 0), 1 do --remove some folders, since looking through hundreds of folders is VERY performance-heavy
tbr(rdir, math.random(1, #rdir))
end
for k, v in pairs(rdir) do --this function is expensive
local rnfile = ff("materials/"..v.."/*.vtf", "GAME") --find vtf files
for k, vn in pairs(rnfile) do
rnfile[k] = v.."/"..rnfile[k]
tbi(matable, rnfile[k])
end
coroutine.yield()
end
matablelen = #matable
local rfile, rdir = ff("sound/*", "GAME")
for i=1, math.Round(#rdir/1.5, 0), 1 do
tbr(rdir, math.random(1, #rdir))
end
for k, v in pairs(rdir) do --this function is expensive too
local rnfile = ff("sound/"..v.."/*.mp3", "GAME")
for k, vn in pairs(rnfile) do
rnfile[k] = v.."/"..rnfile[k]
tbi(sndtable, rnfile[k])
end
coroutine.yield()
local rnfilewav = ff("sound/"..v.."/*.wav", "GAME")
for k, vn in pairs(rnfilewav) do
rnfilewav[k] = v.."/"..rnfilewav[k]
tbi(sndtable, rnfilewav[k])
end
coroutine.yield()
end
sndtablelen = #sndtable
end
local random_loc_co = coroutine.create(init_random_locations)
coroutine.resume(random_loc_co)
hook.Add("Think", "map_intitialize_random_locations_co", function()
if coroutine.status(random_loc_co) == "dead" then
hook.Remove("Think", "map_intitialize_random_locations_co")
MsgC(Color(0, 157, 255), "Game textures have been successfully initialized\n")
return
end
coroutine.resume(random_loc_co)
end)
concommand.Add("map_randomizetextures", function()
MsgC(Color(0, 157, 255), "Randomizing map textures. You may experience some lag for a bit!\n")
local co = coroutine.create(function() --create a coroutine to hopefully reduce the game freezing
for k, v in pairs(map_materials) do
stext(v, "$basetexture", matable[math.random(matablelen)]) --setting random textures is very laggy
stext(v, "$basetexture2", matable[math.random(matablelen)]) --set basetexture2 for displacements
coroutine.yield()
end
for k, ent in pairs(ents.GetAll()) do
if ent == game.GetWorld() then continue end --don't affect the world materials, they already changed
for k, v in pairs(ent:GetMaterials()) do
stext(imat(v), "$basetexture", matable[math.random(matablelen)])
coroutine.yield()
end
end
end)
timer.Create("map_randomizetextures_co", 2 / get_fps(), 0, function() --2 / max fps - try to run every 2 frames or so
if coroutine.status(co) == "dead" then
timer.Remove("map_randomizetextures_co")
MsgC(Color(0, 157, 255), "Map textures have been successfully randomized\n")
return
end
coroutine.resume(co)
end)
end)
concommand.Add("map_erroreverything", function()
for k, v in pairs(map_materials) do
stext(v, "$basetexture", "")
stext(v, "$basetexture2", "")
end
for k, ent in pairs(ents.GetAll()) do
if ent == game.GetWorld() then continue end
for k, v in pairs(ent:GetMaterials()) do
stext(imat(v), "$basetexture", "")
end
end
for k, ent in pairs(ents.FindByClass("prop_*")) do
ent:SetModel("models/error.mdl")
for k, v in pairs(ent:GetMaterials()) do
stext(imat(v), "$basetexture", "models/weapons/v_slam/new light1")
end
end
timer.Create("ErrorModels", 0.05, 0, function()
for k, ent in pairs(ents.FindByClass("prop_*")) do
ent:SetModel("models/error.mdl")
end
end)
MsgC(Color(255, 0, 255), "Map textures are now missing.\n")
end)
concommand.Add("map_randomizesounds", function()
hook.Add("EntityEmitSound", "ChevMapSoundRandomizer", function(t)
t.SoundName = sndtable[math.random(sndtablelen)]
t.Channel = CHAN_AUTO
return true
end)
if game.SinglePlayer() then
net.Start("EnableRandomSounds")
net.SendToServer()
net.Receive("SendRandomSound", function()
local t = net.ReadTable()
EmitSound(sndtable[math.random(sndtablelen)], (t.Pos or LocalPlayer():GetPos()), t.Entity:EntIndex(), t.Channel, t.Volume, t.SoundLevel, t.Flags, t.Pitch)
end)
MsgC(Color(0, 255, 255), "Map sounds are now randomized\n")
else
MsgC(Color(20, 255, 255), "Map sounds are now randomized, but only client-side sounds will be randomized, since you aren't in singleplayer\n")
end
end)
end
if CLIENT then hook.Add("InitPostEntity", "initialize_map_error_commands", initialize_map_error_commands) end
if SERVER and game.SinglePlayer() then
util.AddNetworkString("EnableRandomSounds")
util.AddNetworkString("SendRandomSound")
net.Receive("EnableRandomSounds", function()
hook.Add("EntityEmitSound", "RandomizeEntSoundsServer", function(t)
if math.random(0, 10) > 3 then --lower random sound chance to prevent lag a little
net.Start("SendRandomSound")
net.WriteTable(t)
net.Broadcast()
return false
end
end)
end)
end

View file

@ -0,0 +1,3 @@
local no_viewmodel_sway_enabled = CreateClientConVar("no_viewmodel_sway_enabled", "1", true, false, "Whether or not viewmodel velocity is enabled."):GetBool()
cvars.AddChangeCallback("no_viewmodel_sway_enabled", function(_, _, newval) no_viewmodel_sway_enabled = tobool(newval) end)
hook.Add("CalcViewModelView", "no_viewmodel_sway", function(_, _, oldPos, oldAng, _, _) if no_viewmodel_sway_enabled then return oldPos, oldAng end end)

View file

@ -0,0 +1,59 @@
local propyellenabled = true
concommand.Add("propyelling_toggle", function(ply, cmd, args, str)
propyellenabled = !propyellenabled
if propyellenabled == true then
MsgC(Color(200, 200, 200), "Prop yelling is now ", Color(0, 255, 0), "ON\n")
elseif propyellenabled == false then
MsgC(Color(200, 200, 200), "Prop yelling is now ", Color(255, 0, 0), "OFF\n")
else end
end, function() end, "Toggles yelling noises emitted from props when they are spawned.")
local yellsound = {"vo/npc/male01/moan01.wav",
"vo/npc/male01/moan02.wav",
"vo/npc/male01/moan03.wav",
"vo/npc/male01/moan04.wav",
"vo/npc/male01/moan05.wav",
"vo/npc/male01/myarm01.wav",
"vo/npc/male01/myarm02.wav",
"vo/npc/male01/myarm02.wav",
"vo/npc/male01/myleg01.wav",
"vo/npc/male01/myleg02.wav",
"vo/npc/male01/pain01.wav",
"vo/npc/male01/pain02.wav",
"vo/npc/male01/pain03.wav",
"vo/npc/male01/pain04.wav",
"vo/npc/male01/pain05.wav",
"vo/npc/male01/pain06.wav",
"vo/npc/male01/pain07.wav",
"vo/npc/male01/pain08.wav",
"vo/npc/male01/pain09.wav",
"vo/npc/male01/help01.wav",
"vo/npc/male01/mygut02.wav",
"vo/npc/female01/moan01.wav",
"vo/npc/female01/moan02.wav",
"vo/npc/female01/moan03.wav",
"vo/npc/female01/moan04.wav",
"vo/npc/female01/moan05.wav",
"vo/npc/female01/myarm01.wav",
"vo/npc/female01/myarm02.wav",
"vo/npc/female01/myarm02.wav",
"vo/npc/female01/myleg01.wav",
"vo/npc/female01/myleg02.wav",
"vo/npc/female01/pain01.wav",
"vo/npc/female01/pain02.wav",
"vo/npc/female01/pain03.wav",
"vo/npc/female01/pain04.wav",
"vo/npc/female01/pain05.wav",
"vo/npc/female01/pain06.wav",
"vo/npc/female01/pain07.wav",
"vo/npc/female01/pain08.wav",
"vo/npc/female01/pain09.wav",
"vo/npc/female01/help01.wav",
"vo/npc/female01/mygut02.wav"}
hook.Add("OnEntityCreated", "PropYelling", function(ent)
if ent:GetClass() == "prop_physics" and ent:GetMoveType() != MOVETYPE_NONE and propyellenabled then
EmitSound(yellsound[math.random(#yellsound)], ent:GetPos(), ent:EntIndex())
end
end)

View file

@ -0,0 +1,186 @@
local surface = surface
local draw = draw
local render = render
local LocalPlayer = LocalPlayer
local cPushModelMatrix = cam.PushModelMatrix
local cPopModelMatrix = cam.PopModelMatrix
surface.CreateFont("RoR2HUD_Bombardier", {
font = "Bombardier",
extended = false,
size = 25,
antialias = true
})
local tMat = Matrix()
local enabled_cvar = CreateClientConVar("ror2hud_enabled", "1", true, false, "The RoR2 HUD is enabled.", 0, 1)
local xpadding_cvar = CreateClientConVar("ror2hud_xpadding", "122", true, false, "Changes how far away the HUD touches the sides of the screen.", 0, ScrW())
local ypadding_cvar = CreateClientConVar("ror2hud_ypadding", "100", true, false, "Changes how far away the HUD touches the bottom of the screen.", 0, ScrH())
local armorThickness_cvar = CreateClientConVar("ror2hud_armorthickness", "6", true, false, "How thick the armor bar is compared to the health bar (in pixels).", 0, 32)
local hudAngle_cvar = CreateClientConVar("ror2hud_angle", "3", true, false, "The angle at which the HUD is set at.", -90, 90)
local filter_cvar = CreateClientConVar("ror2hud_filter", "3", true, false, "The texture filter used on the HUD. 0 = None, 1 = Point, 2 = Linear, 3 = Anistropic.", 0, 3)
local function drawElements(offsetx, offsety, angle, drawfunc)
tMat:SetAngles(Angle(angle, angle, 45))
tMat:SetTranslation(Vector(offsetx, offsety, 0))
tMat:SetScale(Vector(1, 1, 0))
cPushModelMatrix(tMat)
drawfunc()
cPopModelMatrix()
end
local function drawUVBar(mat, color, xpos, ypos, width, height, pixels)
if width < 1 then return end
surface.SetMaterial(mat)
surface.SetDrawColor(unpack(color)) -- unpack(color)
surface.DrawTexturedRectUV(xpos, ypos, 4, height, 0, 0, 0.125, 1)
surface.DrawTexturedRectUV(xpos+4, ypos, width-(pixels)+1, height, 0.125, 0, 0.875, 1)
surface.DrawTexturedRectUV(xpos+width-4, ypos, 4, height, 0.875, 0, 1, 1)
end
local hpBarMat = Material("ror2hud/hpbar.png")
local armorBarMat = Material("ror2hud/armorbar.png")
local barBackMat = Material("ror2hud/barback.png")
local lowHp = Material("ror2hud/lowhp_indicator.png")
local curFPS = 0
local hidden_elements = {
["CHudHealth"] = true,
["CHudBattery"] = true,
["CHudAmmo"] = true,
["CHudSecondaryAmmo"] = true
}
hook.Add("HUDShouldDraw", "RoR2HUDDisableDefault", function(name)
if hidden_elements[name] then return !enabled_cvar:GetBool() end
end)
hook.Add("HUDPaint", "RoR2HUD", function()
if !enabled_cvar:GetBool() then return end -- if the cvar is set to disable the HUD
render.PushFilterMag(filter_cvar:GetInt()) --smooth filter
render.PushFilterMin(filter_cvar:GetInt())
local xpadding = xpadding_cvar:GetInt()
local ypadding = ypadding_cvar:GetInt()
local armorThickness = armorThickness_cvar:GetInt()
local hudAngle = hudAngle_cvar:GetInt()
--[[------------------------
Health
--]]------------------------
local hp = LocalPlayer():Health()
local maxhp = LocalPlayer():GetMaxHealth()
local hpratio = math.Clamp(hp, 0, maxhp) / maxhp
drawElements(xpadding, ScrH()-ypadding, -hudAngle, function()
surface.SetDrawColor(210, 210, 210, 180)
surface.SetMaterial(barBackMat)
surface.DrawTexturedRect(0, 0, 430, 30)
drawUVBar(hpBarMat, {94, 173, 48, 255}, 0, 0, 430*hpratio, 30, 8)
end) --health bar
local armor = LocalPlayer():Armor()
local maxarmor = LocalPlayer():GetMaxArmor()
local armorratio = math.Clamp(armor, 0, maxarmor) / maxarmor
drawElements(xpadding-armorThickness, ScrH()-ypadding-armorThickness, -hudAngle, function()
drawUVBar(armorBarMat, {255, 255, 255, 255}, 0, 0, 438*armorratio, 30+armorThickness*2, 8)
end) --armor bar
drawElements(xpadding, ScrH()-ypadding, -hudAngle, function()
surface.SetMaterial(lowHp)
surface.DrawTexturedRect(3, 3, 50, 24)
draw.TextShadow({
text = math.max(hp, 0) .. " / " .. maxhp,
font = "RoR2HUD_Bombardier",
pos = {215, 15},
color = color_white,
xalign = TEXT_ALIGN_CENTER,
yalign = TEXT_ALIGN_CENTER
}, 1, 150)
end) -- health text
curFPS = Lerp(4 * RealFrameTime(), curFPS, 1/RealFrameTime())
drawElements(xpadding+6, ScrH()-ypadding-34, -hudAngle, function()
draw.TextShadow({
text = LocalPlayer():Nick(),
font = "RoR2HUD_Bombardier",
pos = {0, 12},
color = color_white,
xalign = TEXT_ALIGN_LEFT,
yalign = TEXT_ALIGN_CENTER
}, 1, 150)
draw.TextShadow({
text = "FPS: " .. math.Round(curFPS) .. " Ping: " .. LocalPlayer():Ping(),
font = "RoR2HUD_Bombardier",
pos = {415, 12},
color = color_white,
xalign = TEXT_ALIGN_RIGHT,
yalign = TEXT_ALIGN_CENTER
}, 1, 150)
end) -- name, fps/ping text
--[[------------------------
Ammunition
--]]------------------------
local wep = LocalPlayer():GetActiveWeapon()
drawElements(ScrW()-xpadding-430, ScrH()-ypadding-(7*hudAngle), hudAngle, function()
surface.SetDrawColor(210, 210, 210, 180)
surface.SetMaterial(barBackMat)
surface.DrawTexturedRectRotated(215, 15, 430, 30, 180)
end)
if IsValid(wep) then
if wep:GetPrimaryAmmoType() > -1 then
local clip1max = wep:GetMaxClip1()
local clip1cur = wep:Clip1()
local clip1ammo = LocalPlayer():GetAmmoCount(wep:GetPrimaryAmmoType())
local clip1ratio = clip1cur > -1 and math.min(clip1cur / clip1max, 1) or math.Clamp(clip1ammo, 0, 1)
local showntext = clip1cur > -1 and clip1cur .. " / " .. clip1ammo or clip1ammo
drawElements(ScrW()-xpadding-430, ScrH()-ypadding-(7*hudAngle), hudAngle, function()
drawUVBar(hpBarMat, {211, 195, 112, 255}, 430*(1-clip1ratio), 0, 430*clip1ratio, 30, 8)
draw.TextShadow({
text = showntext,
font = "RoR2HUD_Bombardier",
pos = {215, 15},
color = color_white,
xalign = TEXT_ALIGN_CENTER,
yalign = TEXT_ALIGN_CENTER
}, 1, 150)
end) --ammo bar with text
end
if wep:GetSecondaryAmmoType() > -1 then
local clip2ammo = LocalPlayer():GetAmmoCount(wep:GetSecondaryAmmoType())
surface.SetFont("RoR2HUD_Bombardier")
local w = surface.GetTextSize(clip2ammo) + 15
drawElements(ScrW()-xpadding-430, ScrH()-ypadding-(7*hudAngle)-34, hudAngle, function()
drawUVBar(hpBarMat, {200, 200, 200, 100}, 424-w, 4, w, 22, 8)
draw.TextShadow({
text = clip2ammo,
font = "RoR2HUD_Bombardier",
pos = {415, 15},
color = color_white,
xalign = TEXT_ALIGN_RIGHT,
yalign = TEXT_ALIGN_CENTER
}, 1, 150)
end) --secondary text ammo
end
end
render.PopFilterMag()
render.PopFilterMin()
end)

View file

@ -0,0 +1,242 @@
local surface = surface
local draw = draw
local LocalPlayer = LocalPlayer
local chair1 = Material("ror2hud/crosshair/dot.png")
local chairdash = Material("ror2hud/crosshair/hitline.png")
local chaircorner = Material("ror2hud/crosshair/bracket01.png")
local chaircircle = Material("ror2hud/crosshair/circle.png")
local chaircurve = Material("ror2hud/crosshair/arc.png")
local chairbox = Material("ror2hud/crosshair/squarebox.png")
local chaircursor = Material("ror2hud/crosshair/cursor.png")
local chairsprint = Material("ror2hud/crosshair/arrow.png")
local chairhit = Material("ror2hud/crosshair/hitline.png")
local plyvel = 10
local chairs = {
{ --commando (dynamic)
name = "Commando",
draw = function(csize)
surface.SetMaterial(chair1)
surface.DrawTexturedRectRotated(ScrW()/2, ScrH()/2, csize, csize, 0)
surface.SetMaterial(chairdash)
local dsize = csize * 1.74
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw-dsize, midh, dsize+1, dsize+2, 0)
surface.DrawTexturedRectRotated(midw+dsize, midh, dsize+1, dsize+2, 0)
surface.DrawTexturedRectRotated(midw, midh-dsize, dsize+1, dsize+2, 90)
surface.DrawTexturedRectRotated(midw, midh+dsize, dsize+1, dsize+2, 90)
end,
size = 15
},
{ --huntress (static)
name = "Huntress",
draw = function(csize)
surface.SetMaterial(chair1)
surface.DrawTexturedRect(ScrW()/2-(csize/2), ScrH()/2-(csize/2), csize, csize)
end,
size = 15
},
{ --mul-t (dynamic)
name = "Mul-T",
draw = function(csize)
local midw, midh = ScrW()/2, ScrH()/2
surface.SetMaterial(chair1)
surface.DrawTexturedRectRotated(midw, midh, csize, csize, 0)
surface.SetMaterial(chaircorner)
surface.DrawTexturedRectRotated(midw+csize, midh-csize, csize, csize, 0)
surface.DrawTexturedRectRotated(midw-csize, midh-csize, csize, csize, 90)
surface.DrawTexturedRectRotated(midw-csize, midh+csize, csize, csize, 180)
surface.DrawTexturedRectRotated(midw+csize, midh+csize, csize, csize, 270)
end,
size = 24
},
{ --mult-t 2 (static)
name = "Mul-T Rebar",
draw = function(csize)
surface.SetMaterial(chairsprint)
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw, midh+6, csize, csize, 0)
surface.DrawTexturedRectRotated(midw+6, midh, csize, csize, 90)
surface.DrawTexturedRectRotated(midw, midh-6, csize, csize, 180)
surface.DrawTexturedRectRotated(midw-6, midh, csize, csize, 270)
end,
size = 100
},
{ --artificer (dynamic)
name = "Artificer",
draw = function(csize)
surface.SetMaterial(chaircircle)
surface.SetDrawColor(255, 255, 255, 50)
local circsize = csize * 9
surface.DrawTexturedRect(ScrW()/2-(circsize/2), ScrH()/2-(circsize/2), circsize, circsize)
surface.SetMaterial(chaircurve)
surface.SetDrawColor(255, 255, 255, 255)
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw, midh-5, csize, csize*1.4, 0)
surface.DrawTexturedRectRotated(midw-5, midh, csize, csize*1.4, 90)
surface.DrawTexturedRectRotated(midw, midh+5, csize, csize*1.4, 180)
surface.DrawTexturedRectRotated(midw+5, midh, csize, csize*1.4, 270)
end,
size = 22
},
{ --rex (static)
name = "Rex",
draw = function(csize)
surface.SetMaterial(chair1)
surface.DrawTexturedRect(ScrW()/2-(csize/2), ScrH()/2-(csize/2), csize, csize)
surface.SetMaterial(chairdash)
local dsize = csize * 1.74
surface.DrawTexturedRect(ScrW()/2-(dsize/2)-26, ScrH()/2-(dsize/2)-1, dsize+1, dsize+2)
surface.DrawTexturedRect(ScrW()/2-(dsize/2)+26, ScrH()/2-(dsize/2)-1, dsize+1, dsize+2)
end,
size = 15
},
{ --loader (static)
name = "Loader",
draw = function(csize)
surface.SetMaterial(chair1)
surface.DrawTexturedRectRotated(ScrW()/2, ScrH()/2, csize, csize, 0)
surface.SetMaterial(chairbox)
surface.DrawTexturedRectRotated(ScrW()/2, ScrH()/2, csize*1.6, csize*1.6, 45)
surface.SetDrawColor(255, 255, 255, 120)
surface.SetMaterial(chaircurve)
local dsize = csize * 2.5
surface.DrawTexturedRectRotated(ScrW()/2-45, ScrH()/2, dsize, dsize*1.2, 90)
surface.DrawTexturedRectRotated(ScrW()/2+45, ScrH()/2, dsize, dsize*1.2, 270)
end,
size = 14
},
{ --acrid (static)
name = "Acrid",
draw = function(csize)
surface.SetMaterial(chair1)
surface.DrawTexturedRectRotated(ScrW()/2, ScrH()/2, csize, csize, 0)
surface.SetDrawColor(255, 255, 255, 220)
surface.SetMaterial(chaircurve)
local dsize = csize * 1
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw-6, midh, dsize, dsize*1.4, 90)
surface.DrawTexturedRectRotated(midw+6, midh, dsize, dsize*1.4, 270)
surface.DrawTexturedRectRotated(midw, midh+6, dsize, dsize*1.4, 180)
end,
size = 24
},
{ --misc. 1 (dynamic)
name = "Misc. 1",
draw = function(csize)
surface.SetMaterial(chair1)
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw, midh, csize, csize, 0)
surface.SetMaterial(chaircurve)
local dsize = csize * 1.74
surface.DrawTexturedRectRotated(midw, midh, dsize, dsize, RealTime()*400%360)
surface.DrawTexturedRectRotated(midw, midh, dsize, dsize, RealTime()*400%360+180)
surface.DrawTexturedRectRotated(midw, midh, dsize*2, dsize*2, -RealTime()*400%360)
surface.DrawTexturedRectRotated(midw, midh, dsize*2, dsize*2, -RealTime()*400%360+180)
end,
size = 14
},
{ --misc. 2 (dynamic)
name = "Misc. 2",
draw = function(csize)
surface.SetMaterial(chair1)
local midw, midh = ScrW()/2, ScrH()/2
surface.DrawTexturedRectRotated(midw, midh, csize, csize, 0)
surface.SetMaterial(chairsprint)
local dsize = csize * 6.74
plyvel = Lerp(10 * FrameTime(), plyvel, LocalPlayer():GetVelocity():Length()/4 + 10)
surface.DrawTexturedRectRotated(midw+plyvel, midh, dsize, dsize, 90)
surface.DrawTexturedRectRotated(midw-plyvel, midh, dsize, dsize, 270)
end,
size = 14
},
{ --misc. 3 (static)
name = "Misc. 3",
draw = function(csize)
local midw, midh = ScrW()/2, ScrH()/2
surface.SetMaterial(chairsprint)
surface.DrawTexturedRectRotated(midw+10, midh, csize, csize, 90)
surface.DrawTexturedRectRotated(midw-10, midh, csize, csize, 270)
local dsize = csize * 1.4
surface.DrawTexturedRectRotated(midw+50, midh, dsize, dsize, 90)
surface.DrawTexturedRectRotated(midw-50, midh, dsize, dsize, 270)
end,
size = 95
},
{ --misc. 4 (static)
name = "Misc. 4",
draw = function(csize)
render.PushFilterMag(0)
render.PushFilterMin(0)
surface.SetMaterial(chaircursor)
surface.DrawTexturedRect(ScrW()/2, ScrH()/2, 12, 19, 0)
render.PopFilterMag()
render.PopFilterMin()
end,
size = 1
},
["sprint"] = {
draw = function(csize)
surface.SetMaterial(chairsprint)
surface.DrawTexturedRect(ScrW()/2-(csize/2), ScrH()/2-(csize/2), csize, csize)
end,
size = 100
},
["hit"] = {
draw = function(csize)
surface.SetMaterial(chairhit)
surface.DrawTexturedRect(ScrW()/2-(csize/2), ScrH()/2-(csize/2), csize, csize)
end,
size = 152
}
}
local function DrawCrosshair(ctype)
surface.SetMaterial(ctype.mat)
surface.DrawTexturedRect(ScrW()/2-(ctype.size/2), ScrH()/2-(ctype.size/2), ctype.size, ctype.size)
end
local enabled_cvar = CreateClientConVar("ror2hud_crosshair_enabled", "1", true, false, "The RoR2 crosshairs are enabled.", 0, 1)
local sprint_enabled_cvar = CreateClientConVar("ror2hud_crosshair_sprint_enabled", "1", true, false, "Shows the sprint crosshair when sprinting.", 0, 1)
local ctype_cvar = CreateClientConVar("ror2hud_crosshair_type", "2", true, false, "Crosshair type.", 0, #chairs)
local filter_cvar = GetConVar("ror2hud_filter")
hook.Add("HUDShouldDraw", "RoR2HUDCrosshairDisableDefault", function(name)
if name == "CHudCrosshair" then return !enabled_cvar:GetBool() end
end)
hook.Add("HUDPaint", "RoR2HUDCrosshair", function()
if !enabled_cvar:GetBool() then return end
render.PushFilterMag(filter_cvar:GetInt())
render.PushFilterMin(filter_cvar:GetInt())
surface.SetDrawColor(255, 255, 255, 255)
local ctype = chairs[ctype_cvar:GetInt()]
--change to sprint crosshair if the player sprints
if LocalPlayer():IsSprinting() and LocalPlayer():GetVelocity():Length() > 0 and sprint_enabled_cvar:GetBool() then ctype = chairs["sprint"] end
if ctype then ctype.draw(ctype.size) end
render.PopFilterMag()
render.PopFilterMin()
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more