From 9ea9ed4b981a86b3d626339a849c0f57c6ec8bac Mon Sep 17 00:00:00 2001 From: uporotiy Date: Wed, 1 Jun 2011 17:06:53 +0000 Subject: [PATCH] Small tweak to the spell system. Conjured objects can now have their vars changed when they're conjured. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1650 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/spells/conjure.dm | 38 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/code/datums/spells/conjure.dm b/code/datums/spells/conjure.dm index ce3fb01fbf0..303356a4362 100644 --- a/code/datums/spells/conjure.dm +++ b/code/datums/spells/conjure.dm @@ -3,28 +3,16 @@ desc = "This spell conjures objs of the specified types in range." var/list/summon_type = list() //determines what exactly will be summoned + //should be text, like list("/obj/machinery/bot/ed209") + var/summon_lifespan = 0 // 0=permanent, any other time in deciseconds var/summon_amt = 1 //amount of objects summoned var/summon_ignore_density = 0 //if set to 1, adds dense tiles to possible spawn places var/summon_ignore_prev_spawn_points = 0 //if set to 1, each new object is summoned on a new spawn point -/* -/obj/proc_holder/spell/conjure - name = "Summon Bigger Carp" - desc = "This spell conjures an elite carp." + var/list/newVars = list() //vars of the summoned objects will be replaced with those where they meet + //should have format of list("emagged" = 1,"name" = "Wizard's Justicebot"), for example - school = "conjuration" - charge_max = 1200 - clothes_req = 1 - invocation = "NOUK FHUNMM SACP RISSKA" - invocation_type = "shout" - range = 1 //radius in which objects are randomly summoned - var/list/summon_type = list("/obj/livestock/spesscarp/elite") //determines what exactly will be summoned - var/summon_duration = 0 // 0=permanent, any other time in deciseconds - var/summon_amt = 1 //amount of objects summoned - var/summon_ignore_density = 0 //if set to 1, adds dense tiles to possible spawn places - var/summon_ignore_prev_spawn_points = 0 //if set to 1, each new object is summoned on a new spawn point -*/ /obj/proc_holder/spell/aoe_turf/conjure/cast(list/targets) for(var/turf/T in targets) @@ -38,10 +26,24 @@ var/spawn_place = pick(targets) if(summon_ignore_prev_spawn_points) targets -= spawn_place - var/summoned_object = new summoned_object_type(spawn_place) + var/atom/summoned_object = new summoned_object_type(spawn_place) + + for(var/varName in newVars) + if(varName in summoned_object.vars) + summoned_object.vars[varName] = newVars[varName] + if(summon_lifespan) spawn(summon_lifespan) if(summoned_object) del(summoned_object) - return \ No newline at end of file + return + +/obj/proc_holder/spell/aoe_turf/conjure/summonEdSwarm //test purposes + name = "Dispense Wizard Justice" + desc = "This spell dispenses wizard justice." + + summon_type = list("/obj/machinery/bot/ed209") + summon_amt = 10 + range = 3 + newVars = list("emagged" = 1,"name" = "Wizard's Justicebot") \ No newline at end of file