Files
Bubberstation/code/datums/elements/empprotection.dm
T
Aliceee2ch 0a2ea363e4 Minor grammar edits for EMP_PROTECT flags (#93914)
## About The Pull Request

title (unrelated to grammar but pr also adds wrapping brackets in
code!!!)

## Why It's Good For The Game

i think we should say that something is only PARTIALLY blocks emps, like
borgs - their wires are protected from EMPs, but examine says "EMP
blocking" and at first glance i'd assume they fully block EMPs.

## Changelog

🆑
spellcheck: Items that block contents/wires from EMPs now showed up as
only "partially EMP blocking" objects in examine menu.
/🆑
2025-11-17 01:22:53 +01:00

44 lines
1.8 KiB
Plaintext

/datum/element/empprotection
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY // Detach for turfs
argument_hash_start_idx = 2
var/flags = NONE
/datum/element/empprotection/Attach(datum/target, _flags)
. = ..()
if(. == ELEMENT_INCOMPATIBLE || !isatom(target))
return ELEMENT_INCOMPATIBLE
flags = _flags
RegisterSignal(target, COMSIG_ATOM_PRE_EMP_ACT, PROC_REF(getEmpFlags))
RegisterSignal(target, COMSIG_ATOM_EXAMINE_TAGS, PROC_REF(get_examine_tags))
/datum/element/empprotection/Detach(atom/target)
UnregisterSignal(target, list(COMSIG_ATOM_PRE_EMP_ACT, COMSIG_ATOM_EXAMINE_TAGS))
return ..()
/datum/element/empprotection/proc/getEmpFlags(datum/source, severity)
SIGNAL_HANDLER
return (flags & EMP_PROTECT_ALL)
/datum/element/empprotection/proc/get_examine_tags(atom/source, mob/user, list/examine_list)
SIGNAL_HANDLER
if(flags & EMP_NO_EXAMINE)
return
if((flags & EMP_PROTECT_ALL) == EMP_PROTECT_ALL)
examine_list["EMP proof"] = "[source.p_They()] [source.p_are()] unaffected by electromagnetic pulses, and shields [source.p_their()] contents and wiring from them."
return
if(flags & EMP_PROTECT_SELF)
examine_list["EMP resilient"] = "[source.p_They()] [source.p_are()] unaffected by electromagnetic pulses."
if((flags & (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES)) == (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES))
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring and contents from electromagnetic pulses."
else if(flags & EMP_PROTECT_CONTENTS)
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] contents from electromagnetic pulses."
else if(flags & EMP_PROTECT_WIRES)
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring from electromagnetic pulses."