Globally calculated difficulty damage

This commit is contained in:
Marco 2025-04-09 16:58:36 +02:00
commit 4d62a0a385
4 changed files with 12 additions and 22 deletions

View file

@ -185,13 +185,7 @@ public partial class PlayerDamageReceiver : Area2D
if (!Enabled) return;
// Change value based on difficulty
float difficultyReducedDmg = GlobalState.Instance.SessionSettings.Difficulty switch
{
DifficultyLevel.Easy => damage / 5,
DifficultyLevel.Normal => damage / 2,
DifficultyLevel.Hard or DifficultyLevel.Lunatic => damage,
_ => damage
};
float difficultyReducedDmg = damage / GlobalState.Instance.SessionSettings.DifficultyDamageMultiplier;
// Check if the shield is empty or damage has skip attributes
if (CurrentShield <= 0 || ShieldDamageResistances.Where(x => x.DamageType == type).Any(x => x.Attribute is DamageAttribute.Skip))