DRG-Femboy-Voice/Source/FSD/Public/ThrowableItem.h
2025-04-15 12:39:31 -07:00

88 lines
3 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "AnimatedItem.h"
#include "Templates/SubclassOf.h"
#include "Upgradable.h"
#include "ThrowableItem.generated.h"
class AActor;
class AItem;
class AThrowableActor;
class UAnimMontage;
class UItemUpgrade;
UCLASS(Blueprintable)
class AThrowableItem : public AAnimatedItem, public IUpgradable {
GENERATED_BODY()
public:
protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSubclassOf<AThrowableActor> ThrowableClass;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
UAnimMontage* FPThrowMontage;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
UAnimMontage* TPThrowMontage;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float ThrowVelocity;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float InheritOwnerVelocityScale;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float ThrowAngle;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float CooldownAfterThrow;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
bool CanThrowBeforeEquipAnimFinish;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float CooldownAfterEquip;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float ThrowDelay;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FVector ThrowOffset;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
float CooldownLeft;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
TArray<UItemUpgrade*> upgrades;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
TSubclassOf<AItem> LoadoutItem;
UPROPERTY(EditAnywhere, Transient, meta=(AllowPrivateAccess=true))
TArray<TWeakObjectPtr<AThrowableActor>> ThrownActors;
public:
AThrowableItem();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
protected:
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
void Simulate_Throw(TSubclassOf<AThrowableActor> ActorClass);
UFUNCTION(BlueprintCallable, Reliable, Server)
void Server_Throw(TSubclassOf<AThrowableActor> ActorClass, const FVector& Location);
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void ReceiveItemThrown(AThrowableActor* thrownActor);
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void ReceiveItemSpawned(AThrowableActor* thrownActor);
UFUNCTION(BlueprintCallable)
void OnThrownActorDestroyed(AActor* Actor);
// Fix for true pure virtual functions not being implemented
};