mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 04:02:31 +00:00
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
28 lines
924 B
Plaintext
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 |