ID:1678546
 
(See the best response by Kaiochao.)
Code:
    verb
Bone_Breaker()
set hidden=1
for(var/mob/M in get_step(src,usr.dir))
if(M==usr) return
if(M.koed) return
if(M.dead) return
flick("APunch",src)
animate(M, transform = matrix()*1.25, alpha = 0, time = 5)
animate(M, transform = matrix()/2, alpha = 255, time = 5)
if(M.dir==EAST)
flick("Koed",M)
M.move_left()

M.HP-=20
M.Death(src)
if(M.dir==WEST)
flick("Koed",M)
M.move_right()
world<<"Hit"

M.HP-=20
M.Death(src)

    verb
move_left()
set category=null
dir=WEST
vel_x-=4
move_right()
set category=null
dir=EAST
vel_x+=4

Problem description:
The mob doesn't move (as it's meant to). The game is a sidescroller, hence the pure x-axis movement.

How much of this code actually happens?
In response to Kaiochao
All of it, apparently.
If you're using Forum_account's Sidescroller library or any kind of pixel movement in general, you probably shouldn't be using get_step(). The Sidescroller library provides atom.front(), which returns a list of atoms in front of atom. That guarantees the atom itself to not be included.

This is unrelated to the issue, but you're calling animate() twice, including the target object both times. If you want to chain animates together, you need to leave out the first argument after the first call.

You should probably be using "else if" for the dir checks because the result of the first condition can cause the second to succeed.

Also unrelated: the dir checks only really need move_left() or move_right(); the rest of the lines can be moved outside to avoid repetition.

Also, if you're using Forum_account's Sidescroller, you might want to just use mob.knockback() for this.
In response to Kaiochao
I'm using Orange55's SS library.
In response to Kboy33
Best response
I just checked it out. I recommend not using it.

Is the other mob an active physics looper? I mean, it should be in active_mobs or its physic() proc must have been called once.
In response to Kaiochao
I'd already programmed the other mob to be in the active_mobs list:

mob
Vegeta
HP=120
Lives=3
icon='Vegeta.dmi'
dir=EAST
Click()
src.Galic_Gun()
New()
active_mobs:Add(src)
src.physics()


EDIT:

KC, I looked into one of his sources and pulled out this:
mob
proc
knockback3(var/mob/M,var/amount,var/amount2)
flick("Koed",M)
M.vel_y=amount2
if(M.dir==EAST)
M.vel_x=-amount
else
M.vel_x=amount


It does the trick. Thanks for all your help.

EDIT #2: Pfft. The only issue with that code is that the "if(M.dir==EAST)" and it's condition (M.vel_x=-amount) doesn't work. The code is completed, however the mob doesn't actually move.
Bump.
Any ideas, anyone?
I went ahead and downloaded the library and used that knockback code on the demo, and it worked as expected. Is there anything that could be locking the movement of the mob, or resetting its velocity?

Also, are you sure that the values being passed in exist?
In response to Mightymo
What I'm doing now is:

    verb
Bone_Breaker()
set hidden=1
if(src.freeze) return
var/amount=20
var/after=src.Ki-amount
if(src.Ki<amount) return
if(src.Ki<=0) return
for(var/mob/M in get_step(src,usr.dir)) //this is hardest part of the code lol, basically, if their is a mob in the persons next step and in the persons direction
if(usr.dead) return
if(M.dead) return
if(M==usr) return
if(M.koed) return
if(M.dead) return
if(src.client)
winset(src,"ki","value=[after]")
src.Ki-=amount
flick("APunch",src)
animate(M, transform = matrix()*1.25, alpha = 0, time = 5)
animate(M, transform = matrix()/2, alpha = 255, time = 5)
if(src.dir==EAST)
flick("Koed",M)
M.knockback3(M,30,10)
M.HP-=20
M.Death(src)
world<<"sa"
if(src.dir==WEST)
flick("Koed",M)
M.knockback3(M,30,10)
M.HP-=20
M.Death(src)


And the "if(src.dir==WEST)" statement works, however the other one doesn't.
In response to Kboy33
Again, you need an "else if" for the west condition. I said this already.
In response to Kaiochao
I originally added an "else", however that didn't work.
In response to Kboy33
Your knockback proc is incorrect. You said you pulled it from the library, but it ended up missing the most important part: it moves src away from a given object, and the conditions in the verb aren't necessary at all. Your knockback simply moves a mob in the opposite direction it's facing, but facing direction should have nothing to do with it.

    verb
Bone_Breaker()
set hidden = TRUE
var amount = 20
if(dead || freeze || Ki < amount) return

Ki -= amount
if(client) winset(src, "ki", "value=[Ki]")

flick("APunch", src)

// find a mob within 32 pixels ahead of src
var mob/m = locate() in obounds(src, dir == EAST ? bound_width : -32, 0, 32 - bound_width, 0))
if(!m) return

// proper use of animate
var t = m.transform
var a = m.alpha
animate(m, transform = matrix() * 1.25, alpha = 0, time = 5)
animate(transform = t, alpha = a, time = 5)
flick("Koed", m)

// the victim is knocked back by src
m.knockback(src, 30, 10)

// the victim takes damage from src
m.HP -= 20
m.Death(src)

mob
proc/knockback(atom/a, move_x, move_y)
// get the center coordinates of both objects involved
var src_cx = (x - 1) * 32 + step_x + bound_x + bound_width / 2
var src_cy = (y - 1) * 32 + step_y + bound_y

var a_cx = (a.x - 1) * 32
var a_cy = (a.y - 1) * 32

if(istype(a, /atom/movable))
var atom/movable/m = a
a_cx += m.step_x + m.bound_x + m.bound_width / 2
a_cy += m.step_y + m.bound_y
else
a_cx += 16

// src is to the right of atom/a
if(src_cx > a_cx)
vel_x += move_x

// src is to the left
else
vel_x -= move_x

// src is at or above atom/a
if(src_cy >= a_cy)
vel_y += move_y

// src is below atom/a
else
vel_y -= move_y
In response to Kaiochao
"Your knockback simply moves a mob in the opposite direction it's facing, but facing direction should have nothing to do with it."

Excuse my lack of understanding, however why shouldn't that be the case? (Thank you for the corrected version.)
First, you'll notice that the exact same behavior will happen regardless of what direction src is facing. (The code is exactly the same regardless of which way it branches.) Second, it is as Kaio says. Say the one that is knock is facing east, and so is the one that is being knocked back. Now, since the one getting knocked back is facing east, it will be knocked west, towards the one knocking. The correct behavior would happen if the mob being knocked back was facing west.

The point is, the mob being knocked back should fly away from the one hitting it, rather than flying a direction based on the current facing direction.
In response to Kboy33
A.Knockback(B, some numbers) causes A to be knocked away from B. A needs to move "away from" B in the direction from B to A. The direction that A or B faces is not always the direction of the movement.

Consider (you are B, attacking A, the arrow represents facing direction):
A-> <-B = A moves left (opposite A's facing direction)
<-A <-B = A moves left (A's facing direction)
B-> <-A = A moves right (opposite A's facing direction)
B-> A-> = A moves right (A's facing direction)

You may have noticed that in the above scenarios, A is always moving in the direction B is facing. This is true only if B is facing A. If you have a shockwave attack, for example, where B can knock back enemies behind itself, then that won't be the case.
A B-> C = A moves left, C moves right
Unless the players are forced to face each other at all times :P ...but that's no excuse really. Do what they say, kboy, DO IT
In response to Mightymo
Ahhh, it all makes sense now. Thank you, Mo and KC.

@Magic *_* I'm coming for you.