2022-12-13 05:11:56 +01:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "GameFramework/Character.h"
|
|
|
|
#include "HealthComponent.h"
|
2023-02-09 22:56:52 +01:00
|
|
|
#include "Weapon.h"
|
2022-12-13 05:11:56 +01:00
|
|
|
#include "NakatomiCharacter.generated.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
UCLASS()
|
|
|
|
class NAKATOMI_API ANakatomiCharacter : public ACharacter
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
2023-02-09 22:56:52 +01:00
|
|
|
public:
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
|
|
TArray<TSubclassOf<class AWeapon>> DefaultWeaponInventory;
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
TArray<AWeapon*> WeaponInventory;
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
AWeapon* CurrentWeapon = nullptr;
|
|
|
|
|
2022-12-13 05:11:56 +01:00
|
|
|
private:
|
|
|
|
UPROPERTY(VisibleDefaultsOnly)
|
|
|
|
UHealthComponent* HealthComponent = nullptr;
|
|
|
|
|
2023-02-09 22:56:52 +01:00
|
|
|
int CurrentInventorySlot = 0;
|
|
|
|
|
2022-12-13 05:11:56 +01:00
|
|
|
public:
|
|
|
|
// Sets default values for this character's properties
|
|
|
|
ANakatomiCharacter();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Called when the game starts or when spawned
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
2023-06-23 22:06:18 +02:00
|
|
|
public:
|
2022-12-13 05:11:56 +01:00
|
|
|
// Called every frame
|
|
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
|
|
|
|
// Called to bind functionality to input
|
|
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
|
|
|
|
UHealthComponent* GetHealthComponent();
|
|
|
|
|
|
|
|
void SetHealthComponent(UHealthComponent* healthComponent);
|
2023-02-09 22:56:52 +01:00
|
|
|
|
|
|
|
void SetInventoryToDefault();
|
|
|
|
|
|
|
|
void SelectInventorySlot(int slot);
|
|
|
|
|
|
|
|
void InventoryIncrement();
|
|
|
|
|
|
|
|
void InventoryDecrement();
|
|
|
|
|
|
|
|
void AddWeaponToInventory(TSubclassOf<class AWeapon> weapon);
|
|
|
|
|
2023-02-12 21:33:08 +01:00
|
|
|
void AddWeaponToInventory(AWeapon* weapon);
|
|
|
|
|
2023-02-09 22:56:52 +01:00
|
|
|
void RemoveWeaponFromInventory(int i);
|
|
|
|
|
|
|
|
void RemoveWeaponFromInventory(AWeapon* weapon);
|
|
|
|
|
|
|
|
void RemoveCurrentWeaponFromInventory();
|
|
|
|
|
|
|
|
AWeapon* InitializeWeapon(TSubclassOf<class AWeapon> weapon);
|
|
|
|
|
|
|
|
AWeapon* GetCurrentWeapon();
|
|
|
|
|
|
|
|
void SetCurrentWeapon(AWeapon* weapon);
|
2023-02-12 21:33:08 +01:00
|
|
|
|
|
|
|
int GetCurrentInventorySlot();
|
2023-03-13 22:45:56 +01:00
|
|
|
|
2023-03-13 23:01:21 +01:00
|
|
|
virtual void OnFire();
|
|
|
|
|
2023-03-13 22:56:23 +01:00
|
|
|
protected:
|
2023-03-13 22:45:56 +01:00
|
|
|
virtual void CalculateHits(TArray<FHitResult>* hits);
|
|
|
|
|
2023-03-13 22:56:23 +01:00
|
|
|
virtual void ProcessHits(TArray<FHitResult> hits);
|
2022-12-13 05:11:56 +01:00
|
|
|
};
|