IL-GSC/BO1/PC/ZM/animscripts/zombie_dog_pain.gsc
2024-02-18 17:32:07 -05:00

45 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#using_animtree ("zombie_dog");
main()
{
self endon("killanimscript");
if ( self.a.disablePain )
{
return;
}
if ( IsDefined( self.enemy ) && IsDefined( self.enemy.syncedMeleeTarget) && self.enemy.syncedMeleeTarget == self )
{
self Unlink();
self.enemy.syncedMeleeTarget = undefined;
}
speed = length( self getaivelocity() );
pain_set = "pain";
pain_direction = getAnimDirection( self.damageyaw );
if ( speed > level.dogRunPainSpeed )
{
pain_set = "pain_run";
}
self ClearAnim( %root, 0.2 );
self SetFlaggedAnimRestart( "dog_pain_anim", anim.dogAnims[self.animSet].pain[pain_set][pain_direction], 1, 0.2, 1 );
self animscripts\zombie_shared::DoNoteTracksForTime( 0.2, "dog_pain_anim" );
}
getAnimDirection( damageyaw )
{
if( ( damageyaw > 135 ) ||( damageyaw <= -135 ) )
{
return 2;
}
else if( ( damageyaw > 45 ) &&( damageyaw <= 135 ) )
{
return 6;
}
else if( ( damageyaw > -45 ) &&( damageyaw <= 45 ) )
{
return 8;
}
else
{
return 4;
}
return "front";
}