ID:138718
 
Code:
mob
verb
Kiblast()
set name = "Ki Blast"
set category="Fighting"
var/obj/ki/K = new/obj/ki(src)
usr.stamina-=rand(1,4)
usr.ki-=10
walk(K,K.distance,K.dir,K.speed)
Bump(var/P)
for(var/mob/characters/M in src.loc)
M.KiDamage()
M.deathcheck()
if(istype(P,/turf/))
if(P.density==1)
del(src)
if(istype(P,/obj/))
if(P.destructable==1)
del(P)
else
del(src)


Problem description:
Techs.dm:70:error: P.density: undefined var
Techs.dm:73:error: P.destructable: undefined var

I know this coding sucks.I need to know how to make it better and how do i get rid of this undef var error
var/atom/P, instead of just Bump(var/P). As density is attributed to atom, and obj; turf; and mob are all children of atom, it'll work. And shouldn't walk() direction be the direction usr is facing, instead of the default direction?

You'll have to define destructable under atom, btw. It shouldn't change any behavior.