Generic display for third-party weapons.

Disable custom bobbing for third-party weapons (since this may cause visual glitches).
Spiced up teleport fog with some sparkles.
This commit is contained in:
Mari the Deer 2020-03-18 13:04:19 +01:00
commit 3eed92fe5e
8 changed files with 129 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

BIN
sprites/BLPFC0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1160,9 +1160,35 @@ Class TeleLight : PaletteLight
}
}
Class SWWMTeleportSparkle : Actor
{
Default
{
RenderStyle "Add";
Scale 0.3;
Radius 0.1;
Height 0;
+NOGRAVITY;
+NOBLOCKMAP;
+DONTSPLASH;
+ROLLSPRITE;
+ROLLCENTER;
+FORCEXYBILLBOARD;
}
States
{
Spawn:
BLPF C 1 Bright
{
A_SetScale(scale.x*specialf1);
A_FadeOut(specialf2);
}
Wait;
}
}
Class SWWMTeleportFog : Actor
{
Default
{
+NOGRAVITY;
@ -1192,7 +1218,22 @@ Class SWWMTeleportFog : Actor
s.scale *= 3.*alpha;
s.alpha *= alpha;
}
A_FadeOut();
numpt = int(Random[ExploS](4,8));
for ( int i=0; i<numpt; i++ )
{
double ang = FRandom[ExploS](0,360);
double pt = FRandom[ExploS](-90,90);
double dist = (FRandom[ExploS](5,10)+60*(1.-alpha));
if ( LineTrace(ang,dist,pt,TRF_THRUACTORS|TRF_THRUHITSCAN) ) continue;
Vector3 ofs = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*dist;
Vector3 spos = level.Vec3Offset(pos,ofs);
let s = Spawn("SWWMTeleportSparkle",spos);
s.scale *= FRandom[ExploS](.8,1.2);
s.specialf1 = FRandom[ExploS](.93,.97);
s.specialf2 = FRandom[ExploS](.02,.04);
s.roll = FRandom[ExploS](0,360);
}
A_FadeOut(.07);
}
Wait;
}

View file

@ -9,7 +9,7 @@ Class MsgLine
Class SWWMStatusBar : BaseStatusBar
{
TextureID StatusTex, WeaponTex, ScoreTex, InventoryTex, ChatTex[6],
HealthTex[5], FuelTex, DashTex, EnemyBTex, EnemyHTex[5];
HealthTex[5], FuelTex, DashTex, EnemyBTex, EnemyHTex[5], GenericAmmoTex[3];
HUDFont mTewiFont, mMiniwiFont, mMPlusFont;
// "Full History" contains all messages since session start, nothing is flushed
@ -359,6 +359,9 @@ Class SWWMStatusBar : BaseStatusBar
EnemyHTex[2] = TexMan.CheckForTexture("graphics/HUD/EnemyBar2.png",TexMan.Type_Any);
EnemyHTex[3] = TexMan.CheckForTexture("graphics/HUD/EnemyBar3.png",TexMan.Type_Any);
EnemyHTex[4] = TexMan.CheckForTexture("graphics/HUD/EnemyBarS.png",TexMan.Type_Any);
GenericAmmoTex[0] = TexMan.CheckForTexture("graphics/HUD/GenericAmmoBoxL.png",TexMan.Type_Any);
GenericAmmoTex[1] = TexMan.CheckForTexture("graphics/HUD/GenericAmmoBoxM.png",TexMan.Type_Any);
GenericAmmoTex[2] = TexMan.CheckForTexture("graphics/HUD/GenericAmmoBoxR.png",TexMan.Type_Any);
mTewiFont = HUDFont.Create("TewiShaded");
mMiniwiFont = HUDFont.Create("MiniwiShaded");
mMPlusFont = HUDFont.Create("MPlusShaded");
@ -648,9 +651,39 @@ Class SWWMStatusBar : BaseStatusBar
private void DrawWeapon()
{
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' ) SWWMWeapon(CPlayer.ReadyWeapon).DrawWeapon(FracTic,ss.x-margin,ss.y-(margin+28),hs,ss);
else
else if ( CPlayer.ReadyWeapon )
{
// TODO generic display
// generic display
double xx = ss.x-(margin+14), yy = ss.y-(margin+43);
int maxlen = 0;
String astr2, astr1;
if ( CPlayer.ReadyWeapon.Ammo2 ) astr2 = String.Format("%d",CPlayer.ReadyWeapon.Ammo2.Amount);
if ( CPlayer.ReadyWeapon.Ammo1 ) astr1 = String.Format("%d",CPlayer.ReadyWeapon.Ammo1.Amount);
maxlen = max(astr1.Length(),astr2.Length());
if ( CPlayer.ReadyWeapon.Ammo2 )
{
yy -= 14;
Screen.DrawTexture(GenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<maxlen; i++ )
{
xx -= 6;
Screen.DrawTexture(GenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(GenericAmmoTex[0],false,xx-3,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(mTewiFont.mFont,Font.CR_FIRE,xx,yy,astr2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
yy += 14;
}
if ( CPlayer.ReadyWeapon.Ammo1 )
{
Screen.DrawTexture(GenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<maxlen; i++ )
{
xx -= 6;
Screen.DrawTexture(GenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(GenericAmmoTex[0],false,xx-3,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(mTewiFont.mFont,Font.CR_FIRE,xx,yy,astr1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
Screen.DrawTexture(WeaponTex,false,ss.x-(margin+61),ss.y-(margin+29),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double xx = ss.x-(margin+58), yy = ss.y-(margin+29);

View file

@ -65,6 +65,7 @@ Mixin Class SWWMStatScreen
override void drawShowNextLoc( void )
{
drawSWWMBg();
// TODO
drawEL();
}
override void Drawer( void )
@ -96,14 +97,59 @@ Mixin Class SWWMStatScreen
Class SWWMStatScreen_SP : DoomStatusScreen
{
Mixin SWWMStatScreen;
override void initStats()
{
Super.initStats();
}
override void updateStats()
{
Super.updateStats();
}
override void drawStats( void )
{
Super.drawStats();
}
}
Class SWWMStatScreen_Coop : CoopStatusScreen
{
Mixin SWWMStatScreen;
override void initStats()
{
Super.initStats();
}
override void updateStats()
{
Super.updateStats();
}
override void drawStats( void )
{
Super.drawStats();
}
}
Class SWWMStatScreen_DM : DeathmatchStatusScreen
{
Mixin SWWMStatScreen;
override void initStats()
{
Super.initStats();
}
override void updateStats()
{
Super.updateStats();
}
override void drawStats( void )
{
Super.drawStats();
}
}

View file

@ -387,6 +387,9 @@ Class Demolitionist : PlayerPawn
}
override Vector2 BobWeapon( double ticfrac )
{
// non-mod weapons bob normally
if ( !(player.ReadyWeapon is 'SWWMWeapon') )
return Super.BobWeapon(ticfrac);
bool oldbob = !!(player.WeaponState&WF_WEAPONBOBBING);
player.WeaponState |= WF_WEAPONBOBBING; // always bob
Vector2 cur = Super.BobWeapon(ticfrac);