Implement score increase/decrease accumulator in HUD.

This commit is contained in:
Mari the Deer 2024-07-18 14:22:35 +02:00
commit 68c01dbd63
5 changed files with 81 additions and 3 deletions

View file

@ -171,6 +171,24 @@ extend Class SWWMHandler
// send the post-teleport position
DoPlayerStep(demo.pos.xy,true);
}
else if ( e.Name ~== "swwmhudgivescore" )
{
let bar = SWWMStatusBar(StatusBar);
if ( !bar ) return;
if ( bar.cummscoreup+e.Args[0] < bar.cummscoreup ) bar.cummscoreup = 999999999;
else bar.cummscoreup = min(999999999,bar.cummscoreup+e.Args[0]);
bar.cummspanup = 120+40*int(Log10(clamp(bar.cummscoreup,1,999999999)));
bar.cummflashup = 15;
}
else if ( e.Name ~== "swwmhudtakescore" )
{
let bar = SWWMStatusBar(StatusBar);
if ( !bar ) return;
if ( bar.cummscoredn+e.Args[0] < bar.cummscoredn ) bar.cummscoredn = 999999999;
else bar.cummscoredn = min(999999999,bar.cummscoredn+e.Args[0]);
bar.cummspandn = 120+40*int(Log10(clamp(bar.cummscoredn,1,999999999)));
bar.cummflashdn = 15;
}
}
override void NetworkProcess( ConsoleEvent e )