Compare commits

..

47 Commits
master ... dev

Author SHA1 Message Date
azw
c47167c2c9 1 2023-11-08 10:11:02 +00:00
azw
eabd540021 1 2023-11-08 10:09:35 +00:00
azw
4f822967d4 1 2023-11-08 10:03:04 +00:00
azw
12feeffafb 1 2023-11-08 09:52:58 +00:00
azw
c3c0bc5d29 1 2023-11-06 11:14:23 +00:00
azw
d0f9a9b30e 1 2023-11-06 10:58:36 +00:00
aozhiwei
9fa4062b82 Merge branch 'jump' into dev 2023-05-15 18:12:23 +08:00
aozhiwei
b68a232135 1 2023-05-14 16:26:48 +08:00
aozhiwei
8ef59c6030 1 2023-05-12 11:57:46 +08:00
aozhiwei
9c00a80f3d 1 2023-05-11 15:55:27 +08:00
aozhiwei
681697d647 1 2023-05-10 16:45:00 +08:00
aozhiwei
976712c9d4 1 2023-05-10 16:30:15 +08:00
aozhiwei
bf283f2ac9 1 2023-05-06 10:41:29 +08:00
aozhiwei
5214bc056e 1 2023-05-06 10:38:48 +08:00
aozhiwei
4f5b8d0d9b 1 2023-05-05 19:23:00 +08:00
aozhiwei
3226878c93 1 2023-04-27 13:22:26 +08:00
aozhiwei
b2bb8cc9e9 1 2023-04-27 10:34:07 +08:00
aozhiwei
8315b155d6 1 2023-04-25 19:14:24 +08:00
aozhiwei
d6a684dd10 1 2023-04-19 13:45:41 +08:00
aozhiwei
cb37f0db76 1 2023-04-18 13:29:46 +08:00
aozhiwei
c79b8453a9 1 2023-04-18 13:23:40 +08:00
aozhiwei
f6f0e5a6bf 1 2023-04-18 11:40:36 +08:00
aozhiwei
55516aee64 1 2023-04-17 20:29:32 +08:00
aozhiwei
943fd1415c 1 2023-04-17 20:09:29 +08:00
aozhiwei
c66ce54497 1 2023-04-17 20:08:04 +08:00
aozhiwei
4c775a46a9 1 2023-04-17 20:06:59 +08:00
aozhiwei
0481a7d088 1 2023-04-17 19:52:39 +08:00
aozhiwei
a5400d027f 1 2023-04-17 19:51:26 +08:00
aozhiwei
13cd59f9a8 1 2023-04-17 19:50:25 +08:00
aozhiwei
7ad03facd1 Merge branch 'online' into dev 2023-04-17 18:51:14 +08:00
aozhiwei
8c3ecf7a26 1 2023-04-17 14:19:41 +08:00
aozhiwei
9b7c7a0f9b 1 2023-04-17 14:16:24 +08:00
aozhiwei
f7678c47fd 1 2023-04-17 14:03:50 +08:00
aozhiwei
301df577f1 1 2023-04-17 13:40:48 +08:00
aozhiwei
f93847711d git Merge branch 'online' into dev 2023-04-17 13:23:34 +08:00
aozhiwei
d348de32fb Merge branch 'online' into dev 2023-04-14 14:25:36 +08:00
aozhiwei
c9ab65044e Merge branch 'online' into dev 2023-04-14 11:09:47 +08:00
aozhiwei
07ed1c345d Merge branch 'online' into dev 2023-04-13 19:17:06 +08:00
aozhiwei
e1ef898c0f Merge branch 'online' into dev 2023-04-12 14:40:42 +08:00
aozhiwei
01b4969583 Merge branch 'online' into dev 2023-04-11 15:57:08 +08:00
aozhiwei
b1e980950a 1 2023-04-11 15:07:04 +08:00
aozhiwei
afa835f36d 1 2023-04-11 10:27:57 +08:00
aozhiwei
08f442aa9c 1 2023-04-10 19:32:15 +08:00
aozhiwei
35f73b8344 1 2023-04-10 19:15:44 +08:00
aozhiwei
385d95c248 1 2023-04-10 18:34:35 +08:00
aozhiwei
ae1ab3b1ee 1 2023-04-10 16:32:09 +08:00
aozhiwei
95d4c99416 修正地图问题 2023-04-10 13:39:57 +08:00
351 changed files with 9819 additions and 18635 deletions

3
.gitignore vendored
View File

@ -29,4 +29,5 @@ x64
*.settings/
server/gameserver/.gitignore
gameserver.cbp
behaviac_generated
behaviac_generated
node_modules/

View File

@ -1,17 +0,0 @@
# 拾取逻辑(涵盖上机甲)
| 函数名 | 函数说明 | 返回值 | 输出参数1 | 输出参数2 | 输出参数3 |
|------------------|--------------------------|--------------------------------------|----------------------|-----------|-----------|
| SearchPickupObj | 查询可以拾取的对象 | 0:无可拾取对象 1:机甲 2:宝箱 3其他 | out_point0对象坐标 | | |
| PickupObjIsValid | 可拾取对象当前是否有效 | true: 有效 false:已失效 | | | |
| AbandonPickup | 放弃拾取当前物件一段时间 | | | | |
| Pickup | 开始拾取 | BT_FAILURE:失败 BT_SUCCESS:成功 | | | |
# 观战
SMJoinedNotify
SMMapInfo
SMUiUpdate
https://www.cnblogs.com/fellow1988/p/17263427.html
export ASAN_OPTIONS=halt_on_error=false:print_scariness=true:fast_unwind_on_malloc=true:detect_leak=1

View File

@ -62,36 +62,12 @@ template<> inline int RoomAgent::_Execute_Method_<METHOD_TYPE_RoomAgent_GetPlaye
struct METHOD_TYPE_HeroAgent_AbandonPickup { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_AbandonPickup>(int p0, int p1)
{
this->HeroAgent::AbandonPickup(p0, p1);
}
struct METHOD_TYPE_HeroAgent_Abort { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_Abort>(behaviac::string p0, behaviac::vector<int> p1)
{
this->HeroAgent::Abort(p0, p1);
}
struct METHOD_TYPE_HeroAgent_CanThrowItem { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_CanThrowItem>(InventorySlot_e p0)
{
return this->HeroAgent::CanThrowItem(p0);
}
struct METHOD_TYPE_HeroAgent_CarHasBuffEffect { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasBuffEffect>(int p0)
{
return this->HeroAgent::CarHasBuffEffect(p0);
}
struct METHOD_TYPE_HeroAgent_CarHasOil { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasOil>()
{
return this->HeroAgent::CarHasOil();
}
struct METHOD_TYPE_HeroAgent_ClearEvents { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_ClearEvents>()
{
@ -110,78 +86,12 @@ template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_DecV>(i
this->HeroAgent::DecV(p0, p1);
}
struct METHOD_TYPE_HeroAgent_GetCarCurOil { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarCurOil>()
{
return this->HeroAgent::GetCarCurOil();
}
struct METHOD_TYPE_HeroAgent_GetCarMaxOil { };
template<> inline float HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarMaxOil>()
{
return this->HeroAgent::GetCarMaxOil();
}
struct METHOD_TYPE_HeroAgent_GetDown { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_GetDown>()
{
this->HeroAgent::GetDown();
}
struct METHOD_TYPE_HeroAgent_GetTeammateManhattanDistance { };
template<> inline float HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_GetTeammateManhattanDistance>()
{
return this->HeroAgent::GetTeammateManhattanDistance();
}
struct METHOD_TYPE_HeroAgent_GetTodayBattleTimes { };
template<> inline int HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_GetTodayBattleTimes>()
{
return this->HeroAgent::GetTodayBattleTimes();
}
struct METHOD_TYPE_HeroAgent_IsSingleCar { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_IsSingleCar>()
{
return this->HeroAgent::IsSingleCar();
}
struct METHOD_TYPE_HeroAgent_Pickup { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_Pickup>()
{
return this->HeroAgent::Pickup();
}
struct METHOD_TYPE_HeroAgent_PickupObjIsValid { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_PickupObjIsValid>()
{
return this->HeroAgent::PickupObjIsValid();
}
struct METHOD_TYPE_HeroAgent_ResetUseSkillTimes { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_ResetUseSkillTimes>()
{
this->HeroAgent::ResetUseSkillTimes();
}
struct METHOD_TYPE_HeroAgent_SearchHumanEnemy { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_SearchHumanEnemy>(int p0)
{
return this->HeroAgent::SearchHumanEnemy(p0);
}
struct METHOD_TYPE_HeroAgent_SearchPickupObj { };
template<> inline int HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_SearchPickupObj>()
{
return this->HeroAgent::SearchPickupObj();
}
struct METHOD_TYPE_HeroAgent_SearchTeammate { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_SearchTeammate>(int p0)
{
return this->HeroAgent::SearchTeammate(p0);
}
struct METHOD_TYPE_HeroAgent_SendEmote { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_SendEmote>(int p0)
{
@ -218,36 +128,12 @@ template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_ShotNor
this->HeroAgent::ShotNormal(p0);
}
struct METHOD_TYPE_HeroAgent_SwitchSeat { };
template<> inline void HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_SwitchSeat>(int p0)
{
this->HeroAgent::SwitchSeat(p0);
}
struct METHOD_TYPE_HeroAgent_TargetInShotRange { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_TargetInShotRange>()
{
return this->HeroAgent::TargetInShotRange();
}
struct METHOD_TYPE_HeroAgent_TeammateIsValid { };
template<> inline bool HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_TeammateIsValid>()
{
return this->HeroAgent::TeammateIsValid();
}
struct METHOD_TYPE_HeroAgent_ThrowItem { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_ThrowItem>(InventorySlot_e p0)
{
return this->HeroAgent::ThrowItem(p0);
}
struct METHOD_TYPE_HeroAgent_TrySearchTeammate { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_TrySearchTeammate>(int p0)
{
return this->HeroAgent::TrySearchTeammate(p0);
}
struct METHOD_TYPE_MasterAgent_IsValid { };
@ -257,83 +143,4 @@ template<> inline bool MasterAgent::_Execute_Method_<METHOD_TYPE_MasterAgent_IsV
}
struct METHOD_TYPE_TeammateAgent_Abandon { };
template<> inline void TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_Abandon>(int p0, int p1)
{
this->TeammateAgent::Abandon(p0, p1);
}
struct METHOD_TYPE_TeammateAgent_ClearAbandon { };
template<> inline void TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_ClearAbandon>()
{
this->TeammateAgent::ClearAbandon();
}
struct METHOD_TYPE_TeammateAgent_GetHeroId { };
template<> inline int TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHeroId>()
{
return this->TeammateAgent::GetHeroId();
}
struct METHOD_TYPE_TeammateAgent_GetHp { };
template<> inline float TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHp>()
{
return this->TeammateAgent::GetHp();
}
struct METHOD_TYPE_TeammateAgent_GetHPRate { };
template<> inline float TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHPRate>()
{
return this->TeammateAgent::GetHPRate();
}
struct METHOD_TYPE_TeammateAgent_GetLevel { };
template<> inline int TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetLevel>()
{
return this->TeammateAgent::GetLevel();
}
struct METHOD_TYPE_TeammateAgent_GetMaxHp { };
template<> inline float TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetMaxHp>()
{
return this->TeammateAgent::GetMaxHp();
}
struct METHOD_TYPE_TeammateAgent_GetPos { };
template<> inline glm::vec3 TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetPos>()
{
return this->TeammateAgent::GetPos();
}
struct METHOD_TYPE_TeammateAgent_GetShotRange { };
template<> inline float TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetShotRange>()
{
return this->TeammateAgent::GetShotRange();
}
struct METHOD_TYPE_TeammateAgent_GetUniId { };
template<> inline int TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_GetUniId>()
{
return this->TeammateAgent::GetUniId();
}
struct METHOD_TYPE_TeammateAgent_HasBuffEffect { };
template<> inline bool TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_HasBuffEffect>(int p0)
{
return this->TeammateAgent::HasBuffEffect(p0);
}
struct METHOD_TYPE_TeammateAgent_IsDead { };
template<> inline bool TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_IsDead>()
{
return this->TeammateAgent::IsDead();
}
struct METHOD_TYPE_TeammateAgent_IsValid { };
template<> inline bool TeammateAgent::_Execute_Method_<METHOD_TYPE_TeammateAgent_IsValid>()
{
return this->TeammateAgent::IsValid();
}
#endif // _BEHAVIAC_MEMBER_VISITOR_H_

View File

@ -633,7 +633,7 @@ namespace behaviac
virtual bool load()
{
AgentMeta::SetTotalSignature(2686576916u);
AgentMeta::SetTotalSignature(7815860u);
AgentMeta* meta = NULL;
BEHAVIAC_UNUSED_VAR(meta);
@ -750,10 +750,9 @@ namespace behaviac
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// HeroAgent
meta = BEHAVIAC_NEW AgentMeta(1955586164u);
meta = BEHAVIAC_NEW AgentMeta(1794127831u);
AgentMeta::GetAgentMetas()[2270112014u] = meta;
meta->RegisterMemberProperty(2706111800u, BEHAVIAC_NEW CMemberProperty< TargetAgent* >("current_target_agent", Set_HeroAgent_current_target_agent, Get_HeroAgent_current_target_agent));
meta->RegisterMemberProperty(3525744799u, BEHAVIAC_NEW CMemberProperty< TeammateAgent* >("current_teammate_agent", Set_HeroAgent_current_teammate_agent, Get_HeroAgent_current_teammate_agent));
meta->RegisterMemberProperty(1530109714u, BEHAVIAC_NEW CMemberProperty< MasterAgent* >("master_agent", Set_HeroAgent_master_agent, Get_HeroAgent_master_agent));
meta->RegisterMemberProperty(3100058733u, BEHAVIAC_NEW CMemberProperty< int >("out_errno", Set_HeroAgent_out_errno, Get_HeroAgent_out_errno));
meta->RegisterMemberProperty(1342699083u, BEHAVIAC_NEW CMemberProperty< glm::vec3 >("out_point0", Set_HeroAgent_out_point0, Get_HeroAgent_out_point0));
@ -779,17 +778,12 @@ namespace behaviac
meta->RegisterMemberProperty(3112816101u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val2", Set_HeroAgent_tmp_val2, Get_HeroAgent_tmp_val2));
meta->RegisterMemberProperty(2693987492u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val3", Set_HeroAgent_tmp_val3, Get_HeroAgent_tmp_val3));
meta->RegisterMemberProperty(4023609955u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val4", Set_HeroAgent_tmp_val4, Get_HeroAgent_tmp_val4));
meta->RegisterMethod(2391826255u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_HeroAgent_AbandonPickup));
meta->RegisterMethod(1724035246u, BEHAVIAC_NEW CAgentMethodVoid_2<behaviac::string, behaviac::vector<int>>(FunctionPointer_HeroAgent_Abort));
meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<CoId_e>(FunctionPointer_HeroAgent_AbortCoroutine));
meta->RegisterMethod(3724946699u, BEHAVIAC_NEW CAgentMethodVoid_1<glm::vec3&>(FunctionPointer_HeroAgent_BattleMove) /* BattleMove */);
meta->RegisterMethod(113953652u, BEHAVIAC_NEW CMethod_HeroAgent_CalcDistance());
meta->RegisterMethod(2948764806u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_CanAttack));
meta->RegisterMethod(896336728u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_CanShot));
meta->RegisterMethod(3040220846u, BEHAVIAC_NEW CAgentMethod_1< bool, InventorySlot_e >(FunctionPointer_HeroAgent_CanThrowItem));
meta->RegisterMethod(1672911688u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_HeroAgent_CanUseSkill));
meta->RegisterMethod(2595662667u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_HeroAgent_CarHasBuffEffect));
meta->RegisterMethod(4065227029u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_CarHasOil));
meta->RegisterMethod(513965041u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_HeroAgent_ChaseToKill) /* ChaseToKill */);
meta->RegisterMethod(2692459416u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_ChiMode) /* ChiMode */);
meta->RegisterMethod(2330028911u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_ClearEvents));
@ -812,13 +806,9 @@ namespace behaviac
meta->RegisterMethod(961264360u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_HeroAgent_DecV));
meta->RegisterMethod(1811924796u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_HeroAgent_DeltaTime));
meta->RegisterMethod(3850832265u, BEHAVIAC_NEW CAgentMethodVoid_2<glm::vec3&, float>(FunctionPointer_HeroAgent_FollowMaster) /* FollowMaster */);
meta->RegisterMethod(337666808u, BEHAVIAC_NEW CAgentMethodVoid_2<glm::vec3&, float>(FunctionPointer_HeroAgent_FollowTeammate) /* FollowTeammate */);
meta->RegisterMethod(3395125024u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetAgentType));
meta->RegisterMethod(1962280222u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetAliveEnemyNum));
meta->RegisterMethod(755433673u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetBattleTimes));
meta->RegisterMethod(4144905011u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_GetCarCurOil));
meta->RegisterMethod(1975916610u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_HeroAgent_GetCarMaxOil));
meta->RegisterMethod(170554228u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_GetDown));
meta->RegisterMethod(2524021140u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetHeroId));
meta->RegisterMethod(3358849663u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_HeroAgent_GetHp));
meta->RegisterMethod(3597666367u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_HeroAgent_GetHPRate));
@ -840,9 +830,7 @@ namespace behaviac
meta->RegisterMethod(1330753553u, BEHAVIAC_NEW CAgentMethod< behaviac::string >(FunctionPointer_HeroAgent_GetSkillBtFile));
meta->RegisterMethod(2253976520u, BEHAVIAC_NEW CAgentMethod< glm::vec3 >(FunctionPointer_HeroAgent_GetTargetDir));
meta->RegisterMethod(2804704472u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_HeroAgent_GetTargetManhattanDistance));
meta->RegisterMethod(1110524645u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_HeroAgent_GetTeammateManhattanDistance));
meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetTickCount));
meta->RegisterMethod(2633051214u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetTodayBattleTimes));
meta->RegisterMethod(1866966855u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetUniId));
meta->RegisterMethod(4271568288u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_GetUseSkillTimes));
meta->RegisterMethod(1736603085u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_HeroAgent_GetV));
@ -858,7 +846,6 @@ namespace behaviac
meta->RegisterMethod(2838752827u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_IsMobaMode));
meta->RegisterMethod(3287572438u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_IsMoving));
meta->RegisterMethod(550488892u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_HeroAgent_IsNearGas));
meta->RegisterMethod(54061425u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_IsSingleCar));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_HeroAgent_LogMessage));
meta->RegisterMethod(2967784099u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_MasterHelpAttack) /* MasterHelpAttack */);
meta->RegisterMethod(130282478u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_HeroAgent_MasterInRange));
@ -868,9 +855,6 @@ namespace behaviac
meta->RegisterMethod(1702775901u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_OnMobaRevive) /* OnMobaRevive */);
meta->RegisterMethod(77932836u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_HeroAgent_OnUnderAttack) /* OnUnderAttack */);
meta->RegisterMethod(542998674u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_OpenBulletTraceMode));
meta->RegisterMethod(3362692163u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_Pickup));
meta->RegisterMethod(1393407872u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, glm::vec3&>(FunctionPointer_HeroAgent_PickupItem) /* PickupItem */);
meta->RegisterMethod(1843541573u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_PickupObjIsValid));
meta->RegisterMethod(3156314303u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_Rand));
meta->RegisterMethod(657529872u, BEHAVIAC_NEW CMethod_HeroAgent_RandomPoint());
meta->RegisterMethod(664971319u, BEHAVIAC_NEW CAgentMethod_2< behaviac::EBTStatus, int, int >(FunctionPointer_HeroAgent_RandomSafeZonePoint));
@ -884,9 +868,6 @@ namespace behaviac
meta->RegisterMethod(3146209884u, BEHAVIAC_NEW CAgentMethodVoid_1<glm::vec3&>(FunctionPointer_HeroAgent_RunAway) /* RunAway */);
meta->RegisterMethod(160678866u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_HeroAgent_RunGas) /* RunGas */);
meta->RegisterMethod(3025058903u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, float >(FunctionPointer_HeroAgent_SearchEnemy));
meta->RegisterMethod(3238208553u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_HeroAgent_SearchHumanEnemy));
meta->RegisterMethod(1182328469u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_HeroAgent_SearchPickupObj));
meta->RegisterMethod(3477639065u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_HeroAgent_SearchTeammate));
meta->RegisterMethod(2380700906u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_HeroAgent_SendEmote));
meta->RegisterMethod(1147186661u, BEHAVIAC_NEW CMethod_HeroAgent_SetAttackDir());
meta->RegisterMethod(2408617877u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_HeroAgent_SetBulletAngleOffset));
@ -895,16 +876,12 @@ namespace behaviac
meta->RegisterMethod(3683918805u, BEHAVIAC_NEW CMethod_HeroAgent_ShotNormal());
meta->RegisterMethod(72479814u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_ShotTrace));
meta->RegisterMethod(1576005918u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_StayPutAttack) /* StayPutAttack */);
meta->RegisterMethod(1984585436u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_HeroAgent_SwitchSeat));
meta->RegisterMethod(151356521u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_SwitchToNewAttacker));
meta->RegisterMethod(277653485u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_HeroAgent_TargetInRange));
meta->RegisterMethod(179831127u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_TargetInShotRange));
meta->RegisterMethod(3214329694u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_HeroAgent_TeammateHelpAttack) /* TeammateHelpAttack */);
meta->RegisterMethod(3664148232u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_TeammateIsValid));
meta->RegisterMethod(3795830842u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_HeroAgent_Test));
meta->RegisterMethod(2561715433u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, InventorySlot_e >(FunctionPointer_HeroAgent_ThrowItem));
meta->RegisterMethod(1520897413u, BEHAVIAC_NEW CAgentMethod_3< behaviac::EBTStatus, float, int, int >(FunctionPointer_HeroAgent_TrySearchEnemy));
meta->RegisterMethod(3751499467u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_HeroAgent_TrySearchTeammate));
meta->RegisterMethod(1219646948u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_HeroAgent_UseNormalSkill) /* UseNormalSkill */);
meta->RegisterMethod(657339709u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_HeroAgent_UseSkill30100) /* UseSkill30100 */);
meta->RegisterMethod(899390163u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_HeroAgent_UseSkill30200) /* UseSkill30200 */);
@ -923,10 +900,9 @@ namespace behaviac
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// AndroidAgent
meta = BEHAVIAC_NEW AgentMeta(3669426665u);
meta = BEHAVIAC_NEW AgentMeta(1963696203u);
AgentMeta::GetAgentMetas()[2475098143u] = meta;
meta->RegisterMemberProperty(2706111800u, BEHAVIAC_NEW CMemberProperty< TargetAgent* >("current_target_agent", Set_HeroAgent_current_target_agent, Get_HeroAgent_current_target_agent));
meta->RegisterMemberProperty(3525744799u, BEHAVIAC_NEW CMemberProperty< TeammateAgent* >("current_teammate_agent", Set_HeroAgent_current_teammate_agent, Get_HeroAgent_current_teammate_agent));
meta->RegisterMemberProperty(1530109714u, BEHAVIAC_NEW CMemberProperty< MasterAgent* >("master_agent", Set_HeroAgent_master_agent, Get_HeroAgent_master_agent));
meta->RegisterMemberProperty(3100058733u, BEHAVIAC_NEW CMemberProperty< int >("out_errno", Set_HeroAgent_out_errno, Get_HeroAgent_out_errno));
meta->RegisterMemberProperty(1342699083u, BEHAVIAC_NEW CMemberProperty< glm::vec3 >("out_point0", Set_HeroAgent_out_point0, Get_HeroAgent_out_point0));
@ -952,17 +928,12 @@ namespace behaviac
meta->RegisterMemberProperty(3112816101u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val2", Set_HeroAgent_tmp_val2, Get_HeroAgent_tmp_val2));
meta->RegisterMemberProperty(2693987492u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val3", Set_HeroAgent_tmp_val3, Get_HeroAgent_tmp_val3));
meta->RegisterMemberProperty(4023609955u, BEHAVIAC_NEW CMemberProperty< float >("tmp_val4", Set_HeroAgent_tmp_val4, Get_HeroAgent_tmp_val4));
meta->RegisterMethod(2391826255u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_AndroidAgent_AbandonPickup));
meta->RegisterMethod(1724035246u, BEHAVIAC_NEW CAgentMethodVoid_2<behaviac::string, behaviac::vector<int>>(FunctionPointer_AndroidAgent_Abort));
meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<CoId_e>(FunctionPointer_AndroidAgent_AbortCoroutine));
meta->RegisterMethod(3724946699u, BEHAVIAC_NEW CAgentMethodVoid_1<glm::vec3&>(FunctionPointer_AndroidAgent_BattleMove) /* BattleMove */);
meta->RegisterMethod(113953652u, BEHAVIAC_NEW CMethod_HeroAgent_CalcDistance());
meta->RegisterMethod(2948764806u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_CanAttack));
meta->RegisterMethod(896336728u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_CanShot));
meta->RegisterMethod(3040220846u, BEHAVIAC_NEW CAgentMethod_1< bool, InventorySlot_e >(FunctionPointer_AndroidAgent_CanThrowItem));
meta->RegisterMethod(1672911688u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_AndroidAgent_CanUseSkill));
meta->RegisterMethod(2595662667u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_AndroidAgent_CarHasBuffEffect));
meta->RegisterMethod(4065227029u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_CarHasOil));
meta->RegisterMethod(513965041u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_AndroidAgent_ChaseToKill) /* ChaseToKill */);
meta->RegisterMethod(2692459416u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_ChiMode) /* ChiMode */);
meta->RegisterMethod(2330028911u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_ClearEvents));
@ -985,14 +956,10 @@ namespace behaviac
meta->RegisterMethod(961264360u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_AndroidAgent_DecV));
meta->RegisterMethod(1811924796u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_AndroidAgent_DeltaTime));
meta->RegisterMethod(3850832265u, BEHAVIAC_NEW CAgentMethodVoid_2<glm::vec3&, float>(FunctionPointer_AndroidAgent_FollowMaster) /* FollowMaster */);
meta->RegisterMethod(337666808u, BEHAVIAC_NEW CAgentMethodVoid_2<glm::vec3&, float>(FunctionPointer_AndroidAgent_FollowTeammate) /* FollowTeammate */);
meta->RegisterMethod(397371422u, BEHAVIAC_NEW CAgentMethod< behaviac::string >(FunctionPointer_AndroidAgent_GetAccountId));
meta->RegisterMethod(3395125024u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetAgentType));
meta->RegisterMethod(1962280222u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetAliveEnemyNum));
meta->RegisterMethod(755433673u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetBattleTimes));
meta->RegisterMethod(4144905011u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_GetCarCurOil));
meta->RegisterMethod(1975916610u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_AndroidAgent_GetCarMaxOil));
meta->RegisterMethod(170554228u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_GetDown));
meta->RegisterMethod(2524021140u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetHeroId));
meta->RegisterMethod(3358849663u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_AndroidAgent_GetHp));
meta->RegisterMethod(3597666367u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_AndroidAgent_GetHPRate));
@ -1014,9 +981,7 @@ namespace behaviac
meta->RegisterMethod(1330753553u, BEHAVIAC_NEW CAgentMethod< behaviac::string >(FunctionPointer_AndroidAgent_GetSkillBtFile));
meta->RegisterMethod(2253976520u, BEHAVIAC_NEW CAgentMethod< glm::vec3 >(FunctionPointer_AndroidAgent_GetTargetDir));
meta->RegisterMethod(2804704472u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_AndroidAgent_GetTargetManhattanDistance));
meta->RegisterMethod(1110524645u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_AndroidAgent_GetTeammateManhattanDistance));
meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetTickCount));
meta->RegisterMethod(2633051214u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetTodayBattleTimes));
meta->RegisterMethod(1866966855u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetUniId));
meta->RegisterMethod(4271568288u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetUseSkillTimes));
meta->RegisterMethod(1736603085u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_AndroidAgent_GetV));
@ -1032,7 +997,6 @@ namespace behaviac
meta->RegisterMethod(2838752827u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsMobaMode));
meta->RegisterMethod(3287572438u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsMoving));
meta->RegisterMethod(550488892u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_AndroidAgent_IsNearGas));
meta->RegisterMethod(54061425u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsSingleCar));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_AndroidAgent_LogMessage));
meta->RegisterMethod(2967784099u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_MasterHelpAttack) /* MasterHelpAttack */);
meta->RegisterMethod(130282478u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_AndroidAgent_MasterInRange));
@ -1042,9 +1006,6 @@ namespace behaviac
meta->RegisterMethod(1702775901u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_OnMobaRevive) /* OnMobaRevive */);
meta->RegisterMethod(77932836u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_AndroidAgent_OnUnderAttack) /* OnUnderAttack */);
meta->RegisterMethod(542998674u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_OpenBulletTraceMode));
meta->RegisterMethod(3362692163u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_Pickup));
meta->RegisterMethod(1393407872u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, glm::vec3&>(FunctionPointer_AndroidAgent_PickupItem) /* PickupItem */);
meta->RegisterMethod(1843541573u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_PickupObjIsValid));
meta->RegisterMethod(3156314303u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_Rand));
meta->RegisterMethod(657529872u, BEHAVIAC_NEW CMethod_HeroAgent_RandomPoint());
meta->RegisterMethod(664971319u, BEHAVIAC_NEW CAgentMethod_2< behaviac::EBTStatus, int, int >(FunctionPointer_AndroidAgent_RandomSafeZonePoint));
@ -1058,9 +1019,6 @@ namespace behaviac
meta->RegisterMethod(3146209884u, BEHAVIAC_NEW CAgentMethodVoid_1<glm::vec3&>(FunctionPointer_AndroidAgent_RunAway) /* RunAway */);
meta->RegisterMethod(160678866u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_AndroidAgent_RunGas) /* RunGas */);
meta->RegisterMethod(3025058903u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, float >(FunctionPointer_AndroidAgent_SearchEnemy));
meta->RegisterMethod(3238208553u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_AndroidAgent_SearchHumanEnemy));
meta->RegisterMethod(1182328469u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_SearchPickupObj));
meta->RegisterMethod(3477639065u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_AndroidAgent_SearchTeammate));
meta->RegisterMethod(2380700906u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_AndroidAgent_SendEmote));
meta->RegisterMethod(1147186661u, BEHAVIAC_NEW CMethod_HeroAgent_SetAttackDir());
meta->RegisterMethod(2408617877u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_AndroidAgent_SetBulletAngleOffset));
@ -1069,16 +1027,12 @@ namespace behaviac
meta->RegisterMethod(3683918805u, BEHAVIAC_NEW CMethod_HeroAgent_ShotNormal());
meta->RegisterMethod(72479814u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_ShotTrace));
meta->RegisterMethod(1576005918u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_StayPutAttack) /* StayPutAttack */);
meta->RegisterMethod(1984585436u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_AndroidAgent_SwitchSeat));
meta->RegisterMethod(151356521u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_SwitchToNewAttacker));
meta->RegisterMethod(277653485u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_AndroidAgent_TargetInRange));
meta->RegisterMethod(179831127u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_TargetInShotRange));
meta->RegisterMethod(3214329694u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_AndroidAgent_TeammateHelpAttack) /* TeammateHelpAttack */);
meta->RegisterMethod(3664148232u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_TeammateIsValid));
meta->RegisterMethod(3795830842u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_AndroidAgent_Test));
meta->RegisterMethod(2561715433u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, InventorySlot_e >(FunctionPointer_AndroidAgent_ThrowItem));
meta->RegisterMethod(1520897413u, BEHAVIAC_NEW CAgentMethod_3< behaviac::EBTStatus, float, int, int >(FunctionPointer_AndroidAgent_TrySearchEnemy));
meta->RegisterMethod(3751499467u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_AndroidAgent_TrySearchTeammate));
meta->RegisterMethod(1219646948u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_AndroidAgent_UseNormalSkill) /* UseNormalSkill */);
meta->RegisterMethod(657339709u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_AndroidAgent_UseSkill30100) /* UseSkill30100 */);
meta->RegisterMethod(899390163u, BEHAVIAC_NEW CAgentMethodVoid_3<int, int, int>(FunctionPointer_AndroidAgent_UseSkill30200) /* UseSkill30200 */);
@ -1123,29 +1077,6 @@ namespace behaviac
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// TeammateAgent
meta = BEHAVIAC_NEW AgentMeta(43981287u);
AgentMeta::GetAgentMetas()[559474020u] = meta;
meta->RegisterMethod(347903289u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_TeammateAgent_Abandon));
meta->RegisterMethod(97826769u, BEHAVIAC_NEW CAgentMethodVoid(FunctionPointer_TeammateAgent_ClearAbandon));
meta->RegisterMethod(2524021140u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TeammateAgent_GetHeroId));
meta->RegisterMethod(3358849663u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_TeammateAgent_GetHp));
meta->RegisterMethod(3597666367u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_TeammateAgent_GetHPRate));
meta->RegisterMethod(3451565888u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TeammateAgent_GetLevel));
meta->RegisterMethod(3311091192u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_TeammateAgent_GetMaxHp));
meta->RegisterMethod(3533946671u, BEHAVIAC_NEW CAgentMethod< glm::vec3 >(FunctionPointer_TeammateAgent_GetPos));
meta->RegisterMethod(138556770u, BEHAVIAC_NEW CAgentMethod< float >(FunctionPointer_TeammateAgent_GetShotRange));
meta->RegisterMethod(1866966855u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_TeammateAgent_GetUniId));
meta->RegisterMethod(3603629747u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_TeammateAgent_HasBuffEffect));
meta->RegisterMethod(1054489725u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TeammateAgent_IsDead));
meta->RegisterMethod(2785609189u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_TeammateAgent_IsValid));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_TeammateAgent_LogMessage));
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
AgentMeta::Register<behaviac::Agent>("behaviac::Agent");
AgentMeta::Register<BaseAgent>("BaseAgent");
@ -1155,13 +1086,11 @@ namespace behaviac
AgentMeta::Register<HeroAgent>("HeroAgent");
AgentMeta::Register<AndroidAgent>("AndroidAgent");
AgentMeta::Register<MasterAgent>("MasterAgent");
AgentMeta::Register<TeammateAgent>("TeammateAgent");
AgentMeta::Register<SkillIdx_e>("SkillIdx_e");
AgentMeta::Register<BuffEffectType_e>("BuffEffectType_e");
AgentMeta::Register<BtEvent_e>("BtEvent_e");
AgentMeta::Register<GasMode_e>("GasMode_e");
AgentMeta::Register<CoId_e>("CoId_e");
AgentMeta::Register<InventorySlot_e>("InventorySlot_e");
AgentMeta::Register<glm::vec3>("glm::vec3");
return true;
@ -1177,13 +1106,11 @@ namespace behaviac
AgentMeta::UnRegister<HeroAgent>("HeroAgent");
AgentMeta::UnRegister<AndroidAgent>("AndroidAgent");
AgentMeta::UnRegister<MasterAgent>("MasterAgent");
AgentMeta::UnRegister<TeammateAgent>("TeammateAgent");
AgentMeta::UnRegister<SkillIdx_e>("SkillIdx_e");
AgentMeta::UnRegister<BuffEffectType_e>("BuffEffectType_e");
AgentMeta::UnRegister<BtEvent_e>("BtEvent_e");
AgentMeta::UnRegister<GasMode_e>("GasMode_e");
AgentMeta::UnRegister<CoId_e>("CoId_e");
AgentMeta::UnRegister<InventorySlot_e>("InventorySlot_e");
AgentMeta::UnRegister<glm::vec3>("glm::vec3");
return true;

