Face animation stuff.

This commit is contained in:
Marisa the Magician 2024-04-17 18:44:23 +02:00
parent 4df11b3946
commit 2d41298100
5 changed files with 70 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 970 B

View File

@ -1,3 +1,3 @@
[default]
SAYA_MODVER="\cgRED-EYED RAMPAGE\c- \cw0.1a r142 \cu(Wed Apr 17 18:44:15 CEST 2024)\c-";
SAYA_SHORTVER="\cw0.1a r142 \cu(2024-04-17 18:44:15)\c-";
SAYA_MODVER="\cgRED-EYED RAMPAGE\c- \cw0.1a r143 \cu(Wed Apr 17 18:44:23 CEST 2024)\c-";
SAYA_SHORTVER="\cw0.1a r143 \cu(2024-04-17 18:44:23)\c-";

View File

@ -52,13 +52,32 @@ extend Class SayaStatusBar
let paindir = demo.paindir;
let facetimer = demo.facetimer;
let blinktime = demo.blinktime;
if ( CPlayer.Health <= 0 ) return 14;
if ( isInvulnerable() && (facestate >= FS_LOPAIN) ) return 4;
if ( facestate == FS_OUCH ) return (paindir==-1)?12:(paindir==1)?13:11;
if ( facestate == FS_HIPAIN ) return (paindir==-1)?9:(paindir==1)?10:8;
if ( facestate == FS_LOPAIN ) return (paindir==-1)?6:(paindir==1)?7:5;
if ( CPlayer.Health <= 0 )
{
if ( SayaPlayer(demo).lastword ) return 23;
return 22;
}
if ( facestate == FS_RAMPAGE )
{
// TODO: tiers
return 13;
}
if ( facestate == FS_EVILGRIN ) return 12;
if ( facestate == FS_GRIN ) return 4;
if ( facestate == FS_SAD ) return 5;
if ( facestate == FS_SAD ) return 8;
if ( isInvulnerable() )
{
if ( blinktime < 0 ) return 7;
return demo.lookdir+4;
}
if ( facestate == FS_OUCH ) return (paindir==-1)?20:(paindir==1)?21:19;
if ( facestate == FS_HIPAIN ) return (paindir==-1)?17:(paindir==1)?18:16;
if ( facestate == FS_LOPAIN ) return (paindir==-1)?9:(paindir==1)?10:8; // re-uses sad face
if ( CPlayer.Health <= 25 ) // low HP face
{
if ( blinktime < 0 ) return 11;
return demo.lookdir+8;
}
if ( blinktime < 0 ) return 3;
return demo.lookdir;
}

View File

@ -5,15 +5,17 @@ Enum ESayaFaceState
FS_DEFAULT,
FS_GRIN,
FS_SAD,
FS_EVILGRIN,
FS_LOPAIN,
FS_HIPAIN,
FS_OUCH,
FS_DEAD // UNUSED
FS_RAMPAGE
};
Class SayaPlayer : SWWMPlayer
{
int SpellSel;
bool lastword;
Default
{
@ -54,7 +56,7 @@ Class SayaPlayer : SWWMPlayer
override void UpdateFace()
{
// damage handling
if ( facedamage )
if ( facedamage && (facestate < FS_RAMPAGE) )
{
if ( lastdamage > 50 )
{
@ -80,6 +82,15 @@ Class SayaPlayer : SWWMPlayer
}
}
facedamage = false;
// "evil" grin variant, for BFG-tier weapons
// (takes priority over sad face, unlike standard grin)
if ( faceevilgrin && (facestate <= FS_SAD) )
{
facestate = FS_EVILGRIN;
facetimer = 50;
facegrin = false; // cancels normal grin
}
faceevilgrin = false;
if ( facegrin && (facestate < FS_SAD) )
{
facestate = FS_GRIN;
@ -92,6 +103,10 @@ Class SayaPlayer : SWWMPlayer
facetimer = 50;
}
facesad = false;
// TODO: rampage face when holding attack
// (takes priority over everything else,
// also Saya has three "tiers" to it,
// more to that will come when implemented)
if ( facetimer > 0 )
{
facetimer--;
@ -134,10 +149,35 @@ Class SayaPlayer : SWWMPlayer
if ( (item is 'Weapon') && level.maptime )
{
A_StartSound("*weaponlaugh",CHAN_VOICE);
facegrin = true;
if ( (item is 'SWWMWeapon') && SWWMWeapon(item).bISBFGTIER )
faceevilgrin = true;
else facegrin = true;
}
}
override int GetRespawnTimer()
{
// start smug
A_StartSound("saya/lastword",CHAN_VOICE);
lastword = true;
return 60;
}
override void PreRespawn()
{
// end smug
lastword = false;
// TODO spawn blast and backpack
}
override void PostRespawn()
{
// force ouch face
facestate = FS_OUCH;
facetimer = 40;
paindir = 0;
}
override Weapon PickWeapon( int slot, bool checkammo )
{
if ( slot == 8 ) EventHandler.SendNetworkEvent("sayaspellslot",0);