mob/player
var/shot = NORTH
icon = 'player.dmi'
Login()
usr.Move(locate(2,5,1))
world << "[usr] has entered Drawl."
icon_state = input("Choose your color","Color") in list("Red","Green","Blue","Purple","Gold","Gray","Cyan")
new /obj/fire1(usr) //give player a spell to cast
verb
castnorth() //using directional casting verbs so it doesn't have to be usr.dir
shot = NORTH
Spell(arglist(usr.contents))
castsouth()
shot = SOUTH
Spell(arglist(usr.contents))
castwest()
shot = WEST
Spell(arglist(usr.contents))
casteast()
shot = EAST
Spell(arglist(usr.contents))
proc/Spell(S)
var/obj/P = new S(usr.loc) //problem here
while(P)
step(P,shot)
var/turf/T = P.loc
if(T.density==1)
del(P)
break
for(var/mob/M as mob in T)
if(M==src)
continue
else
M.health -= P.spelldamage
M.deathcheck()
-snip-
obj
var/spelldamage
fire1
icon = 'fire1.dmi'
spelldamage = 3
Problem description:
If you didn't notice this is supposed to shoot a projectile :D
The problem here is that in the game when you use one of the cast verbs, the proc crashes saying that an object of type /obj/fire1 cant be created. I originally thought there was a problem with assigning S from arglist(usr.contents), but it seems to be referencing it fine...any ideas?
NOTE: The reason for getting the projectile from usr.contents is that I'm going to use usr inventory to switch spells
Try grouping the damage proc under the spell itself. Its not creating the spell because, well, it isnt complete. This may sound confusing, but atleast thats what I noticed. Perhaps a more expirienced coder will see this and offer more complete help.