View File

@ -78,9 +78,6 @@ namespace behaviac
inline void Set_HeroAgent_current_target_agent(Agent* self, TargetAgent* value) { ((HeroAgent*)self)->current_target_agent = value; };
inline const void* Get_HeroAgent_current_target_agent(Agent* self) { return &((HeroAgent*)self)->current_target_agent; };
inline void Set_HeroAgent_current_teammate_agent(Agent* self, TeammateAgent* value) { ((HeroAgent*)self)->current_teammate_agent = value; };
inline const void* Get_HeroAgent_current_teammate_agent(Agent* self) { return &((HeroAgent*)self)->current_teammate_agent; };
inline void Set_HeroAgent_master_agent(Agent* self, MasterAgent* value) { ((HeroAgent*)self)->master_agent = value; };
inline const void* Get_HeroAgent_master_agent(Agent* self) { return &((HeroAgent*)self)->master_agent; };
@ -156,16 +153,11 @@ namespace behaviac
inline void Set_HeroAgent_tmp_val4(Agent* self, float value) { ((HeroAgent*)self)->tmp_val4 = value; };
inline const void* Get_HeroAgent_tmp_val4(Agent* self) { return &((HeroAgent*)self)->tmp_val4; };
inline void FunctionPointer_HeroAgent_AbandonPickup(Agent* self, int min_time, int max_time) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_AbandonPickup, void, int, int >(min_time, max_time); }
inline void FunctionPointer_HeroAgent_Abort(Agent* self, behaviac::string msg, behaviac::vector<int> args) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_Abort, void, behaviac::string, behaviac::vector<int> >(msg, args); }
inline void FunctionPointer_HeroAgent_AbortCoroutine(Agent* self, CoId_e co_id) { ((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_AbortCoroutine, void, CoId_e >(co_id); }
inline void FunctionPointer_HeroAgent_BattleMove(Agent* self, glm::vec3& loc_point0) { } /* BattleMove */
inline bool FunctionPointer_HeroAgent_CanAttack(Agent* self) { return ((HeroAgent*)self)->CanAttack(); }
inline bool FunctionPointer_HeroAgent_CanShot(Agent* self) { return ((HeroAgent*)self)->CanShot(); }
inline bool FunctionPointer_HeroAgent_CanThrowItem(Agent* self, InventorySlot_e slot) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CanThrowItem, bool, InventorySlot_e >(slot); }
inline bool FunctionPointer_HeroAgent_CanUseSkill(Agent* self, int skill_id) { return ((HeroAgent*)self)->CanUseSkill(skill_id); }
inline bool FunctionPointer_HeroAgent_CarHasBuffEffect(Agent* self, int effect_id) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasBuffEffect, bool, int >(effect_id); }
inline bool FunctionPointer_HeroAgent_CarHasOil(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasOil, bool >(); }
inline void FunctionPointer_HeroAgent_ChaseToKill(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* ChaseToKill */
inline void FunctionPointer_HeroAgent_ChiMode(Agent* self) { } /* ChiMode */
inline behaviac::EBTStatus FunctionPointer_HeroAgent_ClearEvents(Agent* self) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_ClearEvents, behaviac::EBTStatus >(); }
@ -186,13 +178,9 @@ namespace behaviac
inline void FunctionPointer_HeroAgent_DecV(Agent* self, int id, int val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_DecV, void, int, int >(id, val); }
inline int FunctionPointer_HeroAgent_DeltaTime(Agent* self, int time) { return ((HeroAgent*)self)->DeltaTime(time); }
inline void FunctionPointer_HeroAgent_FollowMaster(Agent* self, glm::vec3& loc_point0, float loc_val0) { } /* FollowMaster */
inline void FunctionPointer_HeroAgent_FollowTeammate(Agent* self, glm::vec3& loc_point0, float loc_val0) { } /* FollowTeammate */
inline int FunctionPointer_HeroAgent_GetAgentType(Agent* self) { return ((HeroAgent*)self)->GetAgentType(); }
inline int FunctionPointer_HeroAgent_GetAliveEnemyNum(Agent* self) { return ((HeroAgent*)self)->GetAliveEnemyNum(); }
inline int FunctionPointer_HeroAgent_GetBattleTimes(Agent* self) { return ((HeroAgent*)self)->GetBattleTimes(); }
inline bool FunctionPointer_HeroAgent_GetCarCurOil(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarCurOil, bool >(); }
inline float FunctionPointer_HeroAgent_GetCarMaxOil(Agent* self) { return (float)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarMaxOil, float >(); }
inline void FunctionPointer_HeroAgent_GetDown(Agent* self) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetDown, void >(); }
inline int FunctionPointer_HeroAgent_GetHeroId(Agent* self) { return ((HeroAgent*)self)->GetHeroId(); }
inline float FunctionPointer_HeroAgent_GetHp(Agent* self) { return ((HeroAgent*)self)->GetHp(); }
inline float FunctionPointer_HeroAgent_GetHPRate(Agent* self) { return ((HeroAgent*)self)->GetHPRate(); }
@ -214,9 +202,7 @@ namespace behaviac
inline behaviac::string FunctionPointer_HeroAgent_GetSkillBtFile(Agent* self) { return ((HeroAgent*)self)->GetSkillBtFile(); }
inline glm::vec3 FunctionPointer_HeroAgent_GetTargetDir(Agent* self) { return ((HeroAgent*)self)->GetTargetDir(); }
inline float FunctionPointer_HeroAgent_GetTargetManhattanDistance(Agent* self) { return ((HeroAgent*)self)->GetTargetManhattanDistance(); }
inline float FunctionPointer_HeroAgent_GetTeammateManhattanDistance(Agent* self) { return (float)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetTeammateManhattanDistance, float >(); }
inline int FunctionPointer_HeroAgent_GetTickCount(Agent* self) { return ((HeroAgent*)self)->GetTickCount(); }
inline int FunctionPointer_HeroAgent_GetTodayBattleTimes(Agent* self) { return (int)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetTodayBattleTimes, int >(); }
inline int FunctionPointer_HeroAgent_GetUniId(Agent* self) { return ((HeroAgent*)self)->GetUniId(); }
inline int FunctionPointer_HeroAgent_GetUseSkillTimes(Agent* self) { return ((HeroAgent*)self)->GetUseSkillTimes(); }
inline int FunctionPointer_HeroAgent_GetV(Agent* self, int id) { return ((HeroAgent*)self)->GetV(id); }
@ -232,7 +218,6 @@ namespace behaviac
inline bool FunctionPointer_HeroAgent_IsMobaMode(Agent* self) { return ((HeroAgent*)self)->IsMobaMode(); }
inline bool FunctionPointer_HeroAgent_IsMoving(Agent* self) { return ((HeroAgent*)self)->IsMoving(); }
inline bool FunctionPointer_HeroAgent_IsNearGas(Agent* self, float anti_range) { return ((HeroAgent*)self)->IsNearGas(anti_range); }
inline bool FunctionPointer_HeroAgent_IsSingleCar(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_IsSingleCar, bool >(); }
inline void FunctionPointer_HeroAgent_LogMessage(char* param0) { HeroAgent::LogMessage(param0); }
inline void FunctionPointer_HeroAgent_MasterHelpAttack(Agent* self) { } /* MasterHelpAttack */
inline bool FunctionPointer_HeroAgent_MasterInRange(Agent* self, float range) { return ((HeroAgent*)self)->MasterInRange(range); }
@ -242,9 +227,6 @@ namespace behaviac
inline void FunctionPointer_HeroAgent_OnMobaRevive(Agent* self) { } /* OnMobaRevive */
inline void FunctionPointer_HeroAgent_OnUnderAttack(Agent* self, int enemy_uniid) { } /* OnUnderAttack */
inline void FunctionPointer_HeroAgent_OpenBulletTraceMode(Agent* self) { ((HeroAgent*)self)->OpenBulletTraceMode(); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_Pickup(Agent* self) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_Pickup, behaviac::EBTStatus >(); }
inline void FunctionPointer_HeroAgent_PickupItem(Agent* self, int loc_val0, int loc_val1, glm::vec3& loc_val2) { } /* PickupItem */
inline bool FunctionPointer_HeroAgent_PickupObjIsValid(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_PickupObjIsValid, bool >(); }
inline int FunctionPointer_HeroAgent_Rand(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Rand, int >(); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_RandomSafeZonePoint(Agent* self, int try_count, int step_len) { return ((HeroAgent*)self)->RandomSafeZonePoint(try_count, step_len); }
inline void FunctionPointer_HeroAgent_RandomShot(Agent* self, int loc_val0, int loc_val1, glm::vec3& loc_point0) { } /* RandomShot */
@ -257,24 +239,17 @@ namespace behaviac
inline void FunctionPointer_HeroAgent_RunAway(Agent* self, glm::vec3& loc_point0) { } /* RunAway */
inline void FunctionPointer_HeroAgent_RunGas(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* RunGas */
inline behaviac::EBTStatus FunctionPointer_HeroAgent_SearchEnemy(Agent* self, float range) { return ((HeroAgent*)self)->SearchEnemy(range); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_SearchHumanEnemy(Agent* self, int range) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchHumanEnemy, behaviac::EBTStatus, int >(range); }
inline int FunctionPointer_HeroAgent_SearchPickupObj(Agent* self) { return (int)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchPickupObj, int >(); }
inline bool FunctionPointer_HeroAgent_SearchTeammate(Agent* self, int range) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchTeammate, bool, int >(range); }
inline void FunctionPointer_HeroAgent_SendEmote(Agent* self, int emote) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SendEmote, void, int >(emote); }
inline void FunctionPointer_HeroAgent_SetBulletAngleOffset(Agent* self, int min_val, int max_val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SetBulletAngleOffset, void, int, int >(min_val, max_val); }
inline void FunctionPointer_HeroAgent_SetV(Agent* self, int id, int val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SetV, void, int, int >(id, val); }
inline void FunctionPointer_HeroAgent_ShotTrace(Agent* self) { ((HeroAgent*)self)->ShotTrace(); }
inline void FunctionPointer_HeroAgent_StayPutAttack(Agent* self) { } /* StayPutAttack */
inline void FunctionPointer_HeroAgent_SwitchSeat(Agent* self, int seat) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SwitchSeat, void, int >(seat); }
inline bool FunctionPointer_HeroAgent_SwitchToNewAttacker(Agent* self) { return ((HeroAgent*)self)->SwitchToNewAttacker(); }
inline bool FunctionPointer_HeroAgent_TargetInRange(Agent* self, float range) { return ((HeroAgent*)self)->TargetInRange(range); }
inline bool FunctionPointer_HeroAgent_TargetInShotRange(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TargetInShotRange, bool >(); }
inline void FunctionPointer_HeroAgent_TeammateHelpAttack(Agent* self) { } /* TeammateHelpAttack */
inline bool FunctionPointer_HeroAgent_TeammateIsValid(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TeammateIsValid, bool >(); }
inline int FunctionPointer_HeroAgent_Test(Agent* self, int p1) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Test, int, int >(p1); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_ThrowItem(Agent* self, InventorySlot_e slot) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_ThrowItem, behaviac::EBTStatus, InventorySlot_e >(slot); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_TrySearchEnemy(Agent* self, float range, int min_interval, int max_interval) { return ((HeroAgent*)self)->TrySearchEnemy(range, min_interval, max_interval); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_TrySearchTeammate(Agent* self, int range) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TrySearchTeammate, behaviac::EBTStatus, int >(range); }
inline void FunctionPointer_HeroAgent_UseNormalSkill(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseNormalSkill */
inline void FunctionPointer_HeroAgent_UseSkill30100(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30100 */
inline void FunctionPointer_HeroAgent_UseSkill30200(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30200 */
@ -286,16 +261,11 @@ namespace behaviac
inline void FunctionPointer_HeroAgent_UseSkill30800(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30800 */
inline void FunctionPointer_HeroAgent_UseSkill30900(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30900 */
inline void FunctionPointer_HeroAgent_UseSkill31000(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill31000 */
inline void FunctionPointer_AndroidAgent_AbandonPickup(Agent* self, int min_time, int max_time) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_AbandonPickup, void, int, int >(min_time, max_time); }
inline void FunctionPointer_AndroidAgent_Abort(Agent* self, behaviac::string msg, behaviac::vector<int> args) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_Abort, void, behaviac::string, behaviac::vector<int> >(msg, args); }
inline void FunctionPointer_AndroidAgent_AbortCoroutine(Agent* self, CoId_e co_id) { ((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_AbortCoroutine, void, CoId_e >(co_id); }
inline void FunctionPointer_AndroidAgent_BattleMove(Agent* self, glm::vec3& loc_point0) { } /* BattleMove */
inline bool FunctionPointer_AndroidAgent_CanAttack(Agent* self) { return ((AndroidAgent*)self)->CanAttack(); }
inline bool FunctionPointer_AndroidAgent_CanShot(Agent* self) { return ((AndroidAgent*)self)->CanShot(); }
inline bool FunctionPointer_AndroidAgent_CanThrowItem(Agent* self, InventorySlot_e slot) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CanThrowItem, bool, InventorySlot_e >(slot); }
inline bool FunctionPointer_AndroidAgent_CanUseSkill(Agent* self, int skill_id) { return ((AndroidAgent*)self)->CanUseSkill(skill_id); }
inline bool FunctionPointer_AndroidAgent_CarHasBuffEffect(Agent* self, int effect_id) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasBuffEffect, bool, int >(effect_id); }
inline bool FunctionPointer_AndroidAgent_CarHasOil(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_CarHasOil, bool >(); }
inline void FunctionPointer_AndroidAgent_ChaseToKill(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* ChaseToKill */
inline void FunctionPointer_AndroidAgent_ChiMode(Agent* self) { } /* ChiMode */
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_ClearEvents(Agent* self) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_ClearEvents, behaviac::EBTStatus >(); }
@ -316,14 +286,10 @@ namespace behaviac
inline void FunctionPointer_AndroidAgent_DecV(Agent* self, int id, int val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_DecV, void, int, int >(id, val); }
inline int FunctionPointer_AndroidAgent_DeltaTime(Agent* self, int time) { return ((AndroidAgent*)self)->DeltaTime(time); }
inline void FunctionPointer_AndroidAgent_FollowMaster(Agent* self, glm::vec3& loc_point0, float loc_val0) { } /* FollowMaster */
inline void FunctionPointer_AndroidAgent_FollowTeammate(Agent* self, glm::vec3& loc_point0, float loc_val0) { } /* FollowTeammate */
inline behaviac::string FunctionPointer_AndroidAgent_GetAccountId(Agent* self) { return ((AndroidAgent*)self)->GetAccountId(); }
inline int FunctionPointer_AndroidAgent_GetAgentType(Agent* self) { return ((AndroidAgent*)self)->GetAgentType(); }
inline int FunctionPointer_AndroidAgent_GetAliveEnemyNum(Agent* self) { return ((AndroidAgent*)self)->GetAliveEnemyNum(); }
inline int FunctionPointer_AndroidAgent_GetBattleTimes(Agent* self) { return ((AndroidAgent*)self)->GetBattleTimes(); }
inline bool FunctionPointer_AndroidAgent_GetCarCurOil(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarCurOil, bool >(); }
inline float FunctionPointer_AndroidAgent_GetCarMaxOil(Agent* self) { return (float)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetCarMaxOil, float >(); }
inline void FunctionPointer_AndroidAgent_GetDown(Agent* self) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetDown, void >(); }
inline int FunctionPointer_AndroidAgent_GetHeroId(Agent* self) { return ((AndroidAgent*)self)->GetHeroId(); }
inline float FunctionPointer_AndroidAgent_GetHp(Agent* self) { return ((AndroidAgent*)self)->GetHp(); }
inline float FunctionPointer_AndroidAgent_GetHPRate(Agent* self) { return ((AndroidAgent*)self)->GetHPRate(); }
@ -345,9 +311,7 @@ namespace behaviac
inline behaviac::string FunctionPointer_AndroidAgent_GetSkillBtFile(Agent* self) { return ((AndroidAgent*)self)->GetSkillBtFile(); }
inline glm::vec3 FunctionPointer_AndroidAgent_GetTargetDir(Agent* self) { return ((AndroidAgent*)self)->GetTargetDir(); }
inline float FunctionPointer_AndroidAgent_GetTargetManhattanDistance(Agent* self) { return ((AndroidAgent*)self)->GetTargetManhattanDistance(); }
inline float FunctionPointer_AndroidAgent_GetTeammateManhattanDistance(Agent* self) { return (float)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetTeammateManhattanDistance, float >(); }
inline int FunctionPointer_AndroidAgent_GetTickCount(Agent* self) { return ((AndroidAgent*)self)->GetTickCount(); }
inline int FunctionPointer_AndroidAgent_GetTodayBattleTimes(Agent* self) { return (int)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_GetTodayBattleTimes, int >(); }
inline int FunctionPointer_AndroidAgent_GetUniId(Agent* self) { return ((AndroidAgent*)self)->GetUniId(); }
inline int FunctionPointer_AndroidAgent_GetUseSkillTimes(Agent* self) { return ((AndroidAgent*)self)->GetUseSkillTimes(); }
inline int FunctionPointer_AndroidAgent_GetV(Agent* self, int id) { return ((AndroidAgent*)self)->GetV(id); }
@ -363,7 +327,6 @@ namespace behaviac
inline bool FunctionPointer_AndroidAgent_IsMobaMode(Agent* self) { return ((AndroidAgent*)self)->IsMobaMode(); }
inline bool FunctionPointer_AndroidAgent_IsMoving(Agent* self) { return ((AndroidAgent*)self)->IsMoving(); }
inline bool FunctionPointer_AndroidAgent_IsNearGas(Agent* self, float anti_range) { return ((AndroidAgent*)self)->IsNearGas(anti_range); }
inline bool FunctionPointer_AndroidAgent_IsSingleCar(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_IsSingleCar, bool >(); }
inline void FunctionPointer_AndroidAgent_LogMessage(char* param0) { AndroidAgent::LogMessage(param0); }
inline void FunctionPointer_AndroidAgent_MasterHelpAttack(Agent* self) { } /* MasterHelpAttack */
inline bool FunctionPointer_AndroidAgent_MasterInRange(Agent* self, float range) { return ((AndroidAgent*)self)->MasterInRange(range); }
@ -373,9 +336,6 @@ namespace behaviac
inline void FunctionPointer_AndroidAgent_OnMobaRevive(Agent* self) { } /* OnMobaRevive */
inline void FunctionPointer_AndroidAgent_OnUnderAttack(Agent* self, int enemy_uniid) { } /* OnUnderAttack */
inline void FunctionPointer_AndroidAgent_OpenBulletTraceMode(Agent* self) { ((AndroidAgent*)self)->OpenBulletTraceMode(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_Pickup(Agent* self) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_Pickup, behaviac::EBTStatus >(); }
inline void FunctionPointer_AndroidAgent_PickupItem(Agent* self, int loc_val0, int loc_val1, glm::vec3& loc_val2) { } /* PickupItem */
inline bool FunctionPointer_AndroidAgent_PickupObjIsValid(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_PickupObjIsValid, bool >(); }
inline int FunctionPointer_AndroidAgent_Rand(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Rand, int >(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_RandomSafeZonePoint(Agent* self, int try_count, int step_len) { return ((AndroidAgent*)self)->RandomSafeZonePoint(try_count, step_len); }
inline void FunctionPointer_AndroidAgent_RandomShot(Agent* self, int loc_val0, int loc_val1, glm::vec3& loc_point0) { } /* RandomShot */
@ -388,24 +348,17 @@ namespace behaviac
inline void FunctionPointer_AndroidAgent_RunAway(Agent* self, glm::vec3& loc_point0) { } /* RunAway */
inline void FunctionPointer_AndroidAgent_RunGas(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* RunGas */
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_SearchEnemy(Agent* self, float range) { return ((AndroidAgent*)self)->SearchEnemy(range); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_SearchHumanEnemy(Agent* self, int range) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchHumanEnemy, behaviac::EBTStatus, int >(range); }
inline int FunctionPointer_AndroidAgent_SearchPickupObj(Agent* self) { return (int)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchPickupObj, int >(); }
inline bool FunctionPointer_AndroidAgent_SearchTeammate(Agent* self, int range) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SearchTeammate, bool, int >(range); }
inline void FunctionPointer_AndroidAgent_SendEmote(Agent* self, int emote) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SendEmote, void, int >(emote); }
inline void FunctionPointer_AndroidAgent_SetBulletAngleOffset(Agent* self, int min_val, int max_val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SetBulletAngleOffset, void, int, int >(min_val, max_val); }
inline void FunctionPointer_AndroidAgent_SetV(Agent* self, int id, int val) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SetV, void, int, int >(id, val); }
inline void FunctionPointer_AndroidAgent_ShotTrace(Agent* self) { ((AndroidAgent*)self)->ShotTrace(); }
inline void FunctionPointer_AndroidAgent_StayPutAttack(Agent* self) { } /* StayPutAttack */
inline void FunctionPointer_AndroidAgent_SwitchSeat(Agent* self, int seat) { ((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_SwitchSeat, void, int >(seat); }
inline bool FunctionPointer_AndroidAgent_SwitchToNewAttacker(Agent* self) { return ((AndroidAgent*)self)->SwitchToNewAttacker(); }
inline bool FunctionPointer_AndroidAgent_TargetInRange(Agent* self, float range) { return ((AndroidAgent*)self)->TargetInRange(range); }
inline bool FunctionPointer_AndroidAgent_TargetInShotRange(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TargetInShotRange, bool >(); }
inline void FunctionPointer_AndroidAgent_TeammateHelpAttack(Agent* self) { } /* TeammateHelpAttack */
inline bool FunctionPointer_AndroidAgent_TeammateIsValid(Agent* self) { return (bool)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TeammateIsValid, bool >(); }
inline int FunctionPointer_AndroidAgent_Test(Agent* self, int p1) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Test, int, int >(p1); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_ThrowItem(Agent* self, InventorySlot_e slot) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_ThrowItem, behaviac::EBTStatus, InventorySlot_e >(slot); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_TrySearchEnemy(Agent* self, float range, int min_interval, int max_interval) { return ((AndroidAgent*)self)->TrySearchEnemy(range, min_interval, max_interval); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_TrySearchTeammate(Agent* self, int range) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_TrySearchTeammate, behaviac::EBTStatus, int >(range); }
inline void FunctionPointer_AndroidAgent_UseNormalSkill(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseNormalSkill */
inline void FunctionPointer_AndroidAgent_UseSkill30100(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30100 */
inline void FunctionPointer_AndroidAgent_UseSkill30200(Agent* self, int loc_val0, int loc_val1, int loc_val2) { } /* UseSkill30200 */
@ -436,20 +389,6 @@ namespace behaviac
inline int FunctionPointer_MasterAgent_RandRange(Agent* self, int min_val, int max_val) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_RandRange, int, int, int >(min_val, max_val); }
inline float FunctionPointer_MasterAgent_RandRangeAsFloat(Agent* self, float min_val, float max_val) { return ((MasterAgent*)self)->RandRangeAsFloat(min_val, max_val); }
inline int FunctionPointer_MasterAgent_Test(Agent* self, int p1) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Test, int, int >(p1); }
inline void FunctionPointer_TeammateAgent_Abandon(Agent* self, int min_time, int max_time) { ((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_Abandon, void, int, int >(min_time, max_time); }
inline void FunctionPointer_TeammateAgent_ClearAbandon(Agent* self) { ((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_ClearAbandon, void >(); }
inline int FunctionPointer_TeammateAgent_GetHeroId(Agent* self) { return (int)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHeroId, int >(); }
inline float FunctionPointer_TeammateAgent_GetHp(Agent* self) { return (float)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHp, float >(); }
inline float FunctionPointer_TeammateAgent_GetHPRate(Agent* self) { return (float)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetHPRate, float >(); }
inline int FunctionPointer_TeammateAgent_GetLevel(Agent* self) { return (int)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetLevel, int >(); }
inline float FunctionPointer_TeammateAgent_GetMaxHp(Agent* self) { return (float)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetMaxHp, float >(); }
inline glm::vec3 FunctionPointer_TeammateAgent_GetPos(Agent* self) { return (glm::vec3)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetPos, glm::vec3 >(); }
inline float FunctionPointer_TeammateAgent_GetShotRange(Agent* self) { return (float)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetShotRange, float >(); }
inline int FunctionPointer_TeammateAgent_GetUniId(Agent* self) { return (int)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_GetUniId, int >(); }
inline bool FunctionPointer_TeammateAgent_HasBuffEffect(Agent* self, int effect_id) { return (bool)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_HasBuffEffect, bool, int >(effect_id); }
inline bool FunctionPointer_TeammateAgent_IsDead(Agent* self) { return (bool)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_IsDead, bool >(); }
inline bool FunctionPointer_TeammateAgent_IsValid(Agent* self) { return (bool)((TeammateAgent*)self)->_Execute_Method_<METHOD_TYPE_TeammateAgent_IsValid, bool >(); }
inline void FunctionPointer_TeammateAgent_LogMessage(char* param0) { TeammateAgent::LogMessage(param0); }
inline void Set_glm_vec3_x(Agent* self, float value) { ((glm::vec3*)self)->x = value; };
inline const void* Get_glm_vec3_x(Agent* self) { return &((glm::vec3*)self)->x; };

View File

@ -66,13 +66,3 @@ BEHAVIAC_BEGIN_ENUM_EX(CoId_e, CoId_e)
}
BEHAVIAC_END_ENUM_EX()
BEHAVIAC_BEGIN_ENUM_EX(InventorySlot_e, InventorySlot_e)
{
BEHAVIAC_ENUMCLASS_DISPLAY_INFO_EX(L"InventorySlot_e", L"");
BEHAVIAC_ENUM_ITEM_EX(IS_FRAG, "IS_FRAG");
BEHAVIAC_ENUM_ITEM_EX(IS_SMOKE, "IS_SMOKE");
BEHAVIAC_ENUM_ITEM_EX(IS_MOLOTOR_COCKTAIL, "IS_MOLOTOR_COCKTAIL");
}
BEHAVIAC_END_ENUM_EX()

View File

@ -37,10 +37,6 @@ DECLARE_BEHAVIAC_ENUM_EX(CoId_e, CoId_e);
BEHAVIAC_DECLARE_TYPE_VECTOR_HANDLER(CoId_e);
DECLARE_BEHAVIAC_ENUM_EX(InventorySlot_e, InventorySlot_e);
BEHAVIAC_DECLARE_TYPE_VECTOR_HANDLER(InventorySlot_e);
// -------------------
// Customized structs
// -------------------

View File

@ -13,7 +13,6 @@
#include "room_agent.h"
#include "target_agent.h"
#include "team_agent.h"
#include "teammate_agent.h"
#include "master_agent.h"
#include "behaviac_customized_types.h"

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<agents version="1" signature="2686576916">
<agent type="HeroAgent" base="BaseAgent" signature="1955586164">
<agents version="1" signature="7815860">
<agent type="HeroAgent" base="BaseAgent" signature="1794127831">
<properties>
<property name="current_target_agent" type="TargetAgent*" member="false" static="false" defaultvalue="null" />
<property name="current_teammate_agent" type="TeammateAgent*" member="false" static="false" defaultvalue="null" />
<property name="master_agent" type="MasterAgent*" member="false" static="false" defaultvalue="null" />
<property name="out_errno" type="int" member="false" static="false" defaultvalue="0" />
<property name="out_point0" type="glm::vec3" member="false" static="false" defaultvalue="{x=0;y=0;z=0;}" />
@ -32,10 +31,9 @@
<property name="tmp_val4" type="float" member="false" static="false" defaultvalue="0" />
</properties>
</agent>
<agent type="AndroidAgent" base="HeroAgent" signature="3669426665">
<agent type="AndroidAgent" base="HeroAgent" signature="1963696203">
<properties>
<property name="current_target_agent" type="TargetAgent*" member="false" static="false" defaultvalue="null" />
<property name="current_teammate_agent" type="TeammateAgent*" member="false" static="false" defaultvalue="null" />
<property name="master_agent" type="MasterAgent*" member="false" static="false" defaultvalue="null" />
<property name="out_errno" type="int" member="false" static="false" defaultvalue="0" />
<property name="out_point0" type="glm::vec3" member="false" static="false" defaultvalue="{x=0;y=0;z=0;}" />

View File

@ -2,75 +2,67 @@
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: monster\8002_thief.xml-->
<behavior name="monster/8002_thief" agenttype="HeroAgent" version="5">
<node class="IfElse" id="19">
<node class="Condition" id="20">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMobaMode()" />
<property Opr="const bool true" />
<node class="IfElse" id="6">
<node class="Action" id="7">
<property Method="Self.HeroAgent::SearchEnemy(300)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Noop" id="21" />
<node class="IfElse" id="6">
<node class="Action" id="7">
<property Method="Self.HeroAgent::SearchEnemy(300)" />
<node class="SelectorProbability" id="8">
<node class="DecoratorWeight" id="9">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 80" />
<node class="ReferencedBehavior" id="2">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="1">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 20" />
<node class="Action" id="4">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
<node class="IfElse" id="0">
<node class="Action" id="3">
<property Method="Self.HeroAgent::SearchEnemy(600)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="8">
<node class="DecoratorWeight" id="9">
<node class="SelectorProbability" id="5">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 80" />
<node class="ReferencedBehavior" id="2">
<property Weight="const int 30" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="1">
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 20" />
<node class="Action" id="4">
<property Weight="const int 70" />
<node class="Action" id="13">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
<node class="IfElse" id="0">
<node class="Action" id="3">
<property Method="Self.HeroAgent::SearchEnemy(600)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="5">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 30" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 70" />
<node class="Action" id="13">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="14">
<node class="DecoratorWeight" id="15">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 10" />
<node class="ReferencedBehavior" id="16">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="SelectorProbability" id="14">
<node class="DecoratorWeight" id="15">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 10" />
<node class="ReferencedBehavior" id="16">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="17">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 90" />
<node class="Action" id="18">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="DecoratorWeight" id="17">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 90" />
<node class="Action" id="18">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>

View File

@ -2,75 +2,67 @@
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: monster\8003_mystery_troop.xml-->
<behavior name="monster/8003_mystery_troop" agenttype="HeroAgent" version="5">
<node class="IfElse" id="19">
<node class="Condition" id="20">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMobaMode()" />
<property Opr="const bool true" />
<node class="IfElse" id="6">
<node class="Action" id="7">
<property Method="Self.HeroAgent::SearchEnemy(300)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Noop" id="21" />
<node class="IfElse" id="6">
<node class="Action" id="7">
<property Method="Self.HeroAgent::SearchEnemy(300)" />
<node class="SelectorProbability" id="8">
<node class="DecoratorWeight" id="9">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 70" />
<node class="ReferencedBehavior" id="2">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="1">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 30" />
<node class="Action" id="4">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
<node class="IfElse" id="0">
<node class="Action" id="3">
<property Method="Self.HeroAgent::SearchEnemy(600)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="8">
<node class="DecoratorWeight" id="9">
<node class="SelectorProbability" id="5">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 70" />
<node class="ReferencedBehavior" id="2">
<property Weight="const int 30" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="1">
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 30" />
<node class="Action" id="4">
<property Weight="const int 70" />
<node class="Action" id="13">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
<node class="IfElse" id="0">
<node class="Action" id="3">
<property Method="Self.HeroAgent::SearchEnemy(600)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="5">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 30" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 70" />
<node class="Action" id="13">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="SelectorProbability" id="14">
<node class="DecoratorWeight" id="15">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 10" />
<node class="ReferencedBehavior" id="16">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="SelectorProbability" id="14">
<node class="DecoratorWeight" id="15">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 10" />
<node class="ReferencedBehavior" id="16">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="17">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 90" />
<node class="Action" id="18">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="DecoratorWeight" id="17">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 90" />
<node class="Action" id="18">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>

View File

@ -11,13 +11,8 @@
<property Prototype="Self.HeroAgent::UseSkill30100(0,0,0)" />
<property IsHTN="false" />
<node class="Sequence" id="1">
<node class="SelectorStochastic" id="2">
<node class="Selector" id="2">
<node class="Sequence" id="3">
<node class="Condition" id="12">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(180)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="Condition" id="4">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanUseSkill(60101)" />
@ -29,11 +24,6 @@
</node>
</node>
<node class="Sequence" id="6">
<node class="Condition" id="13">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(220)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanUseSkill(60121)" />
@ -45,25 +35,11 @@
</node>
</node>
<node class="Sequence" id="9">
<node class="Condition" id="14">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="Condition" id="10">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanUseSkill(60111)" />
<property Opr="const bool true" />
</node>
<node class="Assignment" id="15">
<property CastRight="false" />
<property Opl="glm::vec3 Self.HeroAgent::tmp_point1" />
<property Opr="Self.HeroAgent::GetTargetDir()" />
</node>
<node class="Action" id="16">
<property Method="Self.HeroAgent::SetAttackDir(glm::vec3 Self.HeroAgent::tmp_point0)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Action" id="11">
<property Method="Self.HeroAgent::CoUseSkill(60111)" />
<property ResultOption="BT_INVALID" />

View File

@ -43,28 +43,6 @@
<property Phase="Both" />
</attachment>
<node class="Sequence" id="6">
<node class="Selector" id="108">
<node class="ReferencedBehavior" id="106">
<property ReferenceBehavior="const string &quot;task/Pickup&quot;" />
<property Task="Self.HeroAgent::PickupItem(0,0,{x=0;y=0;z=0;})" />
</node>
<node class="True" id="107" />
</node>
<node class="IfElse" id="118">
<node class="Condition" id="120">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool true" />
</node>
<node class="True" id="121" />
<node class="Sequence" id="122">
<node class="Action" id="123">
<property Method="current_target_agent.TargetAgent::Abandon(0,0)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="False" id="124" />
</node>
</node>
<node class="Selector" id="100">
<node class="IfElse" id="9">
<node class="Condition" id="10">
@ -138,44 +116,7 @@
<property Opr="const bool false" />
</node>
<node class="IfElse" id="36">
<node class="Selector" id="22">
<node class="Selector" id="119">
<node class="Sequence" id="105">
<node class="Condition" id="110">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanThrowItem(IS_FRAG)" />
<property Opr="const bool true" />
</node>
<node class="Action" id="111">
<property Method="Self.HeroAgent::ThrowItem(IS_FRAG)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="Sequence" id="116">
<node class="Condition" id="112">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanThrowItem(IS_SMOKE)" />
<property Opr="const bool true" />
</node>
<node class="Action" id="113">
<property Method="Self.HeroAgent::ThrowItem(IS_SMOKE)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="Sequence" id="117">
<node class="Condition" id="114">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanThrowItem(IS_MOLOTOR_COCKTAIL)" />
<property Opr="const bool true" />
</node>
<node class="Action" id="115">
<property Method="Self.HeroAgent::ThrowItem(IS_MOLOTOR_COCKTAIL)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
<node class="True" id="109" />
</node>
<node class="True" id="22" />
<node class="Sequence" id="17">
<node class="Action" id="76">
<property Method="Self.HeroAgent::DebugOut(&quot;ddddd要战斗走位了&quot;,0,0,0)" />
@ -222,10 +163,6 @@
<property Method="Self.HeroAgent::SetAttackDir(glm::vec3 Self.HeroAgent::tmp_point0)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Action" id="104">
<property Method="Self.HeroAgent::SetBulletAngleOffset(0,30)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Action" id="18">
<property Method="Self.HeroAgent::ShotNormal(glm::vec3 Self.HeroAgent::tmp_point0)" />
<property ResultOption="BT_SUCCESS" />

View File

@ -32,73 +32,40 @@
<property ReferenceBehavior="const string &quot;task/RunGas&quot;" />
<property Task="Self.HeroAgent::RunGas(0,0,0)" />
</node>
<node class="Sequence" id="18">
<node class="SelectorProbability" id="23">
<node class="DecoratorWeight" id="24">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="IfElse" id="26">
<node class="Condition" id="27">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool false" />
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="17">
<node class="SelectorProbability" id="9">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
<node class="IfElse" id="34">
<node class="Condition" id="35">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMoving()" />
<property Opr="const bool false" />
</node>
<node class="SelectorProbability" id="28">
<node class="DecoratorWeight" id="29">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="30">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
</node>
<node class="True" id="36" />
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 100" />
<node class="ReferencedBehavior" id="13">
<property ReferenceBehavior="const string &quot;task/RandomShot&quot;" />
<property Task="Self.HeroAgent::RandomShot(0,0,{x=0;y=0;z=0;})" />
</node>
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="17">
<node class="SelectorProbability" id="9">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 0" />
<node class="ReferencedBehavior" id="13">
<property ReferenceBehavior="const string &quot;task/RandomShot&quot;" />
<property Task="Self.HeroAgent::RandomShot(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 60" />
<node class="Action" id="15">
<property Method="Self.HeroAgent::CoIdle(1000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 60" />
<node class="Action" id="15">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: task\ChiJiMode_0.xml-->
<behavior name="task/ChiJiMode_0" agenttype="HeroAgent" version="5">
<pars>
<par name="_$local_task_param_$_0" type="int" value="0" />
<par name="loc_val0" type="int" value="0" />
<par name="loc_val1" type="int" value="0" />
</pars>
<node class="Task" id="0">
<property Prototype="Self.HeroAgent::ChiMode()" />
<property IsHTN="false" />
<node class="IfElse" id="1">
<node class="Sequence" id="2">
<node class="Assignment" id="16">
<property CastRight="true" />
<property Opl="float Self.HeroAgent::tmp_val0" />
<property Opr="Self.BaseAgent::RandRange(25,150)" />
</node>
<node class="Condition" id="4">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsNearGas(float Self.HeroAgent::tmp_val0)" />
<property Opr="const bool true" />
</node>
<node class="Condition" id="5">
<property Operator="GreaterEqual" />
<property Opl="Self.HeroAgent::GetSafeAreaRadius()" />
<property Opr="const float 500" />
</node>
</node>
<node class="ReferencedBehavior" id="3">
<property ReferenceBehavior="const string &quot;task/RunGas&quot;" />
<property Task="Self.HeroAgent::RunGas(0,0,0)" />
</node>
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="17">
<node class="SelectorProbability" id="9">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 100" />
<node class="ReferencedBehavior" id="13">
<property ReferenceBehavior="const string &quot;task/RandomShot&quot;" />
<property Task="Self.HeroAgent::RandomShot(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 60" />
<node class="Action" id="15">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</behavior>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: task\Follow.xml-->
<behavior name="task/Follow" agenttype="HeroAgent" version="5">
<node class="Sequence" id="0">
<node class="Assignment" id="1">
<property CastRight="false" />
<property Opl="glm::vec3 current_teammate_agent.TeammateAgent::tmp_point0" />
<property Opr="current_teammate_agent.TeammateAgent::GetPos()" />
</node>
<node class="Action" id="2">
<property Method="Self.HeroAgent::CoFindPathEx(glm::vec3 current_teammate_agent.TeammateAgent::tmp_point0,60)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Action" id="3">
<property Method="Self.HeroAgent::DebugOut(&quot;ddddd跟随队友&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</behavior>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: task\FollowTeammate.xml-->
<behavior name="task/FollowTeammate" agenttype="HeroAgent" version="5">
<pars>
<par name="_$local_task_param_$_0" type="glm::vec3" value="{x=0;y=0;z=0;}" />
<par name="_$local_task_param_$_1" type="float" value="0" />
</pars>
<node class="Task" id="4">
<property Prototype="Self.HeroAgent::FollowTeammate({x=0;y=0;z=0;},0)" />
<property IsHTN="false" />
<node class="Sequence" id="0">
<node class="Action" id="7">
<property Method="Self.HeroAgent::DebugOut(&quot;ddddd开始跟随&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Condition" id="6">
<property Operator="Equal" />
<property Opl="current_teammate_agent.TeammateAgent::IsValid()" />
<property Opr="const bool true" />
</node>
<node class="Action" id="8">
<property Method="Self.HeroAgent::DebugOut(&quot;跟随2&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Assignment" id="1">
<property CastRight="false" />
<property Opl="glm::vec3 Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="current_teammate_agent.TeammateAgent::GetPos()" />
</node>
<node class="Action" id="9">
<property Method="Self.HeroAgent::DebugOut(&quot;跟随3&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Assignment" id="5">
<property CastRight="false" />
<property Opl="float Self.HeroAgent::_$local_task_param_$_1" />
<property Opr="Self.BaseAgent::RandRangeAsFloat(120,150)" />
</node>
<node class="Action" id="10">
<property Method="Self.HeroAgent::DebugOut(&quot;跟随4&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Action" id="2">
<property Method="Self.HeroAgent::CoFindPathEx(glm::vec3 Self.HeroAgent::_$local_task_param_$_0,float Self.HeroAgent::_$local_task_param_$_1)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Action" id="3">
<property Method="Self.HeroAgent::DebugOut(&quot;ddddd跟随队友&quot;,0,0,0)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</behavior>

View File

@ -27,92 +27,62 @@
<property Method="Self.HeroAgent::RegisterEvents(1:kMobaModeReviveEvent)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="IfElse" id="33">
<node class="Condition" id="34">
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool false" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="IfElse" id="15">
<node class="Condition" id="35">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMoving()" />
<property Opr="const bool true" />
</node>
<node class="True" id="36" />
<node class="SelectorProbability" id="37">
<node class="DecoratorWeight" id="38">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="39">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="IfElse" id="6">
<node class="Or" id="7">
<node class="Condition" id="40">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchHumanEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="Condition" id="41">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="Sequence" id="4">
<node class="Action" id="5">
<property Method="Self.HeroAgent::CoGetNextMobaModeRoadPoint()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="4">
<node class="Action" id="5">
<property Method="Self.HeroAgent::CoGetNextMobaModeRoadPoint()" />
<property ResultOption="BT_INVALID" />
<node class="Sequence" id="21">
<node class="Assignment" id="22">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_1" />
<property Opr="Self.BaseAgent::GetTickCount()" />
</node>
<node class="Sequence" id="21">
<node class="Assignment" id="22">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_1" />
<property Opr="Self.BaseAgent::GetTickCount()" />
<node class="Parallel" id="9">
<property ChildFinishPolicy="CHILDFINISH_ONCE" />
<property ExitPolicy="EXIT_NONE" />
<property FailurePolicy="FAIL_ON_ONE" />
<property SuccessPolicy="SUCCEED_ON_ONE" />
<node class="Action" id="10">
<property Method="Self.HeroAgent::CoFindPath(glm::vec3 Self.HeroAgent::out_point0)" />
<property ResultOption="BT_INVALID" />
<attachment class="Precondition" id="11" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Enter" />
</attachment>
<attachment class="Effector" id="12" flag="effector">
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 1" />
<property Phase="Both" />
</attachment>
</node>
<node class="Parallel" id="9">
<property ChildFinishPolicy="CHILDFINISH_LOOP" />
<property ExitPolicy="EXIT_NONE" />
<property FailurePolicy="FAIL_ON_ONE" />
<property SuccessPolicy="SUCCEED_ON_ONE" />
<node class="Action" id="10">
<property Method="Self.HeroAgent::CoFindPath(glm::vec3 Self.HeroAgent::out_point0)" />
<property ResultOption="BT_INVALID" />
<attachment class="Precondition" id="11" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Enter" />
</attachment>
<attachment class="Effector" id="12" flag="effector">
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 1" />
<property Phase="Both" />
</attachment>
</node>
<node class="DecoratorLoop" id="13">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<attachment class="Precondition" id="14" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Both" />
</attachment>
<node class="Sequence" id="16">
<node class="DecoratorLoop" id="13">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<attachment class="Precondition" id="14" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Both" />
</attachment>
<node class="Sequence" id="16">
<node class="IfElse" id="15">
<node class="Condition" id="17">
<property Operator="Greater" />
<property Opl="Self.BaseAgent::DeltaTime(int Self.HeroAgent::_$local_task_param_$_1)" />
@ -135,15 +105,15 @@
</node>
</node>
<node class="False" id="23" />
<node class="Assignment" id="19">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 1" />
</node>
<node class="Action" id="20">
<property Method="Self.BaseAgent::AbortCoroutine(kCoFindPath)" />
<property ResultOption="BT_SUCCESS" />
</node>
</node>
<node class="Assignment" id="19">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 1" />
</node>
<node class="Action" id="20">
<property Method="Self.BaseAgent::AbortCoroutine(kCoFindPath)" />
<property ResultOption="BT_SUCCESS" />
</node>
</node>
</node>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: task\Pickup.xml-->
<behavior name="task/Pickup" agenttype="HeroAgent" version="5">
<pars>
<par name="_$local_task_param_$_0" type="int" value="0" />
<par name="_$local_task_param_$_1" type="int" value="0" />
<par name="_$local_task_param_$_2" type="glm::vec3" value="{x=0;y=0;z=0;}" />
</pars>
<node class="Task" id="0">
<property Prototype="Self.HeroAgent::PickupItem(0,0,{x=0;y=0;z=0;})" />
<property IsHTN="false" />
<node class="IfElse" id="1">
<node class="Condition" id="2">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchPickupObj()" />
<property Opr="const int 0" />
</node>
<node class="Noop" id="3" />
<node class="Sequence" id="4">
<node class="Assignment" id="15">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 0" />
</node>
<node class="Parallel" id="5">
<property ChildFinishPolicy="CHILDFINISH_ONCE" />
<property ExitPolicy="EXIT_NONE" />
<property FailurePolicy="FAIL_ON_ONE" />
<property SuccessPolicy="SUCCEED_ON_ALL" />
<node class="Sequence" id="7">
<node class="Action" id="6">
<property Method="Self.HeroAgent::CoFindPath(glm::vec3 Self.HeroAgent::out_point0)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Action" id="8">
<property Method="Self.HeroAgent::Pickup()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorLoop" id="9">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<attachment class="Precondition" id="16" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Both" />
</attachment>
<node class="IfElse" id="10">
<node class="Condition" id="11">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::PickupObjIsValid()" />
<property Opr="const bool true" />
</node>
<node class="True" id="12" />
<node class="Sequence" id="13">
<node class="Action" id="14">
<property Method="Self.BaseAgent::AbortCoroutine(kCoFindPath)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Assignment" id="17">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 1" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</behavior>

View File

@ -125,10 +125,6 @@
<property Method="Self.HeroAgent::SetAttackDir(glm::vec3 Self.HeroAgent::tmp_point0)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Action" id="39">
<property Method="Self.HeroAgent::SetBulletAngleOffset(0,30)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="Action" id="29">
<property Method="Self.HeroAgent::ShotNormal(glm::vec3 Self.HeroAgent::tmp_point0)" />
<property ResultOption="BT_SUCCESS" />

View File

@ -1 +0,0 @@
../../exported

View File

@ -1,4 +0,0 @@
{
"api_url": "https://game2006api-test.kingsome.cn/webapp/index.php",
"api_secret_key": "BIgDh5J%uUktooKxT!IM7#m$NtB51%la"
}

View File

@ -1,32 +0,0 @@
[
{
"instance_id" : 1,
"ip": "127.0.0.1",
"listen_port": 7611,
"channel": 0
},
{
"instance_id" : 2,
"ip": "127.0.0.1",
"listen_port": 7612,
"channel": 0
},
{
"instance_id" : 3,
"ip": "127.0.0.1",
"listen_port": 7613,
"channel": 0
},
{
"instance_id" : 6,
"ip": "127.0.0.1",
"listen_port": 7616,
"channel": 0
},
{
"instance_id" : 8,
"ip": "127.0.0.1",
"listen_port": 7618,
"channel": 5990
}
]

View File

@ -1,5 +0,0 @@
[
{
"url": "http://192.168.100.21:8321/webapp/index.php"
}
]

View File

@ -1,12 +0,0 @@
[
{
"instance_id": 1,
"ip": "192.168.100.45",
"listen_port": 7621
},
{
"instance_id": 2,
"ip": "192.168.100.21",
"listen_port": 7621
}
]

View File

@ -1,4 +0,0 @@
{
"api_url": "https://game2006api-test.kingsome.cn/webapp/index.php",
"api_secret_key": "BIgDh5J%uUktooKxT!IM7#m$NtB51%la"
}

View File

@ -1,26 +0,0 @@
[
{
"instance_id" : 1,
"ip": "127.0.0.1",
"listen_port": 7611,
"channel": 0
},
{
"instance_id" : 2,
"ip": "127.0.0.1",
"listen_port": 7612,
"channel": 0
},
{
"instance_id" : 3,
"ip": "127.0.0.1",
"listen_port": 7613,
"channel": 0
},
{
"instance_id" : 8,
"ip": "127.0.0.1",
"listen_port": 7618,
"channel": 5990
}
]

View File

@ -1,5 +0,0 @@
[
{
"url": "http://127.0.0.1:8321/webapp/index.php"
}
]

View File

@ -1,7 +0,0 @@
[
{
"instance_id": 1,
"ip": "127.0.0.1",
"listen_port": 7621
}
]

11
server/bin/monitor.sh Normal file
View File

@ -0,0 +1,11 @@
path_arr=$(echo $PWD|tr '/' '\n')
path_arr=(${path_arr})
GAME_ID=${path_arr[-5]}
if echo $GAME_ID | grep -q '[^0-9]'
then
echo 'game_id参数必须为数字'
exit 1
fi
python ../../third_party/tools/scripts/server/monitor.py gameserver${GAME_ID} '-n1 -i1'

View File

@ -0,0 +1,10 @@
#!/bin/bash
source /etc/profile
source /root/.bash_profile
./gameserver2006 -n $1 -i $2 >> gameserver2006$2_$1.out
echo $? >> start.log
date >> start.log
echo $1 $2 >> start.log
free -m >> start.log

View File

@ -3,7 +3,7 @@
#source /etc/profile
#source /root/.bash_profile
pid=$(ps -ef|grep "gameserver2006 -z 1 -n $2 -i $1"|grep -v grep|awk '{print $2}')
pid=$(ps -ef|grep "gameserver2006 -n $2 -i $1"|grep -v grep|awk '{print $2}')
echo $pid
if [[ $pid != "" ]]
@ -13,4 +13,4 @@ else
echo "pid 为空"
fi
nohup ./gameserver2006 -z 1 -n $2 -i $1 >> gameserver2006$2_$1.out 2>$1 &
nohup ./gameserver2006 -n $2 -i $1 >> gameserver2006$2_$1.out 2>$1 &

View File

@ -1 +0,0 @@
../bt/exported

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Behavior Version="5" NoError="true">
<Node Class="Behaviac.Design.Nodes.Behavior" AgentType="AndroidAgent" Domains="" Enable="true" HasOwnPrefabData="false" Id="-1" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
<DescriptorRefs value="0:" />
<Connector Identifier="GenericChildren">
<Node Class="PluginBehaviac.Nodes.Sequence" Enable="true" HasOwnPrefabData="false" Id="0" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
<Connector Identifier="GenericChildren">
<Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="1" Method="Self.AndroidAgent::CoConnectBattleServer()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_INVALID">
<Comment Background="NoColor" Text="" />
</Node>
<Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="2" Method="Self.AndroidAgent::CoJoin()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_INVALID">
<Comment Background="NoColor" Text="" />
</Node>
<Node Class="PluginBehaviac.Nodes.DecoratorLoop" Count="const int -1" DecorateWhenChildEnds="true" DoneWithinFrame="false" Enable="true" HasOwnPrefabData="false" Id="3" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
<Connector Identifier="GenericChildren">
<Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="6" Method="Self.AndroidAgent::CoUpdateGame()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_INVALID">
<Comment Background="NoColor" Text="" />
</Node>
</Connector>
</Node>
</Connector>
</Node>
</Connector>
</Node>
</Behavior>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Behavior Version="5">
<Node Class="Behaviac.Design.Nodes.Behavior" AgentType="AndroidAgent" Domains="" Enable="true" HasOwnPrefabData="false" Id="-1" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
<DescriptorRefs value="0:" />
<Connector Identifier="GenericChildren">
<Node Class="PluginBehaviac.Nodes.IfElse" Enable="true" HasOwnPrefabData="false" Id="0" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
<Connector Identifier="_condition">
<Node Class="PluginBehaviac.Nodes.Condition" Enable="true" HasOwnPrefabData="false" Id="1" Operator="Equal" Opl="Self.AndroidAgent::IsLoginSuccess()" Opr="const bool true" PrefabName="" PrefabNodeId="-1">
<Comment Background="NoColor" Text="" />
</Node>
</Connector>
<Connector Identifier="_if">
<Node Class="Behaviac.Design.Nodes.ReferencedBehavior" Enable="true" HasOwnPrefabData="false" Id="3" PrefabName="" PrefabNodeId="-1" ReferenceBehavior="const string &quot;android/battle&quot;" Task="&quot;&quot;">
<Comment Background="Gray" Text="" />
</Node>
</Connector>
<Connector Identifier="_else">
<Node Class="PluginBehaviac.Nodes.Action" Enable="true" HasOwnPrefabData="false" Id="2" Method="Self.AndroidAgent::CoLogin()" PrefabName="" PrefabNodeId="-1" ResultFunctor="&quot;&quot;" ResultOption="BT_INVALID">
<Comment Background="NoColor" Text="" />
</Node>
</Connector>
</Node>
</Connector>
</Node>
</Behavior>

View File

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<meta>
<types />
<agents>
<agent classfullname="behaviac::Agent" DisplayName="behaviac::Agent" Desc="behaviac::Agent" IsRefType="true" IsImplemented="true">
<Method Name="VectorLength" DisplayName="VectorLength" Desc="VectorLength" Class="behaviac::Agent" ReturnType="int" ReturnTypeFullName="System.Int32" Static="true" Public="true" istask="false">
<Param Name="param0" Type="const IList&amp;" TypeFullName="System.Collections.IList" DisplayName="param0" Desc="param0" />
</Method>
<Method Name="VectorAdd" DisplayName="VectorAdd" Desc="VectorAdd" Class="behaviac::Agent" ReturnType="void" ReturnTypeFullName="System.Void" Static="true" Public="true" istask="false">
<Param Name="param0" Type="IList&amp;" TypeFullName="System.Collections.IList" DisplayName="param0" Desc="param0" />
<Param Name="param1" Type="const System::Object&amp;" TypeFullName="System.Object" DisplayName="param1" Desc="param1" />
</Method>
<Method Name="VectorRemove" DisplayName="VectorRemove" Desc="VectorRemove" Class="behaviac::Agent" ReturnType="void" ReturnTypeFullName="System.Void" Static="true" Public="true" istask="false">
<Param Name="param0" Type="IList&amp;" TypeFullName="System.Collections.IList" DisplayName="param0" Desc="param0" />
<Param Name="param1" Type="const System::Object&amp;" TypeFullName="System.Object" DisplayName="param1" Desc="param1" />
</Method>
<Method Name="VectorContains" DisplayName="VectorContains" Desc="VectorContains" Class="behaviac::Agent" ReturnType="bool" ReturnTypeFullName="System.Boolean" Static="true" Public="true" istask="false">
<Param Name="param0" Type="IList&amp;" TypeFullName="System.Collections.IList" DisplayName="param0" Desc="param0" />
<Param Name="param1" Type="const System::Object&amp;" TypeFullName="System.Object" DisplayName="param1" Desc="param1" />
</Method>
<Method Name="VectorClear" DisplayName="VectorClear" Desc="VectorClear" Class="behaviac::Agent" ReturnType="void" ReturnTypeFullName="System.Void" Static="true" Public="true" istask="false">
<Param Name="param0" Type="IList&amp;" TypeFullName="System.Collections.IList" DisplayName="param0" Desc="param0" />
</Method>
<Method Name="LogMessage" DisplayName="LogMessage" Desc="LogMessage" Class="behaviac::Agent" ReturnType="void" ReturnTypeFullName="System.Void" Static="true" Public="true" istask="false">
<Param Name="param0" Type="const char*" TypeFullName="System.String" DisplayName="param0" Desc="param0" />
</Method>
</agent>
<agent classfullname="BaseAgent" base="behaviac::Agent" DisplayName="BaseAgent" Desc="BaseAgent" IsRefType="true" IsCustomized="true" IsImplemented="true">
<Method Name="GetTickCount" DisplayName="GetTickCount" Desc="GetTickCount" Class="BaseAgent" ReturnType="int" ReturnTypeFullName="System.Int32" Static="false" Public="false" istask="false" />
<Method Name="RandRange" DisplayName="RandRange" Desc="RandRange" Class="BaseAgent" ReturnType="int" ReturnTypeFullName="System.Int32" Static="false" Public="false" istask="false">
<Param Name="min_val" Type="int" TypeFullName="System.Int32" DisplayName="min_val" Desc="min_val" />
<Param Name="max_val" Type="int" TypeFullName="System.Int32" DisplayName="max_val" Desc="max_val" />
</Method>
<Method Name="RandRangeAsFloat" DisplayName="RandRangeAsFloat" Desc="RandRangeAsFloat" Class="BaseAgent" ReturnType="float" ReturnTypeFullName="System.Single" Static="false" Public="false" istask="false">
<Param Name="min_val" Type="float" TypeFullName="System.Single" DisplayName="min_val" Desc="min_val" />
<Param Name="max_val" Type="float" TypeFullName="System.Single" DisplayName="max_val" Desc="max_val" />
</Method>
<Method Name="Rand" DisplayName="Rand" Desc="Rand" Class="BaseAgent" ReturnType="int" ReturnTypeFullName="System.Int32" Static="false" Public="false" istask="false" />
<Method Name="DeltaTime" DisplayName="DeltaTime" Desc="DeltaTime" Class="BaseAgent" ReturnType="int" ReturnTypeFullName="System.Int32" Static="false" Public="false" istask="false">
<Param Name="time" Type="int" TypeFullName="System.Int32" DisplayName="time" Desc="time" />
</Method>
<Method Name="AbortCoroutine" DisplayName="AbortCoroutine" Desc="AbortCoroutine" Class="BaseAgent" ReturnType="void" ReturnTypeFullName="System.Void" Static="false" Public="false" istask="false">
<Param Name="co_id" Type="int" TypeFullName="System.Int32" DisplayName="co_id" Desc="co_id" />
</Method>
</agent>
<agent classfullname="AndroidAgent" base="BaseAgent" DisplayName="AndroidAgent" Desc="AndroidAgent" IsRefType="true" IsCustomized="true" IsImplemented="true">
<Method Name="IsLoginSuccess" DisplayName="IsLoginSuccess" Desc="IsLoginSuccess" Class="AndroidAgent" ReturnType="bool" ReturnTypeFullName="System.Boolean" Static="false" Public="false" istask="false" />
<Method Name="SearchEnemy" DisplayName="SearchEnemy" Desc="SearchEnemy" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false">
<Param Name="range" Type="int" TypeFullName="System.Int32" DisplayName="range" Desc="range" />
</Method>
<Method Name="NetIsConnected" DisplayName="NetIsConnected" Desc="NetIsConnected" Class="AndroidAgent" ReturnType="bool" ReturnTypeFullName="System.Boolean" Static="false" Public="false" istask="false" />
<Method Name="CoIdle" DisplayName="CoIdle" Desc="CoIdle" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false">
<Param Name="min_val" Type="int" TypeFullName="System.Int32" DisplayName="min_val" Desc="min_val" />
<Param Name="max_val" Type="int" TypeFullName="System.Int32" DisplayName="max_val" Desc="max_val" />
</Method>
<Method Name="CoLogin" DisplayName="CoLogin" Desc="CoLogin" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false" />
<Method Name="CoConnectBattleServer" DisplayName="CoConnectBattleServer" Desc="CoConnectBattleServer" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false" />
<Method Name="CoJoin" DisplayName="CoJoin" Desc="CoJoin" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false" />
<Method Name="IsGameOver" DisplayName="IsGameOver" Desc="IsGameOver" Class="AndroidAgent" ReturnType="bool" ReturnTypeFullName="System.Boolean" Static="false" Public="false" istask="false" />
<Method Name="CoUpdateGame" DisplayName="CoUpdateGame" Desc="CoUpdateGame" Class="AndroidAgent" ReturnType="behaviac::EBTStatus" ReturnTypeFullName="XMLPluginBehaviac.behaviac_EBTStatus" Static="false" Public="false" istask="false" />
</agent>
</agents>
<instances />
</meta>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: android\battle.xml-->
<behavior name="android/battle" agenttype="AndroidAgent" version="5">
<node class="Sequence" id="0">
<node class="Action" id="1">
<property Method="Self.AndroidAgent::CoConnectBattleServer()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Action" id="2">
<property Method="Self.AndroidAgent::CoJoin()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="DecoratorLoop" id="3">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<node class="Action" id="6">
<property Method="Self.AndroidAgent::CoUpdateGame()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</behavior>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: android\test.xml-->
<behavior name="android/test" agenttype="AndroidAgent" version="5">
<node class="IfElse" id="0">
<node class="Condition" id="1">
<property Operator="Equal" />
<property Opl="Self.AndroidAgent::IsLoginSuccess()" />
<property Opr="const bool true" />
</node>
<node class="ReferencedBehavior" id="3">
<property ReferenceBehavior="const string &quot;android/battle&quot;" />
</node>
<node class="Action" id="2">
<property Method="Self.AndroidAgent::CoLogin()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</behavior>

View File

@ -1,71 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_TYPES_H_
#define _BEHAVIAC_TYPES_H_
#include "behaviac/behaviac.h"
#include "behaviac/behaviortree/behaviortree.h"
#include "behaviac/agent/agent.h"
#include "behaviac/common/meta.h"
#include "behaviac/behaviortree/nodes/actions/action.h"
#include "behaviac/behaviortree/nodes/actions/assignment.h"
#include "behaviac/behaviortree/nodes/actions/compute.h"
#include "behaviac/behaviortree/nodes/actions/end.h"
#include "behaviac/behaviortree/nodes/actions/noop.h"
#include "behaviac/behaviortree/nodes/actions/wait.h"
#include "behaviac/behaviortree/nodes/actions/waitforsignal.h"
#include "behaviac/behaviortree/nodes/actions/waitframes.h"
#include "behaviac/behaviortree/nodes/composites/compositestochastic.h"
#include "behaviac/behaviortree/nodes/composites/ifelse.h"
#include "behaviac/behaviortree/nodes/composites/parallel.h"
#include "behaviac/behaviortree/nodes/composites/referencebehavior.h"
#include "behaviac/behaviortree/nodes/composites/selector.h"
#include "behaviac/behaviortree/nodes/composites/selectorloop.h"
#include "behaviac/behaviortree/nodes/composites/selectorprobability.h"
#include "behaviac/behaviortree/nodes/composites/selectorstochastic.h"
#include "behaviac/behaviortree/nodes/composites/sequence.h"
#include "behaviac/behaviortree/nodes/composites/sequencestochastic.h"
#include "behaviac/behaviortree/nodes/composites/withprecondition.h"
#include "behaviac/behaviortree/nodes/conditions/and.h"
#include "behaviac/behaviortree/nodes/conditions/conditionbase.h"
#include "behaviac/behaviortree/nodes/conditions/condition.h"
#include "behaviac/behaviortree/nodes/conditions/false.h"
#include "behaviac/behaviortree/nodes/conditions/or.h"
#include "behaviac/behaviortree/nodes/conditions/true.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwaysfailure.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwaysrunning.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwayssuccess.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorcount.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorcountlimit.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorfailureuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorframes.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoriterator.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorlog.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorloop.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorloopuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratornot.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorrepeat.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorsuccessuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratortime.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorweight.h"
#include "behaviac/behaviortree/attachments/event.h"
#include "behaviac/behaviortree/attachments/attachaction.h"
#include "behaviac/behaviortree/attachments/precondition.h"
#include "behaviac/behaviortree/attachments/effector.h"
#include "behaviac/htn/task.h"
#include "behaviac/fsm/fsm.h"
#include "behaviac/fsm/state.h"
#include "behaviac/fsm/startcondition.h"
#include "behaviac/fsm/transitioncondition.h"
#include "behaviac/fsm/waitstate.h"
#include "behaviac/fsm/waitframesstate.h"
#include "behaviac/fsm/alwaystransition.h"
#include "behaviac/fsm/waittransition.h"
#include "internal/behaviac_agent_headers.h"
#include "internal/behaviac_agent_member_visitor.h"
#endif // _BEHAVIAC_TYPES_H_

View File

@ -1,12 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_AGENT_HEADERS_H_
#define _BEHAVIAC_AGENT_HEADERS_H_
#include "behaviac_headers.h"
// THE FOLLOWING AGENT HEADER FILES IS GENERATED AUTOMATICALLY:
#endif // _BEHAVIAC_AGENT_HEADERS_H_

View File

@ -1,105 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_MEMBER_VISITOR_H_
#define _BEHAVIAC_MEMBER_VISITOR_H_
#include "behaviac_agent_headers.h"
// Agent property and method handlers
struct METHOD_TYPE_BaseAgent_AbortCoroutine { };
template<> inline void BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_AbortCoroutine>(int p0)
{
this->BaseAgent::AbortCoroutine(p0);
}
struct METHOD_TYPE_BaseAgent_DeltaTime { };
template<> inline int BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_DeltaTime>(int p0)
{
return this->BaseAgent::DeltaTime(p0);
}
struct METHOD_TYPE_BaseAgent_GetTickCount { };
template<> inline int BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_GetTickCount>()
{
return this->BaseAgent::GetTickCount();
}
struct METHOD_TYPE_BaseAgent_Rand { };
template<> inline int BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_Rand>()
{
return this->BaseAgent::Rand();
}
struct METHOD_TYPE_BaseAgent_RandRange { };
template<> inline int BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_RandRange>(int p0, int p1)
{
return this->BaseAgent::RandRange(p0, p1);
}
struct METHOD_TYPE_BaseAgent_RandRangeAsFloat { };
template<> inline float BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_RandRangeAsFloat>(float p0, float p1)
{
return this->BaseAgent::RandRangeAsFloat(p0, p1);
}
struct METHOD_TYPE_AndroidAgent_CoConnectBattleServer { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_CoConnectBattleServer>()
{
return this->AndroidAgent::CoConnectBattleServer();
}
struct METHOD_TYPE_AndroidAgent_CoIdle { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_CoIdle>(int p0, int p1)
{
return this->AndroidAgent::CoIdle(p0, p1);
}
struct METHOD_TYPE_AndroidAgent_CoJoin { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_CoJoin>()
{
return this->AndroidAgent::CoJoin();
}
struct METHOD_TYPE_AndroidAgent_CoLogin { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_CoLogin>()
{
return this->AndroidAgent::CoLogin();
}
struct METHOD_TYPE_AndroidAgent_CoUpdateGame { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_CoUpdateGame>()
{
return this->AndroidAgent::CoUpdateGame();
}
struct METHOD_TYPE_AndroidAgent_IsGameOver { };
template<> inline bool AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_IsGameOver>()
{
return this->AndroidAgent::IsGameOver();
}
struct METHOD_TYPE_AndroidAgent_IsLoginSuccess { };
template<> inline bool AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_IsLoginSuccess>()
{
return this->AndroidAgent::IsLoginSuccess();
}
struct METHOD_TYPE_AndroidAgent_NetIsConnected { };
template<> inline bool AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_NetIsConnected>()
{
return this->AndroidAgent::NetIsConnected();
}
struct METHOD_TYPE_AndroidAgent_SearchEnemy { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_SearchEnemy>(int p0)
{
return this->AndroidAgent::SearchEnemy(p0);
}
#endif // _BEHAVIAC_MEMBER_VISITOR_H_

View File

@ -1,330 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#include "behaviac/common/meta.h"
#include "behaviac/common/member.h"
#include "behaviac_agent_meta.h"
namespace behaviac
{
class CMethod_behaviac_Agent_VectorAdd : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorAdd() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorAdd(CMethod_behaviac_Agent_VectorAdd &rhs) : CAgentMethodVoidBase(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorAdd()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
behaviac::Agent::VectorAdd(pValue_param0, pValue_param1);
}
};
class CMethod_behaviac_Agent_VectorClear : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
public:
CMethod_behaviac_Agent_VectorClear() : _param0(0)
{
}
CMethod_behaviac_Agent_VectorClear(CMethod_behaviac_Agent_VectorClear &rhs) : CAgentMethodVoidBase(rhs) , _param0(0)
{
}
~CMethod_behaviac_Agent_VectorClear()
{
BEHAVIAC_DELETE _param0;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 1);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
behaviac::Agent::VectorClear(pValue_param0);
}
};
class CMethod_behaviac_Agent_VectorContains : public CAgentMethodBase<bool>
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorContains() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorContains(CMethod_behaviac_Agent_VectorContains &rhs) : CAgentMethodBase<bool>(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorContains()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
_returnValue->value = behaviac::Agent::VectorContains(pValue_param0, pValue_param1);
}
};
class CMethod_behaviac_Agent_VectorLength : public CAgentMethodBase<int>
{
IInstanceMember* _param0;
public:
CMethod_behaviac_Agent_VectorLength() : _param0(0)
{
}
CMethod_behaviac_Agent_VectorLength(CMethod_behaviac_Agent_VectorLength &rhs) : CAgentMethodBase<int>(rhs) , _param0(0)
{
}
~CMethod_behaviac_Agent_VectorLength()
{
BEHAVIAC_DELETE _param0;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 1);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
_returnValue->value = behaviac::Agent::VectorLength(pValue_param0);
}
};
class CMethod_behaviac_Agent_VectorRemove : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorRemove() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorRemove(CMethod_behaviac_Agent_VectorRemove &rhs) : CAgentMethodVoidBase(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorRemove()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
behaviac::Agent::VectorRemove(pValue_param0, pValue_param1);
}
};
class BehaviorLoaderImplement : BehaviorLoader
{
public:
BehaviorLoaderImplement()
{
AgentMeta::SetBehaviorLoader(this);
}
virtual ~BehaviorLoaderImplement()
{
}
virtual bool load()
{
AgentMeta::SetTotalSignature(3338390249u);
AgentMeta* meta = NULL;
BEHAVIAC_UNUSED_VAR(meta);
// behaviac::Agent
meta = BEHAVIAC_NEW AgentMeta(24743406u);
AgentMeta::GetAgentMetas()[1770892321u] = meta;
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_behaviac_Agent_LogMessage));
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// BaseAgent
meta = BEHAVIAC_NEW AgentMeta(378357712u);
AgentMeta::GetAgentMetas()[2774251291u] = meta;
meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_BaseAgent_AbortCoroutine));
meta->RegisterMethod(1811924796u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_BaseAgent_DeltaTime));
meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_BaseAgent_GetTickCount));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_BaseAgent_LogMessage));
meta->RegisterMethod(3156314303u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_BaseAgent_Rand));
meta->RegisterMethod(1110901686u, BEHAVIAC_NEW CAgentMethod_2< int, int, int >(FunctionPointer_BaseAgent_RandRange));
meta->RegisterMethod(966948371u, BEHAVIAC_NEW CAgentMethod_2< float, float, float >(FunctionPointer_BaseAgent_RandRangeAsFloat));
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// AndroidAgent
meta = BEHAVIAC_NEW AgentMeta(3724796529u);
AgentMeta::GetAgentMetas()[2475098143u] = meta;
meta->RegisterMethod(1352812660u, BEHAVIAC_NEW CAgentMethodVoid_1<int>(FunctionPointer_AndroidAgent_AbortCoroutine));
meta->RegisterMethod(1384709030u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_CoConnectBattleServer));
meta->RegisterMethod(3209797653u, BEHAVIAC_NEW CAgentMethod_2< behaviac::EBTStatus, int, int >(FunctionPointer_AndroidAgent_CoIdle));
meta->RegisterMethod(3402581732u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_CoJoin));
meta->RegisterMethod(2804162432u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_CoLogin));
meta->RegisterMethod(805357126u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_CoUpdateGame));
meta->RegisterMethod(1811924796u, BEHAVIAC_NEW CAgentMethod_1< int, int >(FunctionPointer_AndroidAgent_DeltaTime));
meta->RegisterMethod(2541118574u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_GetTickCount));
meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsGameOver));
meta->RegisterMethod(856196672u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsLoginSuccess));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_AndroidAgent_LogMessage));
meta->RegisterMethod(2514585826u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_NetIsConnected));
meta->RegisterMethod(3156314303u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_AndroidAgent_Rand));
meta->RegisterMethod(1110901686u, BEHAVIAC_NEW CAgentMethod_2< int, int, int >(FunctionPointer_AndroidAgent_RandRange));
meta->RegisterMethod(966948371u, BEHAVIAC_NEW CAgentMethod_2< float, float, float >(FunctionPointer_AndroidAgent_RandRangeAsFloat));
meta->RegisterMethod(3025058903u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_AndroidAgent_SearchEnemy));
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
AgentMeta::Register<behaviac::Agent>("behaviac::Agent");
AgentMeta::Register<BaseAgent>("BaseAgent");
AgentMeta::Register<AndroidAgent>("AndroidAgent");
return true;
}
virtual bool unLoad()
{
AgentMeta::UnRegister<behaviac::Agent>("behaviac::Agent");
AgentMeta::UnRegister<BaseAgent>("BaseAgent");
AgentMeta::UnRegister<AndroidAgent>("AndroidAgent");
return true;
}
};
static BehaviorLoaderImplement _behaviorLoaderImplement_;
static BehaviorLoaderImplement* _pBehaviorLoader_ = NULL;
void InitBehaviorLoader()
{
_pBehaviorLoader_ = BEHAVIAC_NEW BehaviorLoaderImplement();
}
void DestroyBehaviorLoader()
{
if (_pBehaviorLoader_)
{
BEHAVIAC_DELETE _pBehaviorLoader_;
_pBehaviorLoader_ = NULL;
}
}
}

