Question about bouncing enemies off the ground

Matute2175

New member
Hi, how's it going? It's really hot here.

I have a question. I'm trying to make my character perform an aerial grab, grab the enemy, and throw him from the air towards the ground, but right when he hit the ground, I want the enemy to bounce upwards, simulating a big impact. I only want the enemy to bounce during that animation. Looking at the Legacy Manual, I see the bouncefactor option, but it would make me create a new fall animation for all enemies. I'm already using the function:

void throw(int Damage, int Type, int x, int y, int z, int Face)

{ // Damage as throw finisher

void self = getlocalvar("self");

void target = getlocalvar("Target" + self);

int SDir = getentityproperty(target,"direction");

int MDir;


if(Face==0){ // Same facing?

MDir = SDir;

}

if(Face==1){ // Opposite facing?

if(SDir==0){ // Facing left?
MDir = 1;
} else { MDir = 0;}
}

if(target==NULL())
{
target = getentityproperty(self, "grabbing");
setlocalvar("Target" + self, target);
}
if(target!=NULL())
{
int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
if(dir==0){ // Facing left?
x = -x;
}

if(Type==1)
{
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL5")); // 1st throw type
}

if(Type==2)
{
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL5")); // 2nd throw type
}

if(Type==3)
{
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL6")); // 3rd throw type
}

if(Type==4)
{
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL12")); // 4th throw type
}

if(Type==5)
{
damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL32")); // 5th throw type
}

changeentityproperty(target, "attacking", 1);
//changeentityproperty(target, "damage_on_landing", Damage);

changeentityproperty(target, "projectile", 1);

changeentityproperty(target, "direction", MDir);

tossentity(target, y, x, z); // Toss opponent ;)

}
}

My question is if there's a simpler way to solve this.

Thanks and regards!
 
Yes, I think in the end I'm going to have to create a new animation for all the enemies, even though there are quite a few of them o_O
i agree with bloodbane, you can fake the bouncing in the custom fall anim or if you want it to sufer further damage, make it so that it spawns and entity that can damage enemy at the exact time of hiting the ground/landing frame..
 
Back
Top Bottom