diff --git a/RTAPI.h b/RTAPI.h index d9252c1..e31d14f 100644 --- a/RTAPI.h +++ b/RTAPI.h @@ -14,6 +14,7 @@ #define EV_RTAPI_GROUP_MEMBER_JOINED "RTAPI_GROUP_MEMBER_JOINED" // Payload is RTAPI::GroupMember* #define EV_RTAPI_GROUP_MEMBER_LEFT "RTAPI_GROUP_MEMBER_LEFT" // Payload is RTAPI::GroupMember* #define EV_RTAPI_GROUP_MEMBER_UPDATED "RTAPI_GROUP_MEMBER_UPDATED" // Payload is RTAPI::GroupMember* +#define EV_RTAPI_COMBAT_EVENT "RTAPI_COMBAT_EVENT" // Payload is RTAPI::CombatEvent* #include @@ -120,6 +121,71 @@ typedef struct GroupMember uint32_t IsLieutenant : 1; } GroupMember; +///---------------------------------------------------------------------------------------------------- +/// EAgentType Enumeration +///---------------------------------------------------------------------------------------------------- +enum EAgentType +{ + AT_Character, + AT_Gadget, + AT_AttackTarget +}; + +///---------------------------------------------------------------------------------------------------- +/// Agent Struct +///---------------------------------------------------------------------------------------------------- +typedef struct Agent +{ + uint32_t ID; + uint32_t SpeciesID; + EAgentType Type; + char Name[128]; + + uint32_t IsMinion : 1; + uint32_t IsSelf : 1; + uint32_t OwnerID; // valid value only if IsMinion == true +} Agent; + +///---------------------------------------------------------------------------------------------------- +/// ECombatEventType Enumeration +///---------------------------------------------------------------------------------------------------- +enum ECombatEventType +{ + CET_Health, + CET_Down, + CET_Death +}; + +///---------------------------------------------------------------------------------------------------- +/// Skill Struct +///---------------------------------------------------------------------------------------------------- +typedef struct Skill +{ + uint32_t ID; + char Name[128]; +} Skill; + +///---------------------------------------------------------------------------------------------------- +/// CombatEvent Struct +///---------------------------------------------------------------------------------------------------- +struct CombatEvent +{ + uint64_t Time; + + Agent* SrcAgent; + Agent* DstAgent; + Skill* Skill; + + ECombatEventType Type; + + float Value; + float ValueAlt; + + uint32_t IsConditionDamage : 1; + uint32_t IsCritical : 1; + uint32_t IsFumble : 1; +}; + ///---------------------------------------------------------------------------------------------------- /// RealTimeData Struct ///---------------------------------------------------------------------------------------------------- diff --git a/RTAPI.hpp b/RTAPI.hpp index 71d58b7..0db3b1a 100644 --- a/RTAPI.hpp +++ b/RTAPI.hpp @@ -14,6 +14,7 @@ #define EV_RTAPI_GROUP_MEMBER_JOINED "RTAPI_GROUP_MEMBER_JOINED" // Payload is RTAPI::GroupMember* #define EV_RTAPI_GROUP_MEMBER_LEFT "RTAPI_GROUP_MEMBER_LEFT" // Payload is RTAPI::GroupMember* #define EV_RTAPI_GROUP_MEMBER_UPDATED "RTAPI_GROUP_MEMBER_UPDATED" // Payload is RTAPI::GroupMember* +#define EV_RTAPI_COMBAT_EVENT "RTAPI_COMBAT_EVENT" // Payload is RTAPI::CombatEvent* #include @@ -125,6 +126,72 @@ namespace RTAPI uint32_t IsLieutenant : 1; }; + ///---------------------------------------------------------------------------------------------------- + /// EAgentType Enumeration + ///---------------------------------------------------------------------------------------------------- + enum class EAgentType + { + Character, + Gadget, + AttackTarget + }; + + ///---------------------------------------------------------------------------------------------------- + /// Agent Struct + ///---------------------------------------------------------------------------------------------------- + struct Agent + { + uint32_t ID; + uint32_t SpeciesID; + EAgentType Type; + char Name[128]; + + uint32_t IsMinion : 1; + uint32_t IsSelf : 1; + uint32_t OwnerID; // valid value only if IsMinion == true + }; + + + ///---------------------------------------------------------------------------------------------------- + /// ECombatEventType Enumeration + ///---------------------------------------------------------------------------------------------------- + enum class ECombatEventType + { + Health, + Down, + Death + }; + + ///---------------------------------------------------------------------------------------------------- + /// Skill Struct + ///---------------------------------------------------------------------------------------------------- + struct Skill + { + uint32_t ID; + char Name[128]; + }; + + ///---------------------------------------------------------------------------------------------------- + /// CombatEvent Struct + ///---------------------------------------------------------------------------------------------------- + struct CombatEvent + { + uint64_t Time; + + Agent* SrcAgent; + Agent* DstAgent; + Skill* Skill; + + ECombatEventType Type; + + float Value; + float ValueAlt; + + uint32_t IsConditionDamage : 1; + uint32_t IsCritical : 1; + uint32_t IsFumble : 1; + }; + ///---------------------------------------------------------------------------------------------------- /// RealTimeData Struct ///---------------------------------------------------------------------------------------------------- @@ -134,6 +201,7 @@ namespace RTAPI uint32_t GameBuild; // Set to 0 when RTAPI is unloaded. EGameState GameState; EGameLanguage Language; + /* Instance/World Data */ ETimeOfDay TimeOfDay; uint32_t MapID;