Add strictness options for untouchable bonus handling.

Fix order of operations making first untouchable kill not have a bonus.
This commit is contained in:
Mari the Deer 2020-11-29 21:25:40 +01:00
commit 5ea5cb35fc
9 changed files with 45 additions and 7 deletions

View file

@ -89,6 +89,7 @@ user bool swwm_camhud = false; // keep full hud visible when operating cameras
user bool swwm_rageshader = false; // alternate ragekit shader for people with photosensitivity
server bool swwm_uncapalert = false; // all noise alerts have infinite range
user int swwm_damagetarget = 0; // conditional healthbar hiding (1 - hide until damage is first taken, 2 - hide if at full health)
server int swwm_strictuntouchable = 0; // untouchable bonus ends... (1 - even if your armor absorbed all the damage, 2 - if you get hit by anything PERIOD)
server noarchive bool swwm_iseriouslywanttoplaythiswithbd = false; // self-explanatory

View file

@ -164,6 +164,10 @@ SWWM_DAMAGETARGET = "Healthbar Visibility";
SWWM_TARGET_ALWAYS = "Always Visible";
SWWM_TARGET_FIRSTHIT = "After First Hit";
SWWM_TARGET_DAMAGED = "Below Full Health";
SWWM_STRICTUNTOUCHABLE = "Untouchable Bonus Strictness";
SWWM_UNTOUCHABLE_HEALTH = "Health Decrease";
SWWM_UNTOUCHABLE_ARMOR = "Armor Decrease";
SWWM_UNTOUCHABLE_ANYHIT = "Any Hit";
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.";
@ -241,6 +245,7 @@ TOOLTIP_SWWM_CAMHUD = "By default, when the player is looking through a camera,
TOOLTIP_SWWM_UNCAPALERT = "If enabled, all weapons and projectiles will have infinite noise radius. May fix maps that employ vanilla-style teleport traps.";
TOOLTIP_SWWM_COLLECTANIMKEY = "Play special first person animations when picking up keys.";
TOOLTIP_SWWM_DAMAGETARGET = "Select when targetter healthbars should be shown.";
TOOLTIP_SWWM_STRICTUNTOUCHABLE = "By default, the \"Untouchable\" bonus is active until you take direct damage. If you feel this isn't strict enough, you can also make it end if armor absorbs the damage, or, for extra strictness, on ANY hit, even while invulnerable.";
// knowledge base
SWWM_COMINGSOON = "(coming soon)";
SWWM_MISSTAB = "Mission";

View file

@ -163,6 +163,10 @@ SWWM_DAMAGETARGET = "Visibilidad de Barras de Salud";
SWWM_TARGET_ALWAYS = "Siempre Visible";
SWWM_TARGET_FIRSTHIT = "Tras Primer Golpe";
SWWM_TARGET_DAMAGED = "Debajo de Salud Completa";
SWWM_STRICTUNTOUCHABLE = "Rigurosidad de Bonus Intocable";
SWWM_UNTOUCHABLE_HEALTH = "Baja de Salud";
SWWM_UNTOUCHABLE_ARMOR = "Baja de Armadura";
SWWM_UNTOUCHABLE_ANYHIT = "Cualquier Golpe";
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 efectos te causan malestar.";
@ -240,6 +244,7 @@ TOOLTIP_SWWM_CAMHUD = "Por defecto, cuando el jugador está mirando por una cám
TOOLTIP_SWWM_UNCAPALERT = "Si se activa, todas las armas y proyectiles tendrán un rango de ruido ilimitado. Puede arreglar mapas que usan trampas de teletransporte estilo vanilla.";
TOOLTIP_SWWM_COLLECTANIMKEY = "Muestra animaciones especiales en primera persona al recoger llaves.";
TOOLTIP_SWWM_DAMAGETARGET = "Selecciona cuando deben mostrarse las barras de vida.";
TOOLTIP_SWWM_STRICTUNTOUCHABLE = "Por defecto, el bonus \"Intocable\" permanece activo hasta que recibas daño directo. Si sientes que esto no es suficientemente estricto, también puedes hacer que termine si la armadura absorbe el daño, o, para mayor severidad, con CUALQUIER golpe, incluso siendo invulnerable.";
// knowledge base
SWWM_COMINGSOON = "(próximamente)";
SWWM_MISSTAB = "Misión";

View file

@ -1,2 +1,2 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r650 \cu(Sun 29 Nov 11:06:48 CET 2020)";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r651 \cu(Sun 29 Nov 21:25:40 CET 2020)";

View file

