mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Allows Fully Heal to be passed a series of flags, fixes Adminordrazine being horrible (#71123)
## About The Pull Request - Fully heal can be passed a series of flags detailing what all is healed by the proc. This allows for things to provide almost-but-not-quite fully heals. - Uses this in Adminordrazine, so that it stops being a pain to update every time fully heal is updated. This includes some small balance changes which i'll go over, nothing extremely noticable. ## Why It's Good For The Game Allows for more precise control over full heals. ## Changelog 🆑 Melbert refactor: Fully heal can be passed a series of flags. As a result, some things which previously did a full heal might heal slightly less, or some things which did partial full heals might do slightly more. fix: Adminordrazine will no longer completely break every facet of a person admin: Ahealing a changeling will refill all of their chems. /🆑
This commit is contained in:
@@ -141,7 +141,7 @@
|
||||
*
|
||||
* If our lich's mob is revived at some point before returning, stop the timer
|
||||
*/
|
||||
/datum/component/phylactery/proc/stop_timer(mob/living/source, full_heal, admin_revive)
|
||||
/datum/component/phylactery/proc/stop_timer(mob/living/source, full_heal_flags)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
deltimer(revive_timer)
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
var/atom/movable/screen/alert/status_effect/linked_alert
|
||||
/// Used to define if the status effect should be using SSfastprocess or SSprocessing
|
||||
var/processing_speed = STATUS_EFFECT_FAST_PROCESS
|
||||
/// Do we self-terminate when a fullheal is called?
|
||||
var/remove_on_fullheal = FALSE
|
||||
/// If remove_on_fullheal is TRUE, what flag do we need to be removed?
|
||||
var/heal_flag_necessary = HEAL_STATUS
|
||||
|
||||
/datum/status_effect/New(list/arguments)
|
||||
on_creation(arglist(arguments))
|
||||
@@ -39,6 +43,7 @@
|
||||
return
|
||||
if(owner)
|
||||
LAZYADD(owner.status_effects, src)
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_effect_on_heal))
|
||||
|
||||
if(duration != -1)
|
||||
duration = world.time + duration
|
||||
@@ -53,7 +58,7 @@
|
||||
switch(processing_speed)
|
||||
if(STATUS_EFFECT_FAST_PROCESS)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
if (STATUS_EFFECT_NORMAL_PROCESS)
|
||||
if(STATUS_EFFECT_NORMAL_PROCESS)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
return TRUE
|
||||
@@ -62,13 +67,14 @@
|
||||
switch(processing_speed)
|
||||
if(STATUS_EFFECT_FAST_PROCESS)
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
if (STATUS_EFFECT_NORMAL_PROCESS)
|
||||
if(STATUS_EFFECT_NORMAL_PROCESS)
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
if(owner)
|
||||
linked_alert = null
|
||||
owner.clear_alert(id)
|
||||
LAZYREMOVE(owner.status_effects, src)
|
||||
on_remove()
|
||||
UnregisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL)
|
||||
owner = null
|
||||
return ..()
|
||||
|
||||
@@ -137,6 +143,16 @@
|
||||
/datum/status_effect/proc/nextmove_adjust()
|
||||
return 0
|
||||
|
||||
/// Signal proc for [COMSIG_LIVING_POST_FULLY_HEAL] to remove us on fullheal
|
||||
/datum/status_effect/proc/remove_effect_on_heal(datum/source, heal_flags)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!remove_on_fullheal)
|
||||
return
|
||||
|
||||
if(!heal_flag_necessary || (heal_flags & heal_flag_necessary))
|
||||
qdel(src)
|
||||
|
||||
/// Alert base type for status effect alerts
|
||||
/atom/movable/screen/alert/status_effect
|
||||
name = "Curse of Mundanity"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
|
||||
/datum/status_effect/wish_granters_gift/on_remove()
|
||||
owner.revive(full_heal = TRUE, admin_revive = TRUE)
|
||||
owner.revive(ADMIN_HEAL_ALL)
|
||||
owner.visible_message(span_warning("[owner] appears to wake from the dead, having healed all wounds!"), span_notice("You have regenerated."))
|
||||
|
||||
|
||||
@@ -146,22 +146,38 @@
|
||||
//Being on fire will suppress this healing
|
||||
/datum/status_effect/fleshmend
|
||||
id = "fleshmend"
|
||||
duration = 100
|
||||
duration = 10 SECONDS
|
||||
alert_type = /atom/movable/screen/alert/status_effect/fleshmend
|
||||
|
||||
/datum/status_effect/fleshmend/on_apply()
|
||||
. = ..()
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/carbon_owner = owner
|
||||
QDEL_LAZYLIST(carbon_owner.all_scars)
|
||||
|
||||
RegisterSignal(owner, COMSIG_LIVING_IGNITED, PROC_REF(on_ignited))
|
||||
RegisterSignal(owner, COMSIG_LIVING_EXTINGUISHED, PROC_REF(on_extinguished))
|
||||
|
||||
/datum/status_effect/fleshmend/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_IGNITED, COMSIG_LIVING_EXTINGUISHED))
|
||||
|
||||
/datum/status_effect/fleshmend/tick()
|
||||
if(owner.on_fire)
|
||||
linked_alert.icon_state = "fleshmend_fire"
|
||||
return
|
||||
else
|
||||
linked_alert.icon_state = "fleshmend"
|
||||
|
||||
owner.adjustBruteLoss(-10, FALSE)
|
||||
owner.adjustFireLoss(-5, FALSE)
|
||||
owner.adjustOxyLoss(-10)
|
||||
if(!iscarbon(owner))
|
||||
return
|
||||
var/mob/living/carbon/C = owner
|
||||
QDEL_LAZYLIST(C.all_scars)
|
||||
|
||||
/datum/status_effect/fleshmend/proc/on_ignited(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
linked_alert?.icon_state = "fleshmend_fire"
|
||||
|
||||
/datum/status_effect/fleshmend/proc/on_extinguished(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
linked_alert?.icon_state = "fleshmend"
|
||||
|
||||
/atom/movable/screen/alert/status_effect/fleshmend
|
||||
name = "Fleshmend"
|
||||
@@ -309,7 +325,7 @@
|
||||
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, STATUS_EFFECT_TRAIT)
|
||||
owner.adjustBruteLoss(-25)
|
||||
owner.adjustFireLoss(-25)
|
||||
owner.remove_CC()
|
||||
owner.fully_heal(HEAL_CC_STATUS)
|
||||
owner.bodytemperature = owner.get_body_temp_normal()
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/humi = owner
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
id = "choke"
|
||||
tick_interval = 0.2 SECONDS
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
/// Weakref to the thing we're choking on
|
||||
var/datum/weakref/choking_on_ref
|
||||
/// If the thing we're choking on is on fire
|
||||
@@ -41,7 +42,6 @@
|
||||
choking_on.forceMove(owner)
|
||||
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_NOBREATH), PROC_REF(no_breathing))
|
||||
RegisterSignal(owner, COMSIG_MOB_LOGOUT, PROC_REF(on_logout))
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_choke))
|
||||
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(on_death))
|
||||
// Of note, this means plasma lovers lose some methods of vomiting up
|
||||
RegisterSignal(owner, COMSIG_CARBON_VOMITED, PROC_REF(on_vomit))
|
||||
@@ -182,7 +182,7 @@
|
||||
victim.balloon_alert(aggressor, "already helping!")
|
||||
return
|
||||
if(DOING_INTERACTION(aggressor, "heimlich"))
|
||||
victim.balloon_alert(aggressor, "already helping someone!")
|
||||
victim.balloon_alert(aggressor, "already helping someone!")
|
||||
return
|
||||
|
||||
if(!thrusting_continues(victim, aggressor, before_work = TRUE))
|
||||
|
||||
@@ -9,24 +9,18 @@
|
||||
/datum/status_effect/confusion
|
||||
id = "confusion"
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/confusion/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/confusion/on_apply()
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_confusion))
|
||||
RegisterSignal(owner, COMSIG_MOB_CLIENT_PRE_MOVE, PROC_REF(on_move))
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/confusion/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_MOB_CLIENT_PRE_MOVE))
|
||||
|
||||
/// Removes all of our confusion (self terminate) on signal
|
||||
/datum/status_effect/confusion/proc/remove_confusion(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
UnregisterSignal(owner, COMSIG_MOB_CLIENT_PRE_MOVE)
|
||||
|
||||
/// Signal proc for [COMSIG_MOB_CLIENT_PRE_MOVE]. We have a chance to mix up our movement pre-move with confusion.
|
||||
/datum/status_effect/confusion/proc/on_move(datum/source, list/move_args)
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
tick_interval = 0
|
||||
status_type = STATUS_EFFECT_REPLACE
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
heal_flag_necessary = HEAL_CC_STATUS
|
||||
var/needs_update_stat = FALSE
|
||||
|
||||
/datum/status_effect/incapacitating/on_creation(mob/living/new_owner, set_duration)
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
id = "dizziness"
|
||||
tick_interval = 2 SECONDS
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/dizziness/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/dizziness/on_apply()
|
||||
RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), PROC_REF(clear_dizziness))
|
||||
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(clear_dizziness))
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/dizziness/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
|
||||
UnregisterSignal(owner, COMSIG_LIVING_DEATH)
|
||||
// In case our client's offset is somewhere wacky from the dizziness effect
|
||||
owner.client?.pixel_x = initial(owner.client?.pixel_x)
|
||||
owner.client?.pixel_y = initial(owner.client?.pixel_y)
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
/datum/status_effect/drugginess
|
||||
id = "drugged"
|
||||
alert_type = /atom/movable/screen/alert/status_effect/high
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/drugginess/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/drugginess/on_apply()
|
||||
RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), PROC_REF(remove_drugginess))
|
||||
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(remove_drugginess))
|
||||
|
||||
owner.add_mood_event(id, /datum/mood_event/high)
|
||||
owner.overlay_fullscreen(id, /atom/movable/screen/fullscreen/high)
|
||||
@@ -17,7 +18,7 @@
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/drugginess/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
|
||||
UnregisterSignal(owner, COMSIG_LIVING_DEATH)
|
||||
|
||||
owner.clear_mood_event(id)
|
||||
owner.clear_fullscreen(id)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
id = "drunk"
|
||||
tick_interval = 2 SECONDS
|
||||
status_type = STATUS_EFFECT_REPLACE
|
||||
remove_on_fullheal = TRUE
|
||||
/// The level of drunkness we are currently at.
|
||||
var/drunk_value = 0
|
||||
|
||||
@@ -21,13 +22,6 @@
|
||||
. = ..()
|
||||
set_drunk_value(drunk_value)
|
||||
|
||||
/datum/status_effect/inebriated/on_apply()
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(clear_drunkenness))
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/inebriated/on_remove()
|
||||
UnregisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL)
|
||||
|
||||
/datum/status_effect/inebriated/get_examine_text()
|
||||
// Dead people don't look drunk
|
||||
if(owner.stat == DEAD || HAS_TRAIT(owner, TRAIT_FAKEDEATH))
|
||||
@@ -58,12 +52,6 @@
|
||||
|
||||
return null
|
||||
|
||||
/// Removes all of our drunkenness (self-deletes) on signal.
|
||||
/datum/status_effect/inebriated/proc/clear_drunkenness(mob/living/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
|
||||
/// Sets the drunk value to set_to, deleting if the value drops to 0 or lower
|
||||
/datum/status_effect/inebriated/proc/set_drunk_value(set_to)
|
||||
if(!isnum(set_to))
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
|
||||
/datum/status_effect/fire_handler/fire_stacks
|
||||
id = "fire_stacks" //fire_stacks and wet_stacks should have different IDs or else has_status_effect won't work
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
enemy_types = list(/datum/status_effect/fire_handler/wet_stacks)
|
||||
stack_modifier = 1
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
id = "hallucination"
|
||||
alert_type = null
|
||||
tick_interval = 2 SECONDS
|
||||
remove_on_fullheal = TRUE
|
||||
/// Can this hallucination apply to silicons?
|
||||
var/affects_silicons = FALSE
|
||||
/// The lower range of when the next hallucination will trigger after one occurs.
|
||||
@@ -28,8 +29,7 @@
|
||||
if(!affects_silicons && issilicon(owner))
|
||||
return FALSE
|
||||
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_hallucinations))
|
||||
RegisterSignal(owner, COMSIG_LIVING_HEALTHSCAN, PROC_REF(on_health_scan))
|
||||
RegisterSignal(owner, COMSIG_LIVING_HEALTHSCAN, PROC_REF(on_health_scan))
|
||||
if(iscarbon(owner))
|
||||
RegisterSignal(owner, COMSIG_CARBON_CHECKING_BODYPART, PROC_REF(on_check_bodypart))
|
||||
RegisterSignal(owner, COMSIG_CARBON_BUMPED_AIRLOCK_OPEN, PROC_REF(on_bump_airlock))
|
||||
@@ -38,18 +38,11 @@
|
||||
|
||||
/datum/status_effect/hallucination/on_remove()
|
||||
UnregisterSignal(owner, list(
|
||||
COMSIG_LIVING_POST_FULLY_HEAL,
|
||||
COMSIG_LIVING_HEALTHSCAN,
|
||||
COMSIG_CARBON_CHECKING_BODYPART,
|
||||
COMSIG_CARBON_BUMPED_AIRLOCK_OPEN,
|
||||
))
|
||||
|
||||
/// Signal proc for [COMSIG_LIVING_POST_FULLY_HEAL], terminate on full heal
|
||||
/datum/status_effect/hallucination/proc/remove_hallucinations(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
|
||||
/// Signal proc for [COMSIG_LIVING_HEALTHSCAN]. Show we're hallucinating to (advanced) scanners.
|
||||
/datum/status_effect/hallucination/proc/on_health_scan(datum/source, list/render_list, advanced, mob/user, mode)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
id = "jitter"
|
||||
tick_interval = 2 SECONDS
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/jitter/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
@@ -14,12 +15,12 @@
|
||||
owner.do_jitter_animation(duration / 10)
|
||||
return FALSE
|
||||
|
||||
RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), PROC_REF(remove_jitter))
|
||||
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(remove_jitter))
|
||||
owner.add_mood_event(id, /datum/mood_event/jittery)
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/jitter/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
|
||||
UnregisterSignal(owner, COMSIG_LIVING_DEATH)
|
||||
owner.clear_mood_event(id)
|
||||
// juuust in case, reset our x and y's from our jittering
|
||||
owner.pixel_x = 0
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/datum/status_effect/silenced
|
||||
id = "silent"
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/silenced/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/silenced/on_apply()
|
||||
RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), PROC_REF(clear_silence))
|
||||
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(clear_silence))
|
||||
ADD_TRAIT(owner, TRAIT_MUTE, id)
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/silenced/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
|
||||
UnregisterSignal(owner, COMSIG_LIVING_DEATH)
|
||||
REMOVE_TRAIT(owner, TRAIT_MUTE, id)
|
||||
|
||||
/// Signal proc that clears any silence we have (self-deletes).
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/datum/status_effect/speech
|
||||
id = null
|
||||
alert_type = null
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/speech/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
||||
src.duration = duration
|
||||
@@ -8,18 +9,10 @@
|
||||
|
||||
/datum/status_effect/speech/on_apply()
|
||||
RegisterSignal(owner, COMSIG_LIVING_TREAT_MESSAGE, PROC_REF(handle_message))
|
||||
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(on_heal))
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/speech/on_remove()
|
||||
UnregisterSignal(owner, COMSIG_LIVING_TREAT_MESSAGE)
|
||||
UnregisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL)
|
||||
|
||||
/// Signal proc for [COMSIG_LIVING_POST_FULLY_HEAL], removes all stutters and slurring on full heal
|
||||
/datum/status_effect/speech/proc/on_heal(datum/source, admin_revive)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* Signal proc for [COMSIG_LIVING_TREAT_MESSAGE]
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
/datum/status_effect/determined
|
||||
id = "determined"
|
||||
alert_type = /atom/movable/screen/alert/status_effect/determined
|
||||
remove_on_fullheal = TRUE
|
||||
|
||||
/datum/status_effect/determined/on_apply()
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user