Object spell system v1.1

Completely revamped the classes, it's even more streamlined now. Got a few bugs and tweaks (namely, blind doesn't work, fireball got buffed up as compensation for not dealing additional damage to the target), but it's okay, since nobody uses those anyway.
 Fixed the bug with emagged borg laws.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1465 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-04-17 18:49:46 +00:00
parent ffc69056f8
commit b7db69b6f8
26 changed files with 761 additions and 553 deletions
+21 -18
View File
@@ -1,3 +1,14 @@
/obj/spell/aoe_turf/conjure
name = "Conjure"
desc = "This spell conjures objs of the specified types in range."
var/list/summon_type = list() //determines what exactly will be summoned
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/spell/conjure
name = "Summon Bigger Carp"
desc = "This spell conjures an elite carp."
@@ -13,31 +24,23 @@
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/spell/aoe_turf/conjure/cast(list/targets)
/obj/spell/conjure/Click()
..()
if(!cast_check())
return
invocation()
var/list/possible_spawn_points = list()
for(var/turf/T in oview(usr,range))
if(!T.density || summon_ignore_density)
possible_spawn_points += T
for(var/turf/T in targets)
if(T.density && !summon_ignore_density)
targets -= T
for(var/i=0,i<summon_amt,i++)
if(!possible_spawn_points.len)
if(!targets.len)
break
var/summoned_object_type = text2path(pick(summon_type))
var/spawn_place = pick(possible_spawn_points)
var/spawn_place = pick(targets)
if(summon_ignore_prev_spawn_points)
possible_spawn_points -= spawn_place
targets -= spawn_place
var/summoned_object = new summoned_object_type(spawn_place)
if(summon_duration)
spawn(summon_duration)
if(summon_lifespan)
spawn(summon_lifespan)
if(summoned_object)
del(summoned_object)