fix(trenta): stamina trickles back while a Bonemass Trenta swims

Vanilla Player.UpdateStats stops stamina regen while swimming off the
ground, and drowning starts at 0 stamina. The Bonemass unlock only
waived the stroke cost, so a Trenta who went into the water empty never
got a point back and drowned in water it swims for free.

A postfix on UpdateStats adds the regen vanilla held back, with the same
formula, times the new Trenta - Bonemass / Swim Stamina Regen (0.1, slow
on purpose). The compendium line says so in all three languages.
This commit is contained in:
kanym 2026-10-29 02:21:24 +01:00
commit fdc0fdcedc
5 changed files with 48 additions and 3 deletions

View file

@ -46,6 +46,9 @@ namespace RacesOfValheim
public static ConfigEntry<float> PurpleRainHealAmount;
public static ConfigEntry<float> PurpleRainPoisonDamage;
// ─── Bonemass (tier 4+, passive) ──────────────────────────────────────
public static ConfigEntry<float> SwimStaminaRegen;
// ─── Last Stand & Thorns (tier 5+) ────────────────────────────────────
public static ConfigEntry<float> LastStandMaxArmorBonus;
public static ConfigEntry<float> ThornsReflectPercent;
@ -114,6 +117,10 @@ namespace RacesOfValheim
PurpleRainPoisonDamage = config.Bind(purpleRain, "Enemy Poison Damage", 40f,
new ConfigDescription("Flat poison damage applied to every enemy hit.", new AcceptableValueRange<float>(0f, 200f)));
const string bonemass = "Trenta - Bonemass";
SwimStaminaRegen = config.Bind(bonemass, "Swim Stamina Regen", 0.1f,
new ConfigDescription("Share of the normal stamina regen kept while swimming, from Bonemass on. The game stops regen in water entirely, so an empty Trenta used to drown even though swimming is free. 0 is the game's behaviour.", new AcceptableValueRange<float>(0f, 1f)));
const string lastStand = "Trenta - Last Stand & Thorns";
LastStandMaxArmorBonus = config.Bind(lastStand, "Last Stand Max Armor Bonus", 0.5f,
new ConfigDescription("Armor multiplier bonus at near-zero health, tier 5+ (0.5 = +50%). Scales down to 0 at full health.", new AcceptableValueRange<float>(0f, 3f)));