ID:139463
 
Code:
mob
proc
push()
prejutsu()
if(cdelay2||swim||paralysed||dead||addled||buttonjam||resting||caught||seals||moving||dous||busy)return
if(!rinnegan)
src<<output("You must have Rinnegan activated.")
return
handseals(60,90)
if(!sealpass)return
cdelay2=1
for(var/obj/jutsu/pein/Push/M in src)M.overlays+='timer.dmi'
view(8)<<output("<font color=purple><b>[usr]: Push!","infobox")
var/K=new/obj/pushblast(loc)
K:dir=dir
K:owner=src
walk(K,dir)
var/K2=new/obj/pushblast(loc)
K2:dir=dir
K2:owner=src
var/K3=new/obj/pushblast(loc)
K3:dir=dir
K3:owner=src
var/K4=new/obj/pushblast(loc)
K4:dir=SOUTH
K4:owner=src
var/K5=new/obj/pushblast(loc)
K5:dir=SOUTH
K5:owner=src
var/K6=new/obj/pushblast(loc)
K6:dir=SOUTH
K6:owner=src
walk(K6,dir)
var/K7=new/obj/pushblast(loc)
K7:dir=EAST
K7:owner=src
walk(K7,dir)
var/K8=new/obj/pushblast(loc)
K8:dir=EAST
K8:owner=src
walk(K8,dir)
var/K9=new/obj/pushblast(loc)
K9:dir=EAST
K9:owner=src
walk(K9,dir)
var/K10=new/obj/pushblast(loc)
K10:dir=WEST
K10:owner=src
walk(K10,dir)
var/K11=new/obj/pushblast(loc)
K11:dir=WEST
K11:owner=src
var/K12=new/obj/pushblast(loc)
K12:dir=WEST
K12:owner=src
if(dir==NORTH||dir==SOUTH)
K2:x--
K3:x++
if(K4:dir==EAST&&K5:dir==EAST)
K4:y--
K5:y++
if(K11:dir==WEST&&K12:dir==WEST)
K11:y--
K12:y++
if(dir==WEST||dir==EAST)
K2:y--
K3:y++
if(K4:dir==EAST&&K5:dir==EAST)
K4:x--
K5:x++
if(K11:dir==WEST&&K12:dir==WEST)
K11:x--
K12:x++
walk(K2,dir)
walk(K3,dir)
walk(K4,dir)
walk(K5,dir)
walk(K11,dir)
walk(K12,dir)
var/sdelay=600
if(skillspeedmast)sdelay=sdelay*(1-0.15*skillspeedmast)
if(curseseal==2)sdelay=sdelay/1.5
if(curseseal==3)sdelay=sdelay/2
spawn(sdelay)
for(var/obj/jutsu/pein/Push/M in src)M.overlays-='timer.dmi'
cdelay2=0


Problem description:
The job of the skill is to push out a obj in all directions causing mob's around him dmg and to move backward or come forward.

The problem is K-K3 all shoot forward and work fine.
but k4-12 dont move.

I was wondering if anyone could show me a better way to make this happen or fix the way its working now. I understand as much as its a problem with my direction's but idk what to place as the directions to fix it.
You are walking them all in dir, which is the dir of src. You probably want K.dir instead.

Really, you should just do:

// Loop through each direction
for(var/Dir = NORTH, Dir <= 8, Dir << 1)
// Create three objects in a 90 degree arc centered in direction Dir
for(var/v = -45 to 45 step 45)
var/turf/T = step(loc, turn(Dir, v))
var/obj/pushblast/P = new(loc)
walk(P,Dir)
In response to Garthor
Im kinda new to coding so
in there where you put create the obj
would it be similar to how i used K-12. but taking out the K:dir?
In response to Bigj822
No, those are comments that explain what the loops are doing.
In response to Garthor
I know that part. what im asking is.
In your loop would that be added directly to the code. or would it be like a proc id have to use.
Im kinda just learning so your probably going to direct me to the dm guide ,but how would you put it into affect.

Would I need to go to how to forum?
In response to Bigj822
The comments explain the code that is there.

There is nothing else you should add aside from a couple obvious things it's missing.

Those obvious things are not labeled in any way.

The comments should be left as-is, and totally untouched.