2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 ///////////////////////////////////////////////////////////////////////////////
7 // $Header: r:/t2repos/thief2/src/ai/aiactinv.h,v 1.8 1999/11/29 12:27:12 BFarquha Exp $
21 class cAIMotionAction
;
23 class cAIOrientAction
;
24 class cAIWanderAction
;
26 ///////////////////////////////////////////////////////////////////////////////
28 // CLASS: cAIInvestAction
31 #define kAIIA_InfiniteDur INT_MAX
33 enum eAIInvestStyleFlags
35 kAIIS_InitOrient
= 0x01,
36 kAIIS_InitScan
= 0x02,
37 kAIIS_EndWander
= 0x04,
38 kAIIS_VarSpeed
= 0x08,
40 kAIAF_All
= 0xffffffff
43 ///////////////////////////////////////
45 class cAIInvestAction
: public cAIAction
48 cAIInvestAction(IAIActor
* pOwner
, DWORD data
= 0);
52 // Investigate a point, using an object as a hint for determining
53 // the destination cell
55 void Set(const cMxsVector
& dest
,
57 eAISpeed speed
= kAIS_Num
, // defaults based on distance
58 float accuracySq
= kAILA_DefaultAccuracy
,
59 float accuracyZ
= kAILA_DefaultAccuracyZ
);
62 // Investigate an object
64 void Set(ObjID object
,
65 eAISpeed speed
= kAIS_Num
, // defaults based on distance
66 float accuracySq
= kAILA_DefaultAccuracy
,
67 float accuracyZ
= kAILA_DefaultAccuracyZ
);
70 // Investigate a point
72 void Set(const cMxsVector
& dest
,
73 eAISpeed speed
= kAIS_Num
, // defaults based on distance
74 float accuracySq
= kAILA_DefaultAccuracy
,
75 float accuracyZ
= kAILA_DefaultAccuracyZ
);
78 // Path near object if actually can't path to. Should occur before Set.
79 void SetNearPath(BOOL bPathNear
, float fDist
);
81 void SetCheckPathDist(BOOL bCheck
);
86 void SetStyle(unsigned flags
);
87 void SetDuration(unsigned time
); // set to kAIIA_InfiniteDur if want to never expire
92 void SetScan(unsigned minScanDelay
,
93 unsigned maxScanDelay
);
97 BOOL
IsScanning() const;
98 BOOL
ReachedPoint() const;
100 const mxs_vector
& GetDest() const;
102 float ComputePathDist();
105 STDMETHOD_(eAIResult
, Update
)();
107 // Start the action. Instantaneous actions will return result
108 STDMETHOD_(eAIResult
, Enact
)(ulong deltaTime
);
122 cAILocoAction
* m_pLocoAction
;
123 cAIMotionAction
* m_pMotionAction
;
124 cAIOrientAction
* m_pOrientAction
;
125 cAIWanderAction
* m_pWanderAction
;
127 cAITimer m_expiration
;
128 unsigned m_StyleFlags
;
129 cAIRandomTimer m_ScanTimer
;
130 cAITimer m_CheckDistTimer
;
138 ///////////////////////////////////////
140 // Path near object if actually can't path to.
141 inline void cAIInvestAction::SetNearPath(BOOL bPathNear
, float fDist
)
144 fPathNearDist
= fDist
;
150 inline void cAIInvestAction::SetCheckPathDist(BOOL bCheck
)
152 m_bDoCheckDist
= bCheck
;
156 ///////////////////////////////////////
158 inline BOOL
cAIInvestAction::IsScanning() const
160 return !!m_pMotionAction
;
163 ///////////////////////////////////////
165 inline BOOL
cAIInvestAction::ReachedPoint() const
167 return (m_state
== kScanAtLoc
);
170 ///////////////////////////////////////
172 inline void cAIInvestAction::SetStyle(unsigned flags
)
174 m_StyleFlags
|= flags
;
177 ///////////////////////////////////////
179 inline void cAIInvestAction::SetDuration(unsigned time
)
181 m_expiration
.Set(AICustomTime(time
));
184 ///////////////////////////////////////////////////////////////////////////////
188 #endif /* !__AIACTINV_H */