Add functionality to TaskAcquireAttackToken
This commit is contained in:
parent
0afcd945ce
commit
f04bc8378a
|
@ -2,8 +2,21 @@
|
||||||
|
|
||||||
|
|
||||||
#include "TaskAcquireAttackToken.h"
|
#include "TaskAcquireAttackToken.h"
|
||||||
|
#include "EnemyAIController.h"
|
||||||
|
|
||||||
EBTNodeResult::Type UTaskAcquireAttackToken::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory)
|
EBTNodeResult::Type UTaskAcquireAttackToken::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory)
|
||||||
{
|
{
|
||||||
|
auto enemyController = Cast<AEnemyAIController>(owner.GetAIOwner());
|
||||||
|
|
||||||
|
if (enemyController->TryObtainAttackToken())
|
||||||
|
{
|
||||||
return EBTNodeResult::Succeeded;
|
return EBTNodeResult::Succeeded;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EBTNodeResult::Failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
EBTNodeResult::Type UTaskAcquireAttackToken::AbortTask(UBehaviorTreeComponent& owner, uint8* memory)
|
||||||
|
{
|
||||||
|
return EBTNodeResult::Aborted;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,5 @@ public:
|
||||||
|
|
||||||
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override;
|
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override;
|
||||||
|
|
||||||
|
virtual EBTNodeResult::Type AbortTask(UBehaviorTreeComponent& owner, uint8* memory) override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue