diff --git a/graphics/HUD/ScoreBox.png b/graphics/HUD/ScoreBox.png deleted file mode 100644 index 63e88512a..000000000 Binary files a/graphics/HUD/ScoreBox.png and /dev/null differ diff --git a/graphics/HUD/ScoreBoxL.png b/graphics/HUD/ScoreBoxL.png new file mode 100644 index 000000000..079f8ee3c Binary files /dev/null and b/graphics/HUD/ScoreBoxL.png differ diff --git a/graphics/HUD/ScoreBoxM.png b/graphics/HUD/ScoreBoxM.png new file mode 100644 index 000000000..3b3f66d29 Binary files /dev/null and b/graphics/HUD/ScoreBoxM.png differ diff --git a/graphics/HUD/ScoreBoxR.png b/graphics/HUD/ScoreBoxR.png new file mode 100644 index 000000000..a8aa673a4 Binary files /dev/null and b/graphics/HUD/ScoreBoxR.png differ diff --git a/models/HellblazerAmmo.png b/models/HellblazerAmmo.png index b79c2d162..4a21bf5cb 100644 Binary files a/models/HellblazerAmmo.png and b/models/HellblazerAmmo.png differ diff --git a/models/HellblazerAmmo_Cluster.png b/models/HellblazerAmmo_Cluster.png index 8075af77b..32bb788ec 100644 Binary files a/models/HellblazerAmmo_Cluster.png and b/models/HellblazerAmmo_Cluster.png differ diff --git a/models/HellblazerAmmo_Fire.png b/models/HellblazerAmmo_Fire.png index 49a234d4c..c7ff72c29 100644 Binary files a/models/HellblazerAmmo_Fire.png and b/models/HellblazerAmmo_Fire.png differ diff --git a/models/HellblazerAmmo_Nuke.png b/models/HellblazerAmmo_Nuke.png index fb6679a2e..8834ddeac 100644 Binary files a/models/HellblazerAmmo_Nuke.png and b/models/HellblazerAmmo_Nuke.png differ diff --git a/models/HellblazerMissile_Cluster.png b/models/HellblazerMissile_Cluster.png index cfa0a060e..8c1bfa7f6 100644 Binary files a/models/HellblazerMissile_Cluster.png and b/models/HellblazerMissile_Cluster.png differ diff --git a/models/HellblazerMissile_Fire.png b/models/HellblazerMissile_Fire.png index 7f39778f5..d0f81a050 100644 Binary files a/models/HellblazerMissile_Fire.png and b/models/HellblazerMissile_Fire.png differ diff --git a/models/HellblazerMissile_Nuke.png b/models/HellblazerMissile_Nuke.png index 24c1003c3..09464e43a 100644 Binary files a/models/HellblazerMissile_Nuke.png and b/models/HellblazerMissile_Nuke.png differ diff --git a/models/extra/BloodDrop1.png b/models/extra/BloodDrop1.png index 34093d0a5..b8d74c3fc 100644 Binary files a/models/extra/BloodDrop1.png and b/models/extra/BloodDrop1.png differ diff --git a/models/extra/BloodDrop2.png b/models/extra/BloodDrop2.png index 84ad4e0cd..01b4ca7a2 100644 Binary files a/models/extra/BloodDrop2.png and b/models/extra/BloodDrop2.png differ diff --git a/models/extra/BloodDrop3.png b/models/extra/BloodDrop3.png index ba20e2271..af6a442e0 100644 Binary files a/models/extra/BloodDrop3.png and b/models/extra/BloodDrop3.png differ diff --git a/models/extra/BloodDrop4.png b/models/extra/BloodDrop4.png index 7ba7d41ea..71f7c2f69 100644 Binary files a/models/extra/BloodDrop4.png and b/models/extra/BloodDrop4.png differ diff --git a/models/nashgore/Footprint/Footprint01.png b/models/nashgore/Footprint/Footprint01.png index ecf87e0a3..9878bfbb1 100644 Binary files a/models/nashgore/Footprint/Footprint01.png and b/models/nashgore/Footprint/Footprint01.png differ diff --git a/sprites/RFLMA0.png b/sprites/RFLMA0.png index b636e9767..c0769bf60 100644 Binary files a/sprites/RFLMA0.png and b/sprites/RFLMA0.png differ diff --git a/sprites/RFLMB0.png b/sprites/RFLMB0.png index 47044c541..26cb05db8 100644 Binary files a/sprites/RFLMB0.png and b/sprites/RFLMB0.png differ diff --git a/sprites/RFLMC0.png b/sprites/RFLMC0.png index d62da63ba..dffafe079 100644 Binary files a/sprites/RFLMC0.png and b/sprites/RFLMC0.png differ diff --git a/sprites/RFLMD0.png b/sprites/RFLMD0.png index ec77a9596..8f9621f2e 100644 Binary files a/sprites/RFLMD0.png and b/sprites/RFLMD0.png differ diff --git a/sprites/RFLME0.png b/sprites/RFLME0.png index 2da6141f2..06376f5ce 100644 Binary files a/sprites/RFLME0.png and b/sprites/RFLME0.png differ diff --git a/sprites/RFLMF0.png b/sprites/RFLMF0.png index 0636c00c1..4518f331c 100644 Binary files a/sprites/RFLMF0.png and b/sprites/RFLMF0.png differ diff --git a/sprites/RFLMG0.png b/sprites/RFLMG0.png index c2f862adc..673d3c2d0 100644 Binary files a/sprites/RFLMG0.png and b/sprites/RFLMG0.png differ diff --git a/sprites/RFLMH0.png b/sprites/RFLMH0.png index 941c51322..a5706d6fd 100644 Binary files a/sprites/RFLMH0.png and b/sprites/RFLMH0.png differ diff --git a/sprites/RFLMI0.png b/sprites/RFLMI0.png index 1ee7c626f..96a4110cd 100644 Binary files a/sprites/RFLMI0.png and b/sprites/RFLMI0.png differ diff --git a/sprites/RFLMJ0.png b/sprites/RFLMJ0.png index 10a84a0d4..4b0aeaf0a 100644 Binary files a/sprites/RFLMJ0.png and b/sprites/RFLMJ0.png differ diff --git a/sprites/RFLMK0.png b/sprites/RFLMK0.png index 912d66372..2fa387c60 100644 Binary files a/sprites/RFLMK0.png and b/sprites/RFLMK0.png differ diff --git a/sprites/RFLML0.png b/sprites/RFLML0.png index 430ac6526..e12a930e4 100644 Binary files a/sprites/RFLML0.png and b/sprites/RFLML0.png differ diff --git a/sprites/RFLMM0.png b/sprites/RFLMM0.png index 15eed6ece..4201493bd 100644 Binary files a/sprites/RFLMM0.png and b/sprites/RFLMM0.png differ diff --git a/sprites/RFLMN0.png b/sprites/RFLMN0.png index b9557403c..0ff8caee3 100644 Binary files a/sprites/RFLMN0.png and b/sprites/RFLMN0.png differ diff --git a/sprites/RFLMO0.png b/sprites/RFLMO0.png index 6c265e38b..ba80a5e12 100644 Binary files a/sprites/RFLMO0.png and b/sprites/RFLMO0.png differ diff --git a/sprites/RFLMP0.png b/sprites/RFLMP0.png index 5c766f606..d7c38510a 100644 Binary files a/sprites/RFLMP0.png and b/sprites/RFLMP0.png differ diff --git a/sprites/RFLMQ0.png b/sprites/RFLMQ0.png index 7ce7656e0..d0e0504a6 100644 Binary files a/sprites/RFLMQ0.png and b/sprites/RFLMQ0.png differ diff --git a/sprites/RFLMR0.png b/sprites/RFLMR0.png index 3830ffa51..e1ced2ca0 100644 Binary files a/sprites/RFLMR0.png and b/sprites/RFLMR0.png differ diff --git a/sprites/RFLMS0.png b/sprites/RFLMS0.png index 39c9ddd77..3eb357881 100644 Binary files a/sprites/RFLMS0.png and b/sprites/RFLMS0.png differ diff --git a/sprites/RFLMT0.png b/sprites/RFLMT0.png index 42ac58a1b..a67729257 100644 Binary files a/sprites/RFLMT0.png and b/sprites/RFLMT0.png differ diff --git a/zscript/swwm_common.zsc b/zscript/swwm_common.zsc index eec6239aa..d620099a5 100644 --- a/zscript/swwm_common.zsc +++ b/zscript/swwm_common.zsc @@ -222,8 +222,8 @@ Class SWWMStats : Thinker { PlayerInfo myplayer; int lastspawn, dashcount, boostcount, stompcount, airtime, kills, - deaths, damagedealt, damagetaken, mkill, hiscore, topdealt, - toptaken, skill; + deaths, damagedealt, damagetaken, mkill, hiscore, hhiscore, + topdealt, toptaken, skill; double grounddist, airdist, fuelusage, topspeed; Array wstats; Array > alreadygot; @@ -279,42 +279,75 @@ Class SWWMStats : Thinker Class SWWMCredits : Thinker { PlayerInfo myplayer; - int credits; + int credits, hcredits; - static void Give( PlayerInfo p, int amount ) + static void Give( PlayerInfo p, int amount, int hamount = 0 ) { let c = Find(p); if ( !c ) return; - if ( (c.credits+amount < c.credits) || (c.credits+amount > 999999999) ) c.credits = 999999999; + if ( c.credits+amount < c.credits ) c.credits = int.max; else c.credits += amount; + while ( c.credits > 999999999 ) + { + c.credits -= 1000000000; + c.hcredits++; + } + if ( (c.hcredits+hamount < c.hcredits) || (c.hcredits+hamount > 999999999) ) c.hcredits = 999999999; + else c.hcredits += hamount; let s = SWWMStats.Find(p); - if ( s && (c.credits > s.hiscore) ) s.hiscore = c.credits; + if ( s && ((c.hcredits > s.hhiscore) || ((c.credits > s.hiscore) && (c.hcredits >= s.hhiscore))) ) + { + s.hiscore = c.credits; + s.hhiscore = c.hcredits; + } } - static clearscope bool CanTake( PlayerInfo p, int amount ) + static clearscope bool CanTake( PlayerInfo p, int amount, int hamount = 0 ) { let c = Find(p); if ( !c ) return false; + int req = amount, hreq = hamount; + while ( req > 999999999 ) + { + req -= 1000000000; + hreq++; + } + // waaaaay too much + if ( (c.hcredits-hreq < 0) || (c.hcredits-hreq > c.hcredits) ) return false; // too much! - if ( (c.credits-amount < 0) || (c.credits-amount > c.credits) ) return false; + if ( ((c.credits-amount < 0) || (c.credits-amount > c.credits)) && (c.hcredits-hreq <= 0) ) return false; return true; } - static bool Take( PlayerInfo p, int amount ) + static bool Take( PlayerInfo p, int amount, int hamount = 0 ) { let c = Find(p); if ( !c ) return false; + int req = amount, hreq = hamount; + while ( req > 999999999 ) + { + req -= 1000000000; + hreq++; + } + // waaaaay too much + if ( (c.hcredits-hreq < 0) || (c.hcredits-hreq > c.hcredits) ) return false; // too much! - if ( (c.credits-amount < 0) || (c.credits-amount > c.credits) ) return false; - c.credits -= amount; + if ( ((c.credits-amount < 0) || (c.credits-amount > c.credits)) && (c.hcredits-hreq <= 0) ) return false; + c.hcredits -= hreq; + c.credits -= req; + while ( c.credits < 0 ) + { + c.credits += 1000000000; + c.hcredits--; + } return true; } - static clearscope int Get( PlayerInfo p ) + static clearscope int, int Get( PlayerInfo p ) { let c = Find(p); if ( !c ) return 0; - return c.credits; + return c.credits, c.hcredits; } static clearscope SWWMCredits Find( PlayerInfo p ) @@ -2808,7 +2841,7 @@ Class SWWMHandler : EventHandler if ( !item ) return; if ( SWWMCredits.Take(players[e.Args[0]],e.Args[1]) ) { - players[e.Args[0]].mo.GiveInventory(item,e.Args[2]); + players[e.Args[0]].mo.GiveInventory(item,e.Args[2],true); if ( item is 'Weapon' ) players[e.Args[0]].mo.A_SelectWeapon((Class)(item)); } } @@ -2835,7 +2868,7 @@ Class SWWMHandler : EventHandler if ( amt > maxgive ) amt = maxgive; } else if ( amt > def.MaxAmount ) amt = def.MaxAmount; - if ( (amt > 0) && players[e.Args[1]].mo.GiveInventory(item,amt) ) + if ( (amt > 0) && players[e.Args[1]].mo.GiveInventory(item,amt,true) ) { players[e.Args[0]].mo.TakeInventory(item,amt); // add to history @@ -2928,8 +2961,8 @@ Class SWWMHandler : EventHandler S_StartSound("menu/buyinv",CHAN_ITEM,CHANF_UI); S_StartSound("misc/emone",CHAN_VOICE,CHANF_UI); } - SWWMCredits.Give(players[e.Args[0]],999999999); - SWWMScoreObj.Spawn(999999999,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2)); + SWWMCredits.Give(players[e.Args[0]],1000000000); + SWWMScoreObj.Spawn(1000000000,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2)); } else if ( e.Name ~== "swwmlorecheat" ) { diff --git a/zscript/swwm_hud.zsc b/zscript/swwm_hud.zsc index e355e4a1e..b773e9817 100644 --- a/zscript/swwm_hud.zsc +++ b/zscript/swwm_hud.zsc @@ -8,7 +8,7 @@ Class MsgLine Class SWWMStatusBar : BaseStatusBar { - TextureID StatusTex, WeaponTex, ScoreTex, InventoryTex, ChatTex[6], + TextureID StatusTex, WeaponTex, ScoreTex[3], InventoryTex, ChatTex[6], HealthTex[5], FuelTex, DashTex, EnemyBTex, EnemyHTex[5], GenericAmmoTex[3]; HUDFont mTewiFont, mMiniwiFont, mMPlusFont, mk6x8Font; @@ -49,7 +49,7 @@ Class SWWMStatusBar : BaseStatusBar bool can_project; transient CVar cvar_renderer; - DynamicValueInterpolator HealthInter, ScoreInter, FuelInter, DashInter; + DynamicValueInterpolator HealthInter, ScoreInter, ScoreInter2, FuelInter, DashInter; // if playing in Japanese, returns an alternate font of the same height // Tewi -> MPlus @@ -317,7 +317,10 @@ Class SWWMStatusBar : BaseStatusBar // update interpolators HealthInter.Update(CPlayer.health); if ( !hnd ) hnd = SWWMHandler(EventHandler.Find("SWWMHandler")); - ScoreInter.Update(SWWMCredits.Get(CPlayer)); + int s1, s2; + [s1, s2] = SWWMCredits.Get(CPlayer); + ScoreInter.Update(s1); + if ( ScoreInter.GetValue() >= ScoreInter.mCurrentValue ) ScoreInter2.Update(s2); let d = Demolitionist(CPlayer.mo); if ( d ) { @@ -448,7 +451,9 @@ Class SWWMStatusBar : BaseStatusBar HealthTex[2] = TexMan.CheckForTexture("graphics/HUD/HealthBar2.png",TexMan.Type_Any); HealthTex[3] = TexMan.CheckForTexture("graphics/HUD/HealthBar3.png",TexMan.Type_Any); HealthTex[4] = TexMan.CheckForTexture("graphics/HUD/HealthBarS.png",TexMan.Type_Any); - ScoreTex = TexMan.CheckForTexture("graphics/HUD/ScoreBox.png",TexMan.Type_Any); + ScoreTex[0] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxL.png",TexMan.Type_Any); + ScoreTex[1] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxM.png",TexMan.Type_Any); + ScoreTex[2] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxR.png",TexMan.Type_Any); WeaponTex = TexMan.CheckForTexture("graphics/HUD/WeaponBox.png",TexMan.Type_Any); ChatTex[0] = TexMan.CheckForTexture("graphics/HUD/ChatBoxTop.png",TexMan.Type_Any); ChatTex[1] = TexMan.CheckForTexture("graphics/HUD/ChatBoxLine.png",TexMan.Type_Any); @@ -472,6 +477,7 @@ Class SWWMStatusBar : BaseStatusBar mk6x8Font = HUDFont.Create("k6x8Shaded"); HealthInter = DynamicValueInterpolator.Create(100,.1,1,100); ScoreInter = DynamicValueInterpolator.Create(0,.1,1,999999999); + ScoreInter2 = DynamicValueInterpolator.Create(0,.1,1,999999999); FuelInter = DynamicValueInterpolator.Create(120,.5,1,100); DashInter = DynamicValueInterpolator.Create(120,.5,1,40); gl_proj = new("swwmLe__GLScreen"); @@ -520,9 +526,9 @@ Class SWWMStatusBar : BaseStatusBar else tag = String.Format("\cy%s\c-",StringTable.Localize("$SWWM_NEXIT")); } Font fnt = LangFont(mMiniwiFont); - Screen.DrawText(fnt,Font.CR_WHITE,(vpos.x-hsb.x*fnt.StringWidth(tag)/2.)/hsb.x,(vpos.y-hsb.y*fnt.GetHeight()/2.)/hs.y,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true); + Screen.DrawText(fnt,Font.CR_WHITE,(vpos.x-hsb.x*fnt.StringWidth(tag)/2.)/hsb.x,(vpos.y-hsb.y*fnt.GetHeight()/2.)/hsb.y,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true); tag = String.Format("\cu(%s\cu)\c-",FormatDist(tdir.length())); - Screen.DrawText(fnt,Font.CR_WHITE,(vpos.x-hsb.x*fnt.StringWidth(tag)/2.)/hsb.x,(vpos.y+hsb.y*fnt.GetHeight()/2.)/hs.y,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true); + Screen.DrawText(fnt,Font.CR_WHITE,(vpos.x-hsb.x*fnt.StringWidth(tag)/2.)/hsb.x,(vpos.y+hsb.y*fnt.GetHeight()/2.)/hsb.y,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true); } } // targetting array @@ -640,8 +646,35 @@ Class SWWMStatusBar : BaseStatusBar private void DrawScore() { - Screen.DrawTexture(ScoreTex,false,ss.x-(margin+72),margin,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); - Screen.DrawText(mTewiFont.mFont,Font.CR_FIRE,ss.x-(margin+57),margin+1,String.Format("%09d",clamp(ScoreInter.GetValue(),0,999999999)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + if ( ScoreInter2.GetValue() > 0 ) + { + int digits = 9; + digits += int(Log10(ScoreInter2.GetValue()))+1; + int xx = 19+6*digits; + Screen.DrawTexture(ScoreTex[0],false,ss.x-(margin+xx),margin,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + xx -= 15; + for ( int i=0; i 0) && (sel0 < storelist.Size()) ) { - int moni = SWWMCredits.Get(players[consoleplayer]); let itm = GetDefaultByType(storelist[sel0]); let amt = storeunits[sel0]; int price = int(itm.Stamina*(1.+.5*(amt-1))); - if ( moni < price ) + if ( !SWWMCredits.CanTake(players[consoleplayer],price) ) { MenuSound("menu/noinvuse"); tmsg = StringTable.Localize("$SWWM_STOREMUNS"); @@ -1859,8 +1858,11 @@ Class SWWMKnowledgeBaseMenu : GenericMenu Screen.DrawTexture(TabSeparator,false,origin.x+xx,origin.y+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx += 4; } - int muns = SWWMCredits.Get(players[consoleplayer]); - str = String.Format("\cg¥\c-%09d",muns); + int muns1, muns2; + [muns1, muns2] = SWWMCredits.Get(players[consoleplayer]); + str = "\cg¥\c-"; + if ( muns2 > 0 ) str.AppendFormat("%d",muns2); + str.AppendFormat("%09d",muns1); xx = 637-TewiFont.StringWidth(str); Screen.DrawText(TewiFont,Font.CR_FIRE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); // draw bottom messages @@ -1973,7 +1975,8 @@ Class SWWMKnowledgeBaseMenu : GenericMenu } Screen.DrawText(fnt,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += 16; - str = String.Format("\cx%s\cu¥\c-%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hiscore); + if ( stats.hhiscore > 0 ) str = String.Format("\cx%s\cu¥\c-%d%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hhiscore,stats.hiscore); + else str = String.Format("\cx%s\cu¥\c-%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hiscore); Screen.DrawText(fnt,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); yy += 16; } @@ -2215,7 +2218,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu str = String.Format("¥%d",price); len = TewiFont.StringWidth(str); int clscol = Font.CR_FIRE; - if ( price > muns ) clscol = Font.CR_BLACK; + if ( (price > muns1) && (muns2 <= 0) ) clscol = Font.CR_BLACK; Screen.DrawText(TewiFont,clscol,origin.x+xx+longest+80-len,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(i!=sel0)?Color(96,0,0,0):Color(0,0,0,0)); yy += 16; if ( yy >= 370 )