presidents-brigade/Source/PresidentsBrigade/EnemyAIController.h
2024-01-02 19:40:23 -08:00

78 lines
1.3 KiB
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AIController.h"
#include "BasePawn.h"
#include "EnemyAIController.generated.h"
/**
*
*/
UCLASS()
class PRESIDENTSBRIGADE_API AEnemyAIController : public AAIController
{
GENERATED_BODY()
public:
virtual void Tick(float delta_time) override;
void redirect_target();
protected:
virtual void OnMoveCompleted(FAIRequestID request_id, const FPathFollowingResult& result) override;
/**
* President class to find in level.
*/
UPROPERTY(EditAnywhere, Category = "Enemy")
TSubclassOf<ABasePawn> president_class;
UPROPERTY(EditAnywhere, Category = "Movement")
float wait_threshold;
UPROPERTY(EditAnywhere, Category = "Movement")
float overshoot_multiplier;
private:
/**
* State.
*/
enum state_t : uint8
{
init,
wait,
target,
moving_attack,
moving_retreat,
dead
};
ABasePawn* get_president() const;
/**
* Current state.
*/
state_t current_state;
/**
* President that this enemy is targeting.
*/
ABasePawn* president;
/**
* True when last submitted move has completed.
*/
bool move_completed;
/**
* Time spent in waiting.
*/
float waiting_time;
/**
* Starting location.
*/
FVector starting_location;
};