Add reworked Worker Enemy AI #3
							
								
								
									
										14
									
								
								Source/Nakatomi/Decorators/BTDHasPatrolRoute.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Source/Nakatomi/Decorators/BTDHasPatrolRoute.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "../Decorators/BTDHasPatrolRoute.h"
 | 
			
		||||
 | 
			
		||||
#include "Nakatomi/EnemyAIController.h"
 | 
			
		||||
 | 
			
		||||
bool UBTDHasPatrolRoute::CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const
 | 
			
		||||
{
 | 
			
		||||
	AEnemyAIController* enemyController = Cast<AEnemyAIController>(OwnerComp.GetAIOwner());
 | 
			
		||||
	AEnemyCharacter* enemyPawn = Cast<AEnemyCharacter>(enemyController->GetPawn());
 | 
			
		||||
 | 
			
		||||
	return enemyPawn->CurrentPatrolRoute ? true : false;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								Source/Nakatomi/Decorators/BTDHasPatrolRoute.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Source/Nakatomi/Decorators/BTDHasPatrolRoute.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "CoreMinimal.h"
 | 
			
		||||
#include "BehaviorTree/BTDecorator.h"
 | 
			
		||||
#include "BTDHasPatrolRoute.generated.h"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
 */
 | 
			
		||||
UCLASS(Blueprintable)
 | 
			
		||||
class NAKATOMI_API UBTDHasPatrolRoute : public UBTDecorator
 | 
			
		||||
{
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	virtual bool CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const override;
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user