/* Instant throws. */
if(iKLtH || iKRtH) //Holding left or right?
{
/* Air to Air throw (Ax Destroyer). */
vTar = findtarget(vSelf, A_FOLLOW12, 100); //Look for target in range of grab.
if(vTar) //Valid target?
{
iBase = getentityproperty(vTar, "base");
fY = getentityproperty(vTar, "a");
iH = fY - iBase;
iAni = getentityproperty(vTar, "animationid");
if(iAni != DEFPOSE
&& iH >= 5) //More then 5 pixels from ground and not being thrown already?
{
/*
Can be grabbed? Can't use nograb flag as we want to catch falling targets too
and OpenBOR applies nograb flag by default. Instead we check for riding on an animal.
Otherwise, anything that won't crash (i.e. has thrown poses) is fair game.
*/
if(!getentityproperty(vTar, "animal") && getentityproperty(vTar, "animvalid", DEFPOSE))
{
bind0014(vTar, 0); //Initialize bind variable.
ani0009(0, A_FOLLOW12, -1); //Apply animation.
changeentityproperty(vSelf, "velocity",0,0,0);
changeplayerproperty(vSelf, "playkeys", 0); //Clear key event.
}
}
}
/* Air to ground throw (swing DDT) */
vTar = findtarget(vSelf, A_FOLLOW15, 100); //Look for target in range of grab.
if(vTar) //Valid target?
{
iBase = getentityproperty(vTar, "base");
fY = getentityproperty(vTar, "a");
iH = fY - iBase;
iDrop = getentityproperty(vTar, "aiflag", "drop"); //Drop status.
iAni = getentityproperty(vTar, "animationid");
if(iAni != DEFPOSE
&& iAni != A_RISE
&& iAni != A_RISEATK
&& iH < 5
&& !iDrop) //Less then 5 pixels from ground, not falling, not rising, and not being thrown already?
{
/*
Can be grabbed? Can't use nograb flag as we want to catch falling targets too
and OpenBOR applies nograb flag by default. Instead we check for riding on an animal.
Otherwise, anything that won't crash (i.e. has thrown poses) is fair game.
*/
if(!getentityproperty(vTar, "animal") && getentityproperty(vTar, "animvalid", DEFPOSE))
{
bind0014(vTar, 0); //Initialize bind variable.
ani0009(0, A_FOLLOW15, -1); //Apply animation.
changeplayerproperty(vSelf, "playkeys", 0); //Clear key event.
}
}
}
}