This repository has been archived on 2025-04-18. You can view files and clone it, but cannot push or open issues or pull requests.

39 lines
875 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "Enemy/LMEnemy.h"
ALMEnemy::ALMEnemy()
{
PrimaryActorTick.bCanEverTick = true;
EnemyState = EEnemyState::EES_Chasing;
AttackingDamage = 0.f;
}
void ALMEnemy::BeginPlay()
{
Super::BeginPlay();
}
void ALMEnemy::Attack(const APawn* TargetedPawn)
{
// TO DO
FString Debug = FString::Printf(TEXT("Enemy %s attack %s !"), *GetName(), *TargetedPawn->GetName());
GEngine->AddOnScreenDebugMessage(1, 2.f, FColor::Cyan, Debug);
}
double ALMEnemy::GetDistanceToTarget(const AActor* TargetedActor)
{
return (TargetedActor->GetActorLocation() - GetActorLocation()).Length();
}
void ALMEnemy::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void ALMEnemy::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}