feat: enemies now use weights on their attacks (#2004)

* feat: enemies now use weights on their attacks

tested that 8 times out of 10, in close range, spiders did a web attack instead of a melee attack, vs the prior behavior of always following a pattern

fixes #2002

* feedback
This commit is contained in:
David Markowitz
2026-06-18 23:27:14 -07:00
committed by GitHub
parent 0f17e1de3b
commit ce9d4e823c
4 changed files with 68 additions and 36 deletions

View File

@@ -33,13 +33,15 @@ enum class AiState : uint32_t {
*/
struct AiSkillEntry
{
uint32_t skillId;
uint32_t skillId{};
float cooldown;
float cooldown{};
float abilityCooldown;
float abilityCooldown{};
Behavior* behavior;
Behavior* behavior{};
int32_t combatWeight{};
};
/**
@@ -396,9 +398,17 @@ private:
*/
bool m_DirtyStateOrTarget = false;
// Min amount of time to remain as in combat after casting a skill
float m_MinRoundLength = 0.0f;
// max amount of time to remain as in combat after casting a skill
float m_MaxRoundLength = 0.0f;
// The amount of time the entity will be forced to tether for
float m_ForcedTetherTime = 0.0f;
float m_CombatRoundLength = 0.0f;
// The amount of time a removed threat will be ignored for.
std::map<LWOOBJID, float> m_RemovedThreatList;