Additional face reactions.

This commit is contained in:
Mari the Deer 2022-07-06 13:10:46 +02:00
commit 9d0287ef50
8 changed files with 86 additions and 21 deletions

View file

@ -140,7 +140,10 @@ extend Class SWWMHandler
if ( e.Thing.IsFriend(e.DamageSource) && !(e.Thing is 'LampMoth') )
{
if ( !lastcombat || (gametic > lastcombat+20) )
{
lastcombat = AddOneliner("hitfriend",1,10);
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).lastsad = gametic;
}
highesttic = gametic;
}
}
@ -168,7 +171,10 @@ extend Class SWWMHandler
if ( !lastcombat || (gametic > lastcombat+20) )
{
if ( e.Thing.IsFriend(src) )
{
lastcombat = AddOneliner("friendkill",1,5);
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).lastsad = gametic;
}
else if ( (!lastcombat || (gametic > lastcombat+50)) && !SWWMHDoomHandler.IsCuteGirl(e.Thing) ) // [HDoom] don't shout at the girls
{
int lc = 0;

View file

@ -108,6 +108,8 @@ extend Class SWWMHandler
if ( loudlv > 3 ) players[consoleplayer].mo.A_StartSound(onelinersnd,CHAN_DEMOVOICEAUX3,CHANF_DEFAULT,1.,ATTN_NONE);
}
SendNetworkEvent("swwmremoteliner."..onelinersnd,consoleplayer,onelinerlevel);
// hack due to the fact this one can be cancelled early
if ( onelinertype == "falling" ) Demolitionist(players[consoleplayer].mo).lastgrin = gametic;
}
onelinertic = 0;
onelinerspan = 0;

View file

