feat: OnAttack behavior (#1853)

Adds the `OnAttack` property behavior starting node.
Tested that having the node allows the model to be attacked to trigger the start of behaviors
This commit is contained in:
David Markowitz
2025-08-01 01:09:16 -07:00
committed by GitHub
parent c9e95839ee
commit c083f21e44
11 changed files with 111 additions and 6 deletions

View File

@@ -146,11 +146,21 @@ public:
void OnChatMessageReceived(const std::string& sMessage);
void OnHit();
// Sets the speed of the model
void SetSpeed(const float newSpeed) { m_Speed = newSpeed; }
// Whether or not to restart at the end of the frame
void RestartAtEndOfFrame() { m_RestartAtEndOfFrame = true; }
// Increments the number of strips listening for an attack.
// If this is the first strip adding an attack, it will set the factions to the correct values.
void AddAttack();
// Decrements the number of strips listening for an attack.
// If this is the last strip removing an attack, it will reset the factions to the default of -1.
void RemoveAttack();
private:
// Loads a behavior from the database.
@@ -168,6 +178,9 @@ private:
// The number of strips listening for a RequestUse GM to come in.
uint32_t m_NumListeningInteract{};
// The number of strips listening for an attack.
uint32_t m_NumActiveAttack{};
// Whether or not the model is paused and should reject all interactions regarding behaviors.
bool m_IsPaused{};
/**