View File

@ -1,42 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_AGENT_PROPERTIES_H_
#define _BEHAVIAC_AGENT_PROPERTIES_H_
#include "behaviac_agent_headers.h"
#include "behaviac_agent_member_visitor.h"
namespace behaviac
{
// ---------------------------------------------------------------------
// Delegate methods
// ---------------------------------------------------------------------
inline void FunctionPointer_behaviac_Agent_LogMessage(char* param0) { behaviac::Agent::LogMessage(param0); }
inline void FunctionPointer_BaseAgent_AbortCoroutine(Agent* self, int co_id) { ((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_AbortCoroutine, void, int >(co_id); }
inline int FunctionPointer_BaseAgent_DeltaTime(Agent* self, int time) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_DeltaTime, int, int >(time); }
inline int FunctionPointer_BaseAgent_GetTickCount(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_GetTickCount, int >(); }
inline void FunctionPointer_BaseAgent_LogMessage(char* param0) { BaseAgent::LogMessage(param0); }
inline int FunctionPointer_BaseAgent_Rand(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Rand, int >(); }
inline int FunctionPointer_BaseAgent_RandRange(Agent* self, int min_val, int max_val) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_RandRange, int, int, int >(min_val, max_val); }
inline float FunctionPointer_BaseAgent_RandRangeAsFloat(Agent* self, float min_val, float max_val) { return (float)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_RandRangeAsFloat, float, float, float >(min_val, max_val); }
inline void FunctionPointer_AndroidAgent_AbortCoroutine(Agent* self, int co_id) { ((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_AbortCoroutine, void, int >(co_id); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoConnectBattleServer(Agent* self) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_CoConnectBattleServer, behaviac::EBTStatus >(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoIdle(Agent* self, int min_val, int max_val) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_CoIdle, behaviac::EBTStatus, int, int >(min_val, max_val); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoJoin(Agent* self) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_CoJoin, behaviac::EBTStatus >(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoLogin(Agent* self) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_CoLogin, behaviac::EBTStatus >(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoUpdateGame(Agent* self) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_CoUpdateGame, behaviac::EBTStatus >(); }
inline int FunctionPointer_AndroidAgent_DeltaTime(Agent* self, int time) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_DeltaTime, int, int >(time); }
inline int FunctionPointer_AndroidAgent_GetTickCount(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_GetTickCount, int >(); }
inline bool FunctionPointer_AndroidAgent_IsGameOver(Agent* self) { return (bool)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_IsGameOver, bool >(); }
inline bool FunctionPointer_AndroidAgent_IsLoginSuccess(Agent* self) { return (bool)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_IsLoginSuccess, bool >(); }
inline void FunctionPointer_AndroidAgent_LogMessage(char* param0) { AndroidAgent::LogMessage(param0); }
inline bool FunctionPointer_AndroidAgent_NetIsConnected(Agent* self) { return (bool)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_NetIsConnected, bool >(); }
inline int FunctionPointer_AndroidAgent_Rand(Agent* self) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_Rand, int >(); }
inline int FunctionPointer_AndroidAgent_RandRange(Agent* self, int min_val, int max_val) { return (int)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_RandRange, int, int, int >(min_val, max_val); }
inline float FunctionPointer_AndroidAgent_RandRangeAsFloat(Agent* self, float min_val, float max_val) { return (float)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_RandRangeAsFloat, float, float, float >(min_val, max_val); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_SearchEnemy(Agent* self, int range) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_SearchEnemy, behaviac::EBTStatus, int >(range); }
}
#endif // _BEHAVIAC_AGENT_PROPERTIES_H_

View File

@ -1,15 +0,0 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_HEADERS_H_
#define _BEHAVIAC_HEADERS_H_
#include "behaviac/behaviac.h"
// YOU SHOULD SET THE HEADER FILES OF YOUR GAME WHEN EXPORTING CPP FILES ON THE BEHAVIAC EDITOR:
#include "base_agent.h"
#include "android_agent.h"
#endif // _BEHAVIAC_HEADERS_H_

View File

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<agents version="1" signature="3338390249" />

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<workspace name="robot2006" folder="behaviors" export="exported" language="cpp" userelativepath="false" version="3">
<export>
<cpp>
<isexported>False</isexported>
<exportfilecount>1</exportfilecount>
<folder>../exported</folder>
<includedfilenames>
<includedfilename>base_agent.h</includedfilename>
<includedfilename>android_agent.h</includedfilename>
</includedfilenames>
</cpp>
</export>
</workspace>

View File

@ -1 +0,0 @@
../gameserver/test_config

3
server/bin/start_instance.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
nohup sh real_start_instance.sh 1 1 2>&1 &

View File

@ -14,11 +14,11 @@ endif()
set(LIB_DIR "ubuntu20.04_g++-9")
message(LIB_DIR: ${LIB_DIR} )
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEW_NUM=1 -DA8_PERFT=1")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1")
if (${ASAN})
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DMYDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -fsanitize=address -DNEW_NUM=1 -fno-omit-frame-pointer -DA8_PERFT=1 -fsanitize-recover=address")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -fsanitize=address -fno-omit-frame-pointer")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DMYDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -DNEW_NUM=1 -DA8_PERFT=1 -fsanitize-recover=address")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1")
endif()
include_directories(
@ -110,7 +110,7 @@ aux_source_directory(.
)
set(EXECUTABLE_OUTPUT_PATH
${PROJECT_BINARY_DIR}/../bin/gameserver/bin
${PROJECT_BINARY_DIR}/../bin
)
add_executable(
@ -144,10 +144,7 @@ target_link_libraries(
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(
gameserver${GAME_ID}
behaviac_gcc_release
#behaviac_gcc_debug
boost_stacktrace_backtrace
boost_stacktrace_addr2line
behaviac_gcc_debug
)
else()
target_link_libraries(

View File

@ -13,26 +13,6 @@
#include "app.h"
#include "jsondatamgr.h"
#include "handlermgr.h"
#include "playermgr.h"
class SocketDisconnectHandler : public std::enable_shared_from_this<SocketDisconnectHandler>
{
public:
a8::CommonCbProc cb;
int socket_handle = 0;
list_head entry;
long long add_tick = 0;
std::shared_ptr<SocketDisconnectHandler> holder;
SocketDisconnectHandler()
{
}
~SocketDisconnectHandler()
{
}
};
class GCClientSession: public a8::MixedSession
{
@ -44,22 +24,19 @@ public:
is_activite = true;
#endif
bool warning = false;
while (buflen - offset >= sizeof(f8::WSProxyPackHead_C)) {
f8::WSProxyPackHead_C* p = (f8::WSProxyPackHead_C*)&buf[offset];
if (p->magic_code == f8::MAGIC_CODE) {
if (buflen - offset < sizeof(f8::WSProxyPackHead_C) + p->packlen) {
break;
}
f8::App::Instance()->AddSocketMsg
(SF_GameGate,
(socket_handle << 16) + p->socket_handle,
p->ip_saddr,
p->msgid,
p->seqid,
&buf[offset + sizeof(f8::WSProxyPackHead_C)],
p->packlen,
0);
App::Instance()->AddSocketMsg(SF_GameGate,
(socket_handle << 16) + p->socket_handle,
p->ip_saddr,
p->msgid,
p->seqid,
&buf[offset + sizeof(f8::WSProxyPackHead_C)],
p->packlen);
offset += sizeof(f8::WSProxyPackHead_C) + p->packlen;
} else {
warning = true;
@ -69,15 +46,10 @@ public:
}
if (warning) {
f8::UdpLog::Instance()->Warning("收到client非法数据包 buflen:%d", {buflen});
f8::UdpLog::Instance()->Warning("收到client非法数据包", {});
}
}
virtual void OnConnect() override
{
f8::UdpLog::Instance()->Warning("OnConnect socket_handle:%d", {socket_handle});
}
virtual void OnRawHttpGet(const std::string& url, const std::string& querystr,
std::string& response) override
{
@ -96,7 +68,6 @@ public:
virtual void OnDisConnect() override
{
f8::UdpLog::Instance()->Warning("OnDisConnect socket_handle:%d", {socket_handle});
f8::MsgQueue::Instance()->PostMsg
(IM_ClientSocketDisconnect,
a8::Args
@ -109,6 +80,12 @@ public:
};
static void CreateGameClientSocket(a8::TcpSession **p)
{
*p = new GCClientSession();
(*p)->SetMaxPacketLen(1024 * 1024 * 10);
}
static void GSListeneron_error(a8::TcpListener*, int type, int errorid)
{
f8::UdpLog::Instance()->Debug("GGListeneron_error %d %d", {type, errorid});
@ -126,7 +103,7 @@ static void GSListeneron_error(a8::TcpListener*, int type, int errorid)
void GGListener::Init()
{
tcp_listener_ = std::make_shared<a8::TcpListener>();
tcp_listener_->RegisterSessionClass<GCClientSession>(1024 * 1024 * 10);
tcp_listener_->on_create_client_socket = CreateGameClientSocket;
tcp_listener_->on_error = GSListeneron_error;
tcp_listener_->bind_address = "0.0.0.0";
@ -140,44 +117,10 @@ void GGListener::Init()
int error_id = args.Get<int>(0);
GGListener::Instance()->OnListenError(error_id);
});
f8::MsgQueue::Instance()->RegisterCallBack
(
IM_ClientSocketDisconnect,
[this] (const a8::Args& args)
{
int gg_socket = args.Get<int>(0);
PlayerMgr::Instance()->OnGateDisconnect(gg_socket);
{
std::vector<std::weak_ptr<SocketDisconnectHandler>> del_handlers;
for (auto& pair : disconnect_listener_hash_) {
unsigned short parent_socket_handle = (pair.first >> 16) & 0xFFFF;
if (parent_socket_handle == gg_socket) {
SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
list_for_each_entry_safe(handle, tmp, &pair.second, entry) {
del_handlers.push_back(handle->holder);
handle->cb(a8::Args({pair.first}));
}
}
}
for (auto handler : del_handlers) {
RemoveSocketDisconnectHandler(handler);
}
}
});
}
void GGListener::UnInit()
{
std::vector<std::weak_ptr<SocketDisconnectHandler>> del_handlers;
for (auto& pair : disconnect_listener_hash_) {
SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
list_for_each_entry_safe(handle, tmp, &pair.second, entry) {
del_handlers.push_back(handle->holder);
}
}
for (auto& handler : del_handlers) {
RemoveSocketDisconnectHandler(handler);
}
tcp_listener_ = nullptr;
}
@ -214,62 +157,6 @@ long long GGListener::GetSentBytesNum()
void GGListener::OnListenError(int errorid)
{
a8::XPrintf("GGListeneron_error %d\n", {errorid});
f8::App::Instance()->Terminate();
App::Instance()->Terminate();
exit(1);
}
bool GGListener::DebugNetMsg(int msg_id)
{
return false;
}
std::weak_ptr<SocketDisconnectHandler> GGListener::AddSocketDisconnectListener(int socket_handle, a8::CommonCbProc cb)
{
auto itr = disconnect_listener_hash_.find(socket_handle);
if (itr == disconnect_listener_hash_.end()) {
disconnect_listener_hash_[socket_handle] = list_head();
itr = disconnect_listener_hash_.find(socket_handle);
INIT_LIST_HEAD(&itr->second);
}
auto p = std::make_shared<SocketDisconnectHandler>();
p->socket_handle = socket_handle;
p->cb = cb;
p->add_tick = a8::XGetTickCount();
list_add_tail(&p->entry, &itr->second);
p->holder = p;
return p;
}
void GGListener::RemoveSocketDisconnectHandler(std::weak_ptr<SocketDisconnectHandler> handler)
{
if (!handler.expired()) {
auto p = handler.lock();
p->cb = nullptr;
p->holder = nullptr;
#if 1
f8::UdpLog::Instance()->Warning("RemoveSocketDisconnectHandler socket_handle:%d time:%d",
{
p->socket_handle,
a8::XGetTickCount() - p->add_tick
});
#endif
list_del_init(&p->entry);
}
}
void GGListener::OnClientDisconnect(int socket_handle)
{
auto itr = disconnect_listener_hash_.find(socket_handle);
if (itr != disconnect_listener_hash_.end()) {
std::vector<std::weak_ptr<SocketDisconnectHandler>> del_handlers;
SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
list_for_each_entry_safe(handle, tmp, &itr->second, entry) {
del_handlers.push_back(handle->holder);
handle->cb(a8::Args({itr->first}));
}
for (auto handler : del_handlers) {
RemoveSocketDisconnectHandler(handler);
}
}
PlayerMgr::Instance()->OnClientDisconnect(socket_handle);
}

View File

@ -4,12 +4,6 @@
#include <f8/types.h>
#include <f8/protoutils.h>
#include <f8/utils.h>
namespace ss
{
class SS_WSP_SocketDisconnect;
}
//game client listener
namespace a8
@ -17,7 +11,6 @@ namespace a8
class TcpListener;
}
class SocketDisconnectHandler;
class GGListener : public a8::Singleton<GGListener>
{
private:
@ -45,15 +38,6 @@ public:
void SendToClient(int sockhandle, unsigned int seqid, T& msg)
{
static int msgid = f8::Net_GetMessageId(msg);
#ifdef MYDEBUG
if (GGListener::Instance()->DebugNetMsg(msgid)) {
a8::XPrintf("SendToClient msgid:%d %s\n",
{
msgid,
f8::PbToJson(&msg)
});
}
#endif
int packet_size = f8::Net_SendProxyMsg(tcp_listener_.get(), sockhandle, seqid, 0, msgid, msg);
if (packet_size > max_packet_size) {
max_packet_size = packet_size;
@ -71,16 +55,10 @@ public:
long long GetSendNodeNum();
long long GetSentNodeNum();
long long GetSentBytesNum();
std::weak_ptr<SocketDisconnectHandler> AddSocketDisconnectListener(int socket_handle, a8::CommonCbProc cb);
void RemoveSocketDisconnectHandler(std::weak_ptr<SocketDisconnectHandler> handler);
bool DebugNetMsg(int msg_id);
void _SS_WSP_SocketDisconnect(f8::MsgHdr* hdr, const ss::SS_WSP_SocketDisconnect& msg);
private:
void OnListenError(int errorid);
void OnClientDisconnect(int socket_handle);
private:
std::shared_ptr<a8::TcpListener> tcp_listener_;
std::map<int, list_head> disconnect_listener_hash_;
};

File diff suppressed because it is too large Load Diff

View File

@ -16,34 +16,45 @@ class Ability
void DecSwitch(int type);
int GetSwitchTimes(int type);
AttrHandle AddAttr(int attr_id, float val);
void RemoveAttr(AttrHandle handler);
float GetAttr(int attr_id);
bool HasAttr(int attr_id);
AttrAbsHandle AddAttrAbs(int attr_id, float value);
void RemoveAttrAbs(AttrAbsHandle handle);
AttrRateHandle AddAttrRate(int attr_id, float value);
void RemoveAttrRate(AttrRateHandle handle);
float GetAttrAbs(int attr_id);
float GetAttrRate(int attr_id);
AttrAdditionHandle AddAttrAddition(int attr_id, float rate);
void RemoveAttrAddition(AttrAdditionHandle handler);
AttrRuduceHandle AddAttrRuduce(int attr_id, float rate);
void RemoveAttrRuduce(AttrRuduceHandle handler);
float GetAttrAddition(int attr_id);
float GetAttrRuduce(int attr_id);
bool HasAddAttr(int attr_id);
bool HasDecAttr(int attr_id);
void GMDelAttr(int attr_id, int idx);
void GMClearAttr();
AttrDirectHandle AddAttrDirect(int attr_id, float value);
void RemoveAttrDirect(AttrDirectHandle handle);
float GetAttrDirect(int attr_id);
void GMDelBaseAttr(int type, int attr_id, int idx);
void GMClearBaseAttr(int type);
void GMDelGrowAttr(int type, int attr_id, int idx);
void GMClearGrowAttr(int type);
std::vector<std::string> GMShowAttrs();
void SetSource(AttrHandle handle, std::shared_ptr<std::function<std::string()>> cb);
private:
void Clear();
void RecalcAttrAbs(int attr_id);
void RecalcAttrRate(int attr_id);
void RecalcAttrAddition(int attr_id);
void RecalcAttrRuduce(int attr_id);
void RecalcAttrDirect(int attr_id);
private:
CreatureWeakPtr owner_;
std::array<std::tuple<float, list_head>, kHAT_End> attr_abs_ = {};
std::array<std::tuple<float, list_head>, kHAT_End> attr_rate_ = {};
std::array<std::tuple<float, list_head>, kHAT_End> attr_add_ = {};
std::array<std::tuple<float, list_head>, kHAT_End> attr_dec_ = {};
std::array<list_head, kHAT_End> attr_list_ = {};
std::array<std::tuple<float, list_head>, kHVAT_End - kHVAT_Begin> vattr_add_ = {};
std::array<std::tuple<float, list_head>, kHVAT_End - kHVAT_Begin> vattr_dec_ = {};
std::array<list_head, kHVAT_End - kHVAT_Begin> vattr_list_ = {};
std::array<std::tuple<float, list_head>, kHAT_End> attr_direct_ = {};
std::array<int, kSwitchTimeEnd> switch_times_ = {};
std::map<int, int> immune_tags_;

View File

@ -49,7 +49,7 @@ void AirDrop::Init()
void AirDrop::Exec(int appear_time, int box_id, int airdrop_id)
{
#ifdef MYDEBUG
#ifdef DEBUG
if (!f8::IsTestEnv()) {
a8::XPrintf("AirDrop appear_time:%d box_id:%d airdrop_id:%d\n",
{
@ -130,7 +130,7 @@ void AirDrop::ShuaMon(const glm::vec3& center, const std::vector<int>& airdrop_m
dir,
team_id);
if (hero) {
#ifdef MYDEBUG
#ifdef DEBUG
room_->BroadcastDebugMsg
(a8::Format("ShuaMon pos:%f,%f,%f hero_id:%d",
{

View File

@ -36,7 +36,7 @@ void AirRaid::Init()
}
},
&room_->xtimer_attacher_);
#ifdef MYDEBUG
#ifdef DEBUG
timers_.push_back(timer_wp);
#endif
});
@ -87,7 +87,7 @@ bool AirRaid::GenAirRaidPos(const mt::AirRaid* raid_meta, glm::vec3& center)
}
}
}
#ifdef MYDEBUG
#ifdef DEBUG
if (humans.size() > 0 && room_->debug_params.find(121) != room_->debug_params.end()) {
center = humans[0]->GetPos().ToGlmVec3();
}
@ -211,7 +211,7 @@ void AirRaid::ExecOneRoundAirRaid(const mt::AirRaid* raid_meta, const glm::vec3&
#endif
}
#ifdef MYDEBUG
#ifdef DEBUG
void AirRaid::NextRaid()
{

View File

@ -8,7 +8,7 @@ class AirRaid
AirRaid(Room* room);
void Init();
#ifdef MYDEBUG
#ifdef DEBUG
void NextRaid();
#endif
@ -20,7 +20,7 @@ class AirRaid
private:
Room* room_ = nullptr;
#ifdef MYDEBUG
#ifdef DEBUG
std::vector<a8::XTimerWp> timers_;
#endif
};

View File

@ -6,7 +6,6 @@
#include "android_agent.h"
#include "movement.h"
#include "netdata.h"
#include "car.h"
#include "f8/btmgr.h"
@ -15,8 +14,6 @@
#include "mt/Text.h"
#include "mt/Hero.h"
#include "mt/Item.h"
#include "mt/Map.h"
#include "mt/BattleBasicAttribute.h"
Android::Android():Human()
{
@ -31,7 +28,6 @@ Android::Android():Human()
Android::~Android()
{
SetDestorying();
if (agent_) {
f8::BtMgr::Instance()->BtDestory(agent_);
agent_ = nullptr;
@ -44,14 +40,13 @@ Android::~Android()
void Android::Initialize()
{
Human::Initialize();
account_id = a8::Format("0000_2006_%d", {robot_meta->id()});
//RandSkin();
RandSkin();
GiveEquip();
RecalcBaseAttr();
SetInfiniteBulletMode();
{
auto context = std::make_shared<BattleDataContext>();
SetNetData(context);
SetBattleContext(context);
context->ForceInit
(
App::Instance()->AllocTempHeroUniId(),
@ -61,10 +56,9 @@ void Android::Initialize()
0,
nullptr
);
GetNetData()->Init(this);
GetBattleContext()->Init(this);
}
RandSkin();
SetHP(GetNetData()->GetMaxHP());
SetHP(GetBattleContext()->GetMaxHP());
SetMaxHP(GetHP());
{
avatar_url = a8::XValue(50001 + rand() % 10).GetString();
@ -72,16 +66,11 @@ void Android::Initialize()
}
{
std::vector<int> skill_list;
GetNetData()->GetSkillList(skill_list);
GetBattleContext()->GetSkillList(skill_list);
for (auto& skill_id : skill_list) {
AddSkill(skill_id);
}
}
if (GetHeroMeta()->GetBasicMeta()) {
SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id()));
} else {
SetHeroLevel(1, 0, nullptr);
}
agent_->SetOwner(this);
f8::BtMgr::Instance()->BtLoad(agent_, "hero/standard");
f8::BtMgr::Instance()->BtSetCurrent(agent_, "hero/standard");
@ -94,20 +83,30 @@ void Android::Update(int delta_time)
return;
}
}
#ifdef MYDEBUG
if (!dead &&
room->debug_params.find(119) != room->debug_params.end()) {
BeKill(VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"),
VW_Gas,
VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"));
a8::UnSetBitFlag(status, CS_Disable);
#ifdef DEBUG
if (room->BattleStarted()) {
if (!dead &&
room->debug_params.find(119) != room->debug_params.end()) {
BeKill(VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"),
VW_Gas,
VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"));
a8::UnSetBitFlag(status, CS_Disable);
}
if (!dead &&
a8::HasBitFlag(status, CS_ForceTeam) &&
App::Instance()->debug_params.find(120) != App::Instance()->debug_params.end()) {
BeKill(VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"),
VW_Gas,
VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"));
a8::UnSetBitFlag(status, CS_Disable);
}
}
#endif
InternalUpdate(delta_time);
shot_hold = false;
CheckShotHold();
++updated_times_;
}
@ -124,15 +123,26 @@ void Android::InternalUpdate(int delta_time)
UpdateAction();
}
if (HasBuffEffect(kBET_Fly)) {
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
GetMutablePos().FromGlmVec3(room->plane.curr_pos);
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
room->grid_service->MoveCreature(this);
return;
}
if (GetMovement()->GetPathSize() > 0 ||
HasBuffEffect(kBET_Sprint)) {
UpdateMoving();
Global::Instance()->verify_set_pos = 1;
UpdateMove();
#ifdef DEBUG1
a8::XPrintf("updatemove old_pos:%f,%f new_pos:%f,%f\n",
{
old_pos.x,
old_pos.y,
GetPos().x,
GetPos().y,
});
#endif
Global::Instance()->verify_set_pos = 0;
} else {
if (HasBuffEffect(kBET_Jump)) {
glm::vec3 dir = GlmHelper::UP;
@ -145,7 +155,7 @@ void Android::InternalUpdate(int delta_time)
if (playing_skill) {
UpdateSkill();
}
#ifdef MYDEBUG
#ifdef DEBUG
if (!room->stop_world) {
agent_->Exec();
}
@ -177,13 +187,6 @@ void Android::GiveEquip()
void Android::RandSkin()
{
#ifdef MYDEBUG
{
Skin& skin = skins[0];
skin.skin_id = 1 + meta->skinlist();
skin.skin_lv = 1;
}
#endif
#if 0
if (!robot_meta->_skin_id.empty()) {
Skin& skin = skins[0];
@ -192,43 +195,3 @@ void Android::RandSkin()
}
#endif
}
void Android::UpdateMoving()
{
if (GetCar()) {
GetCar()->SetAttackDir(GetAttackDir());
if (GetCar()->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (!GetCar()->HasOil()) {
return;
}
}
if (HasBuffEffect(kBET_Passenger)) {
return;
}
Position old_pos = GetPos();
App::Instance()->verify_set_pos = 1;
UpdateMove();
#ifdef MYDEBUG1
a8::XPrintf("updatemove old_pos:%f,%f new_pos:%f,%f\n",
{
old_pos.x,
old_pos.y,
GetPos().x,
GetPos().y,
});
#endif
App::Instance()->verify_set_pos = 0;
if (GetCar() && GetCar()->IsDriver(this)) {
if (!GetCar()->HasBuffEffect(kBET_Sprint)) {
GetCar()->SyncPos();
float dec_oil = old_pos.Distance2D2(GetPos()) * GetCar()->meta->average_oil() / 100;
GetCar()->DecOil(dec_oil);
room->frame_event.AddPropChg(GetCar()->GetWeakPtrRef(),
kPropCarOil,
GetCar()->GetCurOil(),
GetCar()->GetMaxOil());
}
}
}

View File

@ -21,7 +21,6 @@ private:
void InternalUpdate(int delta_time);
void RandSkin();
void UpdateMoving();
friend class PBUtils;
friend class EntityFactory;

View File

@ -1,10 +1,19 @@
#include "precompile.h"
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <mutex>
#include <condition_variable>
#include <regex>
#include <a8/uuid.h>
#include <a8/collision.h>
#include <a8/magicenum.h>
#include <a8/lisp.h>
#include <f8/udplog.h>
#include <f8/btmgr.h>
#include <f8/timer.h>
#include <f8/netmsghandler.h>
#include "app.h"
#include "jsondatamgr.h"
@ -20,7 +29,17 @@
#include "lispenv.h"
#include "perf.h"
#include "ss_msgid.pb.h"
#include "ss_proto.pb.h"
#include "f8/msgqueue.h"
#include "f8/tglog.h"
#include "f8/httpclientpool.h"
#include "f8/btmgr.h"
#include <f8/timer.h>
#include "tracemgr.h"
#include "matchmgr.h"
#include "selfchecker.h"
#include "hero_agent.h"
#include "android_agent.h"
@ -29,6 +48,21 @@
#include "mt/MetaMgr.h"
#include "mt/Skill.h"
struct MsgNode
{
SocketFrom_e sockfrom;
int sockhandle;
unsigned short msgid;
unsigned int seqid;
long ip_saddr;
char* buf;
int buflen;
MsgNode* next;
};
const char* const PROJ_LOG_ROOT_FMT = "/data/logs/%s/logs";
const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log";
static void SavePerfLog()
{
f8::UdpLog::Instance()->Info
@ -38,7 +72,7 @@ static void SavePerfLog()
"max_full_obj:%d max_part_obj:%d max_bullet:%d max_packet:%d "
"his_max_full_obj:%d his_max_part_obj:%d his_max_bullet:%d his_max_packet:%d",
{
f8::App::Instance()->GetMaxRunDelayTime(),
PerfMonitor::Instance()->max_run_delay_time,
RoomMgr::Instance()->RoomNum(),
PerfMonitor::Instance()->entity_num[ET_Player],
PlayerMgr::Instance()->OnlineNum(),
@ -69,9 +103,18 @@ static void SavePerfLog()
GGListener::Instance()->his_max_packet_size = std::max
(GGListener::Instance()->his_max_packet_size, GGListener::Instance()->max_packet_size);
}
f8::App::Instance()->ResetMaxRunDelayTime();
PerfMonitor::Instance()->max_run_delay_time = 0;
PerfMonitor::Instance()->max_dispatchmsg_time = 0;
PerfMonitor::Instance()->max_timer_idle = 0;
PerfMonitor::Instance()->grid_chg_times = 0;
PerfMonitor::Instance()->test_times = 0;
PerfMonitor::Instance()->params[0] = 0;
PerfMonitor::Instance()->params[1] = 0;
PerfMonitor::Instance()->params[2] = 0;
PerfMonitor::Instance()->params[3] = 0;
PerfMonitor::Instance()->params[4] = 0;
PerfMonitor::Instance()->params[5] = 0;
PerfMonitor::Instance()->params[6] = 0;
PerfMonitor::Instance()->max_full_objects_num = 0;
PerfMonitor::Instance()->max_part_objects_num = 0;
PerfMonitor::Instance()->max_bullet_num = 0;
@ -80,16 +123,55 @@ static void SavePerfLog()
f8::HttpClientPool::Instance()->max_user_request_delay = 0;
}
void App::Init()
bool App::Init(int argc, char* argv[])
{
#ifdef MYDEBUG
signal(SIGPIPE, SIG_IGN);
this->argc_ = argc;
this->argv_ = argv;
if (!ParseOpt()) {
if (node_id_ <= 0) {
a8::XPrintf("gameserver启动失败,缺少-n参数\n", {});
} else if (node_id_ > MAX_NODE_ID) {
a8::XPrintf("gameserver启动失败,-n参数不能大于%d\n", {MAX_NODE_ID});
} else if (instance_id_ <= 0) {
a8::XPrintf("gameserver启动失败,缺少-i参数\n", {});
} else if (instance_id_ > MAX_INSTANCE_ID) {
a8::XPrintf("gameserver启动失败,-i参数不能大于%d\n", {MAX_INSTANCE_ID});
}
return false;
}
int debug_mode = 0;
#ifdef DEBUG
debug_mode = 1;
#endif
a8::XPrintf("gameserver starting node_id: %d instance_id:%d pid:%d game_id:%d debug_mode:%d\n",
{
node_id_,
instance_id_,
getpid(),
GAME_ID,
debug_mode
});
loop_mutex_ = std::make_shared<std::mutex>();
loop_cond_ = std::make_shared<std::condition_variable>();
msg_mutex_ = std::make_shared<std::mutex>();
srand(time(nullptr));
InitLog();
#ifdef DEBUG
TraceMgr::Instance()->Init("gameserver2006");
#endif
PerfMonitor::Instance()->Init();
f8::MsgQueue::Instance()->Init();
HandlerMgr::Instance()->Init();
f8::Timer::Instance()->Init();
Perf::Instance()->Init();
f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), false, 0);
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
f8::BtMgr::Instance()->Init("exported");
#ifdef MYDEBUG1
#ifdef DEBUG1
f8::BtMgr::Instance()->SetLogging(true);
#endif
SkillHelper::Init();
@ -98,12 +180,22 @@ void App::Init()
mt::MetaMgr::Instance()->Init();
SelfChecker::Init();
EntityFactory::Instance()->Init();
uuid_.SetMachineId((node_id_ - 1) * MAX_NODE_ID + instance_id_);
KillMgr::Instance()->Init();
RoomMgr::Instance()->Init();
MatchMgr::Instance()->Init();
MapMgr::Instance()->Init();
PlayerMgr::Instance()->Init();
GGListener::Instance()->Init();
HttpProxy::Instance()->Init();
f8::UdpLog::Instance()->Info("gameserver starting instance_id:%d pid:%d debug_mode:%d channel:%d",
{
instance_id_,
getpid(),
debug_mode,
JsonDataMgr::Instance()->channel
});
{
int perf_log_time = 1000 * 30;
f8::Timer::Instance()->SetInterval
@ -115,15 +207,31 @@ void App::Init()
}
});
}
if (HasFlag(7)) {
f8::Timer::Instance()->SetTimeout
(
1000 * 60 * 1,
[] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
App::Instance()->Terminate();
}
}
);
}
return true;
}
void App::UnInit()
{
PlayerMgr::Instance()->UnInit();
RoomMgr::Instance()->UnInit();
//const char* s2 = GetEnumString<int>();
//int i = static_cast<int>(Test_e::kFlyBuffId);
HttpProxy::Instance()->UnInit();
GGListener::Instance()->UnInit();
PlayerMgr::Instance()->UnInit();
RoomMgr::Instance()->UnInit();
MapMgr::Instance()->UnInit();
MatchMgr::Instance()->UnInit();
KillMgr::Instance()->UnInit();
EntityFactory::Instance()->UnInit();
SelfChecker::UnInit();
@ -131,61 +239,311 @@ void App::UnInit()
LispEnv::Instance()->UnInit();
JsonDataMgr::Instance()->UnInit();
f8::BtMgr::Instance()->UnInit();
f8::HttpClientPool::Instance()->UnInit();
HandlerMgr::Instance()->UnInit();
f8::MsgQueue::Instance()->UnInit();
f8::Timer::Instance()->UnInit();
PerfMonitor::Instance()->UnInit();
Perf::Instance()->UnInit();
#ifdef MYDEBUG
f8::TGLog::Instance()->UnInit();
#ifdef DEBUG
TraceMgr::Instance()->UnInit();
#endif
UnInitLog();
FreeSocketMsgQueue();
msg_mutex_ = nullptr;
loop_cond_ = nullptr;
loop_mutex_ = nullptr;
}
int App::Run()
{
int ret = 0;
f8::UdpLog::Instance()->Info("gameserver running", {});
last_run_tick_ = a8::XGetTickCount();
int delta_time = 0;
while (!terminated_) {
a8::tick_t begin_tick = a8::XGetTickCount();
Global::g_nowtime = time(nullptr);
QuickExecute(delta_time);
SlowerExecute(delta_time);
Schedule();
a8::tick_t end_tick = a8::XGetTickCount();
if (end_tick - begin_tick > PerfMonitor::Instance()->max_run_delay_time) {
PerfMonitor::Instance()->max_run_delay_time = end_tick - begin_tick;
}
delta_time = end_tick - begin_tick;
}
return ret;
}
void App::AddSocketMsg(SocketFrom_e sockfrom,
int sockhandle,
long ip_saddr,
unsigned short msgid,
unsigned int seqid,
const char *msgbody,
int bodylen)
{
std::shared_ptr<int[]> sp1(new int[10]());
MsgNode *p = (MsgNode*) malloc(sizeof(MsgNode));
memset(p, 0, sizeof(MsgNode));
p->sockfrom = sockfrom;
p->ip_saddr = ip_saddr;
p->sockhandle = sockhandle;
p->msgid = msgid;
p->seqid = seqid;
p->buf = nullptr;
p->buflen = bodylen;
if (bodylen > 0) {
p->buf = (char*)malloc(bodylen);
memmove(p->buf, msgbody, bodylen);
}
msg_mutex_->lock();
if (bot_node_) {
bot_node_->next = p;
bot_node_ = p;
} else {
top_node_ = p;
bot_node_ = p;
}
++msgnode_size_;
msg_mutex_->unlock();
NotifyLoopCond();
}
void App::QuickExecute(int delta_time)
{
f8::MsgQueue::Instance()->Update();
DispatchMsg();
RoomMgr::Instance()->Update(delta_time);
f8::Timer::Instance()->Update();
}
void App::SlowerExecute(int delta_time)
{
}
void App::NotifyLoopCond()
{
std::unique_lock<std::mutex> lk(*loop_mutex_);
loop_cond_->notify_all();
}
void App::Schedule()
{
std::unique_lock<std::mutex> lk(*loop_mutex_);
loop_cond_->wait_for(lk, std::chrono::milliseconds(1));
}
bool App::HasTask()
{
return RoomMgr::Instance()->HasTask();
{
if (!work_node_) {
msg_mutex_->lock();
if (!work_node_ && top_node_) {
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
}
msg_mutex_->unlock();
}
if (work_node_) {
return true;
}
}
return false;
}
void App::ProcessGameGateMsg(f8::MsgHdr* hdr)
void App::DispatchMsg()
{
f8::NetMsgHandler* handler = f8::GetNetMsgHandler
(&HandlerMgr::Instance()->ggmsghandler,
hdr->msgid);
long long begin_tick = a8::XGetTickCount();
if (!work_node_ && top_node_) {
msg_mutex_->lock();
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
working_msgnode_size_ = msgnode_size_;
msg_mutex_->unlock();
}
f8::MsgHdr hdr;
while (work_node_) {
MsgNode *pdelnode = work_node_;
work_node_ = pdelnode->next;
hdr.msgid = pdelnode->msgid;
hdr.seqid = pdelnode->seqid;
hdr.socket_handle = pdelnode->sockhandle;
hdr.buf = pdelnode->buf;
hdr.buflen = pdelnode->buflen;
hdr.offset = 0;
hdr.ip_saddr = pdelnode->ip_saddr;
switch (pdelnode->sockfrom) {
case SF_GameGate:
{
ProcessGameGateMsg(hdr);
}
break;
}
if (pdelnode->buf) {
free(pdelnode->buf);
}
free(pdelnode);
working_msgnode_size_--;
if (a8::XGetTickCount() - begin_tick > 200) {
break;
}
}//end while
if (!work_node_) {
working_msgnode_size_ = 0;
}
a8::tick_t end_tick = a8::XGetTickCount();
if (end_tick - begin_tick > PerfMonitor::Instance()->max_dispatchmsg_time) {
PerfMonitor::Instance()->max_dispatchmsg_time = end_tick - begin_tick;
}
}
void App::ProcessGameGateMsg(f8::MsgHdr& hdr)
{
if (hdr.msgid == ss::_SS_Ping) {
ss::SS_Pong pongmsg;
GGListener::Instance()->SendProxyMsg(hdr.socket_handle, pongmsg);
return;
}
f8::NetMsgHandler* handler = f8::GetNetMsgHandler(&HandlerMgr::Instance()->ggmsghandler,
hdr.msgid);
if (handler) {
switch (handler->handlerid) {
case HID_RoomMgr:
ProcessNetMsg(handler, RoomMgr::Instance(), hdr);
break;
case HID_GGListener:
ProcessNetMsg(handler, GGListener::Instance(), hdr);
case HID_MatchTeam:
{
auto match_info = MatchMgr::Instance()->GetMatchInfo(hdr.socket_handle);
if (match_info) {
ProcessNetMsg(handler, std::get<1>(*match_info).get(), hdr);
}
}
break;
case HID_PlayerMgr:
ProcessNetMsg(handler, PlayerMgr::Instance(), hdr);
break;
case HID_Player:
{
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(hdr->socket_handle);
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(hdr.socket_handle);
if (hum) {
hdr->hum = hum;
#ifdef MYDEBUG
if (hum->GetSocketHandle() != hdr->socket_handle) {
A8_ABORT();
}
#endif
hdr.hum = hum;
ProcessNetMsg(handler, hum, hdr);
}
}
break;
case HID_CustomMember:
}
}
}
void App::InitLog()
{
std::string filename_fmt = PROJ_LOG_FILENAME_FMT;
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(getpid()));
std::string proj_root_dir = a8::Format(PROJ_ROOT_FMT, {a8::Format(PROJ_NAME_FMT,{GAME_ID})});
std::string proj_log_root_dir = a8::Format(PROJ_LOG_ROOT_FMT, {a8::Format(PROJ_NAME_FMT, {GAME_ID})});
std::string log_file_name = a8::Format(PROJ_LOG_ROOT_FMT,
{a8::Format(PROJ_NAME_FMT, {GAME_ID})}) + "/" + filename_fmt;
a8::MkDir(proj_root_dir);
a8::MkDir(proj_log_root_dir);
f8::UdpLog::Instance()->SetLogFileName(log_file_name);
f8::UdpLog::Instance()->Init();
f8::UdpLog::Instance()->Info("proj_root_dir:%s", {proj_root_dir});
f8::UdpLog::Instance()->Info("proj_log_root_dir:%s", {proj_log_root_dir});
f8::UdpLog::Instance()->Info("log_file_name:%s", {log_file_name});
}
void App::UnInitLog()
{
f8::UdpLog::Instance()->UnInit();
}
bool App::ParseOpt()
{
int ch = 0;
while ((ch = getopt(argc_, argv_, "i:t:r:f:n:")) != -1) {
switch (ch) {
case 'n':
{
auto member = RoomMgr::Instance()->GetCustomMemberBySocket(hdr->socket_handle);
if (member) {
ProcessNetMsg(handler, member.get(), hdr);
node_id_ = a8::XValue(optarg);
}
break;
case 'i':
{
instance_id_ = a8::XValue(optarg);
}
break;
case 't':
{
is_test_mode_ = true;
test_param_ = a8::XValue(optarg);
}
break;
case 'f':
{
std::vector<std::string> strings;
a8::Split(optarg, strings, ',');
for (auto& str : strings) {
flags.insert(a8::XValue(str).GetInt());
}
}
break;
default:
break;
}
}
return instance_id_ > 0 && node_id_ > 0;
}
std::string App::NewUuid()
{
return a8::XValue(uuid.Generate()).GetString();
}
bool App::HasFlag(int flag)
{
return flags.find(flag) != flags.end();
}
void App::SetFlag(int flag)
{
flags.insert(flag);
}
void App::UnSetFlag(int flag)
{
flags.erase(flag);
}
void App::FreeSocketMsgQueue()
{
msg_mutex_->lock();
if (!work_node_) {
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
}
while (work_node_) {
MsgNode* pdelnode = work_node_;
work_node_ = work_node_->next;
if (pdelnode->buf) {
free(pdelnode->buf);
}
free(pdelnode);
if (!work_node_) {
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
}
}
msg_mutex_->unlock();
}
long long App::AllocTempHeroUniId()
@ -211,58 +569,3 @@ long long App::AllocTempWeaponUniId()
++curr_uniid_;
return -curr_uniid_;
}
static std::string GetSelfPath()
{
char self[PATH_MAX] = { 0 };
int nchar = readlink("/proc/self/exe", self, sizeof self);
if (nchar < 0) {
A8_ABORT();
}
std::string path((char*)self);
a8::XPrintf("exe:%s path:%s\n", {self, path});
return path;
}
int App::GetVersion()
{
if (!version_) {
std::string self_path = GetSelfPath();
//self_path = "/data/backups_app/b_game2006_gameserver_ty_z9.1.0.0.1.20231124R2/bin/gameserver2006";
std::vector<std::string> strings;
a8::Split(self_path, strings, '/');
std::string tag = strings.at(strings.size() - 3);
std::vector<std::string> strings2;
a8::Split(tag, strings2, '.');
std::string version_str = strings2.at(strings2.size() - 1);
a8::ReplaceString(version_str, "R", "0");
version_ = std::make_shared<int>(a8::XValue(version_str).GetInt());
a8::XPrintf("%s %s %s\n", {self_path, *version_, version_str});
}
return *version_;
}
const std::string App::GetPkgName()
{
return a8::Format("gameserver2006", {});
}
void App::Update(int delta_time)
{
RoomMgr::Instance()->Update(delta_time);
}
void App::DispatchSocketMsg(f8::MsgHdr* hdr)
{
switch (hdr->sockfrom) {
case SF_GameGate:
{
ProcessGameGateMsg(hdr);
}
break;
default:
{
break;
}
}
}

View File

@ -1,39 +1,105 @@
#pragma once
#include <a8/uuid.h>
#include <a8/singleton.h>
#include <f8/app.h>
class App : public f8::UserApp, public a8::Singleton<App>
#include <f8/protoutils.h>
struct MsgNode;
class App : public a8::Singleton<App>
{
private:
App() {};
friend class a8::Singleton<App>;
public:
#ifdef DEBUG
std::map<int, int> debug_params;
#endif
virtual const std::string GetPkgName() override;
virtual void Init() override;
virtual void UnInit() override;
virtual void Update(int delta_time) override;
virtual bool HasTask() override;
virtual void DispatchSocketMsg(f8::MsgHdr* hdr) override;
bool Init(int argc, char* argv[]);
void UnInit();
int Run();
void AddSocketMsg(SocketFrom_e sockfrom,
int sockhandle,
long ip_saddr,
unsigned short msgid,
unsigned int seqid,
const char *msgbody,
int bodylen);
void NotifyLoopCond();
std::string NewUuid();
bool HasFlag(int flag);
void SetFlag(int flag);
void UnSetFlag(int flag);
long long AllocTempHeroUniId();
long long AllocTempWeaponUniId();
void Terminate() { terminated_ = true; }
int GetInstanceId() const { return instance_id_; }
int GetNodeId() const { return node_id_; }
bool IsTestMode() const { return is_test_mode_; }
int GetTestParam() const { return test_param_; }
bool IsServicing() const { return servicing_; }
void SetServicing(bool open) { servicing_ = open; }
int GetVersion();
public:
int verify_set_pos = 0;
private:
void ProcessGameGateMsg(f8::MsgHdr* hdr);
void QuickExecute(int delta_time);
void SlowerExecute(int delta_time);
void Schedule();
bool HasTask();
void DispatchMsg();
void ProcessGameGateMsg(f8::MsgHdr& hdr);
void InitLog();
void UnInitLog();
bool ParseOpt();
void FreeSocketMsgQueue();
private:
/*
1:
2:
3: battleReport环境
4:
5:
6:
7:
8: httpclientpool压力测试
*/
std::set<int> flags;
private:
int argc_ = 0;
char** argv_ = nullptr;
volatile bool terminated_ = false;
int instance_id_ = 0;
int node_id_ = 0;
bool is_test_mode_ = false;
int test_param_ = 0;
bool servicing_ = true;
a8::uuid::SnowFlake uuid_;
long long last_run_tick_ = 0;
std::shared_ptr<std::mutex> loop_mutex_;
std::shared_ptr<std::condition_variable> loop_cond_;
std::shared_ptr<std::mutex> msg_mutex_;
MsgNode* top_node_ = nullptr;
MsgNode* bot_node_ = nullptr;
MsgNode* work_node_ = nullptr;
long long curr_uniid_ = 0;
std::shared_ptr<int> version_;
public:
int msgnode_size_ = 0 ;
int working_msgnode_size_ = 0;
};

View File

@ -1,79 +1,61 @@
#pragma once
A8_DECLARE_ENUM(HumanAttrType_e,
enum HumanAttrType_e
{
kHAT_Begin = 0,
kHAT_vCurrnetHealth = 1,
kHAT_vHealth = 2,
kHAT_pHealth = 3,
kHAT_pHealthAm = 4,
kHAT_pHealthRateSe = 5,
kHAT_pHealthRateIn = 6,
kHAT_vHealthAm = 7,
kHAT_vHealthRateSe = 8,
kHAT_vHealthRateIn = 9,
kHAT_vAttack = 10,
kHAT_pAttack = 11,
kHAT_pAttackAm = 12,
kHAT_pAttackRateSe = 13,
kHAT_pAttackRateIn = 14,
kHAT_vAttackAm = 15,
kHAT_vAttackRateSe = 16,
kHAT_vAttackRateIn = 17,
kHAT_vDefend = 18,
kHAT_pDefend = 19,
kHAT_pDefendAm = 20,
kHAT_pDefendRateSe = 21,
kHAT_pDefendRateIn = 22,
kHAT_vBlock = 23,
kHAT_pBlock = 24,
kHAT_pBlockAm = 25,
kHAT_pBlockRateSe = 26,
kHAT_pBlockRateIn = 27,
kHAT_vBloPro = 28,
kHAT_vBloDef = 29,
kHAT_vCrit = 30,
kHAT_pCrit = 31,
kHAT_pCritAm = 32,
kHAT_pCritRateSe = 33,
kHAT_pCritRateIn = 34,
kHAT_vCriPro = 35,
kHAT_vCriBon = 36,
kHAT_vSpeedRateIn = 37,
kHAT_vHaste = 38,
kHAT_vDrain = 39,
kHAT_vTenacity = 40,
kHAT_vDamageTakenRateIn = 41,
kHAT_vDamageDealtRateIn = 42,
kHAT_vNormalDamageTakenRateIn = 43,
kHAT_vNormalDamageDealtRateIn = 44,
kHAT_vSkillDamageTakenRateIn = 45,
kHAT_vSkillDamageDealtRateIn = 46,
kHAT_vHealthGainRateIn = 47,
kHAT_vHealDealtRateIn = 48,
kHAT_Hp = 1,
kHAT_HPRecover = 2,
kHAT_Atk = 3,
kHAT_Def = 4,
kHAT_Speed = 5,
kHAT_ShotRange = 6,
kHAT_ShotSpeed = 7,
kHAT_ReloadSpeed = 8,
kHAT_FireRate = 9,
kHAT_Volume = 10,
kHAT_MaxHp = 11,
kHAT_ShotView = 12,
kHAT_ReloadTime = 14,
kHAT_Hold = 55,
kHAT_WeaponDmg = 20,
kHAT_WeaponShotSpeed = 21,
kHAT_WeaponReloadTime = 22,
kHAT_WeaponExplosionRange = 23,
kHAT_WeaponExplosionContinueTime = 24,
kHAT_PoisoningReduction = 25,
kHAT_RescueTime = 26,
kHAT_DrugTime = 27,
kHAT_DrugEfficacy = 28,
kHAT_CarOil = 29,
kHAT_WeaponExplosionDealyTime = 30,
kHAT_RecoverHpAdd = 31,
kHAT_SkillTime = 32,
kHAT_WeaponThrowRange = 33,
kHAT_LUCKY = 34,
kHAT_HP_RATE = 39,
kHAT_ATK_RATE = 40,
kHAT_DEF_RATE = 41,
kHAT_CRIT = 42,
kHAT_CRIT_DAMAGE_RATE = 43,
kHAT_DODGE = 44,
kHAT_DODGE_DAMAGE_RATE = 45,
kHAT_HpRecoverPct = 46,
kHAT_BrainLifePct = 47,
kHAT_ReloadTimePct = 48,
kHAT_BulletSpeed = 49,
kHAT_BulletSpeedPct = 50,
kHAT_CoolDownPct = 51,
kHAT_PickUpPct = 52,
kHAT_Shield = 53,
kHAT_Tenacity = 54,
kHAT_End
);
};
A8_DECLARE_ENUM(HumanVirtualAttrType_e,
enum HumanVirtualAttrType_e
{
kHVAT_Begin = 1000,
kHVAT_Dmg = 1001,
kHVAT_BulletAngle = 1002,
kHVAT_WeaponAtk = 1003,
kHVAT_ShotRange = 1004,
kHVAT_WeaponExplosionContinueTime = 1005,
kHVAT_RescueTime = 1006,
kHVAT_PoisoningReduction = 1007,
kHVAT_WeaponReloadTime = 1008,
kHVAT_CarOil = 1009,
kHVAT_WeaponExplosionDealyTime = 1010,
kHVAT_WeaponDmg = 1011,
kHVAT_WeaponExplosionRange = 1012,
kHVAT_SkillTime = 1013,
kHVAT_DirectAtk = 1014,
kHVAT_Volume = 1015,
kHVAT_FireRate = 1016,
kHVAT_BulletScale = 1017,
kHVAT_End
);
};

View File

@ -1,7 +1,5 @@
#include "precompile.h"
#include <a8/magicenum.h>
#include "attrhelper.h"
float* AttrHelper::GetAttrAbsPtr(std::array<float, kHAT_End>& attr, int attr_id)
@ -48,18 +46,3 @@ bool AttrHelper::ParseAttr(std::shared_ptr<a8::XObject> xobj,
}
return true;
}
std::string AttrHelper::GetAttrName(int attr_id)
{
if (IsValidHumanAttr(attr_id)) {
std::string name = a8::GetEnumName<HumanAttrType_e>(attr_id);
a8::ReplaceString(name, "kHAT_", "");
return name;
} else if (IsValidHumanVirtualAttr(attr_id)) {
std::string name = a8::GetEnumName<HumanVirtualAttrType_e>(attr_id);
a8::ReplaceString(name, "kHVAT_", "Virtual_");
return name;
} else {
return "None";
}
}

View File

@ -13,5 +13,4 @@ class AttrHelper
std::array<float, kHAT_End>& attr_abs,
std::array<float, kHAT_End>& attr_rate);
static std::string GetAttrName(int attr_id);
};

View File

@ -125,7 +125,7 @@ void BaseAgent::CheckCoroutineEvent()
int BaseAgent::Test(int p1)
{
#ifdef MYDEBUG1
#ifdef DEBUG1
a8::XPrintf("Test output:%d\n", {p1});
#endif
return p1;

View File

@ -23,9 +23,6 @@ BatchSync::~BatchSync()
void BatchSync::AddGlobalObject(Creature* c)
{
if (c->IsOb()) {
return;
}
if (global_object_hash_.find(c->GetUniId()) != global_object_hash_.end()) {
abort();
}
@ -47,10 +44,9 @@ void BatchSync::AddGlobalObject(Creature* c)
std::get<1>(*tuple).FillSMSyncPosition(sync_msg);
room_->TraversePlayerList
(
[&sync_msg] (Player* hum) mutable -> bool
[&sync_msg] (Player* hum) mutable
{
hum->SendNotifyMsg(sync_msg);
return true;
});
}
},
@ -68,9 +64,6 @@ void BatchSync::RemoveGlobalObject(int obj_uniid)
void BatchSync::AddTeam(Team* team)
{
if (team->IsViewTeam()) {
return;
}
if (team_hash_.find(team) != team_hash_.end()) {
abort();
}

View File

@ -7,7 +7,6 @@
#include "bornpoint.h"
#include "room.h"
#include "glmhelper.h"
#include "tracemgr.h"
#include "mt/Map.h"
@ -20,15 +19,6 @@ Position BornPoint::RandPoint(Room* room) const
glm::vec3 dir = GlmHelper::UP;
GlmHelper::RotateY(dir, glm::radians((float)(rand() % 360)));
pos.AddGlmVec3(dir * (float)a8::RandEx(10, 100));
#ifdef MYDEBUG
a8::XPrintf("RandPoint wo_meta:%d pos:%d %d %d\n",
{
(long long)((char*)wo_meta.get()),
pos.GetX(),
pos.GetY(),
pos.GetZ()
});
#endif
}
} else {
pos.SetX(5120.000000000000);
@ -60,17 +50,3 @@ Position BornPoint::GetSrcPoint(Room* room) const
}
return pos;
}
Position BornPoint::NewRandPoint(Room* room, int min_radius, int max_radius) const
{
Position pos;
if (wo_meta) {
pos.FromGlmVec3(wo_meta->pos);
glm::vec3 dir = GlmHelper::UP;
GlmHelper::RotateY(dir, glm::radians((float)(rand() % 360)));
pos.AddGlmVec3(dir * (float)a8::RandEx(min_radius, max_radius));
} else {
A8_ABORT();
}
return pos;
}

