Files
vgstation13/code/datums/spells/trigger.dm
noisomehollow@lycos.com 1d8dea2337 AI's that do not name themselves after 20 seconds will default to their starting name.
Added a direction finding algorithm for target, get_dir_to(). Mostly useful for positioning sprites in relation to a target. Such as energy beams, lines, and so on.
Changes to ninjas. Fixed a bunch of bugs and finished content. It is now possible to drag people with you when phase jaunting/shifting. Jaunting/shifting should also kill livestock, huggers, and damage mechs.
Renamed /obj/spell path to obj/proc_holder/spell in order to have a generic proc_holder category. For now it only works for the AI but can be expanded to other mobs.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1566 316c924e-a436-60f5-8080-3fe189b3f50e
2011-05-11 02:01:30 +00:00

28 lines
996 B
Plaintext

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