From ef39e62e39af7d042850b3475e5f61b55e0e51cb Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 29 Jul 2020 02:11:14 +0300 Subject: [PATCH] Makes bloodsucker death not spam now actually working --- code/modules/antagonists/bloodsucker/bloodsucker_life.dm | 8 +++++--- code/modules/antagonists/bloodsucker/datum_bloodsucker.dm | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm index 47a98623db..208b1be87b 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm @@ -13,7 +13,7 @@ /datum/antagonist/bloodsucker/proc/LifeTick()// Should probably run from life.dm, same as handle_changeling, but will be an utter pain to move set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side. var/notice_healing - while(owner && !AmFinalDeath()) // owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) == src + while(owner && !AmFinalDeath()) if(owner.current.stat == CONSCIOUS && !poweron_feed && !HAS_TRAIT(owner.current, TRAIT_FAKEDEATH)) // Deduct Blood AddBloodVolume(passive_blood_drain) // -.1 currently if(HandleHealing(1)) // Heal @@ -272,13 +272,15 @@ /datum/antagonist/bloodsucker/AmFinalDeath() return owner && owner.AmFinalDeath() -/datum/antagonist/changeling/AmFinalDeath() - return owner && owner.AmFinalDeath() /datum/mind/proc/AmFinalDeath() return !current || QDELETED(current) || !isliving(current) || isbrain(current) || !get_turf(current) // NOTE: "isliving()" is not the same as STAT == CONSCIOUS. This is to make sure you're not a BORG (aka silicon) /datum/antagonist/bloodsucker/proc/FinalDeath() + //Dont bother if we are already supposed to be dead + if(FinalDeath) + return + FinalDeath = TRUE //We are now supposed to die. Lets not spam it. if(!iscarbon(owner.current)) //Check for non carbons. owner.current.gib() return diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm index 888db8193b..d732742e51 100644 --- a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -37,6 +37,7 @@ var/had_toxlover var/level_bloodcost var/passive_blood_drain = -0.1 //The amount of blood we loose each bloodsucker life() tick + var/FinalDeath //Have we reached final death? Used to prevent spam. // LISTS var/static/list/defaultTraits = list (TRAIT_STABLEHEART, TRAIT_NOBREATH, TRAIT_SLEEPIMMUNE, TRAIT_NOCRITDAMAGE, TRAIT_RESISTCOLD, TRAIT_RADIMMUNE, TRAIT_NIGHT_VISION, \ TRAIT_NOSOFTCRIT, TRAIT_NOHARDCRIT, TRAIT_AGEUSIA, TRAIT_COLDBLOODED, TRAIT_NONATURALHEAL, TRAIT_NOMARROW, TRAIT_NOPULSE, TRAIT_VIRUSIMMUNE, TRAIT_NODECAP, TRAIT_NOGUT) @@ -683,6 +684,8 @@ owner.current.hud_used.sunlight_display.invisibility = INVISIBILITY_ABSTRACT /datum/antagonist/bloodsucker/proc/update_hud(updateRank=FALSE) + if(FinalDeath) + return // No Hud? Get out. if(!owner.current.hud_used) return