1
This commit is contained in:
parent
fa5bee011c
commit
f936461640
@ -75,9 +75,6 @@ behaviac::EBTStatus AndroidAgent::DoRandomWalk()
|
||||
[this, context] ()
|
||||
{
|
||||
if (GetOwner()->GetMovement()->GetPathSize() <= 0) {
|
||||
if (!context->handler.expired()) {
|
||||
GetOwner()->GetTrigger()->RemoveEventHandler(context->handler);
|
||||
}
|
||||
return behaviac::BT_SUCCESS;
|
||||
} else {
|
||||
return behaviac::BT_RUNNING;
|
||||
@ -123,6 +120,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomShot()
|
||||
);
|
||||
|
||||
context->owner = GetOwner()->GetWeakPtrRef();
|
||||
context->last_frameno = GetOwenr()->room->GetFrameNo();
|
||||
context->handler = GetOwner()->GetTrigger()->AddListener
|
||||
(
|
||||
kAttacked,
|
||||
@ -200,7 +198,7 @@ behaviac::EBTStatus AndroidAgent::DoAttack()
|
||||
context->owner = GetOwner()->GetWeakPtrRef();
|
||||
context->last_frameno = GetOwner()->room->GetFrameNo();
|
||||
|
||||
auto co = std::make_shared<BtCoroutine>(context, "CoAttack");
|
||||
auto co = std::make_shared<BtCoroutine>(context, "CoAttack");
|
||||
co->runing_cb =
|
||||
[this, context] ()
|
||||
{
|
||||
@ -248,6 +246,7 @@ behaviac::EBTStatus AndroidAgent::DoPursuit()
|
||||
context->target = enemy->GetWeakPtrRef();
|
||||
context->last_frameno = GetOwner()->room->GetFrameNo();
|
||||
context->last_pursuit_frameno = GetOwner()->room->GetFrameNo();
|
||||
#if 0
|
||||
context->handler = GetOwner()->GetTrigger()->AddListener
|
||||
(
|
||||
kAttacked,
|
||||
@ -268,6 +267,7 @@ behaviac::EBTStatus AndroidAgent::DoPursuit()
|
||||
context->owner.Get()->GetTrigger()->RemoveEventHandler(context->handler);
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
auto co = std::make_shared<BtCoroutine>(context, "CoPursuit");
|
||||
co->runing_cb =
|
||||
|
@ -22,11 +22,6 @@ HeroAgent::~HeroAgent()
|
||||
{
|
||||
}
|
||||
|
||||
State_e HeroAgent::GetState()
|
||||
{
|
||||
return kPreBattle;
|
||||
}
|
||||
|
||||
behaviac::EBTStatus HeroAgent::DoRandomWalk()
|
||||
{
|
||||
if (status_ == behaviac::BT_RUNNING) {
|
||||
|
@ -12,8 +12,6 @@ public:
|
||||
|
||||
BEHAVIAC_DECLARE_AGENTTYPE(HeroAgent, BaseAgent)
|
||||
|
||||
State_e GetState();
|
||||
|
||||
behaviac::EBTStatus DoRandomWalk();
|
||||
behaviac::EBTStatus DoRandomShot();
|
||||
behaviac::EBTStatus DoAttack();
|
||||
|
Loading…
x
Reference in New Issue
Block a user