Makes some more lists lazy (#94388)

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
Bloop
2025-12-28 19:57:42 +01:00
committed by GitHub
co-authored by SyncIt21 MrMelbert
parent b88e1a1328
commit 53ed83bb9d
58 changed files with 268 additions and 253 deletions
@@ -71,7 +71,9 @@
/// Overlay for our protection shield.
var/mutable_appearance/shield_overlay
/// Damage coefficients when shielded
var/list/shielded_damage = list(BRUTE = 0.05, BURN = 0.05, TOX = 0.05, STAMINA = 0, OXY = 0.05)
var/static/list/shielded_damage = list(BRUTE = 0.05, BURN = 0.05, TOX = 0.05, STAMINA = 0, OXY = 0.05)
// What the damage coefficients were previously
var/list/original_damage_coeff
/datum/status_effect/protector_shield/on_apply()
if (isguardian(owner))
@@ -86,6 +88,7 @@
if (isbasicmob(owner)) // Better hope you are or this status is doing basically nothing useful for you
var/mob/living/basic/basic_owner = owner
original_damage_coeff = basic_owner.damage_coeff
basic_owner.damage_coeff = shielded_damage
to_chat(owner, span_bolddanger("You enter protection mode."))
@@ -101,7 +104,7 @@
if (isbasicmob(owner))
var/mob/living/basic/basic_owner = owner
basic_owner.damage_coeff = initial(basic_owner.damage_coeff)
basic_owner.damage_coeff = original_damage_coeff
to_chat(owner, span_bolddanger("You return to your normal mode."))
UnregisterSignal(owner, list(COMSIG_ATOM_UPDATE_OVERLAYS) + COMSIG_LIVING_ADJUST_STANDARD_DAMAGE_TYPES)