Made healthbar/scorenum/damnum limits tweakable.

Removed some leftover debug prints.
Additional inventory rearranging so invinciball/ragekit take priority over healing items and armor.
Adjusted ragekit punch splash damage.
This commit is contained in:
Mari the Deer 2020-04-28 12:09:31 +02:00
commit ba79f54cf2
7 changed files with 114 additions and 17 deletions

View file

@ -42,3 +42,6 @@ user bool swwm_bosshealthbars = true; // display large healthbars for vanilla b
server bool swwm_upgradebosses = true; // vanilla bosses will be "upgraded" to be less insta-die prone
server bool swwm_extraalert = false; // enables A_AlertMonsters calls for certain things which may be cpu-heavy
user bool swwm_accdamage = false; // damage within the same tic is grouped into a single damage number
user int swwm_maxtargets = 40; // maximum targeter healthbars to display (0 = unlimited)
user int swwm_maxscorenums = 20; // maximum score numbers to display (0 = unlimited)
user int swwm_maxdamnums = 40; // maximum damage/healing numbers to display (0 = unlimited)

View file

@ -84,6 +84,9 @@ SWWM_BTITLE = "Balance Options";
SWWM_BOSSENHANCE = "Enhance Vanilla Bosses";
SWWM_EXTRAALERT = "Extra Noise Alerts";
SWWM_ACCDAMAGE = "Cumulative Damage Numbers";
SWWM_MAXTARGETS = "Max. Displayed Healthbars";
SWWM_MAXDAMNUMS = "Max. Displayed Damage/Heal Numbers";
SWWM_MAXSCORENUMS = "Max. Displayed Score Numbers";
TOOLTIP_SWWM_VOICETYPE = "Sets the voice pack for the player.";
TOOLTIP_SWWM_MUTEVOICE = "Control what gets muted, if you'd rather have a more silent protagonist.";
TOOLTIP_SWWM_FLASHSTRENGTH = "Screen flashes usually happen when firing some weapons, you can lower this if these effects are harmful for you.";
@ -105,7 +108,7 @@ TOOLTIP_SWWM_FLY6DOF = "Enable 6DOF movement when flying. Disable if this featur
TOOLTIP_SWWM_TARGETER = "Show enemy/player healthbars. Disable if you'd prefer to use another mod for this, such as Target Spy.";
TOOLTIP_SWWM_TARGETTAGS = "Show enemy names above their healthbars.";
TOOLTIP_SWWM_HEALTHNUMS = "Show damage/healing numbers. Disable if you'd prefer to use another mod for this, such as DamNums.";
TOOLTIP_SWWM_SCORENUMS = "Show score kill numbers.";
TOOLTIP_SWWM_SCORENUMS = "Show score numbers.";
TOOLTIP_SWWM_SCOREBONUS = "Show additional bonus strings above score numbers (e.g.: multikill counters).";
TOOLTIP_SWWM_EARBUSTER = "The Wallbuster's firing sounds may be painfully loud at times. This setting will limit the loudness to something more bearable.";
TOOLTIP_SWWM_SHADERS = "Use postprocess shaders for things like powerups and the Silver Bullet scope. You can disable this if you'd prefer something lighter on the eyes.";
@ -118,6 +121,9 @@ TOOLTIP_SWWM_BOSSHEALTHBARS = "Show a healthbar for vanilla boss encounters at t
TOOLTIP_SWWM_UPGRADEBOSSES = "Buffs the health of vanilla bosses in order to make the fights more \"fair\" with this mod, and less prone to instant wins.";
TOOLTIP_SWWM_EXTRAALERT = "Allows monsters to hear things such as bouncing projectiles, ricocheting bullets, and more. Due to the recursive nature of the A_AlertMonsters function, this has a MASSIVE performance hit on very complex maps.";
TOOLTIP_SWWM_ACCDAMAGE = "Damage dealt to a target within the same tic will be grouped into a single damage number, which may make the screen less cluttered in most cases.";
TOOLTIP_SWWM_MAXTARGETS = "Limit the amount of healthbars to display on-screen. Helps keep the screen less cluttered, and may even improve performance.";
TOOLTIP_SWWM_MAXDAMNUMS = "Limit the amount of damage/healing numbers to display on-screen. Helps keep the screen less cluttered, and may even improve performance.";
TOOLTIP_SWWM_MAXSCORENUMS = "Limit the amount of score numbers to display on-screen. Helps keep the screen less cluttered, and may even improve performance.";
// knowledge base
SWWM_COMINGSOON = "(coming soon)";
SWWM_MISSTAB = "Mission";

