void keyintA(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released provided HP is more than limit
void self = getlocalvar("self");
void Health = getentityproperty(self,"health");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void iRKey;
if (Key=="U"){ //Up Required?
iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
}
if (Key=="D"){ //Down Required?
iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
}
if (Key=="J"){ //Jump Required?
iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
}
if (Key=="A"){ //Attack Required?
iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
}
if (Key=="S"){ //Special Required?
iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}
if (Key=="A2"){ //Attack2 Required?
iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
}
if (Key=="UK"){ //Up and Anybutton Required?
iRKey = playerkeys(iPIndex, 0, "moveup", "anybutton"); // "Up" + "Anybutton"
}
if (Key=="UJ"){ //Up and Jump Required?
iRKey = playerkeys(iPIndex, 0, "moveup", "jump"); // "Up" + "Jump"
}
if (Hflag==1){ //Not holding the button case?
iRKey = !iRKey; //Take the opposite condition
}
if ((Health > Limit)&&iRKey){
changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
changeentityproperty(self, "animpos", Frame);
if (Key=="UJ"){
// This is copy of dethrown
changeentityproperty(self, "attacking", 0);
changeentityproperty(self, "damage_on_landing", 0);
changeentityproperty(self, "projectile", 0);
}
}
}