41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Pawn.h"
|
|
#include "EnemySpaceship.generated.h"
|
|
|
|
UCLASS()
|
|
class MYPROJECT3_API AEnemySpaceship : public APawn
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
AEnemySpaceship();
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
|
class UStaticMeshComponent* ShipMesh;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
|
|
float DetectionRange = 1500.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
|
|
float FireRate = 2.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
|
|
float MovementSpeed = 500.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Combat")
|
|
float MaxHealth = 100.0f;
|
|
|
|
float CurrentHealth;
|
|
FTimerHandle FireTimerHandle;
|
|
class ASpaceshipPawn* PlayerPawn;
|
|
|
|
void FireAtPlayer();
|
|
virtual float TakeDamage(float Damage, struct FDamageEvent const& DamageEvent,
|
|
AController* EventInstigator, AActor* DamageCauser) override;
|
|
}; |