#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 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 upgrades; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) TSubclassOf LoadoutItem; UPROPERTY(EditAnywhere, Transient, meta=(AllowPrivateAccess=true)) TArray> ThrownActors; public: AThrowableItem(); virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; protected: UFUNCTION(BlueprintCallable, NetMulticast, Unreliable) void Simulate_Throw(TSubclassOf ActorClass); UFUNCTION(BlueprintCallable, Reliable, Server) void Server_Throw(TSubclassOf 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 };