Add extra debug logs for Aura execute and consume

This commit is contained in:
Ferdinando 2026-07-31 09:24:07 +02:00
commit 152a2f21ad

View file

@ -1005,8 +1005,13 @@ namespace RacesOfValheim
if (currentHp > 0 && currentHp <= maxHp * 0.20f && !c.IsBoss())
{
Jotunn.Logger.LogInfo($"[AswidDebug] Aura Execution TRIGGERED on {c.name}! HP: {currentHp}/{maxHp}");
totalDamage = currentHp * 2f; // Lethal damage for execute
TryConsumeMob(c, maxHp); // Automatically devour when executed
TryConsumeMob(c, maxHp, true); // Automatically devour when executed, bypassing cooldown
}
else
{
Jotunn.Logger.LogInfo($"[AswidDebug] Aura normal tick on {c.name}. HP: {currentHp}/{maxHp}");
}
HitData hd = new HitData();
@ -1028,12 +1033,12 @@ namespace RacesOfValheim
public static bool DevourEnabled = true;
private static float lastConsumeTime = 0f;
public static void TryConsumeMob(Character c, float maxHp)
public static void TryConsumeMob(Character c, float maxHp, bool bypassCooldown = false)
{
if (!DevourEnabled) return;
Jotunn.Logger.LogInfo($"[AswidDebug] TryConsumeMob called for {c.name}");
if (Time.time - lastConsumeTime < 5f)
if (!bypassCooldown && Time.time - lastConsumeTime < 5f)
{
Jotunn.Logger.LogInfo($"[AswidDebug] TryConsumeMob aborted: Cooldown active. Time.time={Time.time}, lastConsumeTime={lastConsumeTime}");
return; // Cooldown active