From 1303bd0868d2a27895701312690fc2c35956da20 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sat, 2 Mar 2024 22:17:26 +0300 Subject: [PATCH] Ports a couple of of misc fixes (#2218) * Ports some borer fixes * Update cortical_borer_abilities.dm * Prosperity prism healing is now forced, because magic * It should really be happening when the organ is inserted/removed (or deleted) * Whoops, missed these * And these * Update modular_nova/modules/cortical_borer/code/cortical_borer_abilities.dm Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- .../code/structures/prosperity_prism.dm | 10 +++++----- .../modules/cortical_borer/code/cortical_borer.dm | 15 +++++++++++++-- .../code/cortical_borer_abilities.dm | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/modular_nova/modules/clock_cult/code/structures/prosperity_prism.dm b/modular_nova/modules/clock_cult/code/structures/prosperity_prism.dm index 6d085454a79..340bd8d77a6 100644 --- a/modular_nova/modules/clock_cult/code/structures/prosperity_prism.dm +++ b/modular_nova/modules/clock_cult/code/structures/prosperity_prism.dm @@ -26,11 +26,11 @@ continue if(use_power(POWER_PER_USE)) - possible_cultist.adjustToxLoss(-2.5 * seconds_per_tick) - possible_cultist.adjustStaminaLoss(-7.5 * seconds_per_tick) - possible_cultist.adjustBruteLoss(-2.5 * seconds_per_tick) - possible_cultist.adjustFireLoss(-2.5 * seconds_per_tick) - possible_cultist.adjustOxyLoss(-2.5 * seconds_per_tick) + possible_cultist.adjustToxLoss(-2.5 * seconds_per_tick, forced = TRUE) + possible_cultist.adjustStaminaLoss(-7.5 * seconds_per_tick, forced = TRUE) + possible_cultist.adjustBruteLoss(-2.5 * seconds_per_tick, forced = TRUE) + possible_cultist.adjustFireLoss(-2.5 * seconds_per_tick, forced = TRUE) + possible_cultist.adjustOxyLoss(-2.5 * seconds_per_tick, forced = TRUE) new /obj/effect/temp_visual/heal(get_turf(possible_cultist), "#45dd8a") diff --git a/modular_nova/modules/cortical_borer/code/cortical_borer.dm b/modular_nova/modules/cortical_borer/code/cortical_borer.dm index d77025e6853..56cca920a0c 100644 --- a/modular_nova/modules/cortical_borer/code/cortical_borer.dm +++ b/modular_nova/modules/cortical_borer/code/cortical_borer.dm @@ -48,6 +48,8 @@ GLOBAL_LIST_EMPTY(cortical_borers) /obj/item/organ/internal/borer_body/Destroy() borer = null + if(owner && HAS_TRAIT_FROM(owner, TRAIT_WEATHER_IMMUNE, "borer_in_host")) + REMOVE_TRAIT(owner, TRAIT_WEATHER_IMMUNE, "borer_in_host") return ..() /obj/item/organ/internal/borer_body/Insert(mob/living/carbon/carbon_target, special, movement_flags) @@ -55,6 +57,7 @@ GLOBAL_LIST_EMPTY(cortical_borers) for(var/datum/borer_focus/body_focus as anything in borer.body_focuses) body_focus.on_add() carbon_target.apply_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type) + ADD_TRAIT(carbon_target, TRAIT_WEATHER_IMMUNE, "borer_in_host") //on removal, force the borer out /obj/item/organ/internal/borer_body/Remove(mob/living/carbon/carbon_target, special) @@ -65,6 +68,7 @@ GLOBAL_LIST_EMPTY(cortical_borers) if(cb_inside) cb_inside.leave_host() carbon_target.remove_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type) + REMOVE_TRAIT(carbon_target, TRAIT_WEATHER_IMMUNE, "borer_in_host") qdel(src) /obj/item/reagent_containers/borer @@ -245,7 +249,13 @@ GLOBAL_LIST_EMPTY(cortical_borers) do_evolution(/datum/borer_evolution/base) /mob/living/basic/cortical_borer/Destroy() - human_host = null + if(human_host) + if(human_host.organs) + var/obj/item/organ/internal/borer_body/borer_organ = locate() in human_host.organs + borer_organ.Remove(human_host) + if(HAS_TRAIT_FROM(human_host, TRAIT_WEATHER_IMMUNE, "borer_in_host")) + REMOVE_TRAIT(human_host, TRAIT_WEATHER_IMMUNE, "borer_in_host") + human_host = null GLOB.cortical_borers -= src QDEL_NULL(reagent_holder) return ..() @@ -260,7 +270,8 @@ GLOBAL_LIST_EMPTY(cortical_borers) deathgasp_once = TRUE for(var/borers in GLOB.cortical_borers) to_chat(borers, span_boldwarning("[src] has left the hivemind forcibly!")) - QDEL_NULL(reagent_holder) + if(gibbed) + QDEL_NULL(reagent_holder) return ..() //so we can add some stuff to status, making it easier to read... maybe some hud some day diff --git a/modular_nova/modules/cortical_borer/code/cortical_borer_abilities.dm b/modular_nova/modules/cortical_borer/code/cortical_borer_abilities.dm index 790d3f07c22..96eeba9e478 100644 --- a/modular_nova/modules/cortical_borer/code/cortical_borer_abilities.dm +++ b/modular_nova/modules/cortical_borer/code/cortical_borer_abilities.dm @@ -509,6 +509,8 @@ borer_organ.Remove(cortical_owner.human_host) cortical_owner.forceMove(human_turfone) cortical_owner.human_host = null + if(HAS_TRAIT_FROM(cortical_owner, TRAIT_WEATHER_IMMUNE, "borer_in_host")) + REMOVE_TRAIT(cortical_owner, TRAIT_WEATHER_IMMUNE, "borer_in_host") StartCooldown() return @@ -572,6 +574,8 @@ var/logging_text = "[key_name(cortical_owner)] went into [key_name(cortical_owner.human_host)] at [loc_name(human_turftwo)]" cortical_owner.log_message(logging_text, LOG_GAME) cortical_owner.human_host.log_message(logging_text, LOG_GAME) + if(!HAS_TRAIT_FROM(cortical_owner, TRAIT_WEATHER_IMMUNE, "borer_in_host")) // if somehow we didn't get a borer organ? + ADD_TRAIT(cortical_owner, TRAIT_WEATHER_IMMUNE, "borer_in_host") StartCooldown() /// Checks if the target's head is bio protected, returns true if this is the case