View file

@ -81,6 +81,9 @@ SWWM_BTITLE = "Opciones de Balance";
SWWM_BOSSENHANCE = "Mejorar Bosses Vanilla";
SWWM_EXTRAALERT = "Alertas de Ruído Extra";
SWWM_ACCDAMAGE = "Números de Daño Acumulativos";
SWWM_MAXTARGETS = "Máx. Barras de Salud en Pantalla";
SWWM_MAXDAMNUMS = "Máx. Números de Daño/Cura en Pantalla";
SWWM_MAXSCORENUMS = "Máx. Números de Puntuación en Pantalla";
TOOLTIP_SWWM_VOICETYPE = "Selecciona el pack de voz para el jugador.";
TOOLTIP_SWWM_MUTEVOICE = "Controla lo que se mutea, si prefieres tener un protagonista más silencioso.";
TOOLTIP_SWWM_FLASHSTRENGTH = "Los destellos en pantalla suelen ocurrir al disparar algunas armas, puedes reducirlo si este tipo de effectos te causan malestar.";
@ -115,6 +118,9 @@ TOOLTIP_SWWM_BOSSHEALTHBARS = "Muestra una barra de vida para bosses vanilla en
TOOLTIP_SWWM_UPGRADEBOSSES = "Incrementa la salud de bosses vanilla para hacer que las peleas sean más \"justas\" con este mod, y no tan propensas a ganarse al instante.";
TOOLTIP_SWWM_EXTRAALERT = "Permite a los enemigos oir cosas como proyectiles y balas rebotando, entre otros. Debido a la naturaleza recursiva de la función A_AlertMonsters, esto puede tener un impacto MASIVO en el rendimiento en mapas muy complejos.";
TOOLTIP_SWWM_ACCDAMAGE = "El daño hecho a un objetivo en el mismo tic será agrupado en un único número, lo cual resultará en una pantalla más despejada en la mayoría de casos.";
TOOLTIP_SWWM_MAXTARGETS = "Limita la cantidad de barras de salud a mostrar en pantalla. Ayuda a mantener la pantalla más despejada, y puede incluso mejorar el rendimiento.";
TOOLTIP_SWWM_MAXDAMNUMS = "Limita la cantidad de números de daño/curación a mostrar en pantalla. Ayuda a mantener la pantalla más despejada, y puede incluso mejorar el rendimiento.";
TOOLTIP_SWWM_MAXSCORENUMS = "Limita la cantidad de números de puntuación a mostrar en pantalla. Ayuda a mantener la pantalla más despejada, y puede incluso mejorar el rendimiento.";
// knowledge base
SWWM_COMINGSOON = "(próximamente)";
SWWM_MISSTAB = "Misión";

View file

@ -46,6 +46,9 @@ OptionMenu "SWWMOptionMenu"
Option "$SWWM_ACCDAMAGE", "swwm_accdamage", "YesNo"
Option "$SWWM_SCORENUMS", "swwm_scorenums", "YesNo"
Option "$SWWM_SCOREBONUS", "swwm_scorebonus", "YesNo"
ScaleSlider "$SWWM_MAXTARGETS", "swwm_maxtargets", 0, 100, 1, "$SWWM_UNLIMITED"
ScaleSlider "$SWWM_MAXDAMNUMS", "swwm_maxdamnums", 0, 100, 1, "$SWWM_UNLIMITED"
ScaleSlider "$SWWM_MAXSCORENUMS", "swwm_maxscorenums", 0, 100, 1, "$SWWM_UNLIMITED"
Option "$SWWM_SHADERS", "swwm_shaders", "YesNo"
Option "$SWWM_INTERTYPE", "swwm_intertype", "SWWMInterType"
StaticText " "

View file

@ -27,7 +27,7 @@ Class SWWMStatusBar : BaseStatusBar
SWWMVanillaBossHandler bosshnd;
// client cvars
transient CVar safezone, maxchat[2], maxpick, chatduration, msgduration, pickduration, chatcol, teamcol, obitcol, critcol, pickcol, targetter, healthnums, scorenums, scorebonus, targettag, lang;
transient CVar safezone, maxchat[2], maxpick, chatduration, msgduration, pickduration, chatcol, teamcol, obitcol, critcol, pickcol, targetter, healthnums, scorenums, scorebonus, targettag, lang, maxtarg, maxscore, maxdamns;
// shared stuff
Vector2 ss, hs;
@ -201,6 +201,12 @@ Class SWWMStatusBar : BaseStatusBar
if ( !targetter ) targetter = CVar.GetCVar('swwm_targeter',players[consoleplayer]);
if ( !healthnums ) healthnums = CVar.GetCVar('swwm_healthnums',players[consoleplayer]);
if ( !scorenums ) scorenums = CVar.GetCVar('swwm_scorenums',players[consoleplayer]);
if ( !maxtarg ) maxtarg = CVar.GetCVar('swwm_maxtargets',players[consoleplayer]);
if ( !maxscore ) maxscore = CVar.GetCVar('swwm_maxscorenums',players[consoleplayer]);
if ( !maxdamns ) maxdamns = CVar.GetCVar('swwm_maxdamnums',players[consoleplayer]);
int maxtargetnum = max(0,maxtarg.GetInt());
int maxscorenum = max(0,maxscore.GetInt());
int maxdamnum = max(0,maxdamns.GetInt());
// prune old messages
for ( int i=0; i<PickupQueue.Size(); i++ )
{
@ -276,7 +282,7 @@ Class SWWMStatusBar : BaseStatusBar
if ( trackers.Size() != hnd.trackers_cnt )
trackers.Resize(hnd.trackers_cnt);
int i = 0;
for ( SWWMCombatTracker trk=hnd.trackers; trk && (i<40); trk=trk.next )
for ( SWWMCombatTracker trk=hnd.trackers; trk && (!maxtargetnum||(i<maxtargetnum)); trk=trk.next )
{
// ignore player unless chasecamming
if ( (trk.mytarget == players[consoleplayer].mo) && (players[consoleplayer].Camera == players[consoleplayer].mo) && !(players[consoleplayer].cheats&CF_CHASECAM) ) continue;
@ -313,8 +319,8 @@ Class SWWMStatusBar : BaseStatusBar
else trackers.Clear();
// update floating scores, adding the scorenums first, then the damnums
int total_sz = 0;
if ( scorenums.GetBool() ) total_sz += min(20,hnd.scorenums_cnt);
if ( healthnums.GetBool() ) total_sz += min(40,hnd.damnums_cnt);
if ( scorenums.GetBool() ) total_sz += maxscorenum?min(maxscorenum,hnd.scorenums_cnt):hnd.scorenums_cnt;
if ( healthnums.GetBool() ) total_sz += maxdamnum?min(maxdamnum,hnd.damnums_cnt):hnd.damnums_cnt;
if ( scoreobjs.Size() != total_sz )
scoreobjs.Resize(total_sz);
int i = 0;

View file

@ -38,10 +38,9 @@ Class SWWMArmor : Armor abstract
bool foundarmor = false;
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( i is 'SWWMArmor' ) foundarmor = true;
if ( (i is 'SWWMArmor') && (i != self) ) foundarmor = true;
if ( !(i is 'SWWMArmor') || (i == self) || (SWWMArmor(i).priority < priority) ) continue;
found = i;
Console.Printf("%s is better",i.GetTag());
}
if ( !found && !foundarmor )
{
@ -49,7 +48,6 @@ Class SWWMArmor : Armor abstract
if ( (other.Inv is 'SWWMHealth') || (other.Inv is 'GrilledCheeseSandwich') )
{
// place ourselves before it
Console.Printf("Moving before %s",other.Inv.GetTag());
Inv = other.Inv;
other.Inv = self;
return;
@ -58,11 +56,19 @@ Class SWWMArmor : Armor abstract
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( (i == self) || (!(i.Inv is 'SWWMHealth' ) && !(i.Inv is 'GrilledCheeseSandwich')) ) continue;
Console.Printf("%s is right next to %s",i.GetTag(),i.Inv.GetTag());
found = i;
break;
}
}
if ( !found && !foundarmor )
{
// find last of either invinciball or ragekit power
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( !(i is 'InvinciballPower') && !(i is 'RagekitPower') ) continue;
found = i;
}
}
if ( !found ) return;
// place ourselves right after it
Inventory saved = found.Inv;
@ -193,7 +199,6 @@ Class SWWMHealth : Inventory abstract
{
if ( !(i is 'SWWMHealth') || (i == self) || (GetDefaultByType(SWWMHealth(i).giveme).Amount < GetDefaultByType(giveme).Amount) ) continue;
found = i;
Console.Printf("%s is better",i.GetTag());
}
if ( !found )
{
@ -202,7 +207,6 @@ Class SWWMHealth : Inventory abstract
{
if ( !(i is 'SWWMArmor') ) continue;
found = i;
Console.Printf("Moving next to armor %s",i.GetTag());
}
}
if ( !found )
@ -210,7 +214,6 @@ Class SWWMHealth : Inventory abstract
// check if the first item in inventory is a sandwich
if ( other.Inv is 'GrilledCheeseSandwich' )
{
Console.Printf("Moving before %s",other.Inv.GetTag());
// place ourselves before it
Inv = other.Inv;
other.Inv = self;
@ -220,11 +223,19 @@ Class SWWMHealth : Inventory abstract
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( (i == self) || !(i.Inv is 'GrilledCheeseSandwich') ) continue;
Console.Printf("%s is right next to %s",i.GetTag(),i.Inv.GetTag());
found = i;
break;
}
}
if ( !found )
{
// find last of either invinciball or ragekit power
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( !(i is 'InvinciballPower') && !(i is 'RagekitPower') ) continue;
found = i;
}
}
if ( !found ) return;
// place ourselves right after it
Inventory saved = found.Inv;
@ -527,8 +538,8 @@ Class BigPunchSplash : Actor
override void PostBeginPlay()
{
Super.PostBeginPlay();
SWWMHandler.DoBlast(self,50,40000,target);
A_Explode(5,80,0);
SWWMHandler.DoBlast(self,120,40000,target);
A_Explode(special1,120,0);
Destroy();
}
}
@ -1033,6 +1044,7 @@ Class SWWMWeapon : Weapon abstract
{
let ps = Spawn("BigPunchSplash",d.HitLocation);
ps.target = self;
ps.special1 = dmg;
}
A_QuakeEx(quakin/2,quakin/2,quakin/2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.06*quakin);
if ( raging ) A_StartSound(bloodless?"pusher/althit":"pusher/altmeat",CHAN_WEAPON,CHANF_OVERLAP);
@ -1112,6 +1124,7 @@ Class SWWMWeapon : Weapon abstract
{
let ps = Spawn("BigPunchSplash",d.HitLocation+HitNormal*4);
ps.target = self;
ps.special1 = dmg;
}
int quakin = raging?4:1;
A_QuakeEx(quakin,quakin,quakin,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12*quakin);

