ID:143197
 
Code:
mob
verb
Attack()
set category = "Attacks"
for(var/mob/M in get_step(usr,usr.dir))
if(!usr.canattack)
return
if(usr.bya&&usr.Jyuken&&usr.bya2)
if(usr.strikes>=6)
flick("jyuken",usr)
usr.canattack = 0
view(usr) << "<font color = #00ffff size = 2>[usr] says: Hakke Hyaku Nijuha Sho!<p>128 palms!</font>"
var/damage = (usr.tai*2)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes = 0
usr.loc = locate(M.x,M.y-1,M.z)
usr.dir = NORTH
usr.chakra -= round(usr.Mchakra/100)
M.Strafe()
M.Savedspeed2 = M.Move_Delay
M.Move_Delay = 0
step(M,usr.dir)
sleep(1)
step(M,usr.dir)
sleep(1)
step(M,usr.dir)
M.Normal()
M.Move_Delay = M.Savedspeed2
sleep(40)
usr.canattack = 1
return
if(usr.strikes==5)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:64 palms!</font>"
var/damage = (usr.tai*1.4)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x-1,M.y,M.z)
usr.dir = EAST
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return
if(usr.strikes==4)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:32 palms!</font>"
var/damage = (usr.tai*1.3)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x,M.y+1,M.z)
usr.dir = SOUTH
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return
if(usr.strikes==3)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:16 palms!</font>"
var/damage = (usr.tai*1.2)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x+1,M.y,M.z)
usr.dir = WEST
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return
if(usr.strikes==2)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:8 palms!</font>"
var/damage = (usr.tai*1.1)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x,M.y-1,M.z)
usr.dir = NORTH
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return
if(usr.strikes==1)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:4 palms!</font>"
var/damage = (usr.tai*1.05)
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x-1,M.y,M.z)
usr.dir = EAST
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return
if(usr.strikes<=0)
flick("jyuken",usr)
usr.canattack = 0
view() << "<font color = #00ffff size = 1>[usr] says:2 palms!</font>"
var/damage = usr.tai
view(M)<<"[M] took [damage] damage!"
M.health -= damage
usr.strikes ++
usr.loc = locate(M.x,M.y+1,M.z)
usr.dir = SOUTH
usr.chakra -= round(usr.Mchakra/100)
sleep(2)
usr.canattack = 1
return


Problem description:
Fairly sloppy coding, I apologize. My problem is when I go through this with the code it crashes, but only if I have the
if(usr.bya&&usr.Jyuken&&usr.bya2)
statement met and the game is live....if its hosted by me alone it runs fin and no runtime errors, and when it does crash it does it within 3 seconds of the final "strike". I'm not quite sure what is causing this and this was my last resort.
Heres some other information that may help, it may not even be the strikes itself, but this proc thats called when byakugan activates.
mob/proc/ByaChakra()
for(var/mob/M in world)
if(M.client&&M!=src)
var/image/I = image('Chakra Pulse.dmi',M,"",FLY_LAYER+999999999999999999)
src << I
spawn(600) del(src)


Possible infinite loop or something else in this proc, and I also figured out after more testing it doesn't crash the game when its live, it just cuts your connection, and its after byakugan was activated and turned off. So now I'm fairly sure that the above post has nothing to do with the problem.
In response to SS10trunks
although i have some suspission that this is the WOTS source, i'll help because you're at least trying :)

mob/proc/ByaChakra()
for(var/client/C) // for every client in the world
if(C.mob!=src)
var/image/I = image('Chakra Pulse.dmi',M,"",FLY_LAYER+999999999999999999)
src<<<I
spawn(600) del I //This deletes the image instead of src


In your original code, you were deleting src, which is the mob that called the proc. You should be deleting I instead.
In response to Axerob
you made a typo, you put mob/prob instead of proc. =)
In response to Scizzees
LOL i see that, fixed.