Add Perception to range enemy and rework enemy C++ class
This commit is contained in:
parent
d221a9ffcc
commit
b1f139426d
BIN
Content/Legumix/Ennemy/E_EnemyState.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Ennemy/E_EnemyState.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Ennemy/MeleeEnemy/AI/BB_MeleeEnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/MeleeEnemy/AI/BB_MeleeEnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/MeleeEnemy/AI/BT_MeleeEnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/MeleeEnemy/AI/BT_MeleeEnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/MeleeEnemy/BP_MeleeEnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/MeleeEnemy/BP_MeleeEnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/BB_RangeEnnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/BB_RangeEnnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/BT_RangeEnnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/BT_RangeEnnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/Task/BTTask_RangeAttack.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/RangeEnemy/AI/Task/BTTask_RangeAttack.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/RangeEnemy/AIC_DistantEnnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/RangeEnemy/AIC_DistantEnnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Ennemy/RangeEnemy/BP_DistantEnemy.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/RangeEnemy/BP_DistantEnemy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Levels/LVL_00.umap
(Stored with Git LFS)
BIN
Content/Legumix/Levels/LVL_00.umap
(Stored with Git LFS)
Binary file not shown.
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user