View File

@ -1,5 +1,10 @@
#pragma once
namespace MetaData
{
struct MapTplThing;
}
namespace mt
{
struct WorldObject;
@ -16,5 +21,4 @@ struct BornPoint
int GetNum();
Position RandPoint(Room* room) const;
Position GetSrcPoint(Room* room) const;
Position NewRandPoint(Room* room, int min_radius, int max_radius) const;
};

View File

@ -1,391 +0,0 @@
#include "precompile.h"
#include <random>
#include <glm/glm.hpp>
#include <a8/mutable_xobject.h>
#include <f8/app.h>
#include <f8/udplog.h>
#include "boxdrop.h"
#include "room.h"
#include "hero.h"
#include "roomobstacle.h"
#include "httpproxy.h"
#include "jsondatamgr.h"
#include "player.h"
#include "mapinstance.h"
#include "human.h"
#include "stats.h"
#include "mt/MapMode.h"
#include "mt/Hero.h"
#include "mt/MapThing.h"
#include "mt/Param.h"
const int BOX_ID = 150001;
BoxDrop::BoxDrop(Room* room):room_(room)
{
}
void BoxDrop::Init()
{
}
void BoxDrop::UnInit()
{
}
void BoxDrop::OnHeroDeadDrop(Hero* hero)
{
int box_num = GetAndDecObjBoxNum(hero->GetUniId());
if (box_num > 0) {
Drop(box_num, hero->GetPos().ToGlmVec3());
}
}
void BoxDrop::OnObstacleDeadDrop(Obstacle* ob)
{
int box_num = GetAndDecObjBoxNum(ob->GetUniId());
if (box_num > 0) {
Drop(box_num, ob->GetPos().ToGlmVec3());
}
}
void BoxDrop::OnHumanDeadDrop(Human* hum)
{
if (hum->box_num <= 0) {
return;
}
if (room_->IsGameOver()) {
return;
}
if (room_->GetVictoryTeam()) {
return;
}
int drop_num = 0;
for (int i = 0; i < hum->box_num; ++i) {
int rnd = a8::RandEx(0, 100);
if (hum->stats->abandon_battle) {
if (rnd <= (mt::Param::s().battle_event_end_loss_rate_quit * 100)) {
++drop_num;
}
} else {
if (rnd <= (mt::Param::s().battle_event_end_loss_rate_dead * 100)) {
++drop_num;
}
}
}
drop_num = std::min(drop_num, hum->box_num);
if (drop_num > 0) {
Drop(drop_num, hum->GetPos().ToGlmVec3());
hum->box_num -= drop_num;
room_->frame_event.AddPropChgEx(hum->GetWeakPtrRef(), kPropBoxNum, 0, hum->box_num,
0, 0, false);
}
}
void BoxDrop::Drop(int num, const glm::vec3& center)
{
for (int i = 0; i < num; ++i) {
glm::vec3 dir = GlmHelper::UP;
GlmHelper::RotateY(dir, a8::RandAngle());
glm::vec3 born_pos = center;
GlmHelper::Normalize(dir);
glm::vec3 start = born_pos;
room_->map_instance->Scale(start);
glm::vec3 real_pos = born_pos;
float distance = 25.0f + rand() % 50;
for (int i = 0; i < 4; ++i) {
glm::vec3 end = born_pos + dir * distance;
glm::vec3 hit_point;
bool hit_result = false;
room_->map_instance->Scale(end);
if (room_->map_instance->Raycast(start,
end,
hit_point,
hit_result,
room_->map_instance->GetMoveIncludeFlags(),
room_->map_instance->GetMoveExcludeFlags())) {
room_->map_instance->UnScale(hit_point);
if (GlmHelper::Norm2D(hit_point - born_pos) > 5) {
real_pos = hit_point;
break;
}
}
GlmHelper::RotateY(dir, glm::radians(90.0f));
}
room_->CreateObstacle(BOX_ID, real_pos.x, real_pos.y, real_pos.z);
}
}
void BoxDrop::OnBattleStart()
{
if (room_->GetMapModeMeta() && room_->GetMapModeMeta()->mapMode() == mt::kTreasureBoxMode) {
get_box_num_timer_ = room_->xtimer.SetIntervalWpEx
(SERVER_FRAME_RATE * 20,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!room_->IsGameOver() && !room_->GetVictoryTeam()) {
if (!alloced_) {
RequestAllocBoxNum();
}
}
}
},
&room_->xtimer_attacher_);
RequestAllocBoxNum();
}
}
void BoxDrop::RequestAllocBoxNum()
{
std::string account_id;
std::string session_id;
if (!FillAccountIdSessionId(account_id, session_id)) {
return;
}
std::string url;
JsonDataMgr::Instance()->GetApiUrl(url);
auto url_params = a8::MutableXObject::CreateObject();
url_params->SetVal("c", "Battle");
url_params->SetVal("a", "requestAllocBoxNum");
url_params->SetVal("room_uuid", room_->GetRoomUuid());
url_params->SetVal("account_id", account_id);
url_params->SetVal("session_id", session_id);
HttpProxy::Instance()->HttpGet
(
[room_wp = room_->weak_from_this(), room_uuid = room_->GetRoomUuid()]
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
{
if (ok) {
f8::UdpLog::Instance()->Info
("RequestAllocBoxNum ok room_uuid:%s %s",
{
room_uuid,
rsp_obj->ToJsonStr()
});
if (rsp_obj->GetType() != a8::XOT_OBJECT ||
!rsp_obj->HasKey("errcode")) {
return;
}
if (!room_wp.expired()) {
auto room = room_wp.lock();
if (rsp_obj->Get("errcode").GetInt() == 0) {
int box_num = rsp_obj->Get("box_num").GetInt();
room->GetBoxDrop()->OnAllocOk(box_num);
} else {
room->GetBoxDrop()->OnAllocFail();
}
}
} else {
f8::UdpLog::Instance()->Warning
("RequestAllocBoxNum error room_uuid:%s",
{
room_uuid
});
}
},
url,
url_params
);
}
void BoxDrop::RequestReturnBoxNum()
{
if (alloc_box_num_ <= 0) {
return;
}
if (room_->GetMapModeMeta() && room_->GetMapModeMeta()->mapMode() == mt::kTreasureBoxMode) {
if (returned_) {
return;
}
returned_ = true;
std::string account_id;
std::string session_id;
if (!FillAccountIdSessionId(account_id, session_id)) {
return;
}
std::string url;
JsonDataMgr::Instance()->GetApiUrl(url);
auto url_params = a8::MutableXObject::CreateObject();
url_params->SetVal("c", "Battle");
url_params->SetVal("a", "requestReturnBoxNum");
url_params->SetVal("account_id", account_id);
url_params->SetVal("session_id", session_id);
url_params->SetVal("room_uuid", room_->GetRoomUuid());
url_params->SetVal("used_num", GetUsedBoxNum());
url_params->SetVal("alloc_box_num", alloc_box_num_);
HttpProxy::Instance()->HttpGet
(
[room_uuid = room_->GetRoomUuid()]
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
{
if (ok) {
f8::UdpLog::Instance()->Info
("RequestReturnBoxNum ok room_uuid:%s %s",
{
room_uuid,
rsp_obj->ToJsonStr()
});
if (rsp_obj->GetType() != a8::XOT_OBJECT ||
!rsp_obj->HasKey("errcode")) {
return;
}
} else {
f8::UdpLog::Instance()->Warning
("RequestReturnBoxNum error room_uuid:%s",
{
room_uuid
});
}
},
url,
url_params
);
}
}
bool BoxDrop::FillAccountIdSessionId(std::string& account_id, std::string& session_id)
{
bool ok = false;
room_->TraversePlayerList
([&ok, &account_id, &session_id] (Player* hum) -> bool
{
ok = true;
account_id = hum->account_id;
session_id = hum->session_id;
return true;
});
return ok;
}
void BoxDrop::OnAllocOk(int box_num)
{
if (!get_box_num_timer_.expired()) {
room_->xtimer.Delete(get_box_num_timer_);
}
if (alloced_) {
return;
}
alloced_ = true;
alloc_box_num_ = box_num;
AllocBoxToRoom();
}
void BoxDrop::OnAllocFail()
{
if (!get_box_num_timer_.expired()) {
room_->xtimer.Delete(get_box_num_timer_);
}
}
void BoxDrop::AllocBoxToRoom()
{
if (alloc_box_num_ <= 0) {
return;
}
std::vector<Entity*> all_list;
std::vector<Creature*> hero_list;
std::vector<Obstacle*> box_list;
room_->TraverseEntityList
(
[this, &all_list, &hero_list, &box_list] (Entity* e) -> bool
{
if (e->IsCreature(room_) && ((Creature*)e)->IsHero()) {
Hero* hero = (Hero*)e;
if (hero->meta->HasDrop()) {
hero_list.push_back(hero);
all_list.push_back(e);
}
} else if (e->IsRoomObstacle()) {
RoomObstacle* ob = (RoomObstacle*)e;
if (ob->meta->HasDrop()) {
box_list.push_back(ob);
all_list.push_back(e);
}
}
return true;
});
std::shuffle(all_list.begin(),
all_list.end(),
std::default_random_engine(a8::XGetTickCount()));
std::shuffle(hero_list.begin(),
hero_list.end(),
std::default_random_engine(a8::XGetTickCount()));
std::shuffle(box_list.begin(),
box_list.end(),
std::default_random_engine(a8::XGetTickCount()));
#ifdef MYDEBUG
f8::UdpLog::Instance()->Info
("AllocBoxToRoom room_uuid:%s all:%d hero:%d box:%d",
{
room_->GetRoomUuid(),
all_list.size(),
hero_list.size(),
box_list.size()
});
#endif
for (int i = 0; i < alloc_box_num_; ++i) {
if (drop_hash_.size() < all_list.size()) {
drop_hash_[all_list.at(i)->GetUniId()] = 1;
}
}
}
int BoxDrop::GetAndDecObjBoxNum(int uniid)
{
auto itr = drop_hash_.find(uniid);
if (itr != drop_hash_.end()) {
int num = itr->second;
itr->second = 0;
return num;
}
return 0;
}
int BoxDrop::GetUsedBoxNum()
{
int num = 0;
room_->TraverseHumanList
(
[&num] (Human* hum) -> bool
{
num += hum->box_num;
return true;
});
return num;
}
bool BoxDrop::GetNextBoxPos(glm::vec3& pos)
{
for (auto& pair : drop_hash_) {
if (pair.second > 0) {
Entity* e = room_->GetEntityByUniId(pair.first);
if (e) {
pos = e->GetPos().ToGlmVec3();
return true;
}
}
}
return false;
}
void BoxDrop::DropByUuid(int obj_uniid, const glm::vec3& center)
{
int box_num = GetAndDecObjBoxNum(obj_uniid);
if (box_num > 0) {
Drop(box_num, center);
}
}

