Add reworked Worker Enemy AI #3

Closed
baz wants to merge 24 commits from worker-ai into master
3 changed files with 44 additions and 2 deletions
Showing only changes of commit cc21d38a0f - Show all commits

BIN
Content/Enemy/BT_Attacking_State.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -0,0 +1,23 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "../Decorators/BTDWeaponCooldown.h"
#include "AIController.h"
#include "Nakatomi/EnemyCharacter.h"
void UBTDWeaponCooldown::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
AEnemyCharacter* EnemyCharacter = Cast<AEnemyCharacter>(OwnerComp.GetAIOwner()->GetPawn());
if (EnemyCharacter && EnemyCharacter->GetCurrentWeapon())
{
const float Cooldown = EnemyCharacter->GetCurrentWeapon()->GetWeaponProperties()->WeaponCooldown;
if (CoolDownTime != Cooldown)
{
CoolDownTime = Cooldown;
}
}
Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);
}

View File

@ -0,0 +1,19 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BehaviorTree/Decorators/BTDecorator_Cooldown.h"
#include "BTDWeaponCooldown.generated.h"
/**
*
*/
UCLASS()
class NAKATOMI_API UBTDWeaponCooldown : public UBTDecorator_Cooldown
{
GENERATED_BODY()
protected:
virtual void TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;
};