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:
parent
83cd49c753
commit
824ddd8956
8 changed files with 50 additions and 9 deletions
|
|
@ -56,6 +56,8 @@ namespace RacesOfValheim
|
|||
public static ConfigEntry<float> AuraBaseDamage;
|
||||
public static ConfigEntry<float> AuraBloodMagicScaling;
|
||||
public static ConfigEntry<float> AuraExecuteThreshold;
|
||||
public static ConfigEntry<bool> AuraInBatForm;
|
||||
public static ConfigEntry<int> BatAuraUnlockState;
|
||||
|
||||
// ─── Superhuman Senses (tier 5+ passive) ─────────────────────────────────
|
||||
public static ConfigEntry<float> SensesRadius;
|
||||
|
|
@ -173,6 +175,10 @@ namespace RacesOfValheim
|
|||
new ConfigDescription("Extra damage per tick at 100 Blood Magic skill (scales linearly from 0).", new AcceptableValueRange<float>(0f, 20f)));
|
||||
AuraExecuteThreshold = config.Bind(aura, "Execute Threshold", 0.20f,
|
||||
new ConfigDescription("Non-boss enemies at or below this fraction of max health are executed by the aura instead of merely damaged.", new AcceptableValueRange<float>(0f, 1f)));
|
||||
AuraInBatForm = config.Bind(aura, "Active In Bat Form", false,
|
||||
new ConfigDescription("Lets the aura drain while you are a bat from the start, as it did before. Off: the bat has no aura until the unlock state below.", null));
|
||||
BatAuraUnlockState = config.Bind(aura, "Bat Form Unlock State", 7,
|
||||
new ConfigDescription("The progression state at which the bat gets its aura back (7 = The Queen). 0 means never, so only the setting above can turn it on.", new AcceptableValueRange<int>(0, 8)));
|
||||
|
||||
const string senses = "Aswid - Superhuman Senses";
|
||||
SensesRadius = config.Bind(senses, "Detection Radius", 100f,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue