2022-11-10 11:52:10 +00:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "GameFramework/Character.h"
|
2022-11-15 03:27:44 +00:00
|
|
|
#include "the_twilight_abyss/BaseItems/Items/BaseItem.h"
|
2023-01-16 20:44:23 +00:00
|
|
|
#include "Camera/CameraComponent.h"
|
2023-02-06 15:55:12 +00:00
|
|
|
#include "Engine/PostProcessVolume.h"
|
2023-04-24 17:01:51 +00:00
|
|
|
#include "Components/WidgetInteractionComponent.h"
|
|
|
|
#include "../TurnBasedCombatV2/TurnBaseCombatV2.h"
|
2022-11-10 11:52:10 +00:00
|
|
|
#include "TempCharacter.generated.h"
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
class THE_TWILIGHT_ABYSS_API ATempCharacter : public ACharacter
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Sets default values for this character's properties
|
|
|
|
ATempCharacter();
|
2023-04-26 02:51:17 +00:00
|
|
|
void ResetWidgetPointer() const;
|
2022-11-10 11:52:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Called when the game starts or when spawned
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
|
|
|
void ForwardInput(float Axis);
|
|
|
|
void RightMoveInput(float Axis);
|
|
|
|
|
2023-02-06 14:30:13 +00:00
|
|
|
UFUNCTION()
|
|
|
|
void Sneak();
|
|
|
|
|
2023-02-06 15:26:22 +00:00
|
|
|
UCapsuleComponent* PlayerCapsule;
|
2023-04-24 17:01:51 +00:00
|
|
|
UPROPERTY()
|
|
|
|
APlayerController* FirstPlayerController;
|
|
|
|
UPROPERTY()
|
|
|
|
UWidgetInteractionComponent* WidgetPointer;
|
|
|
|
UPROPERTY()
|
|
|
|
ATurnBaseCombatV2* CombatSystem;
|
2023-02-06 15:26:22 +00:00
|
|
|
|
2022-11-10 11:52:10 +00:00
|
|
|
public:
|
|
|
|
// Called every frame
|
|
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
|
2023-01-12 13:56:30 +00:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Inventory, meta = (AllowPrivateAccess = "true"))
|
|
|
|
class UInventoryComponent* Inventory; //Using the InventoryComponent class
|
2023-03-16 14:49:17 +00:00
|
|
|
|
2023-03-14 13:04:33 +00:00
|
|
|
|
2022-11-10 11:52:10 +00:00
|
|
|
// Called to bind functionality to input
|
|
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
2023-03-06 04:28:13 +00:00
|
|
|
|
2022-11-11 20:21:44 +00:00
|
|
|
void KeyPressed();
|
2023-03-06 04:28:13 +00:00
|
|
|
|
2022-11-11 22:21:10 +00:00
|
|
|
UPROPERTY(EditAnyWhere)
|
2023-04-28 00:40:49 +00:00
|
|
|
float TraceDistance = 200;
|
2023-01-14 20:35:49 +00:00
|
|
|
|
2023-05-11 10:56:03 +00:00
|
|
|
UFUNCTION(BlueprintCallable)
|
2023-01-14 20:35:49 +00:00
|
|
|
void InputDisabler();
|
2023-05-11 10:56:03 +00:00
|
|
|
|
2022-11-11 22:21:10 +00:00
|
|
|
void LineTraceLogic();
|
2022-11-14 15:53:50 +00:00
|
|
|
|
2023-03-05 17:41:39 +00:00
|
|
|
UPROPERTY()
|
|
|
|
class UPawnNoiseEmitterComponent* NoiseEmitter;
|
2023-03-06 04:28:13 +00:00
|
|
|
|
2022-11-19 20:08:00 +00:00
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= "Health")
|
2022-11-14 15:53:50 +00:00
|
|
|
float Health;
|
2022-11-14 16:52:57 +00:00
|
|
|
|
2022-11-19 20:08:00 +00:00
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category= "Gold")
|
2022-11-15 03:27:44 +00:00
|
|
|
int GoldBalance;
|
|
|
|
|
2022-11-23 00:55:55 +00:00
|
|
|
UPROPERTY(VisibleDefaultsOnly, Category = "LineTrace")
|
|
|
|
bool bHit;
|
2023-03-06 04:28:13 +00:00
|
|
|
|
2022-11-14 16:52:57 +00:00
|
|
|
//Using the item in the inventory
|
|
|
|
UFUNCTION(BlueprintCallable, Category= "Items")
|
2022-11-15 03:27:44 +00:00
|
|
|
void UseItem(class UBaseItem* Item); // Overriding the BaseItem Class
|
2023-01-15 16:15:06 +00:00
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void InputEnabler();
|
2023-01-16 20:44:23 +00:00
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera")
|
|
|
|
UCameraComponent* ThisCamera;
|
|
|
|
|
|
|
|
FVector OriginalCameraLocation;
|
2023-03-06 04:28:13 +00:00
|
|
|
|
2023-01-16 20:44:23 +00:00
|
|
|
FRotator OriginalCameraRotation;
|
|
|
|
|
|
|
|
int OriginalCameraFOV;
|
|
|
|
|
2023-01-16 21:25:54 +00:00
|
|
|
UFUNCTION(BlueprintCallable, Category= "Items")
|
2023-03-28 02:43:31 +00:00
|
|
|
void BuyItem(AActor* Item);
|
2023-01-30 21:07:36 +00:00
|
|
|
|
|
|
|
bool bShopKeeperText = false;
|
2023-02-04 17:39:12 +00:00
|
|
|
|
|
|
|
UPROPERTY(BlueprintReadWrite)
|
|
|
|
bool disableTab = false;
|
2023-02-06 14:30:13 +00:00
|
|
|
|
2023-02-06 15:55:12 +00:00
|
|
|
APostProcessVolume* PostProcessVolume;
|
2023-02-16 15:02:58 +00:00
|
|
|
|
2023-03-06 04:28:13 +00:00
|
|
|
TArray<AActor*> AIActors;
|
2023-02-16 15:02:58 +00:00
|
|
|
|
|
|
|
FName Enemy;
|
|
|
|
|
2023-02-19 15:28:34 +00:00
|
|
|
FName Ammo;
|
|
|
|
|
2023-04-28 04:31:57 +00:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
2023-02-27 04:07:19 +00:00
|
|
|
float ReactionSpeed = 100.0f;
|
2023-03-05 17:41:39 +00:00
|
|
|
|
|
|
|
bool isInStealth = false;
|
2023-03-06 05:25:36 +00:00
|
|
|
|
2023-03-14 13:04:33 +00:00
|
|
|
UPROPERTY()
|
|
|
|
UUserWidget* ImportantStatsWidget;
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
UUserWidget* CrossHairWidget;
|
|
|
|
|
2023-03-06 05:25:36 +00:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
|
|
|
|
UUserWidget* ImportantStats;
|
2023-03-14 13:04:33 +00:00
|
|
|
|
2023-03-06 17:27:16 +00:00
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
|
|
|
|
UUserWidget* MainMenuWidget;
|
2023-03-14 13:04:33 +00:00
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category= "Widgets")
|
|
|
|
TSubclassOf<UUserWidget> ImportantStatsSub;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category= "Widgets")
|
|
|
|
TSubclassOf<UUserWidget> MainMenuSub;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category= "Widgets")
|
|
|
|
TSubclassOf<UUserWidget> CrossHairSub;
|
|
|
|
|
2023-05-10 12:27:27 +00:00
|
|
|
private:
|
2023-03-14 13:04:33 +00:00
|
|
|
|
2023-05-10 12:27:27 +00:00
|
|
|
UPROPERTY()
|
|
|
|
FHitResult OutHit;
|
|
|
|
|
|
|
|
UFUNCTION()
|
|
|
|
void AddToInventory();
|
2022-11-10 11:52:10 +00:00
|
|
|
};
|