magic magic everywhere but not a drop to drink in Developer Help
|
|
in my code for the magic system when you click the fire button it works out that a mob in front of you and casts
the spell opon them but it stops dead.
please help the code is below
obj fire_cast icon = 'effects.dmi' icon_state = "Fire_cast" name = "fire" screen_loc = "4,2" Click() if(usr.mp >= 5) var/mob/M = locate(/mob) in get_step(src,src.dir) if(M != null) var/obj/O = new/obj/fire(M.loc) usr.mp = usr.mp - 0 var/damage = (rand(1,7 + round(usr.level / 3,1))) - M.def if(damage <= 0) damage = 1 M.hp = M.hp - damage s_damage(M, damage, "#FF0000") usr << sound("sfx/Fire.wav",0) M << sound("sfx/Fire.wav",0) sleep(3) del(O) else usr << "you need more mp!"
|
oh and yer he/she does have more than 5 mp at the start.
|
gives me error:src.mp:undefined var
this is on the first usr i have changed plz help