From 7e648a0820942f367afd94455720bfdc74f8bc1e Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 6 Dec 2024 05:45:24 -0500 Subject: [PATCH] implement berserk intensity --- Core/Layer/Worlds/WorldLayer.Render.Hud.cs | 8 +++++++- Core/Render/Renderer.cs | 2 ++ Core/Util/Configs/Components/ConfigGame.cs | 4 ++++ RELEASENOTES.md | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Core/Layer/Worlds/WorldLayer.Render.Hud.cs b/Core/Layer/Worlds/WorldLayer.Render.Hud.cs index a04914ead..6c1ad0363 100644 --- a/Core/Layer/Worlds/WorldLayer.Render.Hud.cs +++ b/Core/Layer/Worlds/WorldLayer.Render.Hud.cs @@ -285,7 +285,13 @@ private void DrawHudEffects(IHudRenderContext hud) IPowerup? powerup = Player.Inventory.PowerupEffectColor; if (powerup?.DrawColor != null && powerup.DrawPowerupEffect) - hud.Clear(powerup.DrawColor.Value, powerup.DrawAlpha); + { + var alpha = powerup.DrawAlpha; + if (powerup.PowerupType == PowerupType.Strength) + alpha *= (float)m_config.Game.BerserkIntensity; + + hud.Clear(powerup.DrawColor.Value, alpha); + } if (Player.BonusCount > 0) hud.Clear(PickupColor, 0.2f); diff --git a/Core/Render/Renderer.cs b/Core/Render/Renderer.cs index 6dfb6aec1..a4598c946 100644 --- a/Core/Render/Renderer.cs +++ b/Core/Render/Renderer.cs @@ -216,6 +216,8 @@ private static PaletteIndex GetPalette(IConfig config, Player player) { if (damageCount == player.DamageCount) damageCount = (int)(player.DamageCount * config.Game.PainIntensity); + else + damageCount = (int)(damageCount * config.Game.BerserkIntensity); palette = GetDamagePalette(damageCount); } diff --git a/Core/Util/Configs/Components/ConfigGame.cs b/Core/Util/Configs/Components/ConfigGame.cs index f7895c471..81c96fff7 100644 --- a/Core/Util/Configs/Components/ConfigGame.cs +++ b/Core/Util/Configs/Components/ConfigGame.cs @@ -33,6 +33,10 @@ public class ConfigGame: ConfigElement [OptionMenu(OptionSectionType.General, "Pain Intensity", spacer: true, sliderMin: 0, sliderMax: 5.0, sliderStep: .1)] public readonly ConfigValue PainIntensity = new(1.0); + [ConfigInfo("Scale red amount drawn to screen when the player pickups up a berserk.")] + [OptionMenu(OptionSectionType.General, "Berserk Intensity", sliderMin: 0, sliderMax: 5.0, sliderStep: .1)] + public readonly ConfigValue BerserkIntensity = new(1.0); + [ConfigInfo("Transition effect between levels/screens.")] [OptionMenu(OptionSectionType.General, "Transition Type")] public readonly ConfigValue TransitionType = new(World.TransitionType.Melt); diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 14703af97..cbb2abc48 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -9,6 +9,7 @@ - Controller gyroscope support (tested with PS DualShock 4, should work with other SDL-supported controllers) - Emulate boom behavior that let player move out of one-sided lines - Controller rumble feedback + - Add option for berserk intensity ## Bug fixes: - Fix per ammo values for box ammo and backpack amount from dehacked patch