mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 10:41:42 +00:00
This commit first and foremost ports the -tg- atom pooling system, and removes the old experimental system entirely. Secondly, this PR modifies the qdel system to use a -tg- lookalike "destroy hint" system, which means that individual objects can tell qdel what to do with them beyond taking care of things they need to delete. This ties into the atom pooling system via a new hint define, QDEL_HINT_PUTINPOOL, which will place the atom in the pool instead of deleting it as per standard. Emitter beams are now fully pooled. Qdel now has semi-compatibility with all datum types, however it is not the same as -tg-'s "Queue everything!" system. It simply passes it through the GC immediately and adds it to the "hard del" lists. This means that reagents can be qdel'ed, but there is no purpose as of yet, as it is more or less the same as just deleting them, with the added effect of adding logs of them being deleted to the garbage collector.
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
/obj/effect/proc_holder/spell/wizard/targeted/trigger
|
|
name = "Trigger"
|
|
desc = "This spell triggers another spell or a few."
|
|
|
|
var/list/linked_spells = list() //those are just referenced by the trigger spell and are unaffected by it directly
|
|
var/list/starting_spells = list() //those are added on New() to contents from default spells and are deleted when the trigger spell is deleted to prevent memory leaks
|
|
|
|
/obj/effect/proc_holder/spell/wizard/targeted/trigger/New()
|
|
..()
|
|
|
|
for(var/spell in starting_spells)
|
|
var/spell_to_add = text2path(spell)
|
|
new spell_to_add(src) //should result in adding to contents, needs testing
|
|
|
|
/obj/effect/proc_holder/spell/wizard/targeted/trigger/Destroy()
|
|
for(var/spell in contents)
|
|
del(spell)
|
|
|
|
return ..()
|
|
|
|
/obj/effect/proc_holder/spell/wizard/targeted/trigger/cast(list/targets)
|
|
for(var/mob/living/target in targets)
|
|
for(var/obj/effect/proc_holder/spell/wizard/spell in contents)
|
|
spell.perform(list(target),0)
|
|
for(var/obj/effect/proc_holder/spell/wizard/spell in linked_spells)
|
|
spell.perform(list(target),0)
|
|
|
|
return |