@ -70,6 +70,9 @@ Enum EDemoFaceState
FS_DEFAULT,
FS_EVIL,
FS_GRIN,
FS_WINK,
FS_BLINK,
FS_SAD,
FS_PAIN,
FS_OUCH,
FS_DEAD // UNUSED
@ -79,7 +82,7 @@ Class SWWMStatusBar : BaseStatusBar
{
TextureID StatusTex, WeaponTex, ScoreTex, InventoryTex, ChatTex[6],
HealthTex[9], FuelTex[2], DashTex, EnemyBTex, EnemyHTex[6],
GenericAmmoTex[3], AmmoTex[3], MiniBox, bgtex, FaceTex[17];
GenericAmmoTex[3], AmmoTex[3], MiniBox, bgtex, FaceTex[19];
Font mSmallFont, mBigFont, mTinyFont, MiniHUDFont, MiniHUDFontOutline;
int mhudfontcol[NUM_MINIHUD_COLOR];
@ -1070,12 +1073,26 @@ Class SWWMStatusBar : BaseStatusBar
}
}
}
// grin timer
if ( d.lastgrin && (d.lastgrin == gametic) && (facestate <= FS_GRIN) )
if ( d.lastgrin && (d.lastgrin == gametic) && (facestate < FS_SAD) )
{
facestate = FS_GRIN;
facetimer = 50;
}
if ( d.lastwink && (d.lastwink == gametic) && (facestate < FS_SAD) )
{
facestate = FS_WINK;
facetimer = 20;
}
if ( d.lastblink && (d.lastblink == gametic) && (facestate < FS_PAIN) )
{
facestate = FS_BLINK;
facetimer = 30;
}
if ( d.lastsad && (d.lastsad == gametic) && (facestate <= FS_SAD) )
{
facestate = FS_SAD;
facetimer = 50;
}
if ( CPlayer.mo.FindInventory("RagekitPower") && (facestate < FS_PAIN) )
{
facestate = FS_EVIL;
@ -1533,6 +1550,8 @@ Class SWWMStatusBar : BaseStatusBar
FaceTex[14] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Barrier.png",TexMan.Type_Any);
FaceTex[15] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Rage.png",TexMan.Type_Any);
FaceTex[16] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Angerage.png",TexMan.Type_Any);
FaceTex[17] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Sad.png",TexMan.Type_Any);
FaceTex[18] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Wink.png",TexMan.Type_Any);
// other expressions will be added when needed
blinktime = 30;
mSmallFont = Font.GetFont('TewiFont');
@ -3138,11 +3157,14 @@ Class SWWMStatusBar : BaseStatusBar
private int GetFaceTex()
{
if ( CPlayer.Health <= 0 ) return 11;
if ( facestate == FS_GRIN ) return 5;
if ( facestate == FS_EVIL ) return 6;
if ( isInvulnerable() || CPlayer.mo.FindInventory("InvinciballPower") ) return (blinktime<-1)?4:12;
if ( (isInvulnerable() || CPlayer.mo.FindInventory("InvinciballPower")) && (facestate >= FS_PAIN) ) return 12;
if ( facestate == FS_OUCH ) return 10;
if ( facestate == FS_PAIN ) return (paindir==1)?8:(paindir==-1)?9:7;
if ( facestate == FS_GRIN ) return 5;
if ( facestate == FS_EVIL ) return 6;
if ( facestate == FS_SAD ) return 17;
if ( facestate == FS_WINK ) return 18;
if ( facestate == FS_BLINK ) return ((facetimer>28)||(facetimer<2))?3:4;
switch ( blinktime )
{
case -1:

View file

@ -81,6 +81,10 @@ Class FrispyCornGesture : SWWMItemGesture
}
Class SayaBeanGesture : SWWMItemGesture
{
action void A_PreSquish()
{
if ( Demolitionist(self) ) Demolitionist(self).lastgrin = gametic;
}
action void A_Squish1()
{
A_StartSound("squeak",CHAN_ITEMEXTRA,CHANF_OVERLAP);
@ -133,7 +137,8 @@ Class SayaBeanGesture : SWWMItemGesture
XZW1 A 3 A_UsePlush();
XZW1 B 3 A_StartSound("demolitionist/handsup",CHAN_WEAPON,CHANF_OVERLAP);
XZW1 CDEFGH 3;
XZW1 IJ 4;
XZW1 I 4 A_PreSquish();
XZW1 J 4;
XZW1 KL 3;
XZW1 M 2 A_Squish1();
XZW1 N 2 A_Squish2();
@ -252,6 +257,10 @@ Class KirinPlushGesture : SWWMItemGesture
s.plushuses++;
SWWMUtility.AchievementProgress("plush",s.plushuses,player);
}
action void A_PreKiss()
{
if ( Demolitionist(self) ) Demolitionist(self).lastblink = gametic;
}
action void A_PetPlush()
{
A_StartSound("demolitionist/petting",CHAN_WEAPON,CHANF_OVERLAP);
@ -304,7 +313,7 @@ Class KirinPlushGesture : SWWMItemGesture
XZW1 CDEFGH 3;
XZW1 IJKL 5;
XZW1 M 5 A_StartSound("demolitionist/handsdown",CHAN_WEAPON,CHANF_OVERLAP);
XZW1 N 4;
XZW1 N 4 A_PreKiss();
XZW1 O 2;
XZW1 P 2 A_PetPlush();
XZW1 Q 3 A_KissPlush();

View file

@ -88,7 +88,10 @@ Class GrilledCheeseSandwich : Inventory
if ( Owner.Health > 500 ) return false;
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA,CHANF_OVERLAP);
if ( (Owner.player == players[consoleplayer]) && (swwm_mutevoice < 2) )
{
SWWMHandler.AddOneliner("eat",2);
if ( Owner is 'Demolitionist' ) Demolitionist(Owner).lastgrin = gametic;
}
DoTheThing();
return true;
}

View file

@ -88,7 +88,7 @@ Class Demolitionist : PlayerPawn
int invwipe; // inventory wipe flags for next level
transient int lastbang, lastgrin;
transient int lastbang, lastgrin, lastsad, lastwink, lastblink;
transient bool ingivecheat;
@ -2775,6 +2775,7 @@ Class Demolitionist : PlayerPawn
{
Console.Printf(StringTable.Localize("$SWWM_FINDSECRET"),score);
SWWMHandler.AddOneliner("findsecret",2,40);
lastgrin = gametic;
}
else Console.Printf(StringTable.Localize("$SWWM_FINDSECRETREM"),player.GetUserName(),score);
SWWMCredits.Give(player,score);
@ -3443,30 +3444,44 @@ Class Demolitionist : PlayerPawn
Goto Spawn+1;
Approve:
#### # 3;
XZW5 NOPQRSTUVWXYZ 3;
XZW5 NOPQR 3;
XZW5 S 3 { lastgrin = gametic; }
XZW5 TUVWXYZ 3;
XZW6 ABCD 3;
Goto Spawn+1;
Victory:
#### # 3;
XZW6 EFGHIJKLMNOPQRSTUVW 3;
XZW6 EFGH 3;
XZW6 I 3 { lastgrin = gametic; }
XZW6 JKLMNOPQRSTUVW 3;
Goto Spawn+1;
BlowKiss:
#### # 3;
XZWD EFGHIJKLMNOPQRSTUVW 3;
XZWD EFGH 3;
XZWD I 3 { lastblink = gametic; }
XZWD JKLMNO 3;
XZWD P 3 { lastwink = gametic; }
XZWD QRSTUVW 3;
Goto Spawn+1;
Headpat:
#### # 3;
XZWH ST 3;
XZWH UVW 2;
XZWH U 2;
XZWH V 2 { lastgrin = gametic; }
XZWH W 2;
XZWH XYZ 1;
XZWI A 1;
XZWI BCDE 2;
XZWI B 2;
XZWI C 2 { lastgrin = gametic; }
XZWI DE 2;
XZWI FG 1;
HeadpatLoop:
XZWI H 1;
XZWH XYZ 1;
XZWI A 1;
XZWI BCDE 2;
XZWI B 2;
XZWI C 2 { lastgrin = gametic; }
XZWI DE 2;
XZWI FGH 1;
XZWI IJK 2;
XZWI LMNO 3;
@ -3562,17 +3577,25 @@ Class Demolitionist : PlayerPawn
Goto Crouch+1;
CrouchApprove:
#### # 3;
XZWF PQRSTUVWXYZ 3;
XZWF PQRST 3;
XZWF U 3 { lastgrin = gametic; }
XZWF VWXYZ 3;
XZWG ABCDEF 3;
Goto Crouch+1;
CrouchVictory:
#### # 3;
XZWG GHIJKLMNOPQRSTUVWXY 3;
XZWG GHIJ 3;
XZWG K 3 { lastgrin = gametic; }
XZWG LMNOPQRSTUVWXY 3;
Goto Crouch+1;
CrouchBlowKiss:
#### # 3;
XZWG Z 3;
XZWH ABCDEFGHIJKLMNOPQR 3;
XZWH ABC 3;
XZWH D 3 { lastblink = gametic; }
XZWH EFGHIJ 3;
XZWH K 3 { lastwink = gametic; }
XZWH LMNOPQR 3;
Goto Crouch+1;
CrouchMissile:
XZW7 M 2;

View file

@ -77,7 +77,7 @@ Class Wallbuster : SWWMWeapon
tdir = level.Vec3Diff(e.ViewPos,cpos25[i]);
// project
ndc = SWWMUtility.ProjectPoint(sb.projdata,e.ViewPos+tdir);
if ( ndc.z >= 1. ) return;
if ( ndc.z >= 1. ) continue;
vpos = SWWMUtility.NDCToViewport(sb.projdata,ndc);
oldvpos = lagvpos25[i];
if ( !prevframe || (lagvpos25[i] == (0,0)) ) oldvpos = lagvpos25[i] = vpos;