1
This commit is contained in:
parent
36540d1bca
commit
caae416b90
@ -633,7 +633,7 @@ namespace behaviac
|
||||
|
||||
virtual bool load()
|
||||
{
|
||||
AgentMeta::SetTotalSignature(1902551082u);
|
||||
AgentMeta::SetTotalSignature(1342570378u);
|
||||
|
||||
AgentMeta* meta = NULL;
|
||||
BEHAVIAC_UNUSED_VAR(meta);
|
||||
@ -671,12 +671,13 @@ namespace behaviac
|
||||
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
|
||||
|
||||
// RoomAgent
|
||||
meta = BEHAVIAC_NEW AgentMeta(2696163459u);
|
||||
meta = BEHAVIAC_NEW AgentMeta(2447231230u);
|
||||
AgentMeta::GetAgentMetas()[1389135714u] = meta;
|
||||
meta->RegisterMethod(3968206693u, BEHAVIAC_NEW CAgentMethod_1< HeroAgent*, int >(FunctionPointer_RoomAgent_FindHero));
|
||||
meta->RegisterMethod(847579834u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetAliveHumanNum));
|
||||
meta->RegisterMethod(3609862701u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetAlivePlayerNum));
|
||||
meta->RegisterMethod(171307406u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetAliveTeamNum));
|
||||
meta->RegisterMethod(100827893u, BEHAVIAC_NEW CAgentMethod< GasMode_e >(FunctionPointer_RoomAgent_GetGasMode));
|
||||
meta->RegisterMethod(4273027005u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetHumanNum));
|
||||
meta->RegisterMethod(797157493u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetMapId));
|
||||
meta->RegisterMethod(2209490160u, BEHAVIAC_NEW CAgentMethod< int >(FunctionPointer_RoomAgent_GetPlayerNum));
|
||||
@ -1013,6 +1014,7 @@ namespace behaviac
|
||||
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<glm::vec3>("glm::vec3");
|
||||
|
||||
return true;
|
||||
@ -1031,6 +1033,7 @@ namespace behaviac
|
||||
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<glm::vec3>("glm::vec3");
|
||||
|
||||
return true;
|
||||
|
@ -26,6 +26,7 @@ namespace behaviac
|
||||
inline int FunctionPointer_RoomAgent_GetAliveHumanNum(Agent* self) { return ((RoomAgent*)self)->GetAliveHumanNum(); }
|
||||
inline int FunctionPointer_RoomAgent_GetAlivePlayerNum(Agent* self) { return ((RoomAgent*)self)->GetAlivePlayerNum(); }
|
||||
inline int FunctionPointer_RoomAgent_GetAliveTeamNum(Agent* self) { return ((RoomAgent*)self)->GetAliveTeamNum(); }
|
||||
inline GasMode_e FunctionPointer_RoomAgent_GetGasMode(Agent* self) { return ((RoomAgent*)self)->GetGasMode(); }
|
||||
inline int FunctionPointer_RoomAgent_GetHumanNum(Agent* self) { return (int)((RoomAgent*)self)->_Execute_Method_<METHOD_TYPE_RoomAgent_GetHumanNum, int >(); }
|
||||
inline int FunctionPointer_RoomAgent_GetMapId(Agent* self) { return ((RoomAgent*)self)->GetMapId(); }
|
||||
inline int FunctionPointer_RoomAgent_GetPlayerNum(Agent* self) { return (int)((RoomAgent*)self)->_Execute_Method_<METHOD_TYPE_RoomAgent_GetPlayerNum, int >(); }
|
||||
|
@ -44,3 +44,14 @@ BEHAVIAC_BEGIN_ENUM_EX(BtEvent_e, BtEvent_e)
|
||||
}
|
||||
BEHAVIAC_END_ENUM_EX()
|
||||
|
||||
BEHAVIAC_BEGIN_ENUM_EX(GasMode_e, GasMode_e)
|
||||
{
|
||||
BEHAVIAC_ENUMCLASS_DISPLAY_INFO_EX(L"GasMode_e", L"");
|
||||
|
||||
BEHAVIAC_ENUM_ITEM_EX(GasInactive, "GasInactive");
|
||||
BEHAVIAC_ENUM_ITEM_EX(GasWaiting, "GasWaiting");
|
||||
BEHAVIAC_ENUM_ITEM_EX(GasMoving, "GasMoving");
|
||||
BEHAVIAC_ENUM_ITEM_EX(GasJump, "GasJump");
|
||||
}
|
||||
BEHAVIAC_END_ENUM_EX()
|
||||
|
||||
|
@ -23,6 +23,10 @@ DECLARE_BEHAVIAC_ENUM_EX(BtEvent_e, BtEvent_e);
|
||||
BEHAVIAC_DECLARE_TYPE_VECTOR_HANDLER(BtEvent_e);
|
||||
|
||||
|
||||
DECLARE_BEHAVIAC_ENUM_EX(GasMode_e, GasMode_e);
|
||||
BEHAVIAC_DECLARE_TYPE_VECTOR_HANDLER(GasMode_e);
|
||||
|
||||
|
||||
// -------------------
|
||||
// Customized structs
|
||||
// -------------------
|
||||
|
@ -2,19 +2,30 @@
|
||||
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
|
||||
<!--Source File: hero\standard.xml-->
|
||||
<behavior name="hero/standard" agenttype="HeroAgent" version="5">
|
||||
<node class="IfElse" id="0">
|
||||
<node class="Condition" id="1">
|
||||
<node class="IfElse" id="4">
|
||||
<node class="Condition" id="5">
|
||||
<property Operator="Equal" />
|
||||
<property Opl="Self.HeroAgent::IsMobaMode()" />
|
||||
<property Opr="const bool true" />
|
||||
<property Opl="room_agent.RoomAgent::GetGasMode()" />
|
||||
<property Opr="const GasMode_e GasInactive" />
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="2">
|
||||
<property ReferenceBehavior="const string "task/MobaMode"" />
|
||||
<property Task="Self.HeroAgent::MobaMode()" />
|
||||
<node class="ReferencedBehavior" id="6">
|
||||
<property ReferenceBehavior="const string "task/RandomWalk"" />
|
||||
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="3">
|
||||
<property ReferenceBehavior="const string "task/ChiJiMode"" />
|
||||
<property Task="Self.HeroAgent::ChiMode()" />
|
||||
<node class="IfElse" id="0">
|
||||
<node class="Condition" id="1">
|
||||
<property Operator="Equal" />
|
||||
<property Opl="Self.HeroAgent::IsMobaMode()" />
|
||||
<property Opr="const bool true" />
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="2">
|
||||
<property ReferenceBehavior="const string "task/MobaMode"" />
|
||||
<property Task="Self.HeroAgent::MobaMode()" />
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="3">
|
||||
<property ReferenceBehavior="const string "task/ChiJiMode"" />
|
||||
<property Task="Self.HeroAgent::ChiMode()" />
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</behavior>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
|
||||
<agents version="1" signature="1902551082">
|
||||
<agents version="1" signature="1342570378">
|
||||
<agent type="HeroAgent" base="BaseAgent" signature="995930905">
|
||||
<properties>
|
||||
<property name="current_target_agent" type="TargetAgent*" member="false" static="false" defaultvalue="null" />
|
||||
|
@ -938,9 +938,11 @@ void Creature::DoSkill(int skill_id,
|
||||
#endif
|
||||
RemoveBuffByEffectId(kBET_Hide);
|
||||
if (!nature_recover_hp_idle_timer.expired()) {
|
||||
room->xtimer.ModifyTime
|
||||
(nature_recover_hp_idle_timer,
|
||||
SERVER_FRAME_RATE * mt::Param::s().nature_recover_hp_idletime);
|
||||
room->xtimer.FireEvent
|
||||
(
|
||||
nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
if (skill->GetMinorType()) {
|
||||
SetAttackDir(skill_dir);
|
||||
@ -2772,7 +2774,7 @@ void Creature::OnLand()
|
||||
if (buff_uniid) {
|
||||
Buff* buff = GetBuffByUniId(buff_uniid);
|
||||
if (buff) {
|
||||
int peace_time = 2000;
|
||||
int peace_time = 6000;
|
||||
room->xtimer.ModifyTime(buff->remover_timer, peace_time / FRAME_RATE_MS);
|
||||
}
|
||||
}
|
||||
|
@ -2305,9 +2305,11 @@ void Human::OnBulletHit(IBullet* bullet)
|
||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||
RemoveBuffByEffectId(kBET_Hide);
|
||||
if (!nature_recover_hp_idle_timer.expired()) {
|
||||
room->xtimer.ModifyTime
|
||||
(nature_recover_hp_idle_timer,
|
||||
SERVER_FRAME_RATE * mt::Param::s().nature_recover_hp_idletime);
|
||||
room->xtimer.FireEvent
|
||||
(
|
||||
nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
GetTrigger()->Attacked(bullet->GetSender().Get());
|
||||
if (!dead && (bullet->IsBomb() || bullet->GetSender().Get()->team_id != team_id)) {
|
||||
@ -2458,9 +2460,11 @@ void Human::OnExplosionHit(Explosion* e)
|
||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||
RemoveBuffByEffectId(kBET_Hide);
|
||||
if (!nature_recover_hp_idle_timer.expired()) {
|
||||
room->xtimer.ModifyTime
|
||||
(nature_recover_hp_idle_timer,
|
||||
SERVER_FRAME_RATE * mt::Param::s().nature_recover_hp_idletime);
|
||||
room->xtimer.FireEvent
|
||||
(
|
||||
nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
float finaly_dmg = GetBattleContext()->CalcDmg(e);
|
||||
#if 1
|
||||
|
@ -1710,9 +1710,11 @@ void Player::UpdateThrowBomb()
|
||||
RemoveBuffByEffectId(kBET_Hide);
|
||||
}
|
||||
if (!nature_recover_hp_idle_timer.expired()) {
|
||||
room->xtimer.ModifyTime
|
||||
(nature_recover_hp_idle_timer,
|
||||
SERVER_FRAME_RATE * mt::Param::s().nature_recover_hp_idletime);
|
||||
room->xtimer.FireEvent
|
||||
(
|
||||
nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
--weapon.ammo;
|
||||
room->frame_event.AddPropChgEx
|
||||
|
@ -59,3 +59,8 @@ bool RoomAgent::IsGameOver()
|
||||
{
|
||||
return room_->IsGameOver();
|
||||
}
|
||||
|
||||
GasMode_e RoomAgent::GetGasMode()
|
||||
{
|
||||
return room_->GetGasData().GetGasMode();
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ public:
|
||||
int GetTeamNum();
|
||||
int GetAliveTeamNum();
|
||||
HeroAgent* FindHero(int hero_uniid);
|
||||
GasMode_e GetGasMode();
|
||||
|
||||
bool IsGameOver();
|
||||
void SetRoom(Room* room) { room_ = room; }
|
||||
|
@ -587,9 +587,11 @@ void InternalShot(Creature* c,
|
||||
c->LockAttackDir(1000);
|
||||
}
|
||||
if (!c->nature_recover_hp_idle_timer.expired()) {
|
||||
c->room->xtimer.ModifyTime
|
||||
(c->nature_recover_hp_idle_timer,
|
||||
SERVER_FRAME_RATE * mt::Param::s().nature_recover_hp_idletime);
|
||||
c->room->xtimer.FireEvent
|
||||
(
|
||||
c->nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
if (c->aiming) {
|
||||
c->aiming = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user