ExoWest/Source/Exo/Public/Items/GunBase.h
Kubson96 b7263615c0 feat: add collecting HP and ammo
Player automatically collect HP and ammo when standing on crates. Ammo is collected only for owned gun.
2025-04-18 01:53:08 +02:00

62 lines
1.5 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AmmoBoxBase.h"
#include "GameFramework/Actor.h"
#include "Interfaces/Interactable.h"
#include "GunBase.generated.h"
UCLASS()
class EXO_API AGunBase : public AActor, public IInteractable
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AGunBase();
UPROPERTY(EditAnywhere, Category = "Shooting")
float MaxRange = 2000.0f;
UPROPERTY(EditAnywhere, Category = "Shooting")
float DamageValue = 100.0f;
UPROPERTY(EditAnywhere, Category = "Shooting")
float FireRateCooldown = 1.0f;
UPROPERTY(EditAnywhere, Category = "Shooting")
float RecoilForceMultiplier = 1.0f;
UPROPERTY(EditAnywhere, Category = "Shooting")
float ReloadTime = 3.0f;
UPROPERTY(EditAnywhere, Category = "Shooting")
float AimingFOV = 55.0f;
UPROPERTY(EditAnywhere, Category = "Ammo")
int32 CurrentAmmo = 10;
UPROPERTY(EditAnywhere, Category = "Ammo")
int32 MaxAmmo = 10;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ammo")
EAmmoType AmmoType = EAmmoType::Revolver;
TSubclassOf<AActor> SceneItemClass;
UFUNCTION(Category = "Ammo")
void AddAmmo(int AddValue);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
virtual void Interact_Implementation(AExoPlayerCharacter* playerCharacter) override;
};