Skip to content

Commit 51003b8

Browse files
committed
Added "Allow Custom NPC Skins" option + GoldSrc Corpse Fix
1 parent 2ce543d commit 51003b8

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

lua/autorun/vj_hlr_autorun.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ if VJExists == true then
443443
local colorYellow = VJ_Color2Byte(Color(255, 221, 35))
444444
local colorRed = VJ_Color2Byte(Color(130, 19, 10))
445445
hook.Add("EntityTakeDamage", "VJ_HLR_EntityTakeDamage", function(target, dmginfo)
446-
if target.HLR_Corpse && !target.Dead && CurTime() > target.HLR_Corpse_StartT then
446+
if target.HLR_Corpse && !target.Dead && CurTime() > target.HLR_Corpse_StartT && target:GetColor().a > 50 then
447447
local dmgForce = dmginfo:GetDamageForce()
448448

449449
-- Blood hit effects & decals
@@ -471,6 +471,7 @@ if VJExists == true then
471471
end
472472
end
473473

474+
-- Damage & Gibs
474475
if GetConVar("vj_hlr1_corpse_gibbable"):GetInt() == 1 && !dmginfo:IsBulletDamage() && target.HLR_Corpse_Gibbable then
475476
local noDamage = false
476477
local dmgType = dmginfo:GetDamageType()
@@ -618,6 +619,7 @@ VJ.AddConVar("vj_hlr1_osprey_deploysoldiers", 1, {FCVAR_ARCHIVE})
618619
VJ.AddConVar("vj_hlr1_assassin_cloaks", 1, {FCVAR_ARCHIVE})
619620
-- Source
620621
VJ.AddConVar("vj_hlr2_merkava_gunner", 1, {FCVAR_ARCHIVE})
622+
VJ.AddConVar("vj_hlr2_custom_skins", 1, {FCVAR_ARCHIVE})
621623

622624
VJ.AddConVar("vj_hlr_autoreplace", 0, {FCVAR_ARCHIVE, FCVAR_NOTIFY})
623625
VJ.AddConVar("vj_hlr_autoreplace_hl1", 1, {FCVAR_ARCHIVE, FCVAR_NOTIFY})
@@ -637,7 +639,7 @@ if CLIENT then
637639
return
638640
end
639641
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
640-
Panel:AddControl("Button", {Text = "#vjbase.menu.general.reset.everything", Command = "vj_hlr1_gonarch_babylimit 20\nvj_hlr1_bradley_deploygrunts 1\nvj_hlr1_osprey_deploysoldiers 1\nvj_hlr2_merkava_gunner 1\nvj_hlr1_assassin_cloaks 1\nvj_hlr1_corpse_effects 1\n vj_hlr1_corpse_gibbable 1"})
642+
Panel:AddControl("Button", {Text = "#vjbase.menu.general.reset.everything", Command = "vj_hlr1_gonarch_babylimit 20\nvj_hlr1_bradley_deploygrunts 1\nvj_hlr1_osprey_deploysoldiers 1\nvj_hlr2_merkava_gunner 1\nvj_hlr1_assassin_cloaks 1\nvj_hlr1_corpse_effects 1\nvj_hlr1_corpse_gibbable 1\nvj_hlr2_custom_skins 1"})
641643
Panel:AddControl( "Label", {Text = "GoldSrc Engine:"})
642644
Panel:AddControl("Checkbox", {Label = "Corpses Create Effects & Decals", Command = "vj_hlr1_corpse_effects"})
643645
Panel:AddControl("Checkbox", {Label = "Corpses Can Be Dismembered", Command = "vj_hlr1_corpse_gibbable"})
@@ -647,6 +649,8 @@ if CLIENT then
647649
Panel:AddControl("Slider", {Label = "Gonarch Baby Headcrab Limit", min = 0, max = 100, Command = "vj_hlr1_gonarch_babylimit"})
648650
Panel:AddControl( "Label", {Text = "Source Engine:"})
649651
Panel:AddControl("Checkbox", {Label = "Merkava Spawns With a Gunner", Command = "vj_hlr2_merkava_gunner"})
652+
Panel:AddControl("Checkbox", {Label = "Allow Custom NPC Skins", Command = "vj_hlr2_custom_skins"})
653+
Panel:ControlHelp("Ex: Custom skins for Rebels & Refugees")
650654
end)
651655

652656
spawnmenu.AddToolMenuOption("DrVrej", "SNPC Configures", "HL Resurgence (AutoReplace)", "HL Resurgence (AutoReplace)", "", "", function(Panel)

lua/entities/npc_vj_hlr1_hgrunt/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ function ENT:CustomOnThink()
381381
end
382382
end
383383

384+
-- Rappelling System
384385
if self.HECU_Rappelling && !self.Dead then
385386
-- If it's on ground then stop rappelling!
386387
if self:IsOnGround() then
@@ -403,7 +404,7 @@ function ENT:CustomOnThink()
403404
end
404405
self:HECU_CustomOnThink()
405406

406-
-- Hurt walking
407+
-- Hurt Walking
407408
if self.HECU_CanHurtWalk && self:Health() <= (self:GetMaxHealth() / 2.2) then
408409
if !self.HECU_UsingHurtWalk then
409410
self.AnimTbl_Walk = {ACT_WALK_HURT}

lua/entities/npc_vj_hlr1_xen_cannon/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function ENT:CustomRangeAttackCode()
9191
//local endPos = (self:GetEnemy():GetPos() + self:GetEnemy():OBBCenter()) + attach.Ang:Forward()*20000 - Vector(0, 0, 10)
9292
local tr = util.TraceLine({
9393
start = startPos,
94-
endpos = self:GetEnemy():GetPos() + self:GetEnemy():OBBCenter() + VectorRand(-5, 5),
94+
endpos = self:GetEnemy():GetPos() + self:GetEnemy():OBBCenter() + VectorRand(-15, 15),
9595
filter = {self} // self.extmdl
9696
})
9797
local hitPos = tr.HitPos

lua/entities/npc_vj_hlr2_rebel/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function ENT:CustomOnInitialize()
211211
end
212212

213213
-- Set different clothing --
214-
-- For Engineers
214+
-- For Engineers (Always have custom skin!)
215215
if self.Human_Type == 1 then
216216
for k, v in ipairs(self:GetMaterials()) do
217217
-- Female Engineer
@@ -224,7 +224,8 @@ function ENT:CustomOnInitialize()
224224
self:SetSubMaterial(k - 1, "models/hl_resurgence/hl2/humans/male/group03/citizen_sheet_engineer")
225225
end
226226
end
227-
else
227+
-- Set custom skins (If enabled!)
228+
elseif GetConVar("vj_hlr2_custom_skins"):GetInt() == 1 then
228229
local rand_refugee = math.random(1, 2)
229230
local rand_rebel = math.random(1, 7)
230231
for k, v in ipairs(self:GetMaterials()) do

0 commit comments

Comments
 (0)