|
|
|
|
| #pragma once
|
|
|
| #include "GameFramework/Actor.h"
|
|
|
| #include "LyraWeaponSpawner.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| namespace EEndPlayReason { enum Type : int; }
|
|
|
| class APawn;
|
| class UCapsuleComponent;
|
| class ULyraInventoryItemDefinition;
|
| class ULyraWeaponPickupDefinition;
|
| class UObject;
|
| class UPrimitiveComponent;
|
| class UStaticMeshComponent;
|
| struct FFrame;
|
| struct FGameplayTag;
|
| struct FHitResult;
|
|
|
| UCLASS(MinimalAPI, Blueprintable,BlueprintType)
|
| class ALyraWeaponSpawner : public AActor
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UE_API ALyraWeaponSpawner();
|
|
|
| protected:
|
|
|
| UE_API virtual void BeginPlay() override;
|
| UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
|
|
| public:
|
|
|
| UE_API virtual void Tick(float DeltaTime) override;
|
|
|
| UE_API void OnConstruction(const FTransform& Transform) override;
|
|
|
| protected:
|
|
|
| UPROPERTY(EditInstanceOnly, BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| TObjectPtr<ULyraWeaponPickupDefinition> WeaponDefinition;
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, ReplicatedUsing = OnRep_WeaponAvailability, Category = "Lyra|WeaponPickup")
|
| bool bIsWeaponAvailable;
|
|
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| float CoolDownTime;
|
|
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| float CheckExistingOverlapDelay;
|
|
|
|
|
| UPROPERTY(BlueprintReadOnly, Transient, Category = "Lyra|WeaponPickup")
|
| float CoolDownPercentage;
|
|
|
| public:
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| TObjectPtr<UCapsuleComponent> CollisionVolume;
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| TObjectPtr<UStaticMeshComponent> PadMesh;
|
|
|
| UPROPERTY(BlueprintReadOnly, Category = "Lyra|WeaponPickup")
|
| TObjectPtr<UStaticMeshComponent> WeaponMesh;
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Lyra|WeaponPickup")
|
| float WeaponMeshRotationSpeed;
|
|
|
| FTimerHandle CoolDownTimerHandle;
|
|
|
| FTimerHandle CheckOverlapsDelayTimerHandle;
|
|
|
| UFUNCTION()
|
| UE_API void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepHitResult);
|
|
|
|
|
| UE_API void CheckForExistingOverlaps();
|
|
|
| UFUNCTION(BlueprintNativeEvent)
|
| UE_API void AttemptPickUpWeapon(APawn* Pawn);
|
|
|
| UFUNCTION(BlueprintImplementableEvent, Category = "Lyra|WeaponPickup")
|
| UE_API bool GiveWeapon(TSubclassOf<ULyraInventoryItemDefinition> WeaponItemClass, APawn* ReceivingPawn);
|
|
|
| UE_API void StartCoolDown();
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|WeaponPickup")
|
| UE_API void ResetCoolDown();
|
|
|
| UFUNCTION()
|
| UE_API void OnCoolDownTimerComplete();
|
|
|
| UE_API void SetWeaponPickupVisibility(bool bShouldBeVisible);
|
|
|
| UFUNCTION(BlueprintNativeEvent, Category = "Lyra|WeaponPickup")
|
| UE_API void PlayPickupEffects();
|
|
|
| UFUNCTION(BlueprintNativeEvent, Category = "Lyra|WeaponPickup")
|
| UE_API void PlayRespawnEffects();
|
|
|
| UFUNCTION()
|
| UE_API void OnRep_WeaponAvailability();
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Lyra|WeaponPickup")
|
| static UE_API int32 GetDefaultStatFromItemDef(const TSubclassOf<ULyraInventoryItemDefinition> WeaponItemClass, FGameplayTag StatTag);
|
| };
|
|
|
| #undef UE_API
|
|
|