Preserve damage on stand up but for real this time

This commit is contained in:
toasterpanic 2026-05-25 17:50:23 -04:00
parent f5e9a8eb66
commit 5953d95fd4
3 changed files with 15 additions and 9 deletions

View file

@ -85,7 +85,7 @@ hook.Add("Think", "zcnpci", function()
((ent.organism.lleg >= 1) and (ent.organism.rleg >= 1)) or
ent.organism.llegamputated or
ent.organism.rlegamputated or
(ent.organism.consciousness <= 0.3) or
(ent.organism.consciousness <= 0.5) or
(ent.organism.pain > 90)
) then
local damage_info = DamageInfo()

View file

@ -69,7 +69,7 @@ local cv_anim_roll_impact_threshold = CreateConVar("zcnpci_falling_anim_roll_imp
local cv_anim_roll_playback_rate = CreateConVar("zcnpci_falling_anim_roll_playback_rate", "3.0", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Скорость воспроизведения анимации")
-- Down time
local minimum_down_time = CreateConVar("zcnpci_down_time", "5", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Down time!!!!!!!!!")
local minimum_down_time = CreateConVar("zcnpci_down_time", "8", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Down time!!!!!!!!!")
--[[-------------------------------------------------------------------------
Tug function
@ -254,7 +254,7 @@ function MODULE:PhysicsSimulate(phys, dt)
-- If the NPC is dead, they probably aren't coming back; don't bother bringing them back to life
self:Remove()
return false -- Cut the bullshit
elseif (target.organism.consciousness <= 0.3) or ((target.organism.lleg >= 1) and (target.organism.rleg >= 1)) then
elseif (target.organism.consciousness <= 0.3) or ((target.organism.lleg >= 0.85) and (target.organism.rleg >= 0.85)) then
self.StartDie = cur_time
return false
end
@ -282,13 +282,22 @@ function MODULE:PhysicsSimulate(phys, dt)
ent:Spawn()
ent.organism = table.Copy(target.organism)
timer.Simple(0, function()
hg.organism.Add(ent)
table.Merge(ent.organism, target.organism)
ent.organism.alive = true
ent.organism.owner = ent
ent:CallOnRemove("organism", hg.organism.Remove, ent)
hg.send_bareinfo(ent.organism)
target:Remove()
end)
self.StopProcessing = true
self:Remove()
target:Remove()
return false
end

View file

@ -35,9 +35,6 @@ local cv_anim_roll_duration = CreateConVar("zcnpci_falling_anim_roll_duration",
local cv_anim_roll_impact_threshold = CreateConVar("zcnpci_falling_anim_roll_impact_threshold", "300", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Мин. скорость удара для запуска анимации")
local cv_anim_roll_playback_rate = CreateConVar("zcnpci_falling_anim_roll_playback_rate", "3.0", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Скорость воспроизведения анимации")
-- Down time
local minimum_down_time = CreateConVar("zcnpci_down_time", "5", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Down time!!!!!!!!!")
-- Do it!
function MODULE:DoTwitch()