2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CAI_HPP__
|
|
|
|
#define __URDE_CAI_HPP__
|
2015-08-17 20:33:58 +00:00
|
|
|
|
2015-10-29 07:52:15 +00:00
|
|
|
#include "GCNTypes.hpp"
|
|
|
|
#include "ScriptObjectSupport.hpp"
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CEntity.hpp"
|
|
|
|
#include "CPhysicsActor.hpp"
|
2016-04-19 00:17:49 +00:00
|
|
|
#include "CDamageVulnerability.hpp"
|
2015-10-29 07:52:15 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
#include "zeus/zeus.hpp"
|
2015-10-29 07:52:15 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
|
|
|
|
2015-10-29 07:52:15 +00:00
|
|
|
/* TODO: Figure out what all this is for and move it somewhere appropriate */
|
2015-11-21 01:16:07 +00:00
|
|
|
enum class EStateMsg
|
2015-10-29 07:52:15 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2015-11-21 01:16:07 +00:00
|
|
|
enum class EListenNoiseType
|
2015-10-29 07:52:15 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2016-04-24 02:46:13 +00:00
|
|
|
class CAi;
|
|
|
|
class CStateMachine;
|
|
|
|
|
|
|
|
typedef void (CAi::*CAiStateFunc)(CStateManager&, EStateMsg, float);
|
|
|
|
typedef bool (CAi::*CAiTriggerFunc)(CStateManager&, float);
|
|
|
|
|
2015-08-17 23:46:41 +00:00
|
|
|
class CAiFuncMap
|
2015-10-29 07:52:15 +00:00
|
|
|
{
|
2016-04-24 02:46:13 +00:00
|
|
|
std::map<const char*, CAiStateFunc> x0_stateFuncs;
|
|
|
|
std::map<const char*, CAiTriggerFunc> x10_triggerFuncs;
|
|
|
|
public:
|
|
|
|
CAiFuncMap();
|
|
|
|
CAiStateFunc GetStateFunc(const char*);
|
|
|
|
CAiTriggerFunc GetTriggerFunc(const char*);
|
2015-10-29 07:52:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CHealthInfo
|
2016-04-18 05:33:23 +00:00
|
|
|
{
|
|
|
|
float x0_;
|
|
|
|
float x4_;
|
|
|
|
public:
|
|
|
|
CHealthInfo(CInputStream& in) : x0_(in.readFloatBig()), x4_(in.readFloatBig()) {}
|
|
|
|
};
|
|
|
|
|
2015-10-29 07:52:15 +00:00
|
|
|
class CStateManager;
|
|
|
|
class CAi : public CPhysicsActor
|
2015-08-22 01:58:41 +00:00
|
|
|
{
|
2016-04-24 02:46:13 +00:00
|
|
|
static CAiFuncMap* m_FuncMap;
|
|
|
|
CHealthInfo x258_healthInfo;
|
|
|
|
CDamageVulnerability x260_damageVulnerability;
|
|
|
|
TLockedToken<CStateMachine> x2c8_stateMachine;
|
2015-08-22 01:58:41 +00:00
|
|
|
public:
|
|
|
|
|
2016-04-24 02:46:13 +00:00
|
|
|
CAi(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const zeus::CAABox& box, float f1, const CHealthInfo& hInfo, const CDamageVulnerability&,
|
|
|
|
const CMaterialList& list, ResId, const CActorParameters&, float f2, float f3);
|
|
|
|
|
|
|
|
static void CreateFuncLookup(CAiFuncMap* funcMap);
|
|
|
|
CAiStateFunc GetStateFunc(const char* func);
|
|
|
|
CAiTriggerFunc GetTrigerFunc(const char* func);
|
|
|
|
|
2015-10-29 07:52:15 +00:00
|
|
|
void GetStateMachine() {}
|
|
|
|
|
|
|
|
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
|
2016-04-24 02:46:13 +00:00
|
|
|
virtual CHealthInfo HealthInfo(CStateManager&) { return x258_healthInfo; }
|
|
|
|
virtual CHealthInfo GetHealthInfo(const CStateManager&) { return x258_healthInfo; }
|
|
|
|
virtual CDamageVulnerability GetDamageVulnerability() { return x260_damageVulnerability; }
|
2015-10-29 07:52:15 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
virtual void TakeDamage(const zeus::CVector3f&, float) {}
|
2015-10-29 07:52:15 +00:00
|
|
|
virtual bool CanBeShot(const CStateManager&, int) { return true; }
|
|
|
|
virtual bool IsListening() { return false; }
|
2016-03-04 23:04:53 +00:00
|
|
|
virtual int Listen(const zeus::CVector3f&, EListenNoiseType) { return 0; }
|
2015-10-29 07:52:15 +00:00
|
|
|
|
|
|
|
virtual void Patrol(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void FollowPattern(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Dead(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void PathFind(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Start(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void SelectTarget(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void TargetPatrol(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void TargetPlayer(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void TargetCover(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Halt(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Walk(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Run(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Generate(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Deactivate(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Attack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void LoopedAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void JumpBack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void DoubleSnap(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Shuffle(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void TurnAround(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Skid(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Active(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void InActive(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void CoverAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Crouch(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void FadeIn(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void FadeOut(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void GetUp(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Taunt(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Suck(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Flee(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Lurk(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void ProjectileAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Flinch(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Hurled(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void TelegraphAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Jump(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Explode(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Dodge(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Retreat(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Cover(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Approach(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void WallHang(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void WallDetach(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Enraged(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void SpecialAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Growth(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Faint(CStateManager&, EStateMsg, float) {}
|
2016-04-24 02:46:13 +00:00
|
|
|
virtual void Land(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Bounce(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void PathFindEx(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void Dizzy(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void CallForBackup(CStateManager&, EStateMsg, float) {}
|
2015-10-29 07:52:15 +00:00
|
|
|
virtual void BulbAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
virtual void PodAttack(CStateManager&, EStateMsg, float) {}
|
|
|
|
|
2016-04-24 02:46:13 +00:00
|
|
|
virtual bool InAttackPosition(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Leash(CStateManager&, float) { return false; }
|
|
|
|
virtual bool OffLine(CStateManager&,float) { return false; }
|
|
|
|
virtual bool Attacked(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PathShagged(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PathOver(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PathFound(CStateManager&, float) { return false; }
|
|
|
|
virtual bool TooClose(CStateManager&, float) { return false; }
|
|
|
|
virtual bool InRange(CStateManager&, float) { return false; }
|
|
|
|
virtual bool InMaxRange(CStateManager&, float) { return false; }
|
|
|
|
virtual bool InDetectionRange(CStateManager&, float) { return false; }
|
|
|
|
virtual bool SpotPlayer(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PlayerSpot(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PatternOver(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PatternShagged(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HasAttackPattern(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HasPatrolPath(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HasRetreatPattern(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Delay(CStateManager&,float) { return false; }
|
|
|
|
virtual bool RandomDelay(CStateManager&, float) { return false; }
|
|
|
|
virtual bool FixedDelay(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Default(CStateManager&, float) { return false; }
|
|
|
|
virtual bool AnimOver(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldAttack(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldDoubleSnap(CStateManager&, float) { return false; }
|
|
|
|
virtual bool InPosition(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldTurn(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HitSomething(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldJumpBack(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Stuck(CStateManager&, float) { return false; }
|
|
|
|
virtual bool NoPathNodes(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Landed(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HearShot(CStateManager&,float) { return false; }
|
|
|
|
virtual bool HearPlayer(CStateManager&,float) { return false; }
|
|
|
|
virtual bool CoverCheck(CStateManager&, float) { return false; }
|
|
|
|
virtual bool CoverFind(CStateManager&, float) { return false; }
|
|
|
|
virtual bool CoverBlown(CStateManager&, float) { return false; }
|
|
|
|
virtual bool CoverNearlyBlown(CStateManager&, float) { return false; }
|
|
|
|
virtual bool CoveringFire(CStateManager&, float) { return false; }
|
|
|
|
virtual bool GotUp(CStateManager&, float) { return false; }
|
|
|
|
virtual bool LineOfSight(CStateManager&,float) { return false; }
|
|
|
|
virtual bool AggressionCheck(CStateManager&, float) { return false; }
|
|
|
|
virtual bool AttackOver(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldTaunt(CStateManager&,float) { return false; }
|
|
|
|
virtual bool Inside(CStateManager&,float) { return false; }
|
|
|
|
virtual bool ShouldFire(CStateManager&,float) { return false; }
|
|
|
|
virtual bool ShouldFlinch(CStateManager&, float) { return false; }
|
|
|
|
virtual bool PatrolPathOver(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldDodge(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldRetreat(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldCrouch(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldMove(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShotAt(CStateManager&, float) { return false; }
|
|
|
|
virtual bool HasTargetingPoint(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldWallHang(CStateManager&, float) { return false; }
|
|
|
|
virtual bool SetAIStage(CStateManager&, float) { return false; }
|
|
|
|
virtual bool AIStage(CStateManager&, float) { return false; }
|
|
|
|
virtual bool StartAttack(CStateManager&, float) { return false; }
|
|
|
|
virtual bool BreakAttack(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldStrafe(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldSpecialAttack(CStateManager&, float) { return false; }
|
|
|
|
virtual bool LostInterest(CStateManager&, float) { return false; }
|
|
|
|
virtual bool CodeTrigger(CStateManager&, float) { return false; }
|
|
|
|
virtual bool BounceFind(CStateManager&, float) { return false; }
|
|
|
|
virtual bool Random(CStateManager&, float) { return false; }
|
|
|
|
virtual bool FixedRandom(CStateManager&, float) { return false; }
|
|
|
|
virtual bool IsDizzy(CStateManager&, float) { return false; }
|
|
|
|
virtual bool ShouldCallForBackup(CStateManager&, float) { return false; }
|
2015-08-22 01:58:41 +00:00
|
|
|
};
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CAI_HPP__
|