Vixen
c7401864
csharp
public sealed class ThreatTable

What one creature is angry about, and with whom.

Read the guide page for this →

Remarks

Here rather than in a game, because every game that adds threat later adds it wrong — doc 28 § Combat says so in as many words. The failure is always the same shape: threat gets bolted on as "whoever hit hardest", and then a taunt has no meaning, a healer cannot pull, and a tank swap is impossible to author.

⚠ A taunt is not a large threat number. Giving the taunter the top score plus a margin makes a taunt fail the moment somebody out-damages the margin, which is the bug every homegrown threat table ships with. Taunt sets the taunter to the current highest and marks them as forced until the duration runs out, so the table has an answer to "who is the target" that damage cannot argue with.

Fields and properties (3)

  • public int Count

    How many attackers are on it.

  • public bool IsTaunted

    Whether a taunt is holding the target.

  • public ReadOnlySpan<ThreatEntry> Entries

    Them, highest first.

Methods (8)

  • public float Add(ulong attacker, float threat)

    Adds threat, putting the attacker on the table if they were not.

  • public void Multiply(ulong attacker, float factor)

    Multiplies one attacker's threat — a threat drop, or a tank's modifier.

  • public void Taunt(ulong attacker, float duration)

    Forces the target for a while.

  • public bool Remove(ulong attacker)

    Takes an attacker off — they died, they left, they vanished.

  • public void Clear()

    Forgets everything. What a reset, a wipe and a leash all do.

  • public float ThreatOf(ulong attacker)

    How much one attacker has.

  • public ulong Target()

    Who the creature should be attacking.

  • public bool Tick(float delta)

    Advances the taunt clock.

Used by (1)

  • ThreatTableTestsVixen.Gameplay.Combat.Tests