@ -30,6 +30,12 @@ OptionValue "SWWMDamageTarget"
1, "$SWWM_TARGET_FIRSTHIT"
2, "$SWWM_TARGET_DAMAGED"
}
OptionValue "SWWMUntouchableStrictness"
{
0, "$SWWM_UNTOUCHABLE_HEALTH"
1, "$SWWM_UNTOUCHABLE_ARMOR"
2, "$SWWM_UNTOUCHABLE_ANYHIT"
}
OptionMenu "SWWMOptionMenu"
{
Class "SWWMOptionMenu"
@ -108,6 +114,7 @@ OptionMenu "SWWMOptionMenu"
Option "$SWWM_YNYKRONALERT", "swwm_ynykronalert", "YesNo"
Option "$SWWM_SIMPLEFOG", "swwm_simplefog", "YesNo"
Option "$SWWM_SHOTGIB", "swwm_shotgib", "YesNo"
Option "$SWWM_STRICTUNTOUCHABLE", "swwm_strictuntouchable", "SWWMUntouchableStrictness"
StaticText " "
StaticText "$SWWM_ITITLE", "Blue"
Option "$SWWM_ARMORUSE", "swwm_autousearmor", "YesNo"

View file

@ -1410,15 +1410,18 @@ Class SWWMHandler : EventHandler
scr.xcnt = ++ofs;
}
}
spreecount[pnum]++;
if ( s && (spreecount[pnum] > s.skill) && !tookdamage[pnum] )
s.skill = spreecount[pnum];
if ( !tookdamage[pnum] )
{
int spreebonus = 10*spreecount[pnum];
int spreebonus = 10*(spreecount[pnum]);
// taper off after 10x (some people go really far with these, holy fuck)
if ( spreecount[pnum] > 10 ) spreebonus = int(spreebonus*((spreecount[pnum]/10.)**.25));
score += 100+spreebonus;
if ( (spreecount[pnum] > 0) && scr )
{
scr.xscore[ofs] = spreecount[pnum]+1;
scr.xscore[ofs] = spreecount[pnum];
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_SPREEKILL");
scr.xcnt = ++ofs;
@ -1444,9 +1447,6 @@ Class SWWMHandler : EventHandler
Console.Printf(StringTable.Localize("$SWWM_LASTMONSTER"),src.player.GetUserName(),1000);
SWWMScoreObj.Spawn(1000,src.Vec3Offset(0,0,src.Height/2));
}
spreecount[pnum]++;
if ( s && (spreecount[pnum] > s.skill) && !tookdamage[pnum] )
s.skill = spreecount[pnum];
}
override void WorldThingDamaged( WorldEvent e )

View file

@ -170,6 +170,11 @@ Class SWWMArmor : Armor abstract
if ( amount <= saved ) saved = amount;
newdamage -= saved;
if ( healed > 0 ) Owner.GiveBody(healed);
if ( (swwm_strictuntouchable == 1) && (saved > 0) && Owner.player )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd ) hnd.tookdamage[Owner.PlayerNumber()] = true;
}
amount -= saved;
damage = newdamage;
bool shouldautouse = false;
@ -364,6 +369,11 @@ Class SWWMHealth : Inventory abstract
return;
else if ( bBIGPOWERUP && (Owner.Health-damage > 0) )
return;
if ( (swwm_strictuntouchable == 1) && Owner.player )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd ) hnd.tookdamage[Owner.PlayerNumber()] = true;
}
if ( ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
int tgive = 0;
bool acc = CVar.GetCVar('swwm_accdamage',players[consoleplayer]).GetBool();

View file

@ -990,6 +990,11 @@ Class Demolitionist : PlayerPawn
}
override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle )
{
if ( (swwm_strictuntouchable >= 2) && (damage > 0) && player )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd ) hnd.tookdamage[PlayerNumber()] = true;
}
// no damage whatsoever
if ( scriptedinvul )
return 0;

View file

@ -82,7 +82,7 @@ Class GrilledCheeseSandwich : Inventory
return; // this damage type is ignored by the player, so it does not affect us
if ( damageType == 'EndLevel' )
return; // don't trigger on endlevel damage
if ( damageType == 'Telefrag' )
if ( (damageType == 'Telefrag') && source )
{
// prevent overlap with voodoo doll
if ( source.player == Owner.player )
@ -91,6 +91,11 @@ Class GrilledCheeseSandwich : Inventory
}
if ( (Owner.Health-damage <= 0) && (Amount > 0) )
{
if ( (swwm_strictuntouchable == 1) && Owner.player )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd ) hnd.tookdamage[Owner.PlayerNumber()] = true;
}
if ( damageType == 'InstantDeath' )
SafeTeleport(); // get out of pits
newdamage = 0;