Files
Bubberstation/code/datums/elements/ELEMENT_TEMPLATE.md
SkyratBot b4fd13b16b [MIRROR] Improve the naming of the element argument hash index selector [MDB IGNORE] (#17588)
* Improve the naming of the element argument hash index selector (#71319)

So confusing name

* Improve the naming of the element argument hash index selector

* sr sync

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-11-21 16:27:40 -05:00

26 lines
908 B
Markdown

# Template file for your new element
See _element.dm for detailed explanations
```dm
/datum/element/myelement
element_flags = ELEMENT_BESPOKE | ELEMENT_COMPLEX_DETACH | ELEMENT_DETACH_ON_HOST_DESTROY | ELEMENT_NOTAREALFLAG // code/__DEFINES/dcs/flags.dm
//argument_hash_start_idx = 2 // Use with ELEMENT_BESPOKE
var/list/myvar = list()
/datum/element/myelement/Attach(datum/target)
if(!ismovable(target))
return COMPONENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, myproc)
to_chat(target, "Hey, you're in your element.")
/datum/element/myelement/Detach(datum/source)
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
to_chat(source, "You feel way out of your element.")
/datum/element/myelement/proc/myproc(datum/source)
SIGNAL_HANDLER
playsound(source, 'sound/effects/gong.ogg', 50, TRUE)
```