View File

@ -1,41 +0,0 @@
#pragma once
class Room;
class Hero;
class Obstacle;
class Human;
class BoxDrop : public std::enable_shared_from_this<BoxDrop>
{
public:
BoxDrop(Room* room);
void Init();
void UnInit();
void OnBattleStart();
void OnHeroDeadDrop(Hero* hero);
void OnObstacleDeadDrop(Obstacle* ob);
void OnHumanDeadDrop(Human* hum);
void RequestReturnBoxNum();
bool GetNextBoxPos(glm::vec3& pos);
void DropByUuid(int obj_uniid, const glm::vec3& center);
private:
void Drop(int num, const glm::vec3& center);
void RequestAllocBoxNum();
bool FillAccountIdSessionId(std::string& account_id, std::string& session_id);
void OnAllocOk(int box_num);
void OnAllocFail();
void AllocBoxToRoom();
int GetAndDecObjBoxNum(int uniid);
int GetUsedBoxNum();
private:
Room* room_ = nullptr;
a8::XTimerWp get_box_num_timer_;
int alloc_box_num_ = 0;
bool alloced_ = false;
bool returned_ = false;
std::map<int, int> drop_hash_;
};

View File

@ -3,8 +3,6 @@
#include <math.h>
#include <float.h>
#include <a8/magicenum.h>
#include "buff.h"
#include "human.h"
#include "room.h"
@ -51,50 +49,10 @@ void Buff::Init()
res_scale = meta->GetResScale(this);
res_scale_frameno = owner->room->GetFrameNo();
}
#ifdef MYDEBUG
switch (meta->buff_effect()) {
case kBET_InRescue:
case kBET_Rescuer:
{
a8::XPrintf("add jiuyuan role_name:%s type:%s buff_id:%d buff_effect:%\n",
{
owner->GetName(),
owner->IsPlayer() ? "player" : "android",
meta->buff_id(),
a8::GetEnumName<BuffEffectType_e>(meta->buff_effect())
});
}
break;
default:
{
}
break;
}
#endif
}
void Buff::UnInit()
{
#ifdef MYDEBUG
switch (meta->buff_effect()) {
case kBET_InRescue:
case kBET_Rescuer:
{
a8::XPrintf("remove jiuyuan role_name:%s type:%s buff_id:%d buff_effect:%\n",
{
owner->GetName(),
owner->IsPlayer() ? "player" : "android",
meta->buff_id(),
a8::GetEnumName<BuffEffectType_e>(meta->buff_effect())
});
}
break;
default:
{
}
break;
}
#endif
list_del_init(&effect_entry);
if (!list_empty(&depend_entry)) {
list_del_init(&depend_entry);
@ -135,14 +93,16 @@ void Buff::InternalTimerAddBuff()
auto caster_state = std::make_shared<SkillCasterState>();
caster_.Get()->FillSkillCasterState(caster_state.get());
auto add_buff_id = std::make_shared<int>(0);
#if 1
const mt::Skill* skill = skill_meta;
#else
const mt::Skill* skill = caster_.Get()->CurrentSkillMeta();
#endif
auto timer_func =
[this, caster_state, skill, add_buff_id] (int event, const a8::Args* args)
[this, caster_state, skill] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
int buff_id = meta->buff_id();
if (!caster_state->caster.Get()) {
return;
}
@ -156,8 +116,8 @@ void Buff::InternalTimerAddBuff()
receiver->context_pos = receiver->GetPos();
#endif
//int buff_id = meta->_int_buff_param2;
const mt::Buff* buff_meta = mt::Buff::GetById(*add_buff_id);
int buff_id = meta->_int_buff_param2;
const mt::Buff* buff_meta = mt::Buff::GetById(buff_id);
if (buff_meta) {
SkillCasterState old_caster_state;
caster.Get()->FillSkillCasterState(&old_caster_state);
@ -179,7 +139,6 @@ void Buff::InternalTimerAddBuff()
switch (meta->buff_effect() ) {
case kBET_DelayAddBuff:
{
*add_buff_id = meta->_int_buff_param2;
owner->room->xtimer.SetTimeoutEx
(
param1 * SERVER_FRAME_RATE,
@ -190,7 +149,6 @@ void Buff::InternalTimerAddBuff()
break;
case kBET_IntervalAddBuff:
{
*add_buff_id = meta->_int_buff_param2;
owner->room->xtimer.SetIntervalEx
(
param1 * SERVER_FRAME_RATE,
@ -199,25 +157,6 @@ void Buff::InternalTimerAddBuff()
);
}
break;
case kBET_PhaseAddBuff:
{
*add_buff_id = meta->_int_buff_param1;
meta->TraverseParams
(
[this, timer_func] (int idx, const std::string& val) -> bool {
if (!val.empty() && idx > 0) {
float param = meta->GetBuffParam(this, idx);
owner->room->xtimer.SetTimeoutEx
(
param * SERVER_FRAME_RATE,
timer_func,
&xtimer_attacher
);
}
return true;
});
}
break;
default:
{
}
@ -237,7 +176,7 @@ bool Buff::FreezeOperate()
void Buff::RecoverHoldWeapons()
{
#ifdef MYDEBUG1
#ifdef DEBUG1
caster_.Get()->SendDebugMsg(a8::Format("RecoverHoldWeapons buff:%d hold_curr_weapon_idx:%d",
{
meta->buff_id(),
@ -263,7 +202,7 @@ void Buff::RecoverHoldWeapons()
}
}
}
#ifdef MYDEBUG1
#ifdef DEBUG1
for (auto& w : caster_.Get()->weapons) {
caster_.Get()->SendDebugMsg(a8::Format("weapon_idx:%d weapon_id:%d",
{
@ -355,7 +294,7 @@ void Buff::PreProcess()
}
break;
}
#ifdef MYDEBUG
#ifdef DEBUG
if (owner->IsPlayer()) {
if (meta->buff_effect() == kBET_Vertigo) {
int i = 0;
@ -387,8 +326,7 @@ void Buff::ProcSputteringFunc(Bullet* bullet)
0,
0,
0,
nullptr,
bullet->shot_uniid);
nullptr);
auto p = std::make_shared<VirtualBullet>();
p->bullet_uniid = bullet_uniid;
p->weapon_uniid = bullet->weapon_uniid;
@ -402,7 +340,6 @@ void Buff::ProcSputteringFunc(Bullet* bullet)
p->dir = bullet_dir;
p->born_pos = bullet_born_pos;
p->born_dir = bullet_dir;
p->shot_uniid = bullet->shot_uniid;
p->Init();
owner->room->AddTask(bullet_uniid, std::make_shared<a8::CommonCbProcEx>
(
@ -423,44 +360,3 @@ void Buff::Activate()
void Buff::Deactivate()
{
}
int Buff::IncV(int key, int val)
{
SetV(key, GetV(key) + val);
return GetV(key);
}
int Buff::DecV(int key, int val)
{
return IncV(key, -val);
}
int Buff::GetV(int key)
{
if (!dyn_data_) {
return 0;
}
auto itr = dyn_data_->find(key);
if (itr != dyn_data_->end()) {
return itr->second;
}
return 0;
}
void Buff::SetV(int key, int val)
{
if (!dyn_data_) {
dyn_data_ = std::make_shared<std::map<int, int>>();
}
(*dyn_data_)[key] = val;
}
void Buff::PreExec(const a8::Args* args)
{
}
void Buff::PostExec(const a8::Args* args)
{
}

View File

@ -37,7 +37,6 @@ class Buff
float res_scale = 1;
long long res_scale_frameno = 0;
std::shared_ptr<std::vector<float>> buff_vars;
std::shared_ptr<std::list<int>> child_buff_uniids;
Buff();
virtual ~Buff();
@ -51,10 +50,6 @@ class Buff
CreatureWeakPtr& GetCaster();
void SetCaster(Creature* caster);
virtual bool IsValid() { return is_valid_; };
int IncV(int key, int val);
int DecV(int key, int val);
int GetV(int key);
void SetV(int key, int val);
void CalcPassengerShotOffset();
@ -62,8 +57,6 @@ class Buff
virtual void Activate();
virtual void Deactivate();
virtual void PreExec(const a8::Args* args);
virtual void PostExec(const a8::Args* args);
protected:
void ClearEventHandlers();
@ -79,7 +72,6 @@ protected:
std::list<std::weak_ptr<EventHandler>> event_handlers_;
CreatureWeakPtr caster_;
std::list<std::weak_ptr<Effect>> effect_list_;
std::shared_ptr<std::map<int, int>> dyn_data_;
friend class PBUtils;
};

View File

@ -17,6 +17,11 @@ void AutoShotBuff::Activate()
owner->AsHuman()->shot_hold = true;
owner->AsHuman()->series_shot_frames = 0;
}
} else if (a8::TIMER_DELETE_EVENT == event) {
if (owner->IsHuman()) {
owner->AsHuman()->shot_hold = false;
owner->AsHuman()->series_shot_frames = 0;
}
}
},
&xtimer_attacher);
@ -24,8 +29,5 @@ void AutoShotBuff::Activate()
void AutoShotBuff::Deactivate()
{
if (owner->IsHuman()) {
owner->AsHuman()->shot_hold = false;
owner->AsHuman()->series_shot_frames = 0;
}
}

View File

@ -11,18 +11,6 @@
void BeatBackBuff::Activate()
{
if (caster_.Get()) {
#if 1
if (std::abs(caster_.Get()->GetAttackDir().x) > FLT_EPSILON ||
std::abs(caster_.Get()->GetAttackDir().y) > FLT_EPSILON) {
float distance = meta->GetBuffParam1(this);
if (std::abs(distance) > 0) {
glm::vec3 old_move_dir = owner->GetMoveDir();
owner->SetMoveDir(caster_.Get()->GetAttackDir());
owner->ForwardMove(distance);
owner->SetMoveDir(old_move_dir);
}
}
#else
if (std::abs(caster_.Get()->context_dir.x) > FLT_EPSILON ||
std::abs(caster_.Get()->context_dir.x) > FLT_EPSILON) {
if (std::abs(meta->_int_buff_param1) > 0) {
@ -32,7 +20,6 @@ void BeatBackBuff::Activate()
owner->SetMoveDir(old_move_dir);
}
}
#endif
}
}

View File

@ -26,6 +26,7 @@
#include "buff/internal_add.h"
#include "buff/jump.h"
#include "buff/machine_gun.h"
#include "buff/once_chg_attr.h"
#include "buff/passenger.h"
#include "buff/pull.h"
#include "buff/pull_to_walkable.h"
@ -41,19 +42,24 @@
#include "buff/use_skill.h"
#include "buff/invincible.h"
#include "buff/modify_attr.h"
#include "buff/modify_base_attr.h"
#include "buff/modify_grow_attr.h"
#include "buff/direct_set_attr.h"
#include "buff/vertigo.h"
#include "buff/cond_add.h"
#include "buff/distance_dmg_addition.h"
#include "buff/downed.h"
#include "buff/phase_add.h"
#include "mt/Buff.h"
std::shared_ptr<Buff> BuffFactory::MakeBuff(const mt::Buff* buff_meta)
{
switch (buff_meta->buff_effect()) {
case kBET_ModifyAttr:
return std::make_shared<ModifyAttrBuff>();
case kBET_ModifyBaseAttr:
return std::make_shared<ModifyBaseAttrBuff>();
case kBET_ModifyGrowAttr:
return std::make_shared<ModifyGrowAttrBuff>();
case kBET_DirectSetAttr:
return std::make_shared<DirectSetAttrBuff>();
case kBET_SummonLoot:
return std::make_shared<SummonLootBuff>();
case kBET_DistanceDmgAddition:
@ -98,12 +104,12 @@ std::shared_ptr<Buff> BuffFactory::MakeBuff(const mt::Buff* buff_meta)
return std::make_shared<InWaterBuff>();
case kBET_IntervalAddBuff:
return std::make_shared<InternalAddBuff>();
case kBET_PhaseAddBuff:
return std::make_shared<PhaseAddBuff>();
case kBET_Jump:
return std::make_shared<JumpBuff>();
case kBET_MachineGun:
return std::make_shared<MachineGunBuff>();
case kBET_OnceChgAttr:
return std::make_shared<OnceChgAttrBuff>();
case kBET_Passenger:
return std::make_shared<PassengerBuff>();
case kBET_PullToWalkable:
@ -128,12 +134,12 @@ std::shared_ptr<Buff> BuffFactory::MakeBuff(const mt::Buff* buff_meta)
return std::make_shared<UseSkillBuff>();
case kBET_Invincible:
return std::make_shared<InvincibleBuff>();
case kBET_ModifyAttr:
return std::make_shared<ModifyBuff>();
case kBET_Vertigo:
return std::make_shared<VertigoBuff>();
case kBET_CondAdd:
return std::make_shared<CondAddBuff>();
case kBET_Down:
return std::make_shared<DownedBuff>();
default:
return std::make_shared<Buff>();
}

File diff suppressed because it is too large Load Diff

View File

@ -35,28 +35,15 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int,
kPlayFlyEffect = 35,
kLispEval = 36,
kSpecCenterRangeHoldBuff = 37,
kThrowKnife = 38,
kDirectAbsDecHP = 39,
kAccumulatePower = 40,
kCallShot = 41,
kBatchRandomPosSummonObstacle = 42,
kOnBreakSkill = 43,
kBreakSkill = 44,
kBuffEffectCondAdd = 45,
kRandAdd = 46,
kShowExplosion = 47,
kAddArmorShield = 48,
kBulletDmgCalcProc = 49,
);
class CallFuncBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
virtual void PreExec(const a8::Args* args) override;
virtual void PostExec(const a8::Args* args) override;
private:
void ProcIntervalRangeAddBuffFunc();
@ -82,23 +69,9 @@ class CallFuncBuff : public Buff
void PlayFlyEffect();
void LispEval();
void SpecCenterRangeHoldBuff();
void ThrowKnife();
void AccumulatePower();
void Shot();
void BatchRandomPosSummonObstacle();
void OnBreakSkill();
void BreakSkill();
void BuffEffectCondAdd();
void RandAdd();
void ShowExplosion();
void AddArmorShield();
void BulletDmgCalcProc();
void InternalRangeHoldBuff(std::function<bool(glm::vec3&)> get_center_func);
void OnBreakSkillPreExec();
void OnBreakSkillPostExec();
float hold_param2_ = 0.0;
Weapon* hold_weapon_ = nullptr;
std::function<void()> deactivate_cb_ = nullptr;

View File

@ -0,0 +1,26 @@
#include "precompile.h"
#include "buff/direct_set_attr.h"
#include "creature.h"
#include "human.h"
#include "car.h"
#include "ability.h"
#include "mt/Buff.h"
void DirectSetAttrBuff::Activate()
{
int attr_id = meta->_int_buff_param1;
float value = meta->GetBuffParam2(this);
if (IsValidHumanAttr(attr_id)) {
handle_ = owner->GetAbility()->AddAttrDirect(attr_id, value);
}
}
void DirectSetAttrBuff::Deactivate()
{
if (!handle_.expired()) {
owner->GetAbility()->RemoveAttrDirect(handle_);
}
}

View File

@ -2,11 +2,13 @@
#include "buff.h"
class PhaseAddBuff : public Buff
class DirectSetAttrBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
private:
AttrDirectHandle handle_;
};

View File

@ -38,9 +38,7 @@ void DiveBuff::Activate()
0,
0,
"water",
dmg_out,
0,
0);
dmg_out);
}
},
&xtimer_attacher

View File

@ -1,27 +0,0 @@
#include "precompile.h"
#include "buff/downed.h"
#include "creature.h"
#include "human.h"
#include "room.h"
#include "mt/Buff.h"
void DownedBuff::Activate()
{
if (!owner->room->IsDestorying() && !owner->room->IsGameOver()) {
if (owner->IsHuman()) {
owner->AsHuman()->SendViewerUiMemberUpdate({owner->GetUniId()});
}
}
}
void DownedBuff::Deactivate()
{
if (!owner->room->IsDestorying() && !owner->room->IsGameOver()) {
if (owner->IsHuman()) {
owner->AsHuman()->SendViewerUiMemberUpdate({owner->GetUniId()});
}
}
}

View File

@ -7,7 +7,6 @@
#include "trigger.h"
#include "collision.h"
#include "human.h"
#include "ability.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
@ -45,12 +44,6 @@ void HideBuff::Activate()
&xtimer_attacher
);
}
if (meta->_int_buff_param1 > 0) {
owner->GetAbility()->IncSwitch(kHideBuffMoveShow);
}
if (meta->_int_buff_param6 > 0) {
owner->GetAbility()->IncSwitch(kHideBuffAimingShow);
}
}
void HideBuff::Deactivate()
@ -62,12 +55,6 @@ void HideBuff::Deactivate()
}
}
alert_buff_hash_.clear();
if (meta->_int_buff_param1 > 0) {
owner->GetAbility()->DecSwitch(kHideBuffMoveShow);
}
if (meta->_int_buff_param6 > 0) {
owner->GetAbility()->DecSwitch(kHideBuffAimingShow);
}
}
void HideBuff::AddInRangeObject(Creature* target)

View File

@ -57,4 +57,24 @@ void MachineGunBuff::SwitchWeapons()
void MachineGunBuff::ProcSkill()
{
if (skill_meta && skill_meta->_number_meta) {
switch (skill_meta->GetMagicId()) {
case MAGIC_20201_HX:
{
owner->room->xtimer.ModifyTime
(remover_timer,
skill_meta->_number_meta->_float_time * 1000 / FRAME_RATE_MS);
owner->GetTrigger()->DispatchEvent(kStartSwitchWeaponBuffEvent, {this});
}
break;
case MAGIC_20401_MAO:
{
}
break;
default:
{
}
break;
}
}
}

View File

@ -1,7 +1,5 @@
#include "precompile.h"
#include <f8/app.h>
#include "buff/modify_attr.h"
#include "creature.h"
@ -9,39 +7,12 @@
#include "car.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
void ModifyAttrBuff::Activate()
void ModifyBuff::Activate()
{
int attr_id = meta->_int_buff_param1;
float value = meta->GetBuffParam2(this);
if (f8::App::Instance()->GetInstanceId() != 3) {
attr_handle_ = owner->GetAbility()->AddAttr(attr_id, value);
#ifdef MYDEBUG
if (!attr_handle_.expired()) {
std::string source_name = a8::Format
("<-buff.%d.%d.%s",
{
meta->buff_id(),
skill_meta ? skill_meta->skill_id() : 0,
GetCaster().Get() ? (GetCaster().Get() == owner ? "self" : GetCaster().Get()->GetName() )
: "none"
});
auto cb = std::make_shared<std::function<std::string()>>
(
[source_name] () -> std::string
{
return source_name;
});
owner->GetAbility()->SetSource(attr_handle_, cb);
}
#endif
}
}
void ModifyAttrBuff::Deactivate()
void ModifyBuff::Deactivate()
{
if (!attr_handle_.expired()) {
owner->GetAbility()->RemoveAttr(attr_handle_);
}
}

View File

@ -1,14 +1,11 @@
#pragma once
#include "buff.h"
#include "ability.h"
class ModifyAttrBuff : public Buff
class ModifyBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
private:
AttrHandle attr_handle_;
};

View File

@ -0,0 +1,43 @@
#include "precompile.h"
#include "buff/modify_base_attr.h"
#include "creature.h"
#include "human.h"
#include "car.h"
#include "mt/Buff.h"
void ModifyBaseAttrBuff::Activate()
{
int attr_id = meta->_int_buff_param1;
if (IsValidHumanAttr(attr_id)) {
float value = meta->GetBuffParam2(this);
switch (meta->_int_buff_param4) {
case 1:
{
rate_handle_ = owner->GetAbility()->AddAttrRate(attr_id, value);
}
break;
case 2:
{
abs_handle_ = owner->GetAbility()->AddAttrAbs(attr_id, value);
}
break;
default:
{
}
break;
}
}
}
void ModifyBaseAttrBuff::Deactivate()
{
if (!abs_handle_.expired()) {
owner->GetAbility()->RemoveAttrAbs(abs_handle_);
}
if (!rate_handle_.expired()) {
owner->GetAbility()->RemoveAttrRate(rate_handle_);
}
}

View File

@ -0,0 +1,16 @@
#pragma once
#include "buff.h"
#include "ability.h"
class ModifyBaseAttrBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
private:
AttrAbsHandle abs_handle_;
AttrRateHandle rate_handle_;
};