View file

@ -65,11 +65,11 @@ Class GrilledCheeseSandwich : Inventory
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// find last armor or health item
// find last armor/health item or invuln/ragekit
Inventory found = null;
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( !(i is 'SWWMHealth') && !(i is 'SWWMArmor') ) continue;
if ( !(i is 'SWWMHealth') && !(i is 'SWWMArmor') && !(i is 'InvinciballPower') && !(i is 'RagekitPower') ) continue;
found = i;
}
if ( !found ) return;
@ -526,6 +526,36 @@ Class InvinciballPower : Powerup
if ( (EffectTics <= 0) && Owner && Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_INVINCIBALL"));
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// find first with health/armor or sandwich after it
Inventory found = null;
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( !(i.Inv is 'SWWMHealth') && !(i.Inv is 'SWWMArmor') && !(i.Inv is 'GrilledCheeseSandwich') ) continue;
found = i;
break;
}
if ( !found )
{
// check if first item in inventory is health/armor or a sandwich
if ( (other.Inv is 'SWWMHealth') || (other.Inv is 'SWWMArmor') || (other.Inv is 'GrilledCheeseSandwich') )
{
// place ourselves before it
Inv = other.Inv;
other.Inv = self;
return;
}
return;
}
// place ourselves right after it
Inventory saved = found.Inv;
found.Inv = self;
other.Inv = Inv;
Inv = saved;
}
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
if ( damageType == 'EndLevel' ) return;
@ -738,6 +768,36 @@ Class RagekitPower : Powerup
if ( (EffectTics <= 0) && Owner && Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_RAGEKIT"));
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// find first with health/armor or sandwich after it
Inventory found = null;
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( !(i.Inv is 'SWWMHealth') && !(i.Inv is 'SWWMArmor') && !(i.Inv is 'GrilledCheeseSandwich') ) continue;
found = i;
break;
}
if ( !found )
{
// check if first item in inventory is health/armor or a sandwich
if ( (other.Inv is 'SWWMHealth') || (other.Inv is 'SWWMArmor') || (other.Inv is 'GrilledCheeseSandwich') )
{
// place ourselves before it
Inv = other.Inv;
other.Inv = self;
return;
}
return;
}
// place ourselves right after it
Inventory saved = found.Inv;
found.Inv = self;
other.Inv = Inv;
Inv = saved;
}
void DoHitFX()
{
if ( level.maptime <= lasteffect+5 ) return;