Adapt to new CL changes.

This commit is contained in:
Marisa the Magician 2023-12-13 20:43:24 +01:00
parent ba0d64a505
commit 7c8ed10735
11 changed files with 185 additions and 48 deletions

View File

@ -102,3 +102,8 @@ Material Texture "graphics/HUD/HealthBarInvul.png"
Define "GRAY_COLORS"
Define "BASE_RES" = "vec2(100.,5.)"
}
Material Texture "graphics/HUD/IbukiFace_Barrier.png"
{
Shader "shaders/glsl/BarrierFace.fp"
Texture "bartex" "models/barrierbar.png"
}

BIN
graphics/HUD/IbukiFace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 115 B

View File

@ -1,3 +1,3 @@
[default]
ONI_MODVER="\crRED ONI\c- \cw0.1a r160 \cu(Mon 11 Dec 11:01:29 CET 2023)\c-";
ONI_SHORTVER="\cw0.1a r160 \cu(2023-12-11 11:01:29)\c-";
ONI_MODVER="\crRED ONI\c- \cw0.1a r161 \cu(Wed 13 Dec 20:43:24 CET 2023)\c-";
ONI_SHORTVER="\cw0.1a r161 \cu(2023-12-13 20:43:24)\c-";

View File

@ -2,7 +2,7 @@
Class OniStatusBar : SWWMStatusBar
{
TextureID StatusTex, AmmoTex, InvExtraTex, WeaponTex, HealthTex[5], OilTex, GenTex[3], LagTex;
TextureID StatusTex, AmmoTex, WeaponTex, HealthTex[5], OilTex, GenTex[3], LagTex, FaceTex[3];
int AmmoFlash[7]; // flash when new ammo is received
int AmmoOldAmounts[7]; // to detect when to flash
int AmmoMaxFlash[7]; // flash when ammo max amount changes
@ -27,7 +27,6 @@ Class OniStatusBar : SWWMStatusBar
Super.Init();
StatusTex = TexMan.CheckForTexture("graphics/HUD/StatusBox.png");
AmmoTex = TexMan.CheckForTexture("graphics/HUD/AmmoBox.png");
InvExtraTex = TexMan.CheckForTexture("graphics/HUD/GrenadeBox.png");
WeaponTex = TexMan.CheckForTexture("graphics/HUD/WeaponBox.png");
HealthTex[0] = TexMan.CheckForTexture("graphics/HUD/HealthBar.png");
HealthTex[1] = TexMan.CheckForTexture("graphics/HUD/HealthBarEx.png");
@ -39,6 +38,11 @@ Class OniStatusBar : SWWMStatusBar
GenTex[1] = TexMan.CheckForTexture("graphics/HUD/GenericAmmoBoxM.png");
GenTex[2] = TexMan.CheckForTexture("graphics/HUD/GenericAmmoBoxR.png");
LagTex = TexMan.CheckForTexture("graphics/HUD/LagBar.png");
FaceTex[0] = TexMan.CheckForTexture("graphics/HUD/IbukiFace.png");
FaceTex[1] = TexMan.CheckForTexture("graphics/HUD/IbukiFace_Flash.png");
FaceTex[2] = TexMan.CheckForTexture("graphics/HUD/IbukiFace_Barrier.png");
mugw = 22;
mugh = 30;
tclabel = mhudfontcol[MCR_RED];
tcvalue = mhudfontcol[MCR_WHITE];
tcextra = mhudfontcol[MCR_IBUKIHUD];

View File

@ -48,32 +48,70 @@ extend Class OniStatusBar
LagOil[i] = LagOil[i-1];
}
override int GetFaceTex( SWWMPlayer demo )
{
let facestate = demo.facestate;
let paindir = demo.paindir;
let facetimer = demo.facetimer;
let blinktime = demo.blinktime;
if ( CPlayer.Health <= 0 ) return 15;
if ( (isInvulnerable() || demo.FindInventory("OniMilkPower")) && (facestate >= FS_LOPAIN) ) return 4;
if ( facestate == FS_OUCH ) return (paindir==-1)?13:(paindir==1)?14:12;
if ( facestate == FS_HIPAIN ) return (paindir==-1)?10:(paindir==1)?11:9;
if ( facestate == FS_LOPAIN ) return (paindir==-1)?7:(paindir==1)?8:6;
if ( facestate == FS_GRIN ) return 4;
if ( facestate == FS_SAD ) return 5;
if ( blinktime < 0 ) return 3;
return demo.lookdir;
}
override int DrawMugshot()
{
int xx = xmargin+(36-mugw)/2;
int yy = ymargin+30;
let demo = SWWMPlayer(CPlayer.mo);
if ( !demo ) return 64;
double paintime = clamp((demo.lastdamagetimer-(gametic+Fractic))/double(GameTicRate),0.,1.);
rss = MSTime()*128;
double noiz = min(demo.lastdamage*.5*paintime,3.);
Vector2 shake = (RandomShiver(),RandomShiver())*noiz;
int idx = GetFaceTex(demo);
Screen.DrawTexture(FaceTex[0],false,xx+shake.x,ss.y-yy+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcWidth,mugw,DTA_SrcHeight,mugh,DTA_DestWidth,mugw,DTA_DestHeight,mugh,DTA_SrcX,mugw*(idx%4),DTA_SrcY,mugh*(idx/4));
Screen.DrawTexture(FaceTex[1],false,xx+shake.x,ss.y-yy+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),DTA_SrcWidth,mugw,DTA_SrcHeight,mugh,DTA_DestWidth,mugw,DTA_DestHeight,mugh,DTA_SrcX,mugw*(idx%4),DTA_SrcY,mugh*(idx/4));
if ( (CPlayer.Health > 0) && (isInvulnerable() || CPlayer.mo.FindInventory("OniMilkPower")) )
Screen.DrawTexture(FaceTex[1],false,xx+shake.x,ss.y-yy+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,.8+.1*sin(gametic+fractic),DTA_SrcWidth,mugw,DTA_SrcHeight,mugh,DTA_DestWidth,mugw,DTA_DestHeight,mugh,DTA_SrcX,mugw*(idx%4),DTA_SrcY,mugh*(idx/4));
if ( CPlayer.mo.FindInventory("BarrierPower") ) Screen.DrawTexture(FaceTex[2],false,xx+shake.x,ss.y-yy+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,.5,DTA_LegacyRenderStyle,STYLE_Add);
return 64;
}
override int DrawStatus()
{
String str;
double xx = xmargin+36;
double yy = ss.y-(ymargin+29);
double ot = clamp(OilInter.GetValue(fractic),0,1000);
double oot = clamp(LagOilInter.GetValue(fractic),0,1000);
if ( (ot > 0) || (oot > 0) )
{
OilFadeOut = gametic+15;
double alph = (gametic < OilFadeIn)?(min(1.-(OilFadeIn-(gametic+FracTic))/15.,1.)**.75):1.;
Screen.DrawTexture(StatusTex,false,xmargin,ss.y-(ymargin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
Screen.DrawTexture(StatusTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
str = String.Format("%3d",clamp(round(ot),0,999));
double ow = min(ot/10.,100);
Screen.DrawTexture(OilTex,false,xmargin+3,ss.y-(ymargin+17),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_ColorOverlay,0xFF000000,DTA_Alpha,alph);
Screen.DrawTexture(OilTex,false,xmargin+2,ss.y-(ymargin+18),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_Alpha,alph);
Screen.DrawTexture(OilTex,false,xx+3,yy+3,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_ColorOverlay,0xFF000000,DTA_Alpha,alph);
Screen.DrawTexture(OilTex,false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_Alpha,alph);
int dcnt = 2-int(Log10(clamp(round(ot),1,999)));
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_BRASS],xmargin+107+j*4,ss.y-(ymargin+18),0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_BRASS],xmargin+107,ss.y-(ymargin+18),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_BRASS],xx+107+j*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_BRASS],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
int f = OilFlash;
if ( f && (gametic < f) )
{
double alph2 = max((f-(gametic+FracTic))/25.,0.)**1.5;
Screen.DrawTexture(HealthTex[3],false,xmargin+2,ss.y-(ymargin+18),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph*alph2);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],xmargin+107,ss.y-(ymargin+18),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph*alph2);
Screen.DrawTexture(HealthTex[3],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,ow,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph*alph2);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph*alph2);
}
double owl = min(oot/10.,100);
if ( owl > ow ) Screen.DrawTexture(LagTex,false,xmargin+2,ss.y-(ymargin+18),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,ow,DTA_WindowRightF,owl,DTA_Alpha,alph);
if ( owl > ow ) Screen.DrawTexture(LagTex,false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,ow,DTA_WindowRightF,owl,DTA_Alpha,alph);
}
else
{
@ -81,54 +119,55 @@ extend Class OniStatusBar
if ( gametic < OilFadeOut )
{
double alph = max((OilFadeOut-(gametic+FracTic))/15.,0.)**1.5;
Screen.DrawTexture(StatusTex,false,xmargin,ss.y-(ymargin+20),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
Screen.DrawTexture(StatusTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
}
}
Screen.DrawTexture(StatusTex,false,xmargin,ss.y-(ymargin+10),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
yy += 12;
Screen.DrawTexture(StatusTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double ht = clamp(HealthInter.GetValue(fractic),0,1000);
str = String.Format("%3d",clamp(round(ht),0,999));
double hw = min(ht,100);
Screen.DrawTexture(HealthTex[0],false,xmargin+3,ss.y-(ymargin+7),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,0xFF000000);
Screen.DrawTexture(HealthTex[0],false,xx+3,yy+3,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_ColorOverlay,0xFF000000);
if ( isInvulnerable() || CPlayer.mo.FindInventory("OniMilkPower") )
{
Screen.DrawTexture(HealthTex[2],false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw);
Screen.DrawTexture(HealthTex[2],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw);
int dcnt = 2-int(Log10(clamp(round(ht),1,999)));
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_WHITE],xmargin+107+j*4,ss.y-(ymargin+8),0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_WHITE],xmargin+107,ss.y-(ymargin+8),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_WHITE],xx+107+j*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_WHITE],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
else
{
Screen.DrawTexture(HealthTex[0],false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw);
Screen.DrawTexture(HealthTex[0],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw);
int dcnt = 2-int(Log10(clamp(round(ht),1,999)));
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_RED],xmargin+107+j*4,ss.y-(ymargin+8),0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_RED],xmargin+107,ss.y-(ymargin+8),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int j=0; j<dcnt; j++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[MCR_RED],xx+107+j*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_RED],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( ht > 100 )
{
double alph = max((ht-100)/900.,0.)**.5;
Screen.DrawTexture(HealthTex[1],false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_BLUE],xmargin+107,ss.y-(ymargin+8),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
Screen.DrawTexture(HealthTex[1],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_BLUE],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
}
if ( (CPlayer.health > 0) && (CPlayer.health <= 25) && (PulsePhase <= 15) )
{
double alph = clamp(sin((PulsePhase-FracTic)*12.),0.,1.);
Screen.DrawTexture(HealthTex[3],false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_REDFLASH],xmargin+107,ss.y-(ymargin+8),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
Screen.DrawTexture(HealthTex[3],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_Alpha,alph);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_REDFLASH],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
}
}
int f = HealthFlash;
if ( f && (gametic < f) )
{
double alph = max((f-(gametic+FracTic))/25.,0.)**1.5;
Screen.DrawTexture(HealthTex[4],false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],xmargin+107,ss.y-(ymargin+8),str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph);
Screen.DrawTexture(HealthTex[4],false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,hw,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph);
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_FLASH],xx+107,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph);
}
ht = clamp(LagHealthInter.GetValue(fractic),0,1000);
double hwl = min(ht,100);
if ( hwl > hw )
{
Screen.DrawTexture(LagTex,false,xmargin+3,ss.y-(ymargin+7),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,hw,DTA_WindowRightF,hwl,DTA_ColorOverlay,0xFF000000);
Screen.DrawTexture(LagTex,false,xmargin+2,ss.y-(ymargin+8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,hw,DTA_WindowRightF,hwl);
Screen.DrawTexture(LagTex,false,xx+3,yy+3,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,hw,DTA_WindowRightF,hwl,DTA_ColorOverlay,0xFF000000);
Screen.DrawTexture(LagTex,false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowLeftF,hw,DTA_WindowRightF,hwl);
}
return ((ot>0)||(oot>0))?(gametic<OilFadeIn)?(36+int(10.*(min(1.-(OilFadeIn-(gametic+FracTic))/15.,1.)**.75))):46:(gametic<OilFadeOut)?(36+int(10.*(max((OilFadeOut-(gametic+FracTic))/15.,0.)**1.5))):36;
return ((ot>0)||(oot>0))?(gametic<OilFadeIn)?(51+int(10.*(min(1.-(OilFadeIn-(gametic+FracTic))/15.,1.)**.75))):63:(gametic<OilFadeOut)?(63+int(10.*(max((OilFadeOut-(gametic+FracTic))/15.,0.)**1.5))):51;
}
}

View File

@ -53,11 +53,11 @@ extend Class OniStatusBar
override void DrawWeapons()
{
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' ) SWWMWeapon(CPlayer.ReadyWeapon).DrawWeapon(FracTic,ss.x-(xmargin+58),ss.y-(ymargin+14),hs,ss);
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' ) SWWMWeapon(CPlayer.ReadyWeapon).DrawWeapon(FracTic,ss.x-(xmargin+56),ss.y-(ymargin+12),hs,ss);
else if ( CPlayer.ReadyWeapon )
{
// generic display
double xx = ss.x-(xmargin+60), yy = ss.y-(ymargin+24);
double xx = ss.x-(xmargin+58), yy = ss.y-(ymargin+22);
String str;
int dlen, dcnt;
if ( CPlayer.ReadyWeapon.Ammo2 && (CPlayer.ReadyWeapon.Ammo2 != CPlayer.ReadyWeapon.Ammo1) )
@ -73,11 +73,11 @@ extend Class OniStatusBar
}
Screen.DrawTexture(GenTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
dcnt = (dlen-1)-int(Log10(max(1,CPlayer.ReadyWeapon.Ammo2.Amount)));
for ( int i=0; i<dlen; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
for ( int i=0; i<dcnt; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
yy += 10;
}
xx = ss.x-(xmargin+60);
xx = ss.x-(xmargin+58);
if ( CPlayer.ReadyWeapon.Ammo1 )
{
dlen = 1+int(Log10(max(1,CPlayer.ReadyWeapon.Ammo1.MaxAmount)));
@ -90,7 +90,7 @@ extend Class OniStatusBar
}
Screen.DrawTexture(GenTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
dcnt = (dlen-1)-int(Log10(max(1,CPlayer.ReadyWeapon.Ammo1.Amount)));
for ( int i=0; i<dlen; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
for ( int i=0; i<dcnt; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
@ -144,7 +144,7 @@ extend Class OniStatusBar
}
}
xx = ss.x-(xmargin+54);
yy = ss.y-(ymargin+61);
yy = ss.y-(ymargin+59);
Screen.DrawTexture(AmmoTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
xx += 2;
yy += 2;

View File

@ -9,15 +9,15 @@ Class OniStatScreen : SWWMStatScreen
override void Start( wbstartstruct wbstartstruct )
{
Super.Start(wbstartstruct);
lnamecolor = Font.CR_WHITE;
lauthcolor = Font.CR_DARKGRAY;
lsubcolor = Font.CR_DARKRED;
statbasecolor = Font.CR_DARKRED;
statcolor0 = Font.CR_DARKGRAY;
statcolor1 = Font.CR_WHITE;
statcolor2 = Font.CR_RED;
tipcolor0 = Font.CR_RED;
tipcolor1 = Font.CR_WHITE;
lnamecolor = Font.FindFontColor('MiniWhite');
lauthcolor = Font.FindFontColor('MiniIbukiHUD');
lsubcolor = Font.FindFontColor('MiniRed');
statbasecolor = Font.FindFontColor('MiniTomato');
statcolor0 = Font.FindFontColor('MiniWhite');
statcolor1 = Font.FindFontColor('MiniBrass');
statcolor2 = Font.FindFontColor('MiniRed');
tipcolor0 = Font.FindFontColor('MiniTomato');
tipcolor1 = Font.FindFontColor('MiniWhite');
}
override void StartMusic()
@ -28,7 +28,7 @@ Class OniStatScreen : SWWMStatScreen
override String StatCnt( int a, int b )
{
if ( b <= 0 ) return "N/A";
return String.Format("%s \cm/\c- %s \cm(\c-%3d%%\cm)",SWWMUtility.ThousandsNum(max(a,0)),SWWMUtility.ThousandsNum(b),GetPct(a,b));
return String.Format("%s \c[MiniIbukiHUD]/\c- %s \c[MiniIbukuHUD](\c-%3d%%\c[MiniIbukiHUD])",SWWMUtility.ThousandsNum(max(a,0)),SWWMUtility.ThousandsNum(b),GetPct(a,b));
}
override String TimeStr( int secs )
@ -37,8 +37,8 @@ Class OniStatScreen : SWWMStatScreen
int h = secs/3600;
int m = (secs/60)%60;
int s = secs%60;
if ( h ) return String.Format("%d\cm:\c-%02d\cm:\c-%02d",h,m,s);
if ( m ) return String.Format("%d\cm:\c-%02d",m,s);
if ( h ) return String.Format("%d\c[MiniIbukiHUD]:\c-%02d\c[MiniIbukiHUD]:\c-%02d",h,m,s);
if ( m ) return String.Format("%d\c[MiniIbukiHUD]:\c-%02d",m,s);
return String.Format("%d",s);
}

View File

@ -1,5 +1,16 @@
// The Red Oni herself
Enum EOniFaceState
{
FS_DEFAULT,
FS_GRIN,
FS_SAD,
FS_LOPAIN,
FS_HIPAIN,
FS_OUCH,
FS_DEAD // UNUSED
};
Class IbukiPlayer : SWWMPlayer
{
Default
@ -37,6 +48,84 @@ Class IbukiPlayer : SWWMPlayer
+SWWMPLAYER.CANWALLCLIMB;
}
// stuck in here for now, to do the mugshot
override void UpdateFace()
{
// damage handling
if ( facedamage )
{
if ( lastdamage > 60 )
{
facestate = FS_OUCH;
facetimer = (lastdamagetimer-gametic)+10;
}
else if ( facestate < FS_OUCH )
{
facestate = (lastdamage>20)?FS_HIPAIN:FS_LOPAIN;
facetimer = (lastdamagetimer-gametic)+10;
}
paindir = 0;
// paraphrased from vanilla, with some tweaks
if ( player.attacker && (player.attacker != self) )
{
double atkang = AngleTo(player.attacker);
double angdiff = deltaangle(angle,atkang);
if ( abs(angdiff) < 135 )
{
if ( angdiff > 45 ) paindir = -1;
else if ( angdiff < -45 ) paindir = 1;
}
}
}
facedamage = false;
if ( facegrin && (facestate < FS_SAD) )
{
facestate = FS_GRIN;
facetimer = 50;
}
facegrin = false;
if ( facesad && (facestate <= FS_SAD) )
{
facestate = FS_SAD;
facetimer = 50;
}
facesad = false;
if ( facetimer > 0 )
{
facetimer--;
if ( facetimer <= 0 )
{
facestate = FS_DEFAULT;
blinktime = 30;
}
}
if ( !(gametic&1) )
{
if ( blinktime <= 0 )
{
blinktime--;
if ( blinktime < -2 )
{
rss = MSTime();
blinktime = (abs(GetRandom())%10)?(40+abs(GetRandom())%40):6;
looktime = 0;
}
}
else
{
blinktime--;
looktime++;
if ( looktime >= 8 )
{
looktime = 0;
rss = MSTime();
lookdir = abs(GetRandom())%3;
}
}
}
// TODO: update the actual texture on the model
}
override void CheatGive_Artifacts( int amount )
{
foreach ( cls:AllActorClasses )