59 lines
1.7 KiB
C++
59 lines
1.7 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Character.h"
|
|
#include "LMEnemy.generated.h"
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EEnemyState : uint8
|
|
{
|
|
EES_Chasing UMETA(DisplayName = "Chasing"),
|
|
EES_Attacking UMETA(DisplayName = "Attacking")
|
|
};
|
|
|
|
UCLASS()
|
|
class LEGUMEMIX_API ALMEnemy : public ACharacter
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEnnemyDeathSignature, ALMEnemy*, pleasefonctionne);
|
|
|
|
public:
|
|
ALMEnemy();
|
|
virtual void Tick(float DeltaTime) override;
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Legumix")
|
|
FOnEnnemyDeathSignature OnEnemyDeath;
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
|
|
EEnemyState EnemyState;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
|
|
double AttackingRadius;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
|
|
float AttackingDamage;
|
|
|
|
/**
|
|
* Returns the distance between the enemy and a target.
|
|
* @param TargetedActor
|
|
* @returns the distance
|
|
*/
|
|
UFUNCTION(BlueprintCallable, Category="Legumix", meta=(ReturnDisplayName="Distance", DefaultToSelf="TargetedActor"))
|
|
double GetDistanceToTarget(const AActor* TargetedActor);
|
|
|
|
/**
|
|
* Performs an attack on the targeted pawn
|
|
* @param TargetedPawn
|
|
* @returns
|
|
*/
|
|
UFUNCTION(BlueprintCallable, Category="Legumix", meta=(DefaultToSelf="TargetedPawn"))
|
|
virtual void Attack(const APawn* TargetedPawn);
|
|
};
|