This commit is contained in:
aozhiwei 2023-11-01 17:12:31 +08:00
parent 750a215bb2
commit 22d271517b
5 changed files with 11 additions and 3 deletions

View File

@ -633,7 +633,7 @@ namespace behaviac
virtual bool load() virtual bool load()
{ {
AgentMeta::SetTotalSignature(2122706072u); AgentMeta::SetTotalSignature(2596760477u);
AgentMeta* meta = NULL; AgentMeta* meta = NULL;
BEHAVIAC_UNUSED_VAR(meta); BEHAVIAC_UNUSED_VAR(meta);
@ -718,7 +718,7 @@ namespace behaviac
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove()); meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// TargetAgent // TargetAgent
meta = BEHAVIAC_NEW AgentMeta(1972716360u); meta = BEHAVIAC_NEW AgentMeta(180577771u);
AgentMeta::GetAgentMetas()[498664641u] = meta; AgentMeta::GetAgentMetas()[498664641u] = meta;
meta->RegisterMethod(347903289u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_TargetAgent_Abandon)); meta->RegisterMethod(347903289u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_TargetAgent_Abandon));
meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<CoId_e>(FunctionPointer_TargetAgent_AbortCoroutine)); meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<CoId_e>(FunctionPointer_TargetAgent_AbortCoroutine));
@ -734,6 +734,7 @@ namespace behaviac
meta->RegisterMethod(3533946671u, BEHAVIAC_NEW CAgentMethod< glm::vec3 >(FunctionPointer_TargetAgent_GetPos)); meta->RegisterMethod(3533946671u, BEHAVIAC_NEW CAgentMethod< glm::vec3 >(FunctionPointer_TargetAgent_GetPos));
meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TargetAgent_GetTickCount)); meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TargetAgent_GetTickCount));
meta->RegisterMethod(1866966855u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TargetAgent_GetUniId)); meta->RegisterMethod(1866966855u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TargetAgent_GetUniId));
meta->RegisterMethod(3603629747u, BEHAVIAC_NEW CAgentMethod_1< bool, BuffEffectType_e >(FunctionPointer_TargetAgent_HasBuffEffect));
meta->RegisterMethod(1054489725u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsDead)); meta->RegisterMethod(1054489725u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsDead));
meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsGameOver)); meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsGameOver));
meta->RegisterMethod(2785609189u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsValid)); meta->RegisterMethod(2785609189u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TargetAgent_IsValid));

View File

@ -65,6 +65,7 @@ namespace behaviac
inline glm::vec3 FunctionPointer_TargetAgent_GetPos(Agent* self) { return ((TargetAgent*)self)->GetPos(); } inline glm::vec3 FunctionPointer_TargetAgent_GetPos(Agent* self) { return ((TargetAgent*)self)->GetPos(); }
inline int FunctionPointer_TargetAgent_GetTickCount(Agent* self) { return ((TargetAgent*)self)->GetTickCount(); } inline int FunctionPointer_TargetAgent_GetTickCount(Agent* self) { return ((TargetAgent*)self)->GetTickCount(); }
inline int FunctionPointer_TargetAgent_GetUniId(Agent* self) { return ((TargetAgent*)self)->GetUniId(); } inline int FunctionPointer_TargetAgent_GetUniId(Agent* self) { return ((TargetAgent*)self)->GetUniId(); }
inline bool FunctionPointer_TargetAgent_HasBuffEffect(Agent* self, BuffEffectType_e effect_id) { return ((TargetAgent*)self)->HasBuffEffect(effect_id); }
inline bool FunctionPointer_TargetAgent_IsDead(Agent* self) { return ((TargetAgent*)self)->IsDead(); } inline bool FunctionPointer_TargetAgent_IsDead(Agent* self) { return ((TargetAgent*)self)->IsDead(); }
inline bool FunctionPointer_TargetAgent_IsGameOver(Agent* self) { return ((TargetAgent*)self)->IsGameOver(); } inline bool FunctionPointer_TargetAgent_IsGameOver(Agent* self) { return ((TargetAgent*)self)->IsGameOver(); }
inline bool FunctionPointer_TargetAgent_IsValid(Agent* self) { return ((TargetAgent*)self)->IsValid(); } inline bool FunctionPointer_TargetAgent_IsValid(Agent* self) { return ((TargetAgent*)self)->IsValid(); }

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!--> <!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<agents version="1" signature="2122706072"> <agents version="1" signature="2596760477">
<agent type="HeroAgent" base="BaseAgent" signature="2320304707"> <agent type="HeroAgent" base="BaseAgent" signature="2320304707">
<properties> <properties>
<property name="current_target_agent" type="TargetAgent*" member="false" static="false" defaultvalue="null" /> <property name="current_target_agent" type="TargetAgent*" member="false" static="false" defaultvalue="null" />

View File

@ -115,3 +115,8 @@ float TargetAgent::GetHPRate()
{ {
return GetHp() / std::max(1.0f, GetMaxHp()); return GetHp() / std::max(1.0f, GetMaxHp());
} }
bool TargetAgent::HasBuffEffect(int effect_id)
{
return target_.Get() && target_.Get()->HasBuffEffect(effect_id);
}

View File

@ -25,6 +25,7 @@ public:
float GetShotRange(); float GetShotRange();
void ClearAbandon(); void ClearAbandon();
float GetHPRate(); float GetHPRate();
bool HasBuffEffect(int effect_id);
void SetOwner(Creature* owner); void SetOwner(Creature* owner);
void SetTarget(Creature* target); void SetTarget(Creature* target);