mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
173 lines
5.4 KiB
Plaintext
173 lines
5.4 KiB
Plaintext
#define HEAL_EFFECT_COOLDOWN (1 SECONDS)
|
|
|
|
/// Applies healing to those in the area.
|
|
/// Will provide them with an alert while they're in range, as well as
|
|
/// give them a healing particle.
|
|
/// Can be applied to those only with a trait conditionally.
|
|
/datum/component/aura_healing
|
|
/// The range of which to heal
|
|
var/range = 5
|
|
|
|
/// Whether or not you must be a visible object of the parent
|
|
var/requires_visibility = TRUE
|
|
|
|
/// Brute damage to heal over a second
|
|
var/brute_heal = 0
|
|
|
|
/// Burn damage to heal over a second
|
|
var/burn_heal = 0
|
|
|
|
/// Toxin damage to heal over a second
|
|
var/toxin_heal = 0
|
|
|
|
/// Suffocation damage to heal over a second
|
|
var/suffocation_heal = 0
|
|
|
|
/// Stamina damage to heal over a second
|
|
var/stamina_heal = 0
|
|
|
|
/// Amount of blood to heal over a second
|
|
var/blood_heal = 0
|
|
|
|
/// Amount of bleed/pierce wound lowering per second.
|
|
var/wound_clotting = 0
|
|
|
|
/// Map of organ (such as ORGAN_SLOT_BRAIN) to damage heal over a second
|
|
var/list/organ_healing = null
|
|
|
|
/// Amount of damage to heal on simple mobs over a second
|
|
var/simple_heal = 0
|
|
|
|
/// Trait to limit healing to, if set
|
|
var/limit_to_trait = null
|
|
|
|
/// The color to give the healing visual
|
|
var/healing_color = COLOR_GREEN
|
|
|
|
/// If the aura also heals the owner of the component
|
|
var/self_heal = TRUE
|
|
|
|
/// A list of being healed to active alerts
|
|
var/list/mob/living/current_alerts = list()
|
|
|
|
/// Cooldown between showing the heal effect
|
|
COOLDOWN_DECLARE(last_heal_effect_time)
|
|
|
|
/datum/component/aura_healing/Initialize(
|
|
range = 5,
|
|
requires_visibility = TRUE,
|
|
brute_heal = 0,
|
|
burn_heal = 0,
|
|
toxin_heal = 0,
|
|
suffocation_heal = 0,
|
|
stamina_heal = 0,
|
|
blood_heal = 0,
|
|
wound_clotting = 0,
|
|
organ_healing = null,
|
|
simple_heal = 0,
|
|
limit_to_trait = null,
|
|
healing_color = COLOR_GREEN,
|
|
self_heal = TRUE,
|
|
)
|
|
if (!isatom(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
START_PROCESSING(SSaura, src)
|
|
|
|
src.range = range
|
|
src.requires_visibility = requires_visibility
|
|
src.brute_heal = brute_heal
|
|
src.burn_heal = burn_heal
|
|
src.toxin_heal = toxin_heal
|
|
src.suffocation_heal = suffocation_heal
|
|
src.stamina_heal = stamina_heal
|
|
src.blood_heal = blood_heal
|
|
src.wound_clotting = wound_clotting
|
|
src.organ_healing = organ_healing
|
|
src.simple_heal = simple_heal
|
|
src.limit_to_trait = limit_to_trait
|
|
src.healing_color = healing_color
|
|
src.self_heal = self_heal
|
|
|
|
/datum/component/aura_healing/Destroy(force)
|
|
STOP_PROCESSING(SSaura, src)
|
|
var/alert_category = "aura_healing_[REF(src)]"
|
|
|
|
for(var/mob/living/alert_holder as anything in current_alerts)
|
|
alert_holder.clear_alert(alert_category)
|
|
current_alerts.Cut()
|
|
|
|
return ..()
|
|
|
|
/datum/component/aura_healing/process(seconds_per_tick)
|
|
var/should_show_effect = COOLDOWN_FINISHED(src, last_heal_effect_time)
|
|
if (should_show_effect)
|
|
COOLDOWN_START(src, last_heal_effect_time, HEAL_EFFECT_COOLDOWN)
|
|
|
|
var/list/to_heal = list()
|
|
var/alert_category = "aura_healing_[REF(src)]"
|
|
|
|
if(requires_visibility)
|
|
for(var/mob/living/candidate in view(range, parent))
|
|
if (!isnull(limit_to_trait) && !HAS_TRAIT(candidate, limit_to_trait))
|
|
continue
|
|
to_heal[candidate] = TRUE
|
|
else
|
|
for(var/mob/living/candidate in range(range, parent))
|
|
if (!isnull(limit_to_trait) && !HAS_TRAIT(candidate, limit_to_trait))
|
|
continue
|
|
to_heal[candidate] = TRUE
|
|
|
|
for (var/mob/living/candidate as anything in to_heal)
|
|
if (!current_alerts[candidate])
|
|
candidate.throw_alert(alert_category, /atom/movable/screen/alert/aura_healing, new_master = parent)
|
|
current_alerts[candidate] = TRUE
|
|
|
|
if (should_show_effect && candidate.health < candidate.maxHealth)
|
|
new /obj/effect/temp_visual/heal(get_turf(candidate), healing_color)
|
|
|
|
if (iscarbon(candidate) || issilicon(candidate) || isbasicmob(candidate))
|
|
candidate.adjust_brute_loss(-brute_heal * seconds_per_tick, updating_health = FALSE)
|
|
candidate.adjust_fire_loss(-burn_heal * seconds_per_tick, updating_health = FALSE)
|
|
|
|
if (iscarbon(candidate))
|
|
// Toxin healing is forced for slime people
|
|
candidate.adjust_tox_loss(-toxin_heal * seconds_per_tick, updating_health = FALSE, forced = TRUE)
|
|
|
|
candidate.adjust_oxy_loss(-suffocation_heal * seconds_per_tick, updating_health = FALSE)
|
|
candidate.adjust_stamina_loss(-stamina_heal * seconds_per_tick, updating_stamina = FALSE)
|
|
|
|
for (var/organ in organ_healing)
|
|
candidate.adjust_organ_loss(organ, -organ_healing[organ] * seconds_per_tick)
|
|
var/mob/living/carbon/carbidate = candidate
|
|
for(var/datum/wound/iter_wound as anything in carbidate.all_wounds)
|
|
iter_wound.adjust_blood_flow(-wound_clotting * seconds_per_tick)
|
|
|
|
else if (isanimal(candidate))
|
|
var/mob/living/simple_animal/animal_candidate = candidate
|
|
animal_candidate.adjustHealth(-simple_heal * seconds_per_tick, updating_health = FALSE)
|
|
else if (isbasicmob(candidate))
|
|
var/mob/living/basic/basic_candidate = candidate
|
|
basic_candidate.adjust_health(-simple_heal * seconds_per_tick, updating_health = FALSE)
|
|
|
|
candidate.adjust_blood_volume(blood_heal * seconds_per_tick, maximum = BLOOD_VOLUME_NORMAL)
|
|
|
|
candidate.updatehealth()
|
|
|
|
for (var/mob/living/remove_alert_from as anything in current_alerts - to_heal)
|
|
remove_alert_from.clear_alert(alert_category)
|
|
current_alerts -= remove_alert_from
|
|
|
|
/atom/movable/screen/alert/aura_healing
|
|
name = "Aura Healing"
|
|
icon_state = "template"
|
|
use_user_hud_icon = USER_HUD_STYLE_INHERIT
|
|
clickable_glow = TRUE
|
|
click_master = FALSE
|
|
|
|
/atom/movable/screen/alert/aura_healing/update_desc(updates)
|
|
. = ..()
|
|
desc = "You are being healed by [master_ref?.resolve()]."
|
|
|
|
#undef HEAL_EFFECT_COOLDOWN
|