From 93891b2ccf8d3ca6ec5440586f533ec746bd5339 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Tue, 5 Jul 2022 23:33:29 +0200 Subject: [PATCH] Add mugshot to HUD. --- cvarinfo.base | 1 + gldefs.misc | 36 +--- graphics/HUD/DemoFace_Angerage.png | Bin 0 -> 185 bytes graphics/HUD/DemoFace_Angery.png | Bin 0 -> 185 bytes graphics/HUD/DemoFace_Barrier.png | Bin 0 -> 151 bytes graphics/HUD/DemoFace_Blink.png | Bin 0 -> 107 bytes graphics/HUD/DemoFace_Booty.png | Bin 0 -> 126 bytes graphics/HUD/DemoFace_Dead.png | Bin 0 -> 114 bytes graphics/HUD/DemoFace_Default.png | Bin 0 -> 114 bytes graphics/HUD/DemoFace_Dizzy.png | Bin 0 -> 119 bytes graphics/HUD/DemoFace_Evil.png | Bin 0 -> 120 bytes graphics/HUD/DemoFace_Flash.png | Bin 0 -> 327 bytes graphics/HUD/DemoFace_Grin.png | Bin 0 -> 111 bytes graphics/HUD/DemoFace_Head.png | Bin 0 -> 401 bytes graphics/HUD/DemoFace_Hurt.png | Bin 0 -> 115 bytes graphics/HUD/DemoFace_HurtLeft.png | Bin 0 -> 123 bytes graphics/HUD/DemoFace_HurtRight.png | Bin 0 -> 123 bytes graphics/HUD/DemoFace_Off.png | Bin 0 -> 185 bytes graphics/HUD/DemoFace_Ouch.png | Bin 0 -> 131 bytes graphics/HUD/DemoFace_Rage.png | Bin 0 -> 185 bytes graphics/HUD/DemoFace_Sad.png | Bin 0 -> 118 bytes graphics/HUD/DemoFace_Smug.png | Bin 0 -> 122 bytes graphics/HUD/DemoFace_Unamused.png | Bin 0 -> 112 bytes graphics/HUD/DemoFace_Wink.png | Bin 0 -> 116 bytes language.def_menu | 2 + language.es_menu | 2 + language.version | 4 +- menudef.txt | 1 + shaders/glsl/BarrierFace.fp | 9 + zscript/hud/swwm_hud.zsc | 247 ++++++++++++++++++++++++---- zscript/swwm_player.zsc | 11 +- zscript/weapons/swwm_splode.zsc | 3 + 32 files changed, 249 insertions(+), 67 deletions(-) create mode 100644 graphics/HUD/DemoFace_Angerage.png create mode 100644 graphics/HUD/DemoFace_Angery.png create mode 100644 graphics/HUD/DemoFace_Barrier.png create mode 100644 graphics/HUD/DemoFace_Blink.png create mode 100644 graphics/HUD/DemoFace_Booty.png create mode 100644 graphics/HUD/DemoFace_Dead.png create mode 100644 graphics/HUD/DemoFace_Default.png create mode 100644 graphics/HUD/DemoFace_Dizzy.png create mode 100644 graphics/HUD/DemoFace_Evil.png create mode 100644 graphics/HUD/DemoFace_Flash.png create mode 100644 graphics/HUD/DemoFace_Grin.png create mode 100644 graphics/HUD/DemoFace_Head.png create mode 100644 graphics/HUD/DemoFace_Hurt.png create mode 100644 graphics/HUD/DemoFace_HurtLeft.png create mode 100644 graphics/HUD/DemoFace_HurtRight.png create mode 100644 graphics/HUD/DemoFace_Off.png create mode 100644 graphics/HUD/DemoFace_Ouch.png create mode 100644 graphics/HUD/DemoFace_Rage.png create mode 100644 graphics/HUD/DemoFace_Sad.png create mode 100644 graphics/HUD/DemoFace_Smug.png create mode 100644 graphics/HUD/DemoFace_Unamused.png create mode 100644 graphics/HUD/DemoFace_Wink.png create mode 100644 shaders/glsl/BarrierFace.fp diff --git a/cvarinfo.base b/cvarinfo.base index 2ba95b26f..64d11ec66 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -122,6 +122,7 @@ server bool swwm_extendedpickup = false; // items will have an additional "virtu nosave bool swwm_voicelog = false; // adds player voicelines to the message log nosave bool swwm_skipskill = false; // skips skill confirmations nosave bool swwm_hudtrimammo = false; // only show ammo for owned weapons +nosave bool swwm_hudmugshot = true; // show an animated mugshot in the hud // minimap settings nosave bool swwm_mm_enable = true; // show a minimap below the score counter diff --git a/gldefs.misc b/gldefs.misc index ce11ea451..92834c0a6 100644 --- a/gldefs.misc +++ b/gldefs.misc @@ -1,10 +1,3 @@ -HardwareShader Texture "graphics/HUD/HealthBarS.png" -{ - Shader "shaders/glsl/Fuzz.fp" - Define "GRAY_COLORS" - Define "BASE_RES" = "vec2(100.,12.)" - Texture "noisetex" "textures/graynoise.png" -} HardwareShader Texture "graphics/HUD/EnemyBarS.png" { Shader "shaders/glsl/Fuzz.fp" @@ -12,46 +5,37 @@ HardwareShader Texture "graphics/HUD/EnemyBarS.png" Define "BASE_RES" = "vec2(50.,3.)" Texture "noisetex" "textures/graynoise.png" } -HardwareShader Texture "graphics/HUD/FuelBarS.png" -{ - Shader "shaders/glsl/Fuzz.fp" - Define "GRAY_COLORS" - Define "BASE_RES" = "vec2(120.,3.)" - Texture "noisetex" "textures/graynoise.png" -} -HardwareShader Texture "graphics/AltHUD/HealthBarS.png" +HardwareShader Texture "graphics/HUD/HealthBarS.png" { Shader "shaders/glsl/Fuzz.fp" Define "GRAY_COLORS" Define "BASE_RES" = "vec2(100.,5.)" Texture "noisetex" "textures/graynoise.png" } -HardwareShader Texture "graphics/AltHUD/FuelBarS.png" +HardwareShader Texture "graphics/HUD/FuelBarS.png" { Shader "shaders/glsl/Fuzz.fp" Define "GRAY_COLORS" Define "BASE_RES" = "vec2(120.,2.)" Texture "noisetex" "textures/graynoise.png" } -HardwareShader Texture "graphics/HUD/HealthBarD.png" -{ - Shader "shaders/glsl/HealthBarD.fp" - Define "TEX_SIZE" = "vec2(120.,32.)" - Texture "noisetex" "textures/graynoise.png" -} HardwareShader Texture "graphics/HUD/EnemyBarD.png" { Shader "shaders/glsl/HealthBarD.fp" Define "TEX_SIZE" = "vec2(70.,23.)" Texture "noisetex" "textures/graynoise.png" } - -HardwareShader Texture "graphics/AltHUD/HealthBarD.png" +HardwareShader Texture "graphics/HUD/HealthBarD.png" { Shader "shaders/glsl/HealthBarD.fp" Define "TEX_SIZE" = "vec2(120.,25.)" Texture "noisetex" "textures/graynoise.png" } +HardwareShader Texture "graphics/HUD/DemoFace_Barrier.png" +{ + Shader "shaders/glsl/BarrierFace.fp" + Texture "bartex" "models/barrierbar.png" +} HardwareShader Texture "graphics/tempbg.png" { Shader "shaders/glsl/Fuzz.fp" @@ -156,10 +140,6 @@ HardwareShader Texture "graphics/M_DEMOCHAN_THUMBUP.png" { Shader "shaders/glsl/Bilinear.fp" } -HardwareShader Texture "graphics/UnSXLogo.png" -{ - Shader "shaders/glsl/Bilinear.fp" -} HardwareShader Sprite "MBRNB0" { Shader "shaders/glsl/Whew.fp" diff --git a/graphics/HUD/DemoFace_Angerage.png b/graphics/HUD/DemoFace_Angerage.png new file mode 100644 index 0000000000000000000000000000000000000000..a131a36d10a5f4f47670cef26c71ac3a5d7cc49c GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0y~yU=U(pVBlk6W?*2r@FlQ?fq{V|y~r`?|Ns9#|NsC0 z&A?4ToPmLXKfou%l>rQl8I)!+82@KrNc%6&#=yY9SQ6wH%;50sMj8VHgNvt&V+cod z>xqrL4F(KH9GrQV8D^$2oM~YAZ_-qGjDdlHu_VYZn8D%MjWh-Z1{Y5k#}JO_ z))O0f8w?nZI6PPH_Lcmv~n-USXGB{8X%ehh7rTrYT>uX=ts_`Q*<<+}e?hAlg9 jZ4KM)e14ldXLw^?-ePYFJ)TxxQ;>C@u6{1-oD!M<`+YqJ literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Barrier.png b/graphics/HUD/DemoFace_Barrier.png new file mode 100644 index 0000000000000000000000000000000000000000..0e366b2e6192d554ff987dcbb1e77cbd2de62fbb GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;IMrH;E2G1=owlgp=um$*pxH5pj()69@85kHC zOM?7@862M7NMm4Nu=jLv4B?1QevqE<<3NMomwFbV|Nn!#C;b2apWXTI|Ns9b{xLJQ yFcdfXu(7pODKsDa$3Nl0e+K0n@(i5Mn0XlH&G+5#T_`dHWPzuvpUXO@geCxZp)scb literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Blink.png b/graphics/HUD/DemoFace_Blink.png new file mode 100644 index 0000000000000000000000000000000000000000..04a1f90e987ee78f50005aac8ac8a8b2e9351fa7 GIT binary patch literal 107 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|`~4V_;y&=z6<~fq{V|y~r`?|NsBr|NsC0 z{X{jU%a3i&*r<95NS#H0lR27-y)%!XMf g_?X?ik{KB)%>{q@U2kM!U|?YIboFyt=akR{01?S2+5i9m literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Dead.png b/graphics/HUD/DemoFace_Dead.png new file mode 100644 index 0000000000000000000000000000000000000000..9598e80acf1962f258cf8841e4c4b2338c938140 GIT binary patch literal 114 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{87V_;w??Y}F;z`($fUgVhc|NsB*|NsC0 z)FB;}&%nT->gnPbB5^r6AtB+%`39~FKY4y!`Ez`6=K`skSrQzXN+;bm{o!DExJ&ST Uf?|RW0|Nttr>mdKI;Vst0N#QqH2?qr literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Default.png b/graphics/HUD/DemoFace_Default.png new file mode 100644 index 0000000000000000000000000000000000000000..78516874443490c82037f51f54e22d6193bc9485 GIT binary patch literal 114 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{87V_;w??Y}F;z`($fUgVhc|NsB*|NsC0 z)FB;}&%nT->gnPbB5^r6rJ>TUe*!;`|a$<%1lYj=j&4IIq> UxI9}K7#J8lUHx3vIVCg!0CQj^CjbBd literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Dizzy.png b/graphics/HUD/DemoFace_Dizzy.png new file mode 100644 index 0000000000000000000000000000000000000000..e9c937d055d0c1fd36da5c72014ddccee521fbc1 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{87V_;w??Y}F;z`($fUgVhc|NsB*|NsC0 z)FB;}&%nT-<>}%WB5^r6rJ>V25c+Rf%Rhizbx8W{+oe;fx*+&&t;ucLK6V#kSkLF literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Flash.png b/graphics/HUD/DemoFace_Flash.png new file mode 100644 index 0000000000000000000000000000000000000000..f17ed4a833bda6617d5c7218302f18ba26c31566 GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I7G?$phQ^Te;|vT8q5(c3t_)ycY;2sCmNs+d z%rj@s{Qv(yI-Bo20|NtNNswPKgTu2MX$%Yu4?JBQLo|YyUfQ_!hyo8=!e++(Opyx0 zDyMi8Sos^yU08nLcmId31FGRMUt<>f??0%}!LcB&R`gTDiRqskK4>e>V`!N3&E@Qh zG~SK9E&|5JPbZ$3#Hf&UKbgzYBlpzA>-UV7CWT%4m3dGvt!lycBgTqXj(HTzO_1Pt z$)-7LlE~hJQJPohC8T|m=cqhjI-|KIEA3ju!_GT**1dM?jq&%tSh7~}%CS3Y8+`)% zx6WIiT75qEmg;0?h2s0l!k`?JRAp3G{`2b_}TBysJHRI4^IlyCQ~Mc6aU$muCGgZ R$iTqB;OXk;vd$@?2>>MSB{2X1 literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Head.png b/graphics/HUD/DemoFace_Head.png new file mode 100644 index 0000000000000000000000000000000000000000..f12b8457d18b2664eeceeb1fa98e0fef04a5f3b0 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4rT@h2A3sW#~2tGECYN(Tp1u>CIiFFnG9zb z7|xtw_|L%b|G&I^nz59Wt?$eaqHCo`ZbeTHnu*p{JrIKQlj4F z8EkEgN*Om+?sQ+|?y!`}qp#tQ;X%%*t-pMo!X#1)MRf|3=TErws@db^1c#L(w?e$K zvJ-xE2wt5N%F5sTpo;s4Or1cE3+s)~eijM)(rX$wU9gyRHOo$H$D#Q*85bMB>$6R0 zy3-ZPKI3_1(alFJH@@&QNR=|Iaua;p`Qdt;@ZC*phOUd3eK5Vxb1;A3t%nPG{8#T~ zn5M1A(QvAjH=^U~zlu9kPcG~F+4Oj6u7IIGN5#H4e;1uN$KSgmM1?pn$&|V#aQh#q zDXqD$Eo7zth`qDL_;%ZMp&v35IePU!_wpZ<-uhMWJpbFMKcJxXboFyt=akR{07ze_ A6951J literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Hurt.png b/graphics/HUD/DemoFace_Hurt.png new file mode 100644 index 0000000000000000000000000000000000000000..985078e199bea010ac0e4dc222a77169563acc86 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{87V_;w??Y}F;z`($fUgVhc|NsB*|NsC0 z)FB;}&%nT-=IP=XB5^r6B_ZL*c?QNFo+FL_Z?OCmzVKnbig4#ehb_H5Pksq9?26(2 Ve(t`M3j+fKgQu&X%Q~loCIIs}DH8wy literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_HurtLeft.png b/graphics/HUD/DemoFace_HurtLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..d89010ae741774a12ed349969af87374c20412b7 GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{87V_;w??Y}F;z`($fUgVhc|NsB*|NsC0 z)FB;}&%nT-=jq}YB5^r6rJ>rQljg8aN(q_(_dAxdk5d#AQV@Z%-FoVOh8)*y-3@)B7jv*Y; zttU3}HW)A*ad@uY@qNCg@dn2EybByWN@7wi{TSLLxnA%%U-kTO@OvXy%XR;)3|n^I k+8Vao`TRC_&hW;(yv5!UdOWSXrXcG)UHx3vIVCg!04eP~bN~PV literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Ouch.png b/graphics/HUD/DemoFace_Ouch.png new file mode 100644 index 0000000000000000000000000000000000000000..3757d77cbb2974cafae44f4fc2ce2ec32b8e3ef3 GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0y~yU=UznU|{E9V_;xlR5X{jU%a3i&*r<95NSM5RM%d-NR58zyov mOGtWrlvgzEnR1MY;q!mN-?{IU-!m{UFnGH9xvXrQ9GBBKBVEE6#@UiRXDFy}x#*!evUFMGaB5^r6!GZO^WI^-)7L|XKmA=n!I2rNuzwkp99@Cx(6^YId%E}BE YW%$3e-Aj1Qz`(%Z>FVdQ&MBb@09DQ@OaK4? literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Smug.png b/graphics/HUD/DemoFace_Smug.png new file mode 100644 index 0000000000000000000000000000000000000000..4858c8a01fab6c4f7f5208cb72672371969a4476 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|`{3V_;y|cbRWH0|Ns`dXZz&|NsBL|NsC0 zqo5G?RR#tIT~8Os5RU7~DGd$(c{mQ7Xpl`<@w4BZQE%gaod}hUH&1kU|FdWQ_`sf- cnVFekbqg0`vRA-b1_lNOPgg&ebxsLQ0NiCLp8x;= literal 0 HcmV?d00001 diff --git a/graphics/HUD/DemoFace_Unamused.png b/graphics/HUD/DemoFace_Unamused.png new file mode 100644 index 0000000000000000000000000000000000000000..4033cc252ac102256c31ad9a5d469d1febed77b1 GIT binary patch literal 112 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5U|{B8V_;xde9exZfq{V|y~r`?|NsBr|NsC0 zAx+fUnSp^p+0(@_gyVX0NTUe*!;`|a$<%1l0 70 ) + { + facestate = FS_OUCH; + facetimer = (d.lastdamagetimer-gametic)+10; + } + else if ( facestate < FS_OUCH ) + { + facestate = FS_PAIN; + facetimer = (d.lastdamagetimer-gametic)+10; + paindir = 0; + // paraphrased from vanilla, with some tweaks + if ( CPlayer.attacker && (CPlayer.attacker != d) && d ) + { + double atkang = d.AngleTo(CPlayer.attacker); + double angdiff = Actor.deltaangle(CPlayer.mo.angle,atkang); + if ( abs(angdiff) < 135 ) + { + if ( angdiff > 45 ) paindir = -1; + else if ( angdiff < -45 ) paindir = 1; + } + } + } + } + // grin timer + if ( d.lastgrin && (d.lastgrin == gametic) && (facestate <= FS_GRIN) ) + { + facestate = FS_GRIN; + facetimer = 50; + } + if ( CPlayer.mo.FindInventory("RagekitPower") && (facestate < FS_PAIN) ) + { + facestate = FS_EVIL; + facetimer = 10; + } + if ( facetimer > 0 ) + { + facetimer--; + if ( facetimer <= 0 ) + { + facestate = FS_DEFAULT; + blinktime = 30; + } + } + if ( !(gametic&1) ) + { + if ( blinktime <= 0 ) + { + blinktime--; + if ( blinktime < -3 ) + { + rss = int(MSTimeF()); + blinktime = (abs(GetRandom())%10)?(40+abs(GetRandom())%40):6; + } + } + else blinktime--; + } + } + // separated so they can be auto-ticked by the demolitionist menu void TickInterpolators() { + UpdateMugState(); ScoreInter.Update(SWWMCredits.Get(CPlayer)); int hp = CPlayer.Health; HealthInter.Update(hp); @@ -1434,6 +1516,25 @@ Class SWWMStatusBar : BaseStatusBar AmmoTex[2] = TexMan.CheckForTexture("graphics/HUD/AmmoBoxB.png",TexMan.Type_Any); MiniBox = TexMan.CheckForTexture("graphics/HUD/MinimapBox.png",TexMan.Type_Any); bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any); + FaceTex[0] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Head.png",TexMan.Type_Any); + FaceTex[1] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Flash.png",TexMan.Type_Any); + FaceTex[2] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Default.png",TexMan.Type_Any); + FaceTex[3] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Unamused.png",TexMan.Type_Any); + FaceTex[4] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Blink.png",TexMan.Type_Any); + FaceTex[5] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Grin.png",TexMan.Type_Any); + FaceTex[6] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Evil.png",TexMan.Type_Any); + FaceTex[7] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Hurt.png",TexMan.Type_Any); + FaceTex[8] = TexMan.CheckForTexture("graphics/HUD/DemoFace_HurtLeft.png",TexMan.Type_Any); + FaceTex[9] = TexMan.CheckForTexture("graphics/HUD/DemoFace_HurtRight.png",TexMan.Type_Any); + FaceTex[10] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Ouch.png",TexMan.Type_Any); + FaceTex[11] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Dead.png",TexMan.Type_Any); + FaceTex[12] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Smug.png",TexMan.Type_Any); + FaceTex[13] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Angery.png",TexMan.Type_Any); + 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); + // other expressions will be added when needed + blinktime = 30; mSmallFont = Font.GetFont('TewiFont'); mBigFont = Font.GetFont('TewiFontOutline'); mTinyFont = Font.GetFont('MiniwiFont'); @@ -1539,7 +1640,7 @@ Class SWWMStatusBar : BaseStatusBar AmmoMaxFlash[i] = 0; AmmoOldMaxAmounts[i] = int.min; } - ScoreInter = SmoothDynamicValueInterpolator.Create(0,.1,1,999999999); + ScoreInter = DynamicValueInterpolator.Create(0,.1,1,999999999); hnd = SWWMHandler(EventHandler.Find("SWWMHandler")); PrevFrame = MSTimeF(); } @@ -2722,12 +2823,14 @@ Class SWWMStatusBar : BaseStatusBar return true; } - private void DrawInventory( int invy = 56 ) + private void DrawInventory( bool drawmug = false ) { + int invy = drawmug?61:56; // active items (armor / powerups) double xx = margin+2; double yy = ss.y-(margin+invy); - if ( CPlayer.mo.InvSel && !isInventoryBarVisible() ) yy -= 34; + if ( drawmug ) yy -= 9; + if ( CPlayer.mo.InvSel && !isInventoryBarVisible() && !drawmug ) yy -= 34; bool drewarmor = false; for ( Inventory i=CPlayer.mo.Inv; i; i=i.Inv ) { @@ -2737,8 +2840,13 @@ Class SWWMStatusBar : BaseStatusBar drewarmor = true; } yy = ss.y-(margin+invy); - if ( drewarmor ) xx += 40; - else if ( CPlayer.mo.InvSel && !isInventoryBarVisible() ) yy -= 34; + if ( drawmug ) yy -= 9; + if ( drewarmor ) + { + xx += 36; + if ( drawmug && CPlayer.mo.InvSel && !isInventoryBarVisible() ) yy -= 34; + } + else if ( CPlayer.mo.InvSel && !isInventoryBarVisible() && !drawmug ) yy -= 34; for ( Inventory i=CPlayer.mo.Inv; i; i=i.Inv ) { if ( (i is 'SWWMLamp') && SWWMLamp(i).bActivated ) @@ -2790,8 +2898,8 @@ Class SWWMStatusBar : BaseStatusBar DrawInvIcon(next[1],xx+70,yy+2,1./3.); return; } - Screen.DrawTexture(InventoryTex,false,margin,ss.y-(margin+invy+2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - DrawInvIcon(CPlayer.mo.InvSel,margin+2,ss.y-(margin+invy),selected:true); + Screen.DrawTexture(InventoryTex,false,margin+(drawmug?36:0),ss.y-(margin+invy+2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + DrawInvIcon(CPlayer.mo.InvSel,margin+2+(drawmug?36:0),ss.y-(margin+invy),selected:true); } private void DrawWeapons() @@ -2967,7 +3075,7 @@ Class SWWMStatusBar : BaseStatusBar Screen.DrawTexture(AmmoTex[0],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); } // score - String sstr = String.Format("%09d",int(ScoreInter.GetValue(fractic))); + String sstr = String.Format("%09d",int(ScoreInter.GetValue())); xx = ss.x-(margin+48); if ( bDrewAmmo ) yy -= 12; else yy = ss.y-(margin+22); @@ -3016,9 +3124,77 @@ Class SWWMStatusBar : BaseStatusBar } } - private void DrawStatus() + private int GetRandom() { - Screen.DrawTexture(StatusTex,false,margin,ss.y-(margin+22),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + return (rss = (rss<<1)*35447+(rss/87)); + } + + private double RandomShiver() + { + int sd = GetRandom(); + return ((abs(sd)%11)-5)*.1; + } + + 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 ( facestate == FS_OUCH ) return 10; + if ( facestate == FS_PAIN ) return (paindir==1)?8:(paindir==-1)?9:7; + switch ( blinktime ) + { + case -1: + case -3: + return 3; + break; + case -2: + return 4; + break; + } + return 2; + } + + private void DrawMugshot() + { + rss = int(MSTimeF())*128; + let demo = Demolitionist(CPlayer.mo); + double paintime = clamp((demo.lastdamagetimer-(gametic+Fractic))/35.,0.,1.); + double noiz = min(demo.lastdamage*.5*paintime,3.); + Vector2 shake = (RandomShiver(),RandomShiver())*noiz; + if ( !CPlayer.mo.FindInventory("GhostPower") ) + { + Screen.DrawTexture(FaceTex[0],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + bool raging = CPlayer.mo.FindInventory("RagekitPower"); + bool angy = CPlayer.mo.FindInventory("AngeryPower"); + if ( raging && angy ) Screen.DrawTexture(FaceTex[16],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + else if ( raging ) Screen.DrawTexture(FaceTex[15],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + else if ( angy ) Screen.DrawTexture(FaceTex[13],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawTexture(FaceTex[1],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Color,Color(255,255,0,0),DTA_Alpha,min(1.,noiz)); + if ( (CPlayer.Health > 0) && (isInvulnerable() || CPlayer.mo.FindInventory("InvinciballPower")) ) + Screen.DrawTexture(FaceTex[1],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,.8+.1*sin(gametic+fractic)); + } + else + { + Screen.DrawTexture(FaceTex[0],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_FillColor,Color(0,0,0),DTA_Alpha,.25*(1.-min(1.,noiz))); + Screen.DrawTexture(FaceTex[1],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_FillColor,Color(255,0,0),DTA_Alpha,.25*min(1.,noiz)); + } + Screen.DrawTexture(FaceTex[GetFaceTex()],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( CPlayer.mo.FindInventory("BarrierPower") ) Screen.DrawTexture(FaceTex[14],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,.5,DTA_LegacyRenderStyle,STYLE_Add); + } + + private void DrawStatus( bool drawmug = false ) + { + int ox = 0; + int oy = 0; + if ( drawmug ) + { + DrawMugshot(); + ox = 36; + oy = 5; + } + Screen.DrawTexture(StatusTex,false,margin+ox,ss.y-(margin+22+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); String str; double ht = clamp(HealthInter.GetValue(fractic),0,10000); str = String.Format("%3d",clamp(round(ht),0,999)); @@ -3030,34 +3206,34 @@ Class SWWMStatusBar : BaseStatusBar else if ( round(ht) > 100 ) hcolor = MCR_CYAN; if ( isInvulnerable() || CPlayer.mo.FindInventory("InvinciballPower") ) { - Screen.DrawTexture(HealthTex[0],false,margin+3,ss.y-(margin+19),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,Color(255,0,0,0)); - Screen.DrawTexture(HealthTex[4],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); + Screen.DrawTexture(HealthTex[0],false,margin+3+ox,ss.y-(margin+19+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,Color(255,0,0,0)); + Screen.DrawTexture(HealthTex[4],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); hcolor = MCR_WHITE; } else { - Screen.DrawTexture(HealthTex[0],false,margin+3,ss.y-(margin+19),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,Color(255,0,0,0)); - Screen.DrawTexture(HealthTex[0],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); + Screen.DrawTexture(HealthTex[0],false,margin+3+ox,ss.y-(margin+19+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,Color(255,0,0,0)); + Screen.DrawTexture(HealthTex[0],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); if ( ht > 100 ) { hw = min(ht-100,100); - Screen.DrawTexture(HealthTex[1],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); + Screen.DrawTexture(HealthTex[1],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); } if ( ht > 200 ) { hw = min(ht-200,300)/3.; - Screen.DrawTexture(HealthTex[2],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); + Screen.DrawTexture(HealthTex[2],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); } if ( ht > 500 ) { hw = min(ht-500,500)/5.; - Screen.DrawTexture(HealthTex[3],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); + Screen.DrawTexture(HealthTex[3],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw); } } if ( CPlayer.mo.FindInventory("DivineSpriteEffect") ) { double falph = clamp((ht-1000)/6000.,0.,1.); - Screen.DrawTexture(HealthTex[5],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph,DTA_LegacyRenderStyle,STYLE_Add); + Screen.DrawTexture(HealthTex[5],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph,DTA_LegacyRenderStyle,STYLE_Add); String tst; double alph = .1; int trl = 9; @@ -3066,42 +3242,42 @@ Class SWWMStatusBar : BaseStatusBar tst = "AAA"; SWWMUtility.ObscureText(tst,(gametic-trl)/3,true); trl--; - Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_WHITE],margin+107,ss.y-(margin+20),tst,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph*alph,DTA_LegacyRenderStyle,STYLE_Add); + Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_WHITE],margin+107+ox,ss.y-(margin+20+oy),tst,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph*alph,DTA_LegacyRenderStyle,STYLE_Add); } - Screen.DrawText(MiniHUDFont,mhudfontcol[hcolor],margin+107,ss.y-(margin+20),String.Format("%3d",clamp(round(ht),0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,1.-falph); + Screen.DrawText(MiniHUDFont,mhudfontcol[hcolor],margin+107+ox,ss.y-(margin+20+oy),String.Format("%3d",clamp(round(ht),0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,1.-falph); } else { - Screen.DrawText(MiniHUDFont,mhudfontcol[hcolor],margin+107,ss.y-(margin+20),String.Format("%3d",clamp(round(ht),0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + Screen.DrawText(MiniHUDFont,mhudfontcol[hcolor],margin+107+ox,ss.y-(margin+20+oy),String.Format("%3d",clamp(round(ht),0,999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); int f = HealthFlash; if ( f && (gametic < f) ) { double alph = max((f-(gametic+FracTic))/25.,0.)**1.5; - Screen.DrawTexture(HealthTex[7],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,bhw,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph); - Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],margin+107,ss.y-(margin+20),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph); + Screen.DrawTexture(HealthTex[7],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,bhw,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph); + Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],margin+107+ox,ss.y-(margin+20+oy),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph); } if ( (CPlayer.health > 0) && (CPlayer.health <= 25) && (PulsePhase <= 15) ) { double alph = clamp(sin((PulsePhase-FracTic)*12.),0.,1.); - Screen.DrawTexture(HealthTex[6],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph); - Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_REDFLASH],margin+107,ss.y-(margin+20),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); + Screen.DrawTexture(HealthTex[6],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph); + Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_REDFLASH],margin+107,ss.y-(margin+20+oy),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph); } ht = clamp(LagHealthInter.GetValue(fractic),0,1000); double hwl = min(ht,100); if ( hwl > bhw ) { - Screen.DrawTexture(HealthTex[8],false,margin+3,ss.y-(margin+19),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,bhw,DTA_WindowRightF,hwl,DTA_ColorOverlay,Color(255,0,0,0)); - Screen.DrawTexture(HealthTex[8],false,margin+2,ss.y-(margin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,bhw,DTA_WindowRightF,hwl); + Screen.DrawTexture(HealthTex[8],false,margin+3+ox,ss.y-(margin+19+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,bhw,DTA_WindowRightF,hwl,DTA_ColorOverlay,Color(255,0,0,0)); + Screen.DrawTexture(HealthTex[8],false,margin+2+ox,ss.y-(margin+20+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,bhw,DTA_WindowRightF,hwl); } } double ft = clamp(FuelInter.GetValue(fractic),0,120); - Screen.DrawTexture(FuelTex[swwm_superfuel],false,margin+3,ss.y-(margin+7),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ft,DTA_ColorOverlay,Color(255,0,0,0)); - Screen.DrawTexture(FuelTex[swwm_superfuel],false,margin+2,ss.y-(margin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ft); + Screen.DrawTexture(FuelTex[swwm_superfuel],false,margin+3+ox,ss.y-(margin+7+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ft,DTA_ColorOverlay,Color(255,0,0,0)); + Screen.DrawTexture(FuelTex[swwm_superfuel],false,margin+2+ox,ss.y-(margin+8+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ft); let d = Demolitionist(CPlayer.mo); bool blink = (!d || (d.dashfuel > 20) || ((gametic%10) < 5)); double dt = clamp(DashInter.GetValue(fractic),0,120); - Screen.DrawTexture(DashTex,false,margin+3,ss.y-(margin+4),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,dt,DTA_ColorOverlay,Color(255,0,0,0)); - Screen.DrawTexture(DashTex,false,margin+2,ss.y-(margin+5),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,dt,DTA_ColorOverlay,Color(blink?0:96,0,0,0)); + Screen.DrawTexture(DashTex,false,margin+3+ox,ss.y-(margin+4+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,dt,DTA_ColorOverlay,Color(255,0,0,0)); + Screen.DrawTexture(DashTex,false,margin+2+ox,ss.y-(margin+5+oy),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,dt,DTA_ColorOverlay,Color(blink?0:96,0,0,0)); } private void DrawPickups() @@ -3401,8 +3577,9 @@ Class SWWMStatusBar : BaseStatusBar { DrawTarget(); DrawTopStuff(); - DrawInventory(); - DrawStatus(); + bool drawmug = swwm_hudmugshot; + DrawInventory(drawmug); + DrawStatus(drawmug); DrawWeapons(); if ( hnd ) hnd.DrawBossBar(self); DrawPickups(); diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 30284602c..c2ccbd7ef 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -88,7 +88,7 @@ Class Demolitionist : PlayerPawn int invwipe; // inventory wipe flags for next level - transient int lastbang; + transient int lastbang, lastgrin; transient bool ingivecheat; @@ -2816,6 +2816,7 @@ Class Demolitionist : PlayerPawn SWWMHandler.AddOneliner("getweapon",2); } else SWWMHandler.AddOneliner("getweapon",2); + lastgrin = gametic; } } if ( (item is 'Key') && !key_reentrant && !deathmatch && !bInDefaultInventory ) @@ -2836,6 +2837,7 @@ Class Demolitionist : PlayerPawn SWWMHandler.AddOneliner("keyget",2); } else SWWMHandler.AddOneliner("keyget",2); + lastgrin = gametic; } // share all keys in mp for ( int i=0; i 0) && (mystats.ownedcollectibles.Find(cls) < mystats.ownedcollectibles.Size()) ) return; @@ -2863,6 +2869,7 @@ Class Demolitionist : PlayerPawn { mystats.gotyorick = true; SWWMHandler.AddOneliner("skullget",2); + lastgrin = gametic; } // notify key obtained to flash icon if ( item is 'Key' ) diff --git a/zscript/weapons/swwm_splode.zsc b/zscript/weapons/swwm_splode.zsc index aa4502c0d..85dd945aa 100644 --- a/zscript/weapons/swwm_splode.zsc +++ b/zscript/weapons/swwm_splode.zsc @@ -61,7 +61,10 @@ Class ExplodiumGun : SWWMWeapon // add the oneliner let demo = Demolitionist(Owner); if ( demo && demo.mystats && !demo.mystats.GotWeapon(SisterWeapon.GetClass()) && (Owner.player == players[consoleplayer]) && !demo.ingivecheat ) + { SWWMHandler.AddOneliner(SWWMWeapon(SisterWeapon).GetLine,2); + demo.lastgrin = gametic; + } item.bPickupGood = true; } return true;