Merge remote-tracking branch 'origin/master'

This commit is contained in:
Bastien 2025-03-21 10:19:38 +01:00
commit 1b6e955807
12 changed files with 21 additions and 42 deletions

BIN
Content/Legumix/Ennemy/E_EnemyState.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_00.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -5,7 +5,6 @@
ALMEnemy::ALMEnemy()
{
PrimaryActorTick.bCanEverTick = true;
EnemyState = EEnemyState::EES_Chasing;
AttackingRadius = 100.f;
AttackingDamage = 0.f;
}
@ -22,11 +21,6 @@ void ALMEnemy::Attack(const APawn* TargetedPawn)
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);

View File

@ -6,13 +6,6 @@
#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
{
@ -31,23 +24,12 @@ public:
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