void test_dograb()
{
void self;
void target;
int d;
int x;
int y;
int z;
int xadj;
/* Get self and target. */
self = getlocalvar("self");
target = getentityproperty(self, "opponent");
/* Get position and directional values. */
d = getentityproperty(self, "direction");
x = getentityproperty(self, "x");
y = getentityproperty(self, "a");
z = getentityproperty(self, "z");
xadj = 56;
/*Reverse X adjustment if facing left. */
if(!d) xadj = -xadj;
/* Set position adjustments */
x += xadj;
z -= 1;
/* Apply position adjustment to target. */
changeentityproperty(target, "position", x, z, y);
/* Apply grab*/
dograb(self, target, 0);
}