View File

@ -0,0 +1,41 @@
#include "precompile.h"
#include "buff/modify_grow_attr.h"
#include "creature.h"
#include "human.h"
#include "car.h"
#include "mt/Buff.h"
void ModifyGrowAttrBuff::Activate()
{
int attr_id = meta->_int_buff_param1;
float value = meta->GetBuffParam2(this);
switch (meta->_int_buff_param3) {
case 1:
{
add_handle_ = owner->GetAbility()->AddAttrAddition(attr_id, value);
}
break;
case 2:
{
ruduce_handle_ = owner->GetAbility()->AddAttrRuduce(attr_id, value);
}
break;
default:
{
}
break;
}
}
void ModifyGrowAttrBuff::Deactivate()
{
if (!add_handle_.expired()) {
owner->GetAbility()->RemoveAttrAddition(add_handle_);
}
if (!ruduce_handle_.expired()) {
owner->GetAbility()->RemoveAttrRuduce(ruduce_handle_);
}
}

View File

@ -0,0 +1,15 @@
#pragma once
#include "buff.h"
#include "ability.h"
class ModifyGrowAttrBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
private:
AttrAdditionHandle add_handle_;
AttrRuduceHandle ruduce_handle_;
};

View File

@ -0,0 +1,93 @@
#include "precompile.h"
#include "buff/once_chg_attr.h"
#include "attrdefine.h"
#include "creature.h"
#include "room.h"
#include "mt/Buff.h"
void OnceChgAttrBuff::Activate()
{
InternalProcOnceChgAttr();
}
void OnceChgAttrBuff::Deactivate()
{
}
void OnceChgAttrBuff::InternalProcOnceChgAttr()
{
if (owner->dead) {
return;
}
switch (meta->_int_buff_param1) {
case kHAT_Hp:
{
int real_killer_id = 0;
std::string real_killer_name;
if (caster_.Get()) {
real_killer_id = caster_.Get()->GetUniId();
real_killer_name = caster_.Get()->GetName();
}
#ifdef DEBUG
if (caster_.Get()->IsPlayer()) {
a8::XPrintf("once chgattr %d %d\n", {real_killer_id, real_killer_name});
}
#endif
if (meta->_int_buff_param2 == 1) {
//绝对值
if (meta->_buff_param3 > 0) {
owner->AddHp(meta->_buff_param3);
} else if (meta->_buff_param3 < 0) {
float dmg_out = 0.0f;
owner->over_delay_time = 100;
owner->DecHP(std::abs(meta->_buff_param3),
VP_Buff,
"",
meta->buff_id(),
real_killer_id,
real_killer_name,
dmg_out);
owner->over_delay_time = 0;
}
} else if (meta->_int_buff_param2 == 2) {
//百分比
float chg_hp = owner->GetHP() * meta->_buff_param3;
if (chg_hp > 0.0001f) {
owner->AddHp(chg_hp);
} else if (chg_hp < 0.0001f) {
float dmg_out = 0.0f;
owner->over_delay_time = 100;
owner->DecHP(std::abs(chg_hp),
VP_Buff,
"",
meta->buff_id(),
real_killer_id,
real_killer_name,
dmg_out);
owner->over_delay_time = 0;
}
}
#ifdef DEBUG
{
std::string dbg_msg = a8::Format
("buff扣血 type:%s val:%f",
{
meta->_int_buff_param2,
meta->_int_buff_param3,
});
owner->room->BroadcastDebugMsg(dbg_msg);
}
#endif
owner->room->frame_event.AddHpChg(owner->GetWeakPtrRef());
}
break;
default:
{
}
break;
}
}

View File

@ -2,11 +2,13 @@
#include "buff.h"
class DownedBuff : public Buff
class OnceChgAttrBuff : public Buff
{
public:
virtual void Activate() override;
virtual void Deactivate() override;
private:
void InternalProcOnceChgAttr();
};

View File

@ -1,13 +0,0 @@
#include "precompile.h"
#include "buff/phase_add.h"
void PhaseAddBuff::Activate()
{
InternalTimerAddBuff();
}
void PhaseAddBuff::Deactivate()
{
}

View File

@ -8,7 +8,6 @@
#include "creature.h"
#include "room.h"
#include "mapinstance.h"
#include "app.h"
void PullToWalkableBuff::Activate()
{
@ -20,9 +19,9 @@ void PullToWalkableBuff::Activate()
abort();
}
owner->room->map_instance->UnScale(point);
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
owner->GetMutablePos().FromGlmVec3(point);
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
}
void PullToWalkableBuff::Deactivate()

View File

@ -15,29 +15,10 @@ void SelectTargetWithSelfPosBuff::Activate()
hold_param3_ = meta->GetBuffParam3(this);
hold_param4_ = meta->GetBuffParam4(this);
std::vector<Creature*> targets;
bool include_car = false;
bool exclude_passenger = false;
if (!meta->_buff_param8_int_set.empty()) {
include_car = meta->_buff_param8_int_set.find(1) != meta->_buff_param8_int_set.end();
exclude_passenger = meta->_buff_param8_int_set.find(2) != meta->_buff_param8_int_set.end();
}
owner->TraverseCreatures
(
[this, &targets, include_car, exclude_passenger] (Creature* c, bool& stop)
[this, &targets] (Creature* c, bool& stop)
{
if (c->dead ||
(c->IsCar() && !include_car) ||
a8::HasBitFlag(c->status, CS_Disable) ||
c->HasBuffEffect(kBET_Dive)
) {
return;
}
if (exclude_passenger) {
if (c->HasBuffEffect(kBET_Driver) &&
c->HasBuffEffect(kBET_Passenger)) {
return;
}
}
float distance = owner->GetPos().Distance2D2(c->GetPos());
float angle = 0.0f;
if (distance > 0.0001f) {

View File

@ -13,53 +13,24 @@
void SelectTargetWithSpecPosBuff::Activate()
{
hold_param3_ = meta->GetBuffParam3(this);
glm::vec3 center = glm::vec3
(
meta->GetBuffParam5(this),
meta->GetBuffParam6(this),
meta->GetBuffParam7(this)
);
hold_param4_ = meta->GetBuffParam4(this);
std::vector<Creature*> targets;
bool include_car = false;
bool exclude_passenger = false;
if (!meta->_buff_param8_int_set.empty()) {
include_car = meta->_buff_param8_int_set.find(1) != meta->_buff_param8_int_set.end();
exclude_passenger = meta->_buff_param8_int_set.find(2) != meta->_buff_param8_int_set.end();
}
owner->TraverseCreatures
(
[this, &targets, &center, include_car, exclude_passenger] (Creature* c, bool& stop)
[this, &targets] (Creature* c, bool& stop)
{
if (c->dead ||
(c->IsCar() && !include_car) ||
a8::HasBitFlag(c->status, CS_Disable) ||
c->HasBuffEffect(kBET_Dive)
) {
return;
}
if (exclude_passenger) {
if (c->HasBuffEffect(kBET_Driver) &&
c->HasBuffEffect(kBET_Passenger)) {
return;
float distance = owner->GetPos().Distance2D2(c->GetPos());
float angle = 0.0f;
if (distance > 0.0001f) {
glm::vec3 dir = owner->GetAttackDir();
if (GlmHelper::IsZero(dir)){
dir = c->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3();
GlmHelper::Normalize(dir);
}
angle = GlmHelper::CalcAngle(dir,
c->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3());
}
float distance = c->GetPos().Distance2D2(center);
#ifdef MYDEBUG
if (c->IsPlayer()) {
a8::XPrintf("select spec pos distance:%f center:%f %f %f pos:%f %f %f range:%f\n",
{
distance,
center.x,
center.y,
center.z,
c->GetPos().GetX(),
c->GetPos().GetY(),
c->GetPos().GetZ(),
hold_param3_,
});
}
#endif
if (distance < hold_param3_) {
if (distance < hold_param3_ && std::abs(angle) <= glm::radians(hold_param4_) / 2.0f / A8_PI) {
switch (meta->_int_buff_param1) {
case kBST_All:
{
@ -76,19 +47,6 @@ void SelectTargetWithSpecPosBuff::Activate()
case kBST_FriendlyIncludeSelf:
{
if (c->team_id == owner->team_id) {
#ifdef MYDEBUG
a8::XPrintf("select spec pos distance:%f center:%f %f %f pos:%f %f %f range:%f\n",
{
distance,
center.x,
center.y,
center.z,
c->GetPos().GetX(),
c->GetPos().GetY(),
c->GetPos().GetZ(),
hold_param3_,
});
#endif
targets.push_back(c);
}
}
@ -124,7 +82,7 @@ void SelectTargetWithSpecPosBuff::Activate()
);
for (auto& target : targets) {
for (int buff_id : meta->_buff_param2_int_list) {
target->TryAddBuff(caster_.Get(), buff_id, skill_meta, init_args, buff_vars);
target->TryAddBuff(caster_.Get(), buff_id, skill_meta);
}
}
}

View File

@ -12,7 +12,6 @@
#include "movement.h"
#include "car.h"
#include "human.h"
#include "app.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
@ -44,7 +43,7 @@ void SprintBuff::SprintMove()
owner->SetAttackDir(owner->context_dir);
owner->SetDisableMoveDirTimes(old_times);
owner->IncDisableMoveDirTimes();
#ifdef MYDEBUG
#ifdef DEBUG
a8::XPrintf("%s\n",
{
a8::Format("xxxxxxxx move_dir:%f,%f,%f attack_dir:%f,%f,%f speed:%d disable_move_dir:%d",
@ -125,7 +124,7 @@ void SprintBuff::Check(Position& pre_pos, Position& src_pos, std::map<int, long
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
#ifdef MYDEBUG1
#ifdef DEBUG1
a8::XPrintf("11111111111111111111111111\n", {});
#endif
owner->TryAddBuff(owner, meta->_int_buff_param1, skill_meta);
@ -179,9 +178,9 @@ void SprintBuff::OnEnemyHit(Creature* enemy)
void SprintBuff::SprintEnd()
{
if (owner->IsCar() && owner->AsCar()->GetDriver()) {
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
owner->AsCar()->GetDriver()->GetMovement()->ClearPath();
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
}
owner->room->xtimer.SetTimeoutEx
(
@ -192,9 +191,9 @@ void SprintBuff::SprintEnd()
owner->TryAddBuff(owner, meta->_int_buff_param1, skill_meta);
owner->GetMovement()->ClearPath();
if (owner->IsCar() && owner->AsCar()->GetDriver()) {
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
owner->AsCar()->GetDriver()->GetMovement()->ClearPath();
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
}
owner->RemoveBuffByUniId(buff_uniid);
}

View File

@ -6,7 +6,6 @@
#include "room.h"
#include "skill.h"
#include "collision.h"
#include "app.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
@ -29,7 +28,7 @@ void TurnOverBuff::Activate()
glm::vec3 old_dir = owner->GetMoveDir();
Position old_pos = owner->GetPos();
float distance = phase->phase_param1.GetDouble();
#ifdef MYDEBUG
#ifdef DEBUG
caster_.Get()->SendDebugMsg(a8::Format("ProTurnOver currTimes:%d last_pos:%d,%d curr_pos:%d,%d",
{
skill->GetCurrTimes(),
@ -39,9 +38,9 @@ void TurnOverBuff::Activate()
owner->GetPos().GetY()
}));
#endif
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
owner->ForwardMove(distance);
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
owner->SetMoveDir(old_dir);
if (phase->phase_param2.GetInt() == 1) {
++owner->turn_over_times;
@ -90,9 +89,9 @@ void TurnOverBuff::Activate()
&target->xtimer_attacher);
}
}
App::Instance()->verify_set_pos = 1;
Global::Instance()->verify_set_pos = 1;
owner->SetPos(curr_pos);
App::Instance()->verify_set_pos = 0;
Global::Instance()->verify_set_pos = 0;
owner->room->grid_service->MoveCreature(owner);
}
if (!meta->_buff_param2_int_list.empty()) {

View File

@ -15,7 +15,7 @@ void UseSkillBuff::Activate()
++skill->force_use_times;
Position target_pos = owner->GetPos();
owner->DoSkill(
skill->GetBaseSkillMeta()->skill_id(),
skill->meta->skill_id(),
owner->GetUniId(),
owner->GetAttackDir(),
0

View File

@ -30,9 +30,6 @@
#include "movement.h"
#include "hero.h"
#include "skill.h"
#include "netdata.h"
#include "cs_proto.pb.h"
#include "team.h"
#include "mt/Param.h"
#include "mt/Equip.h"
@ -49,13 +46,7 @@ Bullet::Bullet():MoveableEntity()
Bullet::~Bullet()
{
SetDestorying();
--PerfMonitor::Instance()->entity_num[ET_Bullet];
if (IsFlyHook()) {
if (sender.Get()) {
sender.Get()->hook_hash.erase(GetUniId());
}
}
}
void Bullet::Initialize()
@ -78,11 +69,10 @@ void Bullet::Initialize()
}
if (sender.Get()) {
sender.Get()->GetTrigger()->FlyHookCreate(this);
sender.Get()->hook_hash[GetUniId()] = GetUniId();
}
Raycast();
}
#ifdef MYDEBUG
#ifdef DEBUG
if (DebugCmd::Enable() && sender.Get() && sender.Get() && sender.Get()->IsPlayer()) {
glm::vec3 hit_pos;
float ray_length;
@ -100,46 +90,12 @@ void Bullet::Initialize()
}
}
#endif
switch (gun_meta->equip_subtype()) {
case GUN_SUB_EQUIP_TYPE_FLY_LASER:
{
room->xtimer.SetTimeoutEx
(SERVER_FRAME_RATE * 2,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
ForceRemove();
}
},
&xtimer_attacher
);
room->xtimer.SetIntervalEx
(SERVER_FRAME_RATE,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!later_removed_) {
ProcLaster();
}
}
},
&xtimer_attacher
);
ProcLaster();
}
break;
default:
{
}
break;
}
}
void Bullet::Update(int delta_time)
{
if (shot_animi_time <= (room->GetFrameNo() - create_frameno_) * FRAME_RATE_MS) {
if (!trace_target_id && !reporter_list && !IsClientHook() && !IsSpecBullet()) {
if (!trace_target_id && !reporter_list) {
MapServiceUpdate();
++updated_times_;
}
@ -161,9 +117,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
ProcFlyHook(target);
if (!c || (c->team_id != sender.Get()->team_id)) {
if (!c || !c->IsCar()) {
if (!ignore_original_dmg) {
target->OnBulletHit(this);
}
target->OnBulletHit(this);
}
}
break;
@ -174,20 +128,11 @@ void Bullet::OnHit(std::set<Entity*>& objects)
bool eat = false;
if (!trace_target_id && !reporter_list) {
if (mt::Param::s().bullet_through_wall_check) {
if (!gun_meta->is_penetrate_thing() &&
!room->BulletCanReach(born_pos.ToGlmVec3(), target->GetPos().ToGlmVec3())) {
if (!room->BulletCanReach(born_pos.ToGlmVec3(), target->GetPos().ToGlmVec3())) {
eat = true;
}
if (gun_meta->id() == 30905 && eat && sender.Get()) {
glm::vec3 new_born_pos = born_pos.ToGlmVec3();
new_born_pos.y = target->GetPos().GetY();
if (gun_meta->is_penetrate_thing() ||
room->BulletCanReach(new_born_pos, target->GetPos().ToGlmVec3())) {
eat = false;
}
}
if (sender.Get() && sender.Get()->IsPlayer()) {
#ifdef MYDEBUG
#ifdef DEBUG
a8::XPrintf("eat %d xxxxxxxxxxxxxxxxxxxxxxxx\n", {eat});
#endif
}
@ -196,9 +141,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
if (!eat) {
bool old_is_dead = target->IsDead(room);
TriggerHitBuff(target);
if (!ignore_original_dmg) {
target->OnBulletHit(this);
}
target->OnBulletHit(this);
if (target->IsDead(room) && !old_is_dead) {
OnKillTarget(target);
}
@ -292,8 +235,9 @@ void Bullet::ProcBomb()
}
if (IsCurrWeapon() &&
sender.Get() &&
sender.Get()->GetAbility()->HasAttr(kHVAT_WeaponExplosionDealyTime) > 0) {
delay_time = delay_time + sender.Get()->GetAbility()->GetAttr(kHVAT_WeaponExplosionDealyTime);
sender.Get()->GetAbility()->GetAttrAbs(kHAT_WeaponExplosionDealyTime) > 0) {
delay_time = delay_time -
sender.Get()->GetAbility()->GetAttrAbs(kHAT_WeaponExplosionDealyTime);
delay_time = std::max(0, delay_time);
}
{
@ -437,7 +381,7 @@ void Bullet::ProcSmokeBomb()
(SERVER_FRAME_RATE * mt::Param::GetIntParam("smoke_duration", 10),
[task] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (a8::TIMER_DELETE_EVENT == event) {
task->Done();
}
},
@ -482,7 +426,7 @@ void Bullet::MapServiceUpdate()
auto old_pos = GetPos();
GetMutablePos().AddGlmVec3(dir * step_len);
float distance = GetPos().DistanceGlmVec3(born_pos.ToGlmVec3());
#ifdef MYDEBUG
#ifdef DEBUG
if (IsFlyHook()) {
a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f %f\n",
{
@ -518,7 +462,7 @@ void Bullet::MapServiceUpdate()
Check(distance);
}
} while(!later_removed_ && move_length >= 0.0001f);
#ifdef MYDEBUG1
#ifdef DEBUG1
{
if (sender.Get()->IsPlayer()) {
if ((room->GetFrameNo() - create_frameno_) % 2 == 0) {
@ -554,14 +498,18 @@ float Bullet::GetAtk()
atk *= android->ai->GetAttackRate();
#endif
}
return atk;
float attr_rate = 1 + ability_->GetAttrRate(kHAT_Atk);
if (IsCurrWeapon()) {
attr_rate += ability_->GetAttrRate(kHAT_WeaponDmg);
}
return atk * attr_rate;
}
float Bullet::GetExplosionRange()
{
float e_range = gun_meta->explosion_range();
if (IsCurrWeapon()) {
e_range *= (1 + ability_->GetAttr(kHVAT_WeaponExplosionRange));
e_range *= (1 + ability_->GetAttrRate(kHAT_WeaponExplosionRange));
}
return e_range;
}
@ -576,8 +524,6 @@ void Bullet::Check(float distance)
GetHitThings(result);
if (result.o_hit_num <= 0) {
GetHitCreatures(result);
} else {
}
if (!result.objects.empty() ||
#if 1
@ -735,6 +681,9 @@ bool Bullet::IsPreBattleBullet()
if (room->IsPveRoom()) {
return false;
}
if (room->IsNewBieRoom()) {
return false;
}
return create_frameno_ <= room->GetBattleStartFrameNo() || room->GetBattleStartFrameNo() == 0;
}
@ -749,9 +698,7 @@ void Bullet::OnKillTarget(Entity* target)
if (sender.Get()->IsHero() &&
sender.Get()->AsHero()->master.Get() &&
sender.Get()->AsHero()->master.Get()->IsHuman()) {
#if 0
sender.Get()->AsHero()->master.Get()->AsHuman()->stats->kills++;
#endif
}
}
}
@ -858,9 +805,6 @@ void Bullet::ForceRemove()
if (!keep_shot_animi_timer_ptr.expired()) {
room->xtimer.Delete(keep_shot_animi_timer_ptr);
}
if (on_bullet_exit) {
on_bullet_exit(this);
}
}
}
@ -892,13 +836,12 @@ void Bullet::GetHitThings(BulletCheckResult& result)
room->grid_service->TraverseObstacles
(room->GetRoomIdx(),
GetGridList(),
[this, &result] (Obstacle* ob, bool& stop) mutable
[this, result] (Obstacle* ob, bool& stop) mutable
{
#if 1
if (!ob->CanThroughable(this) && !ob->IsDead(room)) {
if (Collision::CheckBullet(this, ob)) {
result.objects.insert(ob);
++result.o_hit_num;
}
}
#else
@ -918,7 +861,7 @@ void Bullet::GetHitThings(BulletCheckResult& result)
if (ret) {
strengthened_ = true;
OnStrengthen(ob);
#ifdef MYDEBUG
#ifdef DEBUG
a8::XPrintf("命中能量墙\n", {});
#endif
}
@ -947,9 +890,6 @@ void Bullet::GetHitCreatures(BulletCheckResult& result)
if (c->HasBuffEffect(kBET_BulletThrough)) {
return;
}
if (c->HasBuffEffect(kBET_Dive)) {
return;
}
if (c->HasBuffEffect(kBET_HoldShield)) {
c->CheckBulletHitHoldShield(this, result.eat);
if (result.eat) {
@ -959,7 +899,7 @@ void Bullet::GetHitCreatures(BulletCheckResult& result)
}
if (c != sender.Get() && !c->dead &&
Collision::CheckBullet(this, c)) {
#ifdef MYDEBUG
#ifdef DEBUG
if (IsFlyHook()) {
a8::XPrintf("bullet hit\n", {});
}
@ -974,11 +914,8 @@ void Bullet::GetHitCreatures(BulletCheckResult& result)
}
} else {
result.objects.insert(c);
#ifdef MYDEBUG1
a8::XPrintf("GetHitCreatures gun_id:%d\n", {gun_meta->id()});
#endif
++result.c_hit_num;
if (gun_meta->ispenetrate()) {
++result.c_hit_num;
hit_objects_.insert(c->GetUniId());
}
}
@ -1008,7 +945,7 @@ void Bullet::ProcNormalBullet(BulletCheckResult& result)
}
if (need_remove) {
if (IsFlyHook()) {
#ifdef MYDEBUG
#ifdef DEBUG
a8::XPrintf("ProcHookHit\n",
{
});
@ -1071,9 +1008,6 @@ float Bullet::GetHitRadius()
hit_radius = GetExplosionRange();
}
}
if (gun_meta->id() == 30905) {
hit_radius = 20;
}
return hit_radius;
}
@ -1092,14 +1026,7 @@ void Bullet::Raycast()
glm::vec3 hit_point;
sender.Get()->room->map_instance->Scale(start);
sender.Get()->room->map_instance->Scale(end);
bool ret = sender.Get()->room->map_instance->Raycast
(start,
end,
hit_point,
hit_result,
room->map_instance->GetBulletIncludeFlags(),
room->map_instance->GetBulletExcludeFlags()
);
bool ret = sender.Get()->room->map_instance->Raycast(start, end, hit_point, hit_result);
if (ret && hit_result) {
raycast_hited = true;
sender.Get()->room->map_instance->UnScale(hit_point);
@ -1108,7 +1035,7 @@ void Bullet::Raycast()
} else {
raycast_len_ = gun_meta->range();
}
#ifdef MYDEBUG
#ifdef DEBUG
float distance = 0.0f;
if (hit_result) {
glm::vec3 v1 = raycast_hit_point_;
@ -1142,6 +1069,7 @@ void Bullet::ProcRequestBulletDmg(int shield_hit, int strength_wall_uniid, int t
if (!sender.Get()) {
return;
}
GetMutablePos().FromGlmVec3(pos);
room->grid_service->MoveBullet(this);
float distance = GlmHelper::Norm(GetPos().ToGlmVec3() - born_pos.ToGlmVec3());
@ -1187,6 +1115,9 @@ void Bullet::ProcRequestBulletDmg(int shield_hit, int strength_wall_uniid, int t
const mt::Skill* Bullet::GetSkillMeta()
{
if (sender.Get() && skill_meta) {
return sender.Get()->GetAdjustSkillMeta(skill_meta);
}
return skill_meta;
}
@ -1207,83 +1138,3 @@ bool Bullet::NoAdjustPos()
}
return false;
}
void Bullet::ReportHookHitPos(int hit_obj_uniid, const glm::vec3& hit_pos)
{
if (later_removed_) {
return;
}
if (sender.Get()) {
Creature* hit_obj = room->GetCreatureByUniId(hit_obj_uniid);
BulletCheckResult result;
if (hit_obj && hit_obj->GetPos().Distance2D2(GetPos()) < raycast_len_ + 50) {
++result.c_hit_num;
result.objects.insert(hit_obj);
GetMutablePos().FromGlmVec3(hit_obj->GetPos().ToGlmVec3());
room->grid_service->MoveBullet(this);
result.flyed_distance = hit_obj->GetPos().Distance2D2(sender.Get()->GetPos());
} else {
GetMutablePos().FromGlmVec3(dir * raycast_len_);
result.flyed_distance = raycast_len_;
}
ProcNormalBullet(result);
}
}
bool Bullet::IsClientHook()
{
if (!IsFlyHook() ||
!sender.Get()) {
return false;
}
if (!sender.Get()->IsPlayer()) {
return false;
}
if (sender.Get()->GetNetData()->join_msg &&
sender.Get()->GetNetData()->join_msg->proto_version() > 0 &&
sender.Get()->GetNetData()->join_msg->proto_version() < 2023121501) {
return false;
} else {
return true;
}
}
bool Bullet::IsSpecBullet()
{
return (gun_meta->equip_subtype() == GUN_SUB_EQUIP_TYPE_FLY_LASER);
}
void Bullet::ProcLaster()
{
std::set<Entity*> objects;
room->TraverseCreatureList
(
[this, &objects] (Creature* c) -> bool
{
if (c->team_id == sender.Get()->GetTeam()->GetTeamId()) {
return true;
}
if (c->dead) {
return true;
}
if (c->IsInvincible()) {
return true;
}
glm::vec3 ray_orig = born_pos.ToGlmVec3();
ray_orig.y = 0.0f;
glm::vec3 ray_dir = dir;
ray_dir.y = 0.0f;
glm::vec3 sphere_center = c->GetPos().ToGlmVec3();
sphere_center.y = 0.0f;
float intersection_distance = 0.0;
bool ret = Collision::IntersectRaySphere(GetHitRadius(),
ray_orig, ray_dir, sphere_center, c->GetHitRadius(),
intersection_distance);
if (ret) {
objects.insert(c);
}
return true;
});
OnHit(objects);
}

View File

@ -13,7 +13,6 @@ class Ability;
class Bullet : public MoveableEntity, public IBullet
{
public:
int shot_uniid = 0;
long long weapon_uniid = 0;
int gun_lv = 0;
int spec_gun_buff_id = 0;
@ -33,10 +32,7 @@ class Bullet : public MoveableEntity, public IBullet
a8::XTimerWp keep_shot_animi_timer_ptr;
float shot_animi_time = 0.0f;
std::shared_ptr<std::set<int>> reporter_list;
bool ignore_original_dmg = false;
std::function<void(Bullet*)> on_bullet_exit = nullptr;
int duration = 0;
std::shared_ptr<float> scale;
virtual ~Bullet() override;
virtual void Initialize() override;
@ -65,8 +61,6 @@ class Bullet : public MoveableEntity, public IBullet
virtual const Position& GetPos() override;
virtual void ProcRequestBulletDmg(int shield_hit, int strength_wall_uniid, int target_uniid, const glm::vec3& pos) override;
void ReportHookHitPos(int hit_obj_uniid, const glm::vec3& hit_pos);
protected:
Bullet();
@ -83,7 +77,6 @@ protected:
void ProcShieldWallBomb(int delay_time);
void ProcOilBucketBomb(int delay_time);
void ProcFlyHook(Entity* target);
void ProcLaster();
inline void MapServiceUpdate();
void Check(float distance);
void AddGunBuff();
@ -93,8 +86,6 @@ protected:
void GetHitThings(BulletCheckResult& result);
void GetHitCreatures(BulletCheckResult& result);
void Raycast();
bool IsClientHook();
bool IsSpecBullet();
private:
bool later_removed_ = false;

Some files were not shown because too many files have changed in this diff Show More