Oakfolks Gold_1.14
Oakfolks coop game
Loading...
Searching...
No Matches
MiniGameSystem.h
1#pragma once
2
3#include "CoreMinimal.h"
4#include "Delegates/Delegate.h"
5#include "BCR/Headers/System/Pickable/PickableItem.h"
6#include "BCR/Headers/Interfaces/Interactable.h"
7#include "GameFramework/Actor.h"
8#include <Components/BoxComponent.h>
9#include <Components/BillboardComponent.h>
10#include "MiniGameSystem.generated.h"
11
16
19UDELEGATE()
20DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEndQTESignature, bool, _resultStatus);
21
23
27UCLASS()
28class BCR_API AMiniGameSystem : public AActor, public IInteractable
29{
30 GENERATED_BODY()
31
32public:
33
36 virtual void BeginPlay() override;
37 virtual void Tick(float DeltaTime) override;
38
41 UFUNCTION(BlueprintCallable)
42 virtual void SetInputItem(TArray<TSubclassOf<APickableItem>> _items);
43 UFUNCTION(BlueprintCallable)
44 virtual void SetQTE(UQTEConfigurationAsset* _datas);
45 UFUNCTION(BlueprintCallable)
46 virtual void SetOutputItem(TArray<TSubclassOf<APickableItem>> _items);
47
50 UFUNCTION(BlueprintCallable)
51 void StartExecute();
52 UFUNCTION(BlueprintCallable)
53 void CallQTEReader();
54 UFUNCTION(BlueprintCallable)
55 void FinishExecute(bool _success);
56 UFUNCTION(BlueprintCallable)
57 void SpawnItem(int i);
58 UFUNCTION(BlueprintCallable)
59 void Reset();
60 UFUNCTION(BlueprintCallable)
61 void PartialReset(TSubclassOf<APickableItem> itemClass);
62
65 UPROPERTY(EditAnywhere, BlueprintReadOnly)
66 UBillboardComponent* snapPlayerPoint1;
67 UPROPERTY(EditAnywhere, BlueprintReadOnly)
68 UBillboardComponent* snapPlayerPoint2;
69 UPROPERTY(EditAnywhere, BlueprintReadOnly)
70 UBillboardComponent* outputSpawnPoint;
71 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
72 TMap<UBillboardComponent*, AMainPlayer*> snapPointMap;
73
75 UPROPERTY(EditAnywhere, BlueprintReadOnly)
76 UBoxComponent* inputBox;
77
80 void Interact_Implementation(AMainPlayer* Player);
81 void InteractWithObject_Implementation(AMainPlayer* Player, AActor* Object);
82
85 UFUNCTION(BlueprintCallable)
86 bool checkItemPresent();
87 UFUNCTION(BlueprintCallable)
88 int checkItemInRecipe(APickableItem* item);
89 UFUNCTION(BlueprintCallable)
90 void SetPresentItem(APickableItem* item);
91 UFUNCTION(BlueprintCallable)
92 void RemoveItemFromList(int i);
93 UFUNCTION(BlueprintCallable)
94 bool PlayerIsInBox(AMainPlayer* Player);
95
98 UFUNCTION(BlueprintNativeEvent)
99 void OnFirstSnapPointResult(EQTEResult Result);
100 void OnFirstSnapPointResult_Implementation(EQTEResult Result);
101 UFUNCTION(BlueprintNativeEvent)
102 void OnSecondSnapPointResult(EQTEResult Result);
103 void OnSecondSnapPointResult_Implementation(EQTEResult Result);
104 UFUNCTION(BlueprintNativeEvent)
105 void OnFirstSnapPointProgress(const FQTEActionProgress& Progress);
106 void OnFirstSnapPointProgress_Implementation(const FQTEActionProgress& Progress);
107 UFUNCTION(BlueprintNativeEvent)
108 void OnSecondSnapPointProgress(const FQTEActionProgress& Progress);
109 void OnSecondSnapPointProgress_Implementation(const FQTEActionProgress& Progress);
110 UFUNCTION(BlueprintNativeEvent)
111 void OnQTEComplete(const bool bSuccess);
112 void OnQTEComplete_Implementation(const bool bSuccess);
113
115 UBillboardComponent* GetNearestComponent(FVector ToLocation, TArray<UBillboardComponent*> Components);
116
117private:
118
120 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
121 USceneComponent* DefaultRootComponent;
122
125 UPROPERTY(EditAnywhere)
126 TArray<TSubclassOf<APickableItem>> inputItems;
127 TArray<TSubclassOf<APickableItem>> itemList; /*Copy of inputItems*/
128 UPROPERTY(EditAnywhere)
129 TMap<APickableItem*,TSubclassOf<APickableItem>> presentItem;
130 UPROPERTY(EditAnywhere)
131 TArray<TSubclassOf<APickableItem>> outputItems;
132
135 UPROPERTY(EditAnywhere)
136 UQTEConfigurationAsset* QTEConfig;
137 UPROPERTY(EditAnywhere)
138 TArray<ULocomotionConfigurationAsset*> locomotionConfigs;
139
142 UPROPERTY()
143 int Debug;
144 UPROPERTY(EditAnywhere)
145 float MaxSnapPointDistance = 200.f;
146};
Main player character for cooperative gameplay.
Definition MainPlayer.h:32
Core system for cooperative mini-games with QTE integration.
Definition MiniGameSystem.h:29
Base class for all pickable objects in the game.
Definition PickableItem.h:16
Interface for objects that can be interacted with by players.
Definition Interactable.h:30
Asset container for locomotion configuration data.
Definition LocomotionConfigurationTypes.h:81
Definition QTEConfigurationTypes.h:30
Real-time QTE action progress information.
Definition QTETypes.h:136