Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement berserk intensity #904

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Core/Layer/Worlds/WorldLayer.Render.Hud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions Core/Render/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions Core/Util/Configs/Components/ConfigGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class ConfigGame: ConfigElement<ConfigGame>
[OptionMenu(OptionSectionType.General, "Pain Intensity", spacer: true, sliderMin: 0, sliderMax: 5.0, sliderStep: .1)]
public readonly ConfigValue<double> 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<double> BerserkIntensity = new(1.0);

[ConfigInfo("Transition effect between levels/screens.")]
[OptionMenu(OptionSectionType.General, "Transition Type")]
public readonly ConfigValue<World.TransitionType> TransitionType = new(World.TransitionType.Melt);
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down