66*/
77#pragma once
88#include " PluginBase.h"
9+ #include " eTaskType.h"
910
10- /*
11- https://www.gtamodding.com/wiki/Decision_Maker
12- */
11+ struct DecisionContext
12+ {
13+ bool onFoot = false ;
14+ bool inVehicle = false ;
1315
14- enum eDecisionTypes {
15- DECISION_ON_FOOT = 0 ,
16- DECISION_IN_VEHICLE = 1
16+ DecisionContext () = default ;
17+ DecisionContext (bool onFoot, bool inVehicle) :
18+ onFoot (onFoot), inVehicle(inVehicle)
19+ {}
1720};
21+ VALIDATE_SIZE (DecisionContext, 0x2 );
22+
23+ struct DecisionChances
24+ {
25+ // weights that sums up to total value of all responses applicable to current event,
26+ // then chance is weight/total
27+ unsigned char toNeutral = 0 ;
28+ unsigned char toPlayer = 0 ;
29+ unsigned char toFriend = 0 ;
30+ unsigned char toEnemy = 0 ;
1831
19- enum eDecisionRelationship {
20- DECISION_RELATIONSHIP_NEUTRAL = 0 ,
21- DECISION_RELATIONSHIP_PLAYER = 1 ,
22- DECISION_RELATIONSHIP_FRIEND = 2 ,
23- DECISION_RELATIONSHIP_THREAT = 3
32+ DecisionChances () = default ;
33+ DecisionChances (unsigned char toNeutral, unsigned char toPlayer, unsigned char toFriend, unsigned char toEnemy) :
34+ toNeutral (toNeutral), toPlayer(toPlayer), toFriend(toFriend), toEnemy(toEnemy)
35+ {}
2436};
37+ VALIDATE_SIZE (DecisionChances, 0x4 );
2538
2639class PLUGIN_API CDecision {
2740public:
28- int m_anTaskTypes[6 ]; // see eTaskType
29- unsigned char m_anResponseChances[6 ][4 ]; // 4 different relationships : see eDecisionRelationship
30- unsigned char m_anTypeFlags[2 ][6 ]; // 2 different types : see eDecisionTypes
41+ constexpr static auto RESPONSE_COUNT = 6 ; // max count of unique responses
3142
32- inline CDecision () { // @0x6040C0
33- // SetDefault();
34- }
35- };
43+ eTaskType task[RESPONSE_COUNT]; // response's task
44+ DecisionChances chances[RESPONSE_COUNT]; // response's chances for each relationship type
45+ DecisionContext context[RESPONSE_COUNT]; // situations the response applies to
3646
37- VALIDATE_SIZE (CDecision, 0x3C );
47+ CDecision ();
48+ };
49+ VALIDATE_SIZE (CDecision, 0x3C );
0 commit comments