2023-08-18 00:05:59 +02:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
#include "TaskAcquireAttackToken.h"
|
2023-08-23 01:19:30 +02:00
|
|
|
#include "EnemyAIController.h"
|
2023-08-18 00:05:59 +02:00
|
|
|
|
|
|
|
EBTNodeResult::Type UTaskAcquireAttackToken::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory)
|
|
|
|
{
|
2023-08-23 01:19:30 +02:00
|
|
|
auto enemyController = Cast<AEnemyAIController>(owner.GetAIOwner());
|
|
|
|
|
|
|
|
if (enemyController->TryObtainAttackToken())
|
|
|
|
{
|
|
|
|
return EBTNodeResult::Succeeded;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EBTNodeResult::Failed;
|
|
|
|
}
|
|
|
|
|
|
|
|
EBTNodeResult::Type UTaskAcquireAttackToken::AbortTask(UBehaviorTreeComponent& owner, uint8* memory)
|
|
|
|
{
|
|
|
|
return EBTNodeResult::Aborted;
|
2023-08-18 00:05:59 +02:00
|
|
|
}
|