feat(aswid): sunlight, fire and pierce weaknesses

Each has its own switch under 'Aswid - Weaknesses'. Sunlight: by day
under open sky, slower regen and movement and a slow burn that stops at
30% health; roofs, dungeons, Swamp, Mistlands, night and Eclipse shield
you. Fire +25% until Fader, pierce +20%; both applied after resistances
and armor, so meads still help and Mist Form stays pierce-immune.
This commit is contained in:
kanym 2026-10-26 15:12:05 +01:00
commit 9149d3f0b5
13 changed files with 191 additions and 0 deletions

View file

@ -41,6 +41,21 @@ namespace RacesOfValheim
public static ConfigEntry<float> StaminaBonusPerState;
public static ConfigEntry<float> StaminaCostMultiplier;
// ─── Weaknesses ──────────────────────────────────────────────────────────
// The Discord reports said the race had no real downsides. Each weakness has its own
// switch, so a single player can drop one; on a server the host's values win.
public static ConfigEntry<bool> SunlightEnabled;
public static ConfigEntry<float> SunHealthRegenPenalty;
public static ConfigEntry<float> SunStaminaRegenPenalty;
public static ConfigEntry<float> SunSpeedPenalty;
public static ConfigEntry<float> SunHealthLossPerSecond;
public static ConfigEntry<float> SunHealthFloor;
public static ConfigEntry<bool> FireWeaknessEnabled;
public static ConfigEntry<float> FireWeakness;
public static ConfigEntry<bool> FaderRemovesFireWeakness;
public static ConfigEntry<bool> PierceWeaknessEnabled;
public static ConfigEntry<float> PierceWeakness;
// ─── Bat Form ────────────────────────────────────────────────────────────
// The bat flies on the same directed flight as the Skadi's drakes (DirectedFlight.cs),
// with its own numbers. It used to fly on vanilla's debug-fly flag: 50 m/s, free, blind
@ -168,6 +183,30 @@ namespace RacesOfValheim
StaminaCostMultiplier = config.Bind(stamina, "Stamina Cost Multiplier", 1f,
new ConfigDescription("Multiplies every stamina cost: sprinting, swimming, attacks, blocking. 1 is the normal cost, 0.5 half. There is no infinite setting on purpose; set the bonuses above high instead.", new AcceptableValueRange<float>(0.1f, 2f)));
const string weak = "Aswid - Weaknesses";
SunlightEnabled = config.Bind(weak, "Sunlight", true,
new ConfigDescription("Weakens you by day while you stand under open sky. A roof (the same test as the game's Sheltered status), a dungeon, the Swamp, the Mistlands, the night and your own Eclipse all shield you.", null));
SunHealthRegenPenalty = config.Bind(weak, "Sunlight Health Regen Penalty", 0.5f,
new ConfigDescription("Health regeneration lost in sunlight. 0.5 = half.", new AcceptableValueRange<float>(0f, 1f)));
SunStaminaRegenPenalty = config.Bind(weak, "Sunlight Stamina Regen Penalty", 0.25f,
new ConfigDescription("Stamina regeneration lost in sunlight. 0.25 = a quarter.", new AcceptableValueRange<float>(0f, 1f)));
SunSpeedPenalty = config.Bind(weak, "Sunlight Speed Penalty", 0.1f,
new ConfigDescription("Movement speed lost in sunlight. 0.1 = 10% slower.", new AcceptableValueRange<float>(0f, 0.9f)));
SunHealthLossPerSecond = config.Bind(weak, "Sunlight Health Loss Per Second", 0.5f,
new ConfigDescription("Health the sun burns away each second. 0 turns it off.", new AcceptableValueRange<float>(0f, 10f)));
SunHealthFloor = config.Bind(weak, "Sunlight Health Floor", 0.3f,
new ConfigDescription("The sun stops burning at this fraction of your max health, so it weakens you but never kills you. 0.3 = 30%.", new AcceptableValueRange<float>(0f, 1f)));
FireWeaknessEnabled = config.Bind(weak, "Fire Weakness", true,
new ConfigDescription("Fire, burning included, hurts more.", null));
FireWeakness = config.Bind(weak, "Fire Weakness Amount", 0.25f,
new ConfigDescription("Extra fire damage taken. 0.25 = 25% more. Resistance meads and armour still reduce it.", new AcceptableValueRange<float>(0f, 2f)));
FaderRemovesFireWeakness = config.Bind(weak, "Fader Removes Fire Weakness", true,
new ConfigDescription("Defeating Fader, the boss that grants the Surtling form, ends the fire weakness.", null));
PierceWeaknessEnabled = config.Bind(weak, "Pierce Weakness", true,
new ConfigDescription("Pierce damage (arrows, spears, stakes) hurts more. Mist Form's immunity still wins.", null));
PierceWeakness = config.Bind(weak, "Pierce Weakness Amount", 0.2f,
new ConfigDescription("Extra pierce damage taken. 0.2 = 20% more.", new AcceptableValueRange<float>(0f, 2f)));
const string batform = "Aswid - Bat Form";
// Same controls as the Skadi's drake: aim with the camera, W beats forward, Shift
// sprints, S beats backwards, and letting go hovers briefly before gliding down.