ID:835094
 
(See the best response by DarkCampainger.)
Problem description:
So, I've just gotten back into messing around with DM and found a project I'd like to continue working on. However, before I do anything I'd like to clean it up; and I'm not quite sure how I would go about doing this, honestly.

Thank you for your time.

Code:
mob
verb
Attack()
if(usr.attacking) return
usr.attacking=1
var/obj/A=new/obj/mobcheck
var/obj/B=new/obj/mobcheck
var/obj/C=new/obj/mobcheck
A.loc=usr.loc
A.step_x=usr.step_x
A.step_y=usr.step_y
B.loc=usr.loc
B.step_x=usr.step_x
B.step_y=usr.step_y
C.loc=usr.loc
C.step_x=usr.step_x
C.step_y=usr.step_y
if(usr.attackstyle=="Sword")
if(usr.dir==NORTH)
usr.icon_state="a1"
usr<<sound('SFX/Slash.wav', volume=50)
step(A,EAST,16)
for(var/mob/M in bounds(A,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(A)
/////////////////////////////////////
usr.icon_state="a2"
step(B,NORTHEAST,16)
for(var/mob/M in bounds(B,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(B)
/////////////////////////////////////
usr.icon_state="a3"
step(C,NORTH,16)
for(var/mob/M in bounds(C,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(C)

if(usr.dir==WEST)
usr.icon_state="a1"
usr<<sound('SFX/Slash.wav', volume=50)
step(A,NORTH,16)
for(var/mob/M in bounds(A,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(A)
/////////////////////////////////////
usr.icon_state="a2"
step(B,NORTHWEST,16)
for(var/mob/M in bounds(B,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(B)
/////////////////////////////////////
usr.icon_state="a3"
step(C,WEST,16)
for(var/mob/M in bounds(C,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(C)

if(usr.dir==SOUTH)
usr.icon_state="a1"
usr<<sound('SFX/Slash.wav', volume=50)
step(A,WEST,16)
for(var/mob/M in bounds(A,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(A)
/////////////////////////////////////
usr.icon_state="a2"
step(B,SOUTHWEST,16)
for(var/mob/M in bounds(B,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(B)
/////////////////////////////////////
usr.icon_state="a3"
step(C,SOUTH,16)
for(var/mob/M in bounds(C,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(C)
if(usr.dir==EAST)
usr.icon_state="a1"
usr<<sound('SFX/Slash.wav', volume=50)
step(A,SOUTH,16)
for(var/mob/M in bounds(A,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(A)
/////////////////////////////////////
usr.icon_state="a2"
step(B,SOUTHEAST,16)
for(var/mob/M in bounds(B,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(B)
/////////////////////////////////////
usr.icon_state="a3"
step(C,EAST,16)
for(var/mob/M in bounds(C,0))
if(M == src)
continue
usr<<sound('SFX/Hit-Enemy.wav', volume=50)
sleep(0.5)
del(C)
usr.attacking=0
usr.icon_state=null



Best response
You can combine those four sections using the turn() process (ie step(A, turn(src.dir, -90), 16), step(B, turn(src.dir, -45), 16), and step(C, src.dir, 16) respectively).
In response to DarkCampainger
It works perfectly! Strange, it feels so simple now that the answer is in front of me. Thanks a bunch for the help :)!