Files
CHOMPStation2/code/datums/spells/trigger.dm
uporotiy 4c73d22458 Object Spell System v1.12
Added trigger spell, which basically activates two or more spells at once. Used that to fix fireball and blind to what they were pre-change (not code-wise, but the same for the end user).
Projectiles aren't limited to default spells now.
All spells now use a user argument (=usr by default) instead of usr.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1474 316c924e-a436-60f5-8080-3fe189b3f50e
2011-04-19 20:03:17 +00:00

28 lines
924 B
Plaintext

/obj/spell/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/spell/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/spell/targeted/trigger/Del()
for(var/spell in contents)
del(spell)
..()
/obj/spell/targeted/trigger/cast(list/targets)
for(var/mob/target in targets)
for(var/obj/spell/spell in contents)
spell.perform(list(target),0)
for(var/obj/spell/spell in linked_spells)
spell.perform(list(target),0)
return