ID:138843
 
Code:
obj/Skills/Dragon_Fire_Technique
icon='Fire.dmi' //31x31 graphic for skill
icon_state="6"
mouse_drag_pointer="6" //same as icon_state
layer=91
proc
Tech(mob/M) //DO NOT CHANGE NAME, you can add arguments for your skills
set popup_menu = 0 //keep for all skills
src=M
if(M.delay)
M << "<small><small><small>Your hands cannot move that fast!"
return
if(M.cantshoot)
return
if(M.chakra<=50)
M << "<small><small>You need more chakra."
return
M.delay=1
spawn(27)
M.delay=0
view() << "<b>[M] shouts:</b> Dragon Fire!!"
view() << 'FBullet.wav'
var/damage = 2.7*M.nin
M.chakra -= 50
M.cantmove = 1
var/obj/O = new
O.layer = MOB_LAYER+4
if(src.dir==EAST)
O.loc=locate(src.x+1,src.y-0.5,src.z)
O.icon='Dragon2.dmi'
O.icon_state="Dragon2"
O.dir=EAST
else if(src.dir==WEST)
O.loc=locate(src.x-8,src.y-0.5,src.z)
O.icon = 'Dragon2.dmi'
O.icon_state="Dragon2"
O.dir=WEST
else if(src.dir==NORTH)
O.loc=locate(src.x-0.5,src.y+1,src.z)
O.icon='Dragon.dmi'
O.icon_state="Dragon"
O.dir=NORTH
else if(src.dir==SOUTH)
O.loc=locate(src.x-0.5,src.y-8,src.z)
O.icon='Dragon.dmi'
O.icon_state="Dragon"
O.dir=SOUTH
spawn()//while(O)
for(var/mob/MM in view(O))
if(MM!=src)
if(O.Entered(MM))
MM.damage(damage, M)
view(src) << "<small><small><small>[MM] was hit by [src]'s Dragon Fire Technique for [damage] damage!"
flick("Hurt",MM)
sleep(1)
spawn(17)
M.cantmove = 0
del(O)


Problem description:

When a mob is standing under (technique's layer is bigger then player's layer) the technique/big atom, they don't receive damage. Why is that?
Entered() doesn't work like that. It's called during a successful Move() after the move has occurred. It does not tell you if two atoms overlap.

I believe what you want instead is to loop in obounds(O) instead of view(O).
In response to Lummox JR (#1)
Well, Lummox, I tried what you said. But it doesn't really work out. My debugging tells me that it doesn't go further then the spawn().
obj/Skills/Dragon_Fire_Technique
icon='Fire.dmi' //31x31 graphic for skill
icon_state="6"
mouse_drag_pointer="6" //same as icon_state
layer=91
proc
Tech(mob/M) //DO NOT CHANGE NAME, you can add arguments for your skills
set popup_menu = 0 //keep for all skills
src=M
if(M.delay)
M << "<small><small><small>Your hands cannot move that fast!"
return
if(M.cantshoot)
return
if(M.chakra<=50)
M << "<small><small>You need more chakra."
return
M.delay=1
spawn(27)
M.delay=0
view() << "<b>[M] shouts:</b> Dragon Fire!!"
view() << 'FBullet.wav'
var/damage = 2.7*M.nin
M.chakra -= 50
M.cantmove = 1
var/obj/O = new
O.layer = MOB_LAYER+4
O.density = 1
if(src.dir==EAST)
O.loc=locate(src.x+1,src.y-0.5,src.z)
O.icon='Dragon2.dmi'
O.icon_state="Dragon2"
O.dir=EAST
else if(src.dir==WEST)
O.loc=locate(src.x-8,src.y-0.5,src.z)
O.icon = 'Dragon2.dmi'
O.icon_state="Dragon2"
O.dir=WEST
else if(src.dir==NORTH)
O.loc=locate(src.x-0.5,src.y+1,src.z)
O.icon='Dragon.dmi'
O.icon_state="Dragon"
O.dir=NORTH
else if(src.dir==SOUTH)
O.loc=locate(src.x-0.5,src.y-8,src.z)
O.icon='Dragon.dmi'
O.icon_state="Dragon"
O.dir=SOUTH
spawn()//while(O)
src<<"Spawned."
for(var/mob/MM in obounds(O))
src<<"For going."
if(MM!=src)
src<<"MM != src"
src<<"MM entered O"
MM.damage(damage, M)
view(src) << "<small><small><small>[MM] was hit by [src]'s Dragon Fire Technique for [damage] damage!"
flick("Hurt",MM)
sleep(1)
spawn(17)
M.cantmove = 0
del(O)


This is what I've got now. It still doesn't work. The for loop doesn't get called, because it only outputs the Spawned message, nothing more.