feat(aswid): Vampiric Aura is off in bat form until The Queen

A bat could glide over enemies that cannot reach it and drain them the
whole way. The aura now stays silent in bat form until the configurable
unlock state (7, The Queen), or always if 'Active In Bat Form' is on.
Also corrects the README's aura and Mist Form lines, which still
described the old block-to-channel aura and a weakness the code lacks.
This commit is contained in:
kanym 2026-10-26 14:20:10 +01:00
commit 824ddd8956
8 changed files with 50 additions and 9 deletions

View file

@ -1165,13 +1165,14 @@ namespace RacesOfValheim
private float damageTickTimer = 0f;
/// <summary>
/// The Vampiric Aura drains on its own, in every form, with no key to hold - but it does not
/// The Vampiric Aura drains on its own, with no key to hold (as a bat only once
/// BatAuraAllowed says so) - but it does not
/// distinguish traders from monsters, so it can execute Haldor/Hildir on approach. AuraEnabled
/// (toggled with Devour on the same key) is the escape hatch for that.
/// </summary>
private void HandleVampiricAura()
{
if (!AuraEnabled)
if (!AuraEnabled || (IsBatForm() && !BatAuraAllowed(BossProgressionManager.GetCurrentProgressionState())))
{
damageTickTimer = 0f;
return;
@ -1184,6 +1185,24 @@ namespace RacesOfValheim
PerformLifeDrain();
}
private static bool IsBatForm()
{
return Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_BatForm".GetStableHashCode());
}
/// <summary>
/// Whether the aura drains while the player is a bat. Off until the Queen by default: a bat
/// gliding over enemies that cannot reach it, draining them the whole way, was the "unfun
/// optimal way to play" Dissolution reported. The flag turns it back on for everyone; the
/// unlock state brings it back as a late-game reward, 0 meaning never.
/// </summary>
public static bool BatAuraAllowed(int state)
{
if (AswidConfig.AuraInBatForm.Value) return true;
int unlock = AswidConfig.BatAuraUnlockState.Value;
return unlock > 0 && state >= unlock;
}
/// <summary>Half damage as a human, full as a bat, double as mist.</summary>
private float GetAuraFormMultiplier()
{