From e75d1a19628dc8987a8d1eb557ba820078de7f9c Mon Sep 17 00:00:00 2001 From: Putnam Date: Mon, 7 Sep 2020 02:00:22 -0700 Subject: [PATCH] Signalizes ling/bloodsucker life code. --- code/__DEFINES/dcs/signals.dm | 4 ++++ .../bloodsucker/datum_bloodsucker.dm | 4 +++- .../antagonists/changeling/changeling.dm | 5 ++++ code/modules/mob/living/carbon/life.dm | 24 +------------------ code/modules/mob/living/life.dm | 2 ++ 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 8efb2617bd..4acfdb3218 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -288,6 +288,10 @@ #define COMPONENT_INTERRUPT_LIFE_BIOLOGICAL 1 // interrupt biological processes #define COMPONENT_INTERRUPT_LIFE_PHYSICAL 2 // interrupt physical handling +#define COMSIG_LIVING_BIOLOGICAL_LIFE "biological_life" //from base of mob/living/BiologicalLife() (seconds, times_fired) + +#define COMSIG_LIVING_PHYSICAL_LIFE "physical_life" //from base of mob/living/PhysicalLife() (seconds, times_fired) + // /mob/living/carbon physiology signals #define COMSIG_CARBON_GAIN_WOUND "carbon_gain_wound" //from /datum/wound/proc/apply_wound() (/mob/living/carbon/C, /datum/wound/W, /obj/item/bodypart/L) #define COMSIG_CARBON_LOSE_WOUND "carbon_lose_wound" //from /datum/wound/proc/remove_wound() (/mob/living/carbon/C, /datum/wound/W, /obj/item/bodypart/L) diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm index 1fcffff810..5af2a49b1b 100644 --- a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -138,7 +138,7 @@ if(owner.current.gender == MALE) if(prob(10)) // Gender override bloodsucker_reputation = pick("King of the Damned", "Blood King", "Emperor of Blades", "Sinlord", "God-King") - else + else if(owner.current.gender == FEMALE) if(prob(10)) // Gender override bloodsucker_reputation = pick("Queen of the Damned", "Blood Queen", "Empress of Blades", "Sinlady", "God-Queen") @@ -341,10 +341,12 @@ //This handles the application of antag huds/special abilities /datum/antagonist/bloodsucker/apply_innate_effects(mob/living/mob_override) + RegisterSignal(owner.current,COMSIG_LIVING_BIOLOGICAL_LIFE,.proc/LifeTick) return //This handles the removal of antag huds/special abilities /datum/antagonist/bloodsucker/remove_innate_effects(mob/living/mob_override) + UnregisterSignal(owner.current,COMSIG_LIVING_BIOLOGICAL_LIFE) return //Assign default team and creates one for one of a kind team antagonists diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index d06ebe9d9d..0f3f6d872a 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -94,6 +94,7 @@ B.decoy_override = FALSE remove_changeling_powers() owner.special_role = null + owner.current.hud_used?.lingchemdisplay?.invisibility = INVISIBILITY_ABSTRACT . = ..() /datum/antagonist/changeling/proc/remove_clownmut() @@ -225,6 +226,8 @@ else //not dead? no chem/geneticdamage caps. chem_charges = min(max(0, chem_charges + chem_recharge_rate - chem_recharge_slowdown), chem_storage) geneticdamage = max(0, geneticdamage-1) + owner.current.hud_used?.lingchemdisplay?.invisibility = 0 + owner.current.hud_used?.lingchemdisplay?.maptext = "
[round(changeling.chem_charges)]
" /datum/antagonist/changeling/proc/get_dna(dna_owner) @@ -357,10 +360,12 @@ B.organ_flags &= ~ORGAN_VITAL B.decoy_override = TRUE update_changeling_icons_added() + RegisterSignal(owner.current,COMSIG_LIVING_BIOLOGICAL_LIFE,.proc/regenerate) return /datum/antagonist/changeling/remove_innate_effects() update_changeling_icons_removed() + UnregisterSignal(owner.current,COMSIG_LIVING_BIOLOGICAL_LIFE) return diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index e29c6b9ffe..8f181d47fd 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -1,8 +1,4 @@ /mob/living/carbon/BiologicalLife(seconds, times_fired) - //Updates the number of stored chemicals for powers - handle_changeling() - //Handles the unique mentabolism of bloodsuckers, look at /datum/antagonist/bloodsucker/proc/LifeTick() - handle_bloodsucker() //Reagent processing needs to come before breathing, to prevent edge cases. handle_organs() . = ..() // if . is false, we are dead. @@ -410,25 +406,7 @@ for(var/thing in all_wounds) var/datum/wound/W = thing if(W.processes) // meh - W.handle_process() - -//todo generalize this and move hud out -/mob/living/carbon/proc/handle_changeling() - if(mind && hud_used && hud_used.lingchemdisplay) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling) - changeling.regenerate() - hud_used.lingchemdisplay.invisibility = 0 - hud_used.lingchemdisplay.maptext = "
[round(changeling.chem_charges)]
" - else - hud_used.lingchemdisplay.invisibility = INVISIBILITY_ABSTRACT - - -/mob/living/carbon/proc/handle_bloodsucker() - if(mind && AmBloodsucker(src)) - var/datum/antagonist/bloodsucker/B = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) - B.LifeTick() - + W.handle_process() /mob/living/carbon/handle_mutations_and_radiation() if(dna && dna.temporary_mutations.len) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 89321082c9..9de75702db 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -43,6 +43,7 @@ * Returns TRUE or FALSE based on if we were interrupted. This is used by overridden variants to check if they should stop. */ /mob/living/proc/BiologicalLife(seconds, times_fired) + SEND_SIGNAL(src,COMSIG_LIVING_BIOLOGICAL_LIFE, seconds, times_fired) handle_diseases()// DEAD check is in the proc itself; we want it to spread even if the mob is dead, but to handle its disease-y properties only if you're not. handle_wounds() @@ -78,6 +79,7 @@ * Returns TRUE or FALSE based on if we were interrupted. This is used by overridden variants to check if they should stop. */ /mob/living/proc/PhysicalLife(seconds, times_fired) + SEND_SIGNAL(src,COMSIG_LIVING_PHYSICAL_LIFE, seconds, times_fired) if(digitalinvis) handle_diginvis() //AI becomes unable to see mob