if(usr.curspell == 2 && usr.mp >= 3)
usr.mp -= 3
var/a = new/obj/spell/fbolt/(usr.loc)
var/b = get_dir(a,o)
var/c
var/Io
atk
c = get_step(a,b)
for(var/mob/M in c)
Io += 1
M.hp -= a:dmg
if(M.hp <= 0)
if(M.monster == 1)
del(M)
else
M.loc = locate(1,1,1)
view() << "[M] died!"
var/I = new/obj/spell/fire()
M.overlays += I
M.afterfire()
for(var/mob/g in oview(1,M))
var/D = new/obj/spell/fire()
g.overlays += D
g.hp -= a:dmg
g.afterfire()
if(g.hp <= 0)
if(g.monster == 1)
del(g)
else
g.loc = locate(1,1,1)
view() << "[g] died!"
del(a)
if(Io > 0)
del(a)
step(a,b)
a:dmg -= 2
sleep(2)
if(a:dmg == null|| a:dmg == 0)
del(a)
goto atk
Problem description:
runtime error: Cannot read null.overlays
proc name: Click (/client/Click)
usr: Rky_nick (/mob/player)
src: Rky_nick (/client)
call stack:
Rky_nick (/client): Click(the grass (2,9,1) (/turf/grass), the grass (2,9,1) (/turf/grass))
after a shot of firebolt the second justs sit next to the monster and does nothing with this error. I dont care if my system is ineffiecient, so stop screaming at me unless the uneffieciency is the problem.
Don't use goto either. It has its uses but you should be using while() or something instead.
Also, I noticed this line:
if(a:dmg == null|| a:dmg == 0)
The : abuse aside, this is drastically wrong. The dmg var has already been established as a number because you used a:dmg-=2 above, so it's not null. This should be if(a.dmg<=0) instead.
For other checks like if(M.monster==1), you need to ditch the ==1. Similarly you're using ==0 in places you shouldn't. When a var is either true or false, you use if(M.monster) or if(!M.monster). This form is both simpler and more robust.
Lummox JR