Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Character.h"
- #include "Interfaces/HitInterface.h"
- #include "Characters/CharacterTypes.h"
- #include "Enemy.generated.h"
- class UAnimMontage;
- class UAttributeComponent;
- class UHealthBarComponent;
- UCLASS()
- class SLASH_API AEnemy : public ACharacter, public IHitInterface
- {
- GENERATED_BODY()
- public:
- AEnemy();
- virtual void Tick(float DeltaTime) override;
- virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
- virtual void GetHit_Implementation(const FVector& ImpactPoint) override;
- void DirectionalHitReact(const FVector& ImpactPoint);
- virtual float TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, AActor* DamageCauser) override;
- private:
- UPROPERTY(VisibleAnywhere)
- UAttributeComponent* Attibutes;
- UPROPERTY(VisibleAnywhere)
- UHealthBarComponent* HealthBarWidget;
- /*
- Animation Montages
- */
- UPROPERTY(EditDefaultsOnly, Category = Montages)
- UAnimMontage* HitReactMontage;
- UPROPERTY(EditDefaultsOnly, Category = Montages)
- UAnimMontage* DeathMontage;
- UPROPERTY(EditAnywhere, Category = Sounds)
- USoundBase* HitSound;
- UPROPERTY(EditAnywhere, Category = VisualEffects)
- UParticleSystem* HitParticles;
- UPROPERTY()
- AActor* CombatTarget;
- UPROPERTY(EditAnywhere)
- double CombatRadius = 500.f;
- /*Navigations*/
- UPROPERTY()
- class AAIController* EnemyController;
- //Current patrol target
- UPROPERTY(EditInstanceOnly, Category = "AI Navigation")
- AActor* PatrolTarget;
- UPROPERTY(EditInstanceOnly, Category = "AI Navigation")
- TArray<AActor*> PatrolTargets;
- UPROPERTY(EditAnywhere)
- double PatrollRadius = 200.f;
- FTimerHandle PatrolTimer;
- void PatrolTimerFinished();
- protected:
- virtual void BeginPlay() override;
- void Die();
- bool InTargetRange(AActor* Target, double Radius);
- void MoveToTarget(AActor* Target);
- AActor* ChoosePatrolTarget();
- /*
- Play Montage Functions
- */
- void PlayerHitReactMontage(const FName& SectionName);
- UPROPERTY(BlueprintReadOnly)
- EDeathPose DeathPose = EDeathPose::EDP_Alive;
- public:
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement