Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor adjustments to health thrower, reduced medic rpg ammo cost to 15 #156

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions gamemodes/horde/entities/effects/medic_flame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function EFFECT:Init(data)
has_burner = true
end

if data:GetEntity():IsValid() && Startpos && Hitpos then
if data:GetEntity():IsValid() and Startpos and Hitpos then
self.Emitter = ParticleEmitter(Startpos)


Expand All @@ -32,18 +32,18 @@ function EFFECT:Init(data)
end)
end

for i = 1, 2 do
local p = self.Emitter:Add("particles/smokey", Startpos)
p:SetDieTime(1.5)
p:SetStartAlpha(50)
p:SetEndAlpha(0)
p:SetStartSize(math.Rand(2, 4))
p:SetEndSize(math.random(70, 90))
p:SetRoll(math.random(-10, 10))
p:SetRollDelta(math.random(-10, 10))
p:SetVelocity(((Hitpos - Startpos):GetNormal() * math.random(500, 800)) + VectorRand() * math.random(1, 60) + Vector(0,0,20))
p:SetCollide(true)
p:SetColor(40, 40, 40)
for e = 1, 2 do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if e isn't used replace it with _

local g = self.Emitter:Add("particles/smokey", Startpos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of g this can be something like particle, no need for 1 char vars. it just makes the code harder to read.

g:SetDieTime(1.5)
g:SetStartAlpha(50)
g:SetEndAlpha(0)
g:SetStartSize(math.Rand(2, 4))
g:SetEndSize(math.random(70, 90))
g:SetRoll(math.random(-10, 10))
g:SetRollDelta(math.random(-10, 10))
g:SetVelocity(((Hitpos - Startpos):GetNormal() * math.random(500, 800)) + VectorRand() * math.random(1, 60) + Vector(0,0,20))
g:SetCollide(true)
g:SetColor(40, 40, 40)
end

self.Emitter:Finish()
Expand Down
15 changes: 4 additions & 11 deletions gamemodes/horde/entities/effects/medic_flame_explosion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function EFFECT:Init(data)
has_burner = true
end
local light = DynamicLight( math.random( 0, 9999999 ) )
if(light) then
if (light) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the useless parentheses here

if has_burner then
light.R = 0;
light.G = 132;
Expand All @@ -19,7 +19,7 @@ function EFFECT:Init(data)
light.Size = 128;
light.Decay = 64;
light.Brightness = 3;
light.DieTime = CurTime()+1;
light.DieTime = CurTime() + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ; can entirely be removed

end

local DrawFlame = 1
Expand All @@ -28,7 +28,7 @@ function EFFECT:Init(data)

local FlameEmitter = ParticleEmitter(data:GetOrigin())

for i=0, 16 do
for i = 0, 16 do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i isn't used replace it with _

if !FlameEmitter then return end
local FlameParticle = FlameEmitter:Add("particles/flamelet1", data:GetOrigin() )

Expand All @@ -38,23 +38,16 @@ function EFFECT:Init(data)
else
FlameParticle:SetColor(105, 255, 50)
end

FlameParticle:SetVelocity( VectorRand() * 172 )

FlameParticle:SetLifeTime(0)
FlameParticle:SetDieTime(0.72)

FlameParticle:SetStartAlpha(210)
FlameParticle:SetStartAlpha(150)
FlameParticle:SetEndAlpha(0)

FlameParticle:SetStartSize(0)
FlameParticle:SetEndSize(64 * (data:GetScale() or 1))

FlameParticle:SetRoll(math.Rand(-210, 210))
FlameParticle:SetRollDelta(math.Rand(-3.2, 3.2))

FlameParticle:SetAirResistance(350)

FlameParticle:SetGravity(Vector(0, 0, 64))

end
Expand Down
16 changes: 13 additions & 3 deletions gamemodes/horde/entities/weapons/arccw_horde_medic_rpg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ SWEP.Animations = {
Time = 0.5,
ShellEjectAt = 0,
RestoreAmmo = 1,
SoundTable = { { s = "", p = 100, v = 75, t = 0.1, c = CHAN_ITEM, ind = 1, bg = 1, } },
},
["fire_iron"] = {
Source = "shoot",
Time = 0.5,
ShellEjectAt = 0,
SoundTable = { { s = "", p = 100, v = 75, t = 0.1, c = CHAN_ITEM, ind = 1, bg = 1, } },
},
["reload"] = {
Source = "reload",
Expand All @@ -179,9 +177,21 @@ SWEP.Animations = {
LHIK = true,
LHIKIn = 0.5,
LHIKOut = 0.2,
SoundTable = { { s = "", p = 100, v = 75, t = 1.8, c = CHAN_ITEM, ind = 1, bg = 0, }, },
},
}
if CLIENT then
SWEP.Hook_ModifyBodygroups = function(wep, data)
local vm = data.vm
if not IsValid(vm) then return end
if wep:Clip1() > 0 then
-- loaded
vm:SetBodygroup(1, 0)
else
-- Empty
vm:SetBodygroup(1, 1)
end
end
end

SWEP.ViewModelBoneMods = {
-- ["missile"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) }
Expand Down
5 changes: 2 additions & 3 deletions gamemodes/horde/entities/weapons/horde_healingthrower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ SWEP.Slot = 3

SWEP.HoldType = "smg"
SWEP.Primary.Automatic = true
SWEP.Primary.ClipSize = 100
SWEP.Primary.DefaultClip = 100
SWEP.Primary.ClipSize = 75
SWEP.Primary.DefaultClip = 75
SWEP.Primary.Ammo = "horde_m2_flamethrower"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
Expand Down Expand Up @@ -68,7 +68,6 @@ function SWEP:PrimaryAttack()
owner:MuzzleFlash()
self:SetNextPrimaryFire( CurTime() + self.Delay )
if SERVER then
local eyetrace = owner:GetEyeTrace()
local tracedata = {}
tracedata.start = owner:GetShootPos()
tracedata.endpos = owner:GetShootPos() + (owner:GetAimVector() * 500)
Expand Down
6 changes: 3 additions & 3 deletions gamemodes/horde/gamemode/sh_item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,11 @@ function HORDE:GetDefaultItemsData()
HORDE:CreateItem("Special", "Hivehand", "horde_hivehand", 2000, 5, "Organic weapon used by Xen soldiers.\nHas infinite ammo.\nPrimary fire generates homing ricocheting shots.\nSecondary fire rapidly unloads the entire weapon.",
{Engineer=true}, 2, -1, nil, nil, {Engineer=4}, nil, {HORDE.DMG_BALLISTIC})
HORDE:CreateItem("Special", "Spore Launcher", "horde_spore_launcher", 1750, 6, "Improvised biological weapon.\nShoots out acidic projectiles that explodes after a short delay.\nHeals players and damages enemies.",
{Medic=true, Survivor=true}, 15, -1, nil, nil, {Medic=2, Survivor=2}, nil, {HORDE.DMG_POISON})
{Medic=true, Survivor=true}, 10, -1, nil, nil, {Medic=2, Survivor=2}, nil, {HORDE.DMG_POISON})
HORDE:CreateItem("Special", "M2 Health Thrower", "horde_healingthrower", 3000, 7, "M2-2 Health Thrower.\nAn American man-portable backpack flamethrower converted to heal stuff to death.\nsmells faintly of lime and mint (who hurt you)",
{Medic=true}, 30, -1, nil, nil, nil, nil, {HORDE.DMG_POISON})
{Medic=true}, 35, -1, nil, nil, nil, nil, {HORDE.DMG_POISON})
HORDE:CreateItem("Explosive", "Medic RPG", "arccw_horde_medic_rpg", 3000, 8, "Medic Missile.\nAnti-Death Rocket Propelled Grenade \nmade in the Gamestop ventilation of an abandoned mall. \nnot to be confused with the infamous magic missile.",
{Medic=true}, 20, -1, nil, nil, nil, nil, {HORDE.DMG_POISON})
{Medic=true}, 15, -1, nil, nil, nil, nil, {HORDE.DMG_POISON})

HORDE:CreateItem("Explosive", "Raygun", "arccw_horde_raygun", 3000, 8, "Raygun. \nFires explosive electric bolts that deal Lightning damage.",
{Warden=true}, 40, -1, nil, nil, nil, nil, {HORDE.DMG_LIGHTNING})
Expand Down