From fa679b06b4c92170065d60604da91790d9d40317 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Tue, 10 Oct 2023 17:59:56 +0100 Subject: [PATCH 01/27] Reworked Side Bounty Spawning Technique Every Bounty now stores there own side bounties, however, the bounty director still spawns them in --- .../BountySystem/CC_ReturnToShip.uasset | 4 +- .../Test_Bounty1/BC_TestBounty1.uasset | 4 +- .../HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 4 +- .../BountySystem/BountyClass.cpp | 34 -------------- .../BountySystem/BountyClass.h | 10 +++-- .../BountySystem/BountyDirector.cpp | 45 ++++--------------- .../BountySystem/BountyDirector.h | 14 +----- 7 files changed, 22 insertions(+), 93 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset b/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset index 9fce0370..610c41ad 100644 --- a/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset +++ b/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c7cad648008fd70041f5bf4f160cffa927427c047f41469065e52f61f4fbc5ac -size 22256 +oid sha256:2ff74658b687ff7bf8619b0b1cc1a4c086dee8fb5d7cd21fa820a7272b602721 +size 13616 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset index 6235ec12..3afe0b52 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd50cc9532eeeff9ce7cb812e9e03c28b92860a7793f37f4f39b9a061a0a075a -size 27020 +oid sha256:9e59c8ac9357ddb7da324f75e67b79e1dc430da18acb4638a82a7f6a0bb228f5 +size 26624 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index f281fcf6..9819ebfd 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:999086617d1b45a70b6fc5db1c639bfff0ec0bba5952340e163a1d5d8c21a206 -size 249 +oid sha256:a23fd0e2dcb1d9ef6281f8b224a2fac4c24819434c765688132505ba1439ff83 +size 66790690 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index ae8fbd8d..d1df86ae 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -93,38 +93,4 @@ void ABountyClass::CollectRewards_Implementation() UE_LOG(LogTemp, Warning, TEXT("The player has gained $%d for completing the bounty!"), RewardMoney); } -void ABountyClass::UpdateBountyCheckpoints(TMap> ReplacementCheckpoints) -{ - if (ReplacementCheckpoints.IsEmpty()) - { - UE_LOG(LogTemp, Warning, TEXT("No Replacement Steps found")); - return; - } - - FActorSpawnParameters SpawnParameters; - SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - - for (auto ReplacementCheckpoint : ReplacementCheckpoints) - { - BountyCheckpoints[ReplacementCheckpoint.Key]->Destroy(); - ReplacementCheckpointClass = ReplacementCheckpoint.Value; - - FVector Loc = ReplacementCheckpointClass.GetDefaultObject()->GetCheckpointSpawnTransform().GetLocation(); - FRotator Rot = ReplacementCheckpointClass.GetDefaultObject()->GetCheckpointSpawnTransform().GetRotation().Rotator(); - ACheckpointClass* SpawnedCheckpoint = Cast(GetWorld()->SpawnActor(ReplacementCheckpoint.Value, Loc, Rot, SpawnParameters)); - - if (SpawnedCheckpoint == nullptr) - { - UE_LOG(LogTemp, Fatal, TEXT("The new checkpoint hasn't spawned in properly or can't be cast to")); - return; - } - - BountyCheckpoints[ReplacementCheckpoint.Key] = SpawnedCheckpoint; - if (ReplacementCheckpoint.Key == 0) - { - BountyCheckpoints[ReplacementCheckpoint.Key]->Active = true; - BountyCheckpoints[ReplacementCheckpoint.Key]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint); - } - } -} diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 4f65bae9..8b910cc1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -23,6 +23,9 @@ protected: // ------- Properties Set in Editor -------------- UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray> CheckpointsToSpawn; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray> SideBountiesToSpawn; UPROPERTY(EditDefaultsOnly, Category = "Bounty") int RewardMoney = 0; @@ -62,6 +65,10 @@ public: return Completed; } + TArray> GetSideBountiesToSpawn() + { + return SideBountiesToSpawn; + } FString GetBountyTitle() { return BountyTitle; @@ -136,7 +143,4 @@ public: BountyCheckpoints[0]->Destroy(); } - - // Called by Bounty Director, replaces specified checkpoints to alter Bounty when player completes a side bounty - void UpdateBountyCheckpoints(TMap> ReplacementCheckpoints); }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 7cf44c2a..f14f4580 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -34,14 +34,7 @@ void ABountyDirector::BeginPlay() if (!IsValid(BountyAttachmentPoint)) UE_LOG(LogTemp, Fatal, TEXT("There's no Bounty Attachment UArrowComponent on Players Char ")); break; } - - // Setup up starting Side Bounty indexes - for (int Index = 0; Index < 3; Index++) - { - CurrentSideBountyIndexes.Add(Index); - } - - ActiveSideBounties.SetNum(3); + SpawnBountyAndItsSideBounties(); UpdateBountyDisplay(); } @@ -66,22 +59,16 @@ void ABountyDirector::SpawnBountyAndItsSideBounties() // WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!! ActiveBounty->CompletedFirstCheckpoint.AddDynamic(this, &ABountyDirector::DestroyActiveSideBounties); - - // Spawn in Side Bounties which are linked to the Main Bounty - int ActiveSideBountyIndex = 0; - for (int CurrentSideBountyIndex : CurrentSideBountyIndexes) + ActiveSideBounties.Reset(); + for (TSubclassOf SideBountyClass : ActiveBounty->GetSideBountiesToSpawn()) { - if (SideBountyClassArray.Num() <= CurrentSideBountyIndex || !IsValid(SideBountyClassArray[CurrentSideBountyIndex])) continue; - - AActor* SideBountyActor = GetWorld()->SpawnActor(SideBountyClassArray[CurrentSideBountyIndex], PlayerChar->GetActorLocation(), PlayerChar->GetActorRotation(), SpawnParams); + if (!IsValid(SideBountyClass)) continue; + AActor* SideBountyActor = GetWorld()->SpawnActor(SideBountyClass, PlayerChar->GetActorLocation(), PlayerChar->GetActorRotation(), SpawnParams); + SideBountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules); ASideBountyClass* SideBounty = Cast(SideBountyActor); - SideBounty->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules); - - ActiveSideBounties[ActiveSideBountyIndex] = SideBounty; - SideBounty->ActiveSBC_Index = ActiveSideBountyIndex; - ActiveSideBounties[ActiveSideBountyIndex]->CompletedSideBounty.AddDynamic(this, &ABountyDirector::SideBountyCompleted); + if (!IsValid(SideBounty)) UE_LOG(LogTemp, Fatal, TEXT("A SideBounty for %s has been set to a wrong type"), *ActiveBounty->GetBountyTitle()); + ActiveSideBounties.Add(SideBounty); // ONCE AGAIN WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS SIDE BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!! - ActiveSideBountyIndex++; } } @@ -103,10 +90,6 @@ void ABountyDirector::FinishActiveBounty() // Increment Main and Side Bounty Indexes CurrentBountyIndex++; - for (int i = 0; i < 3; i++) - { - CurrentSideBountyIndexes[i] += 3; - } // Game Completion Check if (CurrentBountyIndex >= BountyClassArray.Num()) @@ -136,17 +119,5 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } -void ABountyDirector::SideBountyCompleted(int SideBountyIndex) -{ - UE_LOG(LogTemp,Warning,TEXT("Updating Main Bounties Checkpoints")); - ActiveBounty->UpdateBountyCheckpoints(ActiveSideBounties[SideBountyIndex]->GetReplacementCheckpoints()); - - // WHEN MARCEL STOPS PLAYING WITH PLAYER CHAR, REMOVE THIS SIDE BOUNTY FROM ACTIVE BOUNTIES - ActiveSideBounties[SideBountyIndex]->CollectRewards(); - ActiveSideBounties[SideBountyIndex]->DestroyCheckpoints(); - ActiveSideBounties[SideBountyIndex]->Destroy(); - - UpdateBountyDisplay(); -} diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index c5c67311..14534e75 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -23,14 +23,8 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray> BountyClassArray; - // Ordered Array of Side Bounties, in three's - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray> SideBountyClassArray; - int CurrentBountyIndex = 0; - TArray CurrentSideBountyIndexes; - UPROPERTY(VisibleAnywhere, Category = "Bounty") ABountyClass* ActiveBounty; @@ -54,11 +48,7 @@ protected: based on data from ActiveBC and ActiveSBC */ UFUNCTION(BlueprintImplementableEvent, Category = "bounty") void UpdateBountyDisplay(); - - // Ran when a Side Bounty is completed and wants to update the active bounties checkpoints - UFUNCTION() - void SideBountyCompleted(int SideBountyIndex); - + UFUNCTION() void DestroyActiveSideBounties(); @@ -93,6 +83,4 @@ public: { return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("N/A") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); } - - }; From 147dcaef6f98a631321a399d5cefccf58c9dcb04 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Tue, 10 Oct 2023 18:21:54 +0100 Subject: [PATCH 02/27] Implemented Side Bounties Awarding Favours --- .../BountySystem/BountyDirector.cpp | 9 ++++++++- .../BountySystem/BountyDirector.h | 3 +++ .../BountySystem/SideBountyClass.cpp | 3 +-- .../BountySystem/SideBountyClass.h | 18 +++++------------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index f14f4580..6f1a7cab 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -67,7 +67,8 @@ void ABountyDirector::SpawnBountyAndItsSideBounties() SideBountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules); ASideBountyClass* SideBounty = Cast(SideBountyActor); if (!IsValid(SideBounty)) UE_LOG(LogTemp, Fatal, TEXT("A SideBounty for %s has been set to a wrong type"), *ActiveBounty->GetBountyTitle()); - ActiveSideBounties.Add(SideBounty); + int i = ActiveSideBounties.Add(SideBounty); + ActiveSideBounties[i]->CompletedSideBounty.AddDynamic(this, &ABountyDirector::EarnFavours); // ONCE AGAIN WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS SIDE BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!! } } @@ -119,5 +120,11 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } +void ABountyDirector::EarnFavours(int FavoursEarned) +{ + UE_LOG(LogTemp, Warning, TEXT("Earned %d favours"), FavoursEarned); +} + + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 14534e75..04c04f42 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -52,6 +52,9 @@ protected: UFUNCTION() void DestroyActiveSideBounties(); + UFUNCTION() + void EarnFavours(int FavoursEarned); + public: // Called every frame virtual void Tick(float DeltaTime) override; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp index 7d63f3ba..b104f604 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp @@ -16,8 +16,7 @@ void ASideBountyClass::IncrementBountyCheckpoint() if (Completed) { - - CompletedSideBounty.Broadcast(ActiveSBC_Index); + CompletedSideBounty.Broadcast(FavoursEarnedForCompletion); } } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h index 9c0dd1e2..35d481fd 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h @@ -6,30 +6,22 @@ #include "BountyClass.h" #include "SideBountyClass.generated.h" -DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, SB_Index); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, FavoursEarned); UCLASS() class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass { GENERATED_BODY() - - UPROPERTY(EditDefaultsOnly, Category = "Side Bounty") - TMap> ReplacementCheckpoints; - + protected: + UPROPERTY(EditDefaultsOnly, Category = "Side Bounty") + int FavoursEarnedForCompletion = 1; + virtual void BeginPlay() override; public: FCompletedSideBounty CompletedSideBounty; - int ActiveSBC_Index; - - TMap> GetReplacementCheckpoints() - { - return ReplacementCheckpoints; - } - virtual void IncrementBountyCheckpoint() override; - void DestroyCheckpoints(); }; From 72e445efed119f5759ca06b6b81c5b03b3b16e33 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Tue, 10 Oct 2023 18:47:33 +0100 Subject: [PATCH 03/27] Reverted Return To Ship Checkpoint Functionality Revert back to a bounty being completed when no more checkpoints exist for it, rather than having an uncompletable return to ship cp which is ignored when considering completion requirements --- EndlessVendetta/Content/BountySystem/BountyDirector.uasset | 4 ++-- EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset | 3 --- .../TestBounties/Test_Bounty1/BC_TestBounty1.uasset | 4 ++-- .../TestBounties/Test_Bounty2/BC_TestBounty2.uasset | 4 ++-- .../StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 2 +- .../C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset | 2 +- .../Source/EndlessVendetta/BountySystem/BountyClass.cpp | 2 +- .../Source/EndlessVendetta/BountySystem/BountyClass.h | 6 ------ .../Source/EndlessVendetta/BountySystem/SideBountyClass.cpp | 3 +-- 9 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index 864d575c..abfc1024 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8364b58c763904adb7b727800d9e1d2de027a9793f82db94c34cfa3ef32be588 -size 43410 +oid sha256:095a379c23e9c3e8d2b07f5b2036d1588931675bee26a2010492c88371620daa +size 42288 diff --git a/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset b/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset deleted file mode 100644 index 610c41ad..00000000 --- a/EndlessVendetta/Content/BountySystem/CC_ReturnToShip.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2ff74658b687ff7bf8619b0b1cc1a4c086dee8fb5d7cd21fa820a7272b602721 -size 13616 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset index 3afe0b52..a8e574e8 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9e59c8ac9357ddb7da324f75e67b79e1dc430da18acb4638a82a7f6a0bb228f5 -size 26624 +oid sha256:72c5dfd7d5c28c07bf90a5870537b16857a6f499d52fee718053eaffd1ae65ca +size 26471 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset index 885ca38f..f0364734 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42dfa3a8b7f8c66bbdf4f9875672f9efc2501e7aee9e28f0dfbd72a1259b0493 -size 22778 +oid sha256:02a0727628be7a72134a3148e042f64691e43b299dd349c9246c034a40c4f798 +size 22625 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 9819ebfd..0c9d4e26 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a23fd0e2dcb1d9ef6281f8b224a2fac4c24819434c765688132505ba1439ff83 +oid sha256:9a25fb0509937f11c2ef9e1e717d9d14d1d41e26352da8353f1181fd19aa5c0d size 66790690 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index a396b15f..08f07fda 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04de015b0bb32939230883654ad41bf7054c369134749aeb11e98f963a1c0a09 +oid sha256:444ddcb2a79ffd12016502dc9f588c06ea0a5e07e033556a698f2cb3249c0d58 size 4464 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index d1df86ae..a115427a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -61,7 +61,7 @@ void ABountyClass::IncrementBountyCheckpoint() } // Bounty Completion Condition - if (BountyCheckpoints.Num() <= MinCPsRequiredForCompletion) + if (BountyCheckpoints.Num() <= 1) { Completed = true; BountyCheckpoints[0]->Active = false; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 8b910cc1..48ecb257 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -39,12 +39,6 @@ protected: bool Completed = false; - /** - * Default is 2 as final step in most Bounties is to return to ship, - * which can't be completed. Change to 1 if that's not the case. - */ - int MinCPsRequiredForCompletion = 2; - // Spawned in Checkpoints for this Bounty TArray BountyCheckpoints; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp index b104f604..d28c84e6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp @@ -6,8 +6,7 @@ void ASideBountyClass::BeginPlay() { Super::BeginPlay(); - - MinCPsRequiredForCompletion = 1; + } void ASideBountyClass::IncrementBountyCheckpoint() From 3c1d16c9671fdd5c8cbbd72a84ea4665d6556db0 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Tue, 10 Oct 2023 19:11:29 +0100 Subject: [PATCH 04/27] Added Custom Bounty Altering Effect UFunctions --- .../BountySystem/BountyClass.h | 41 +++++++++++++++---- .../BountySystem/BountyDirector.cpp | 1 - 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 48ecb257..40f2ff03 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -35,6 +35,16 @@ protected: UPROPERTY(EditDefaultsOnly, Category = "Bounty") FString BountyDesc; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomAlteringEffect1_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomAlteringEffect2_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomAlteringEffect3_Description; + // ----------------------------------------------- bool Completed = false; @@ -128,13 +138,30 @@ public: UFUNCTION(BlueprintCallable, BlueprintNativeEvent) void CollectRewards(); - void DestroyReturnToShipStep() - { - if (BountyCheckpoints.Num() > 1) - { - UE_LOG(LogTemp, Warning, TEXT("Didn't Destroy final step as more than one steps still left in Bounty")); - } + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void CustomBountyAlteringEffect1(); - BountyCheckpoints[0]->Destroy(); + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteringEffect1_Description() + { + return CustomAlteringEffect1_Description; + } + + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void CustomBountyAlteringEffect2(); + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteringEffect2_Description() + { + return CustomAlteringEffect2_Description; + } + + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void CustomBountyAlteringEffect3(); + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteringEffect3_Description() + { + return CustomAlteringEffect3_Description; } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 6f1a7cab..8708cf04 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -85,7 +85,6 @@ void ABountyDirector::FinishActiveBounty() ActiveBounty->CollectRewards(); // Destroy old Bounties - ActiveBounty->DestroyReturnToShipStep(); ActiveBounty->Destroy(); DestroyActiveSideBounties(); From c6db0146e4a48c34d044ad7e5e62e9251bdadd63 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Tue, 10 Oct 2023 19:54:01 +0100 Subject: [PATCH 05/27] Implemented Simple Bounty Alterations --- .../BountySystem/BountyClass.cpp | 22 ++++ .../BountySystem/BountyClass.h | 101 ++++++++++++++---- 2 files changed, 102 insertions(+), 21 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index a115427a..35e32ac1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -93,4 +93,26 @@ void ABountyClass::CollectRewards_Implementation() UE_LOG(LogTemp, Warning, TEXT("The player has gained $%d for completing the bounty!"), RewardMoney); } +void ABountyClass::BuySpawnAmmoDrops() +{ + FActorSpawnParameters SpawnParameters; + SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + for (FTransform Spawn : AmmoDropSpawnTransforms) + { + GetWorld()->SpawnActor(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + } +} + +void ABountyClass::BuySpawnHealthDrops() +{ + FActorSpawnParameters SpawnParameters; + SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + for (FTransform Spawn : HealthDropSpawnTransforms) + { + GetWorld()->SpawnActor(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + } +} + + + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 40f2ff03..d79cdd38 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -35,15 +35,38 @@ protected: UPROPERTY(EditDefaultsOnly, Category = "Bounty") FString BountyDesc; + // ---------------- Bounty Alterations ---------------- + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomBountyAlteration_1_Description; UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomAlteringEffect1_Description; + int CustomBountyAlteration_1_Cost = 2; UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomAlteringEffect2_Description; + FString CustomBountyAlteration_2_Description; UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomAlteringEffect3_Description; + int CustomBountyAlteration_2_Cost = 2; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomBountyAlteration_3_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + int CustomBountyAlteration_3_Cost = 2; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray AmmoDropSpawnTransforms; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TSubclassOf AmmoDropClass; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray HealthDropSpawnTransforms; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TSubclassOf HealthDropClass; + + bool HasEnemyRadio = false; // ----------------------------------------------- @@ -138,30 +161,66 @@ public: UFUNCTION(BlueprintCallable, BlueprintNativeEvent) void CollectRewards(); - UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void CustomBountyAlteringEffect1(); - UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteringEffect1_Description() - { - return CustomAlteringEffect1_Description; - } +// ------------- Custom Bounty Alterations ------------- + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void BuyCustomBountyAlteration_1(); UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void CustomBountyAlteringEffect2(); - - UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteringEffect2_Description() - { - return CustomAlteringEffect2_Description; - } - + void BuyCustomBountyAlteration_2(); + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void CustomBountyAlteringEffect3(); + void BuyCustomBountyAlteration_3(); UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteringEffect3_Description() + FString GetCustomBountyAlteration_1_Description() { - return CustomAlteringEffect3_Description; + return CustomBountyAlteration_1_Description; } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteration_2_Description() + { + return CustomBountyAlteration_2_Description; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteration_3_Description() + { + return CustomBountyAlteration_3_Description; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_1_Cost() + { + return CustomBountyAlteration_1_Cost; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_2_Cost() + { + return CustomBountyAlteration_2_Cost; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_3_Cost() + { + return CustomBountyAlteration_3_Cost; + } +// ------------- Simple Bounty Alterations ------------- + + void BuySpawnAmmoDrops(); + + void BuySpawnHealthDrops(); + + void BuyEnemyRadio() + { + HasEnemyRadio = true; + } + + // Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned + bool CheckIfHasEnemyRadio() + { + return HasEnemyRadio; + }; }; From 546e7b4a6d99a300ec2159f7dd80a9e56bce1e66 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 11 Oct 2023 10:59:14 +0100 Subject: [PATCH 06/27] Created new Main Bounty Class Seperates new properties and behaviours associated with only the main bounties and not any other bounties --- .../Architecture/Floor_400x400.uasset | 4 +- .../HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 4 +- .../BountySystem/BountyClass.cpp | 20 --- .../BountySystem/BountyClass.h | 105 +-------------- .../BountySystem/BountyDirector.cpp | 4 +- .../BountySystem/BountyDirector.h | 6 +- .../BountySystem/MainBountyClass.cpp | 24 ++++ .../BountySystem/MainBountyClass.h | 123 ++++++++++++++++++ 8 files changed, 157 insertions(+), 133 deletions(-) create mode 100644 EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..c85fe9b1 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:460f12438b7058cfb92d3fde1df787aab7d49edd287ff1449947c28a25c95add +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0c9d4e26..0f990580 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a25fb0509937f11c2ef9e1e717d9d14d1d41e26352da8353f1181fd19aa5c0d -size 66790690 +oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d +size 72364642 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index 35e32ac1..fe2a8c58 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -93,26 +93,6 @@ void ABountyClass::CollectRewards_Implementation() UE_LOG(LogTemp, Warning, TEXT("The player has gained $%d for completing the bounty!"), RewardMoney); } -void ABountyClass::BuySpawnAmmoDrops() -{ - FActorSpawnParameters SpawnParameters; - SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - for (FTransform Spawn : AmmoDropSpawnTransforms) - { - GetWorld()->SpawnActor(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); - } -} - -void ABountyClass::BuySpawnHealthDrops() -{ - FActorSpawnParameters SpawnParameters; - SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - for (FTransform Spawn : HealthDropSpawnTransforms) - { - GetWorld()->SpawnActor(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); - } -} - diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index d79cdd38..607d7945 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -23,9 +23,6 @@ protected: // ------- Properties Set in Editor -------------- UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray> CheckpointsToSpawn; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray> SideBountiesToSpawn; UPROPERTY(EditDefaultsOnly, Category = "Bounty") int RewardMoney = 0; @@ -35,39 +32,6 @@ protected: UPROPERTY(EditDefaultsOnly, Category = "Bounty") FString BountyDesc; - // ---------------- Bounty Alterations ---------------- - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_1_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_1_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_2_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_2_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_3_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_3_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray AmmoDropSpawnTransforms; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TSubclassOf AmmoDropClass; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray HealthDropSpawnTransforms; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TSubclassOf HealthDropClass; - - bool HasEnemyRadio = false; - // ----------------------------------------------- bool Completed = false; @@ -91,11 +55,7 @@ public: { return Completed; } - - TArray> GetSideBountiesToSpawn() - { - return SideBountiesToSpawn; - } + FString GetBountyTitle() { return BountyTitle; @@ -160,67 +120,4 @@ public: // Collect Money in C++, any other special reward will be implemented in BP if neccessary UFUNCTION(BlueprintCallable, BlueprintNativeEvent) void CollectRewards(); - - -// ------------- Custom Bounty Alterations ------------- - UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_1(); - - UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_2(); - - UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_3(); - - UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteration_1_Description() - { - return CustomBountyAlteration_1_Description; - } - - UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteration_2_Description() - { - return CustomBountyAlteration_2_Description; - } - - UFUNCTION(BlueprintCallable, Category = "Bounty") - FString GetCustomBountyAlteration_3_Description() - { - return CustomBountyAlteration_3_Description; - } - - UFUNCTION(BlueprintCallable, Category = "Bounty") - int GetCustomBountyAlteration_1_Cost() - { - return CustomBountyAlteration_1_Cost; - } - - UFUNCTION(BlueprintCallable, Category = "Bounty") - int GetCustomBountyAlteration_2_Cost() - { - return CustomBountyAlteration_2_Cost; - } - - UFUNCTION(BlueprintCallable, Category = "Bounty") - int GetCustomBountyAlteration_3_Cost() - { - return CustomBountyAlteration_3_Cost; - } -// ------------- Simple Bounty Alterations ------------- - - void BuySpawnAmmoDrops(); - - void BuySpawnHealthDrops(); - - void BuyEnemyRadio() - { - HasEnemyRadio = true; - } - - // Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned - bool CheckIfHasEnemyRadio() - { - return HasEnemyRadio; - }; }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 8708cf04..f2a11b38 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -54,13 +54,13 @@ void ABountyDirector::SpawnBountyAndItsSideBounties() const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true); BountyActor->AttachToComponent(BountyAttachmentPoint, AttachmentTransformRules); - ActiveBounty = Cast(BountyActor); + ActiveBounty = Cast(BountyActor); if (!IsValid(ActiveBounty)) UE_LOG(LogTemp, Fatal, TEXT("Failed to Cast to Bounty class")); // WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!! ActiveBounty->CompletedFirstCheckpoint.AddDynamic(this, &ABountyDirector::DestroyActiveSideBounties); ActiveSideBounties.Reset(); - for (TSubclassOf SideBountyClass : ActiveBounty->GetSideBountiesToSpawn()) + for (TSubclassOf SideBountyClass : ActiveBounty->GetSideBountiesToSpawn()) { if (!IsValid(SideBountyClass)) continue; AActor* SideBountyActor = GetWorld()->SpawnActor(SideBountyClass, PlayerChar->GetActorLocation(), PlayerChar->GetActorRotation(), SpawnParams); diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 04c04f42..08a92bc6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -3,7 +3,7 @@ #pragma once #include "CoreMinimal.h" -#include "BountyClass.h" +#include "MainBountyClass.h" #include "SideBountyClass.h" #include "EndlessVendetta/EndlessVendettaCharacter.h" #include "GameFramework/Actor.h" @@ -21,12 +21,12 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor // Ordered Array of Main Bounties UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray> BountyClassArray; + TArray> BountyClassArray; int CurrentBountyIndex = 0; UPROPERTY(VisibleAnywhere, Category = "Bounty") - ABountyClass* ActiveBounty; + AMainBountyClass* ActiveBounty; UPROPERTY(VisibleAnywhere, Category = "Bounty") TArray ActiveSideBounties; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp new file mode 100644 index 00000000..714fb672 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp @@ -0,0 +1,24 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MainBountyClass.h" + +void AMainBountyClass::BuySpawnAmmoDrops() +{ + FActorSpawnParameters SpawnParameters; + SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + for (FTransform Spawn : AmmoDropSpawnTransforms) + { + GetWorld()->SpawnActor(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + } +} + +void AMainBountyClass::BuySpawnHealthDrops() +{ + FActorSpawnParameters SpawnParameters; + SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + for (FTransform Spawn : HealthDropSpawnTransforms) + { + GetWorld()->SpawnActor(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + } +} \ No newline at end of file diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h new file mode 100644 index 00000000..a539b84c --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -0,0 +1,123 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "BountyClass.h" +#include "SideBountyClass.h" +#include "MainBountyClass.generated.h" + +/** + * + */ +UCLASS() +class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass +{ + GENERATED_BODY() + +protected: + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray> SideBountiesToSpawn; + + // ---------------- Bounty Alterations ---------------- + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomBountyAlteration_1_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + int CustomBountyAlteration_1_Cost = 2; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomBountyAlteration_2_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + int CustomBountyAlteration_2_Cost = 2; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + FString CustomBountyAlteration_3_Description; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + int CustomBountyAlteration_3_Cost = 2; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray AmmoDropSpawnTransforms; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TSubclassOf AmmoDropClass; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray HealthDropSpawnTransforms; + + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TSubclassOf HealthDropClass; + + bool HasEnemyRadio = false; + +public: + TArray> GetSideBountiesToSpawn() + { + return SideBountiesToSpawn; + } + + // ------------- Custom Bounty Alterations ------------- + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void BuyCustomBountyAlteration_1(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void BuyCustomBountyAlteration_2(); + + UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") + void BuyCustomBountyAlteration_3(); + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteration_1_Description() + { + return CustomBountyAlteration_1_Description; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteration_2_Description() + { + return CustomBountyAlteration_2_Description; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetCustomBountyAlteration_3_Description() + { + return CustomBountyAlteration_3_Description; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_1_Cost() + { + return CustomBountyAlteration_1_Cost; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_2_Cost() + { + return CustomBountyAlteration_2_Cost; + } + + UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetCustomBountyAlteration_3_Cost() + { + return CustomBountyAlteration_3_Cost; + } + // ------------- Simple Bounty Alterations ------------- + + void BuySpawnAmmoDrops(); + + void BuySpawnHealthDrops(); + + void BuyEnemyRadio() + { + HasEnemyRadio = true; + } + + // Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned + bool CheckIfHasEnemyRadio() + { + return HasEnemyRadio; + }; + +}; From 17916321f28de8246255cbaa5d9c8e8ec312418b Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 11 Oct 2023 13:20:28 +0100 Subject: [PATCH 07/27] Implemented Favour Buying System Wituout UI --- .../BountySystem/BountyDirector.cpp | 59 ++++++++++++++++++- .../BountySystem/BountyDirector.h | 27 ++++++++- .../EndlessVendettaCharacter.h | 2 + 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index f2a11b38..8e87f2e3 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -119,11 +119,68 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } +// ----------- Favour Shop --------------- + void ABountyDirector::EarnFavours(int FavoursEarned) { - UE_LOG(LogTemp, Warning, TEXT("Earned %d favours"), FavoursEarned); + Favours += FavoursEarned; +} + +void ABountyDirector::BuyCustomBountyAlteration_1() +{ + if (!IsValid(ActiveBounty)) return; + int Cost = ActiveBounty->GetCustomBountyAlteration_1_Cost(); + if (Favours < Cost) return; + Favours -= Cost; + ActiveBounty->BuyCustomBountyAlteration_1(); } +void ABountyDirector::BuyCustomBountyAlteration_2() +{ + if (!IsValid(ActiveBounty)) return; + int Cost = ActiveBounty->GetCustomBountyAlteration_2_Cost(); + if (Favours < Cost) return; + Favours -= Cost; + ActiveBounty->BuyCustomBountyAlteration_2(); +} +void ABountyDirector::BuyCustomBountyAlteration_3() +{ + if (!IsValid(ActiveBounty)) return; + int Cost = ActiveBounty->GetCustomBountyAlteration_3_Cost(); + if (Favours < Cost) return; + Favours -= Cost; + ActiveBounty->BuyCustomBountyAlteration_3(); +} +void ABountyDirector::BuyAmmoDrop() +{ + if (!IsValid(ActiveBounty)) return; + if (Favours < 1) return; + Favours--; + ActiveBounty->BuySpawnAmmoDrops(); +} + +void ABountyDirector::BuyHealthDrop() +{ + if (!IsValid(ActiveBounty)) return; + if (Favours < 1) return; + Favours--; + ActiveBounty->BuySpawnHealthDrops(); +} + +void ABountyDirector::BuyEnemyRadio() +{ + if (!IsValid(ActiveBounty)) return; + if (Favours < 1) return; + Favours--; + ActiveBounty->BuyEnemyRadio(); +} + +void ABountyDirector::BuyFavours() +{ + if (PlayerChar->Money < FavourCost) return; + PlayerChar->Money -= FavourCost; + Favours++; +} \ No newline at end of file diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 08a92bc6..dcaa927b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -20,9 +20,12 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor UArrowComponent* BountyAttachmentPoint; // Ordered Array of Main Bounties - UPROPERTY(EditDefaultsOnly, Category = "Bounty") + UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") TArray> BountyClassArray; + UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") + int FavourCost = 500; + int CurrentBountyIndex = 0; UPROPERTY(VisibleAnywhere, Category = "Bounty") @@ -41,6 +44,7 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor void FinishActiveBounty(); protected: + int Favours = 0; // Called when the game starts or when spawned virtual void BeginPlay() override; @@ -55,6 +59,27 @@ protected: UFUNCTION() void EarnFavours(int FavoursEarned); + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyCustomBountyAlteration_1(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyCustomBountyAlteration_2(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyCustomBountyAlteration_3(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyAmmoDrop(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyHealthDrop(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyEnemyRadio(); + + UFUNCTION(BlueprintCallable, Category = "Bounty Director") + void BuyFavours(); + public: // Called every frame virtual void Tick(float DeltaTime) override; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 3fb99716..b1c84ec7 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -86,6 +86,8 @@ protected: AGadgetManager* GadgetManager; public: + int Money = 2000; + /** Look Input Action */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) class UInputAction* LookAction; From be22eae329ed8793b8cb4cc150b54499c2225849 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 11 Oct 2023 14:59:17 +0100 Subject: [PATCH 08/27] Reparented Bounty Director to an Interactable Actor --- .../BountySystem/BountyDirector.uasset | 4 +-- .../Architecture/Floor_400x400.uasset | 4 +-- .../C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset | 4 +-- .../BountySystem/BountyDirector.cpp | 7 ++++ .../BountySystem/BountyDirector.h | 5 ++- .../EndlessVendetta/InteractableActor.cpp | 33 +++++++++++++++++++ .../EndlessVendetta/InteractableActor.h | 26 +++++++++++++++ 7 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 EndlessVendetta/Source/EndlessVendetta/InteractableActor.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/InteractableActor.h diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index abfc1024..0acba18f 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:095a379c23e9c3e8d2b07f5b2036d1588931675bee26a2010492c88371620daa -size 42288 +oid sha256:d9d96d19206de2c336790632a9774519478154bb0eedd7080b8ee8c485e15844 +size 43857 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c85fe9b1..c2a34afc 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:460f12438b7058cfb92d3fde1df787aab7d49edd287ff1449947c28a25c95add -size 14831 +oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 +size 14948 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index 08f07fda..29ca0d25 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:444ddcb2a79ffd12016502dc9f588c06ea0a5e07e033556a698f2cb3249c0d58 -size 4464 +oid sha256:b37ffa979db56e7f9d07e4c0d02718fa6f15cda90cf7e41886f7301a917cfe15 +size 4934 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 8e87f2e3..fbb820d2 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -119,6 +119,13 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } +void ABountyDirector::Interact() +{ + Super::Interact(); + UE_LOG(LogTemp, Warning, TEXT("This is where I'll put widget opening code!!!!")); +} + + // ----------- Favour Shop --------------- void ABountyDirector::EarnFavours(int FavoursEarned) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index dcaa927b..105e4b89 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -6,11 +6,12 @@ #include "MainBountyClass.h" #include "SideBountyClass.h" #include "EndlessVendetta/EndlessVendettaCharacter.h" +#include "EndlessVendetta/InteractableActor.h" #include "GameFramework/Actor.h" #include "BountyDirector.generated.h" UCLASS() -class ENDLESSVENDETTA_API ABountyDirector : public AActor +class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor { GENERATED_BODY() @@ -42,6 +43,8 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor // Collect reward for current Bounty and prepare for the next void FinishActiveBounty(); + + void Interact() override; protected: int Favours = 0; diff --git a/EndlessVendetta/Source/EndlessVendetta/InteractableActor.cpp b/EndlessVendetta/Source/EndlessVendetta/InteractableActor.cpp new file mode 100644 index 00000000..346e151d --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/InteractableActor.cpp @@ -0,0 +1,33 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "InteractableActor.h" + +// Sets default values +AInteractableActor::AInteractableActor() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; + +} + +// Called when the game starts or when spawned +void AInteractableActor::BeginPlay() +{ + Super::BeginPlay(); + +} + +// Called every frame +void AInteractableActor::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + +void AInteractableActor::Interact() +{ + UE_LOG(LogTemp, Warning, TEXT("Interacted with %s"), *GetName()); +} + + diff --git a/EndlessVendetta/Source/EndlessVendetta/InteractableActor.h b/EndlessVendetta/Source/EndlessVendetta/InteractableActor.h new file mode 100644 index 00000000..4756112c --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/InteractableActor.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "InteractableActor.generated.h" + +UCLASS() +class ENDLESSVENDETTA_API AInteractableActor : public AActor +{ + GENERATED_BODY() + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Sets default values for this actor's properties + AInteractableActor(); + // Called every frame + virtual void Tick(float DeltaTime) override; + + virtual void Interact(); + +}; From 64420326c085262fe9c17c5f690ff3ed0e49134c Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 11 Oct 2023 15:20:18 +0100 Subject: [PATCH 09/27] Implemented Input for Interacting --- .../BountySystem/BountyDirector.uasset | 4 ++-- .../Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../Input/Actions/IA_Interact.uasset | 3 +++ .../FirstPerson/Input/IMC_Default.uasset | 4 ++-- .../EndlessVendettaCharacter.cpp | 23 +++++++++++++++++++ .../EndlessVendettaCharacter.h | 6 +++++ 6 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index 0acba18f..0c495524 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9d96d19206de2c336790632a9774519478154bb0eedd7080b8ee8c485e15844 -size 43857 +oid sha256:b32ceb2fef229808e1ce4cb7ed0542b84e6e0b0e6b93e7a6d0bcd7bdeea57895 +size 18290 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index e7dcb857..36dc8b7e 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65d9f1286e3e2a0afeb00fd61e2a4ad5d105f8c4ea61cf146761901c810ea4bb -size 42451 +oid sha256:43fc07df656cbeca06e4be24c733f74347f92cf868f0197227f924c697e7b984 +size 42671 diff --git a/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset new file mode 100644 index 00000000..ef199a6b --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56e5fddda3b901b313fde855f6615339551cedbc06032712cda370c384bab101 +size 1370 diff --git a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset index 2bc21ec7..6f9680cf 100644 --- a/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset +++ b/EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84853e2ab5cb8653ef3686fdd8ce458fbadd1261807bdc73feb5212015290ce -size 17496 +oid sha256:574a8a6fe6bd0d9ee1e4e32e2fadfbaea00a337525907ac14aba3dd4bef1b164 +size 18076 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index d27bdc42..522245e6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -6,6 +6,7 @@ #include "Components/CapsuleComponent.h" #include "EnhancedInputComponent.h" #include "EnhancedInputSubsystems.h" +#include "InteractableActor.h" #include "AI/EnemyCharacter.h" #include "GameFramework/CharacterMovementComponent.h" #include "Kismet/GameplayStatics.h" @@ -102,9 +103,31 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* //Crouching EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::SetCrouch); EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Completed, this, &AEndlessVendettaCharacter::SetUnCrouch); + + //Interacting + EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Interact); } } +void AEndlessVendettaCharacter::Interact() +{ + FHitResult OutHit; + FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam; + QueryParams.AddIgnoredActor(this); + FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation(); + FVector LT_End = LT_Start + (FirstPersonCameraComponent->GetForwardVector() * InteractionRange); + DrawDebugLine(GetWorld(), LT_Start, LT_End, FColor::Red, false, 3, 0, 2); + if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return; + + AActor* HitActor = OutHit.GetActor(); + AInteractableActor* InteractableActor = Cast(HitActor); + if (!IsValid(InteractableActor)) return; + + DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 3, 0, 2); + InteractableActor->Interact(); +} + + void AEndlessVendettaCharacter::SetCrouch() { Crouch(); diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index b1c84ec7..cc936f99 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -68,6 +68,9 @@ class AEndlessVendettaCharacter : public ACharacter UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) UInputAction* CrouchAction; + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) + UInputAction* InteractAction; + public: AEndlessVendettaCharacter(); @@ -146,6 +149,9 @@ protected: void EquipPrimary(); void EquipSecondary(); + UPROPERTY(EditDefaultsOnly, Category = "Interaction") + float InteractionRange = 250; + void Interact(); protected: // APawn interface From cec447eb73ae773724098856dc597438e2a0f611 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 11 Oct 2023 23:41:26 +0100 Subject: [PATCH 10/27] Implemented PC Display User Widget Class with WIP USTRUCT --- .../BountySystem/BountyDirector.uasset | 4 +- .../BountySystem/WBP_PC_Display.uasset | 3 + .../Particles/P_Ambient_Dust.uasset | 4 +- .../C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset | 4 +- EndlessVendetta/EndlessVendetta.uproject | 3 +- .../BountySystem/BountyClass.h | 5 ++ .../BountySystem/BountyDirector.cpp | 34 +++++++++--- .../BountySystem/BountyDirector.h | 30 +++++++--- .../EndlessVendettaCharacter.cpp | 2 - .../UserWidgets/PC_Display.cpp | 6 ++ .../EndlessVendetta/UserWidgets/PC_Display.h | 55 +++++++++++++++++++ 11 files changed, 124 insertions(+), 26 deletions(-) create mode 100644 EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset create mode 100644 EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index 0c495524..13661ced 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b32ceb2fef229808e1ce4cb7ed0542b84e6e0b0e6b93e7a6d0bcd7bdeea57895 -size 18290 +oid sha256:f62b028aaa92370d26281005a26678e2b3d6e2ba93c0ee7ae227a3d2ba6377db +size 18565 diff --git a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset new file mode 100644 index 00000000..400ff6de --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:029587dac1de32522f1913c7535e675cdab887348dbe9271aa4823a0e5733550 +size 11826 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index bf2e4391..e9b09590 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d -size 43456 +oid sha256:4c7ea4b8f4ba84d970fabbc731c246e0744fe104a295e3422823f0ebb8798ae1 +size 53268 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index 29ca0d25..a6d9a764 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b37ffa979db56e7f9d07e4c0d02718fa6f15cda90cf7e41886f7301a917cfe15 -size 4934 +oid sha256:7be067073df07be66cbc1d10a227dbdbdb65550aa37fc9ba7c7c4b7716e2ff41 +size 4397 diff --git a/EndlessVendetta/EndlessVendetta.uproject b/EndlessVendetta/EndlessVendetta.uproject index 4717d351..1494b081 100644 --- a/EndlessVendetta/EndlessVendetta.uproject +++ b/EndlessVendetta/EndlessVendetta.uproject @@ -9,7 +9,8 @@ "Type": "Runtime", "LoadingPhase": "Default", "AdditionalDependencies": [ - "Engine" + "Engine", + "UMG" ] } ], diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 607d7945..9f614102 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -66,6 +66,11 @@ public: return BountyDesc; } + int GetBountyreardMoney() + { + return RewardMoney; + } + FVector GetCheckpointLocation() { if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index fbb820d2..ec65c7a5 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -3,6 +3,7 @@ #include "BountyDirector.h" +#include "Blueprint/UserWidget.h" #include "Components/ArrowComponent.h" // Sets default values @@ -119,13 +120,6 @@ void ABountyDirector::DestroyActiveSideBounties() UpdateBountyDisplay(); } -void ABountyDirector::Interact() -{ - Super::Interact(); - UE_LOG(LogTemp, Warning, TEXT("This is where I'll put widget opening code!!!!")); -} - - // ----------- Favour Shop --------------- void ABountyDirector::EarnFavours(int FavoursEarned) @@ -190,4 +184,28 @@ void ABountyDirector::BuyFavours() if (PlayerChar->Money < FavourCost) return; PlayerChar->Money -= FavourCost; Favours++; -} \ No newline at end of file +} + +// ----------- PC Display --------------- + +void ABountyDirector::Interact() +{ + FInputModeUIOnly InputMode; + APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + + PC_DisplayWidget = CreateWidget(GetWorld(), PC_DisplayWidgetClass); + PC_DisplayWidget->AddToViewport(3); + + PlayerController->SetInputMode(InputMode); + PlayerController->bShowMouseCursor = true; + PlayerController->bEnableClickEvents = true; + PlayerController->bEnableMouseOverEvents = true; + + bool GO = IsValid(ActiveBounty); + + + UPC_Display* PC_Display = Cast(PC_DisplayWidget); + PC_Display->PC_Display_Info.IsGameOver = true; + Cast(PC_DisplayWidget)->LoadOS(); +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 105e4b89..cf36c427 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -7,6 +7,7 @@ #include "SideBountyClass.h" #include "EndlessVendetta/EndlessVendettaCharacter.h" #include "EndlessVendetta/InteractableActor.h" +#include "EndlessVendetta/UserWidgets/PC_Display.h" #include "GameFramework/Actor.h" #include "BountyDirector.generated.h" @@ -27,6 +28,11 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") int FavourCost = 500; + UPROPERTY(EditDefaultsOnly, Category = "Bounty Director") + TSubclassOf PC_DisplayWidgetClass; + + UUserWidget* PC_DisplayWidget; + int CurrentBountyIndex = 0; UPROPERTY(VisibleAnywhere, Category = "Bounty") @@ -91,27 +97,33 @@ public: ABountyDirector(); // ------ Getters ------ - UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetBountyTitle() { - return !IsValid(ActiveBounty) ? FString("N/A") : ActiveBounty->GetBountyTitle(); + return !IsValid(ActiveBounty) ? FString("") : ActiveBounty->GetBountyTitle(); } - UFUNCTION(BlueprintCallable, Category = "Bounty") + UTexture2D* GetBountyIcon() + { + return !IsValid(ActiveBounty) ? nullptr : ActiveBounty->GetActiveWaypointIcon(); + } + FString GetBountyDescription() { - return !IsValid(ActiveBounty) ? FString("N/A") : ActiveBounty->GetBountyDesc(); + return !IsValid(ActiveBounty) ? FString("") : ActiveBounty->GetBountyDesc(); } - UFUNCTION(BlueprintCallable, Category = "Bounty") + int GetBountyReward() + { + return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyreardMoney(); + } + FString GetSideBountyTitle(int SideBountyIndex) { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("N/A") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); + return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); } - - UFUNCTION(BlueprintCallable, Category = "Bounty") + FString GetSideBountyDescription(int SideBountyIndex) { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("N/A") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); + return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 522245e6..1d8f5d11 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -116,14 +116,12 @@ void AEndlessVendettaCharacter::Interact() QueryParams.AddIgnoredActor(this); FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation(); FVector LT_End = LT_Start + (FirstPersonCameraComponent->GetForwardVector() * InteractionRange); - DrawDebugLine(GetWorld(), LT_Start, LT_End, FColor::Red, false, 3, 0, 2); if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return; AActor* HitActor = OutHit.GetActor(); AInteractableActor* InteractableActor = Cast(HitActor); if (!IsValid(InteractableActor)) return; - DrawDebugLine(GetWorld(), LT_Start, OutHit.ImpactPoint, FColor::Green, false, 3, 0, 2); InteractableActor->Interact(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp new file mode 100644 index 00000000..1909b302 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "PC_Display.h" + + diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h new file mode 100644 index 00000000..86c8579f --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -0,0 +1,55 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "PC_Display.generated.h" + +USTRUCT(BlueprintType) +struct FPC_Display_Info +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + bool IsGameOver; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString MB_Title; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + UTexture2D* MB_Icon; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString MB_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + int MB_Reward; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString SB_1_Title; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + UTexture2D* SB_1_Icon; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + FString SB_1_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + int SB_1_Reward; +}; + +UCLASS() +class ENDLESSVENDETTA_API UPC_Display : public UUserWidget +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") + void LoadOS(); + + UPROPERTY(BlueprintReadOnly) + FPC_Display_Info PC_Display_Info; + //bool IsGameOver, FString& MB_Title, UTexture2D* MB_Icon, FString& MB_Desc, int MB_Reward +}; + From 2b16934644aa5d142ea7268f683577fa572349e2 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 12 Oct 2023 10:46:25 +0100 Subject: [PATCH 11/27] Implemented PC Display Info USTRUCT --- .../BountySystem/BountyClass.h | 2 +- .../BountySystem/BountyDirector.cpp | 43 ++++++++++++++++--- .../BountySystem/BountyDirector.h | 11 +---- .../BountySystem/MainBountyClass.h | 28 ++++-------- .../EndlessVendetta/UserWidgets/PC_Display.h | 15 ++++--- 5 files changed, 58 insertions(+), 41 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 9f614102..88a6c5e7 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -66,7 +66,7 @@ public: return BountyDesc; } - int GetBountyreardMoney() + int GetBountyrewardMoney() { return RewardMoney; } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index ec65c7a5..4fa18855 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -201,11 +201,44 @@ void ABountyDirector::Interact() PlayerController->bEnableClickEvents = true; PlayerController->bEnableMouseOverEvents = true; - bool GO = IsValid(ActiveBounty); - - UPC_Display* PC_Display = Cast(PC_DisplayWidget); - PC_Display->PC_Display_Info.IsGameOver = true; - Cast(PC_DisplayWidget)->LoadOS(); + bool GameOver = IsValid(ActiveBounty); + PC_Display->PC_Display_Info.IsGameOver = GameOver; + + if (GameOver) return; + + // Info about main bounty + PC_Display->PC_Display_Info.MB_Title = GetBountyTitle(); + PC_Display->PC_Display_Info.MB_Icon = GetBountyIcon(); + PC_Display->PC_Display_Info.MB_Desc = GetBountyDescription(); + PC_Display->PC_Display_Info.MB_Reward = GetBountyReward(); + + // Info about side bounties + PC_Display->PC_Display_Info.SB_Title.Reset(); + PC_Display->PC_Display_Info.SB_Icon.Reset(); + PC_Display->PC_Display_Info.SB_Desc.Reset(); + PC_Display->PC_Display_Info.SB_Reward.Reset(); + for (ASideBountyClass* SideBounty : ActiveSideBounties) + { + if (!IsValid(SideBounty)) continue; + PC_Display->PC_Display_Info.SB_Title.Add(SideBounty->GetBountyTitle()); + PC_Display->PC_Display_Info.SB_Icon.Add(SideBounty->GetActiveWaypointIcon()); + PC_Display->PC_Display_Info.SB_Desc.Add(SideBounty->GetBountyDesc()); + PC_Display->PC_Display_Info.SB_Reward.Add(SideBounty->GetBountyrewardMoney()); + } + + // Info about main bounty alterations + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Reset(); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Reset(); + + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_1_Description()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_2_Description()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_3_Description()); + + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_1_Cost()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_2_Cost()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_3_Cost()); + + PC_Display->LoadOS(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index cf36c427..790b7d1d 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -114,16 +114,7 @@ public: int GetBountyReward() { - return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyreardMoney(); + return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyrewardMoney(); } - FString GetSideBountyTitle(int SideBountyIndex) - { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); - } - - FString GetSideBountyDescription(int SideBountyIndex) - { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); - } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index a539b84c..f2a3aca3 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -21,22 +21,10 @@ protected: // ---------------- Bounty Alterations ---------------- UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_1_Description; + TArray CustomBountyAlteration_Description; UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_1_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_2_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_2_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_3_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_3_Cost = 2; + TArray CustomBountyAlteration_Cost; UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray AmmoDropSpawnTransforms; @@ -71,37 +59,37 @@ public: UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_1_Description() { - return CustomBountyAlteration_1_Description; + return CustomBountyAlteration_Description.IsEmpty() ? FString("") : CustomBountyAlteration_Description[0]; } UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_2_Description() { - return CustomBountyAlteration_2_Description; + return CustomBountyAlteration_Description.Num() < 1 ? FString("") : CustomBountyAlteration_Description[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_3_Description() { - return CustomBountyAlteration_3_Description; + return CustomBountyAlteration_Description.Num() < 2 ? FString("") : CustomBountyAlteration_Description[2]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_1_Cost() { - return CustomBountyAlteration_1_Cost; + return CustomBountyAlteration_Cost.IsEmpty() ? 0 : CustomBountyAlteration_Cost[0]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_2_Cost() { - return CustomBountyAlteration_2_Cost; + return CustomBountyAlteration_Cost.Num() < 1 ? 0 : CustomBountyAlteration_Cost[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_3_Cost() { - return CustomBountyAlteration_3_Cost; + return CustomBountyAlteration_Cost.Num() < 2 ? 0 : CustomBountyAlteration_Cost[2]; } // ------------- Simple Bounty Alterations ------------- diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 86c8579f..f8e50a38 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -27,16 +27,22 @@ struct FPC_Display_Info int MB_Reward; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - FString SB_1_Title; + TArray SB_Title; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - UTexture2D* SB_1_Icon; + TArray SB_Icon; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - FString SB_1_Desc; + TArray SB_Desc; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - int SB_1_Reward; + TArray SB_Reward; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + TArray CustomBountyAlteration_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + TArray CustomBountyAlteration_Cost; }; UCLASS() @@ -50,6 +56,5 @@ public: UPROPERTY(BlueprintReadOnly) FPC_Display_Info PC_Display_Info; - //bool IsGameOver, FString& MB_Title, UTexture2D* MB_Icon, FString& MB_Desc, int MB_Reward }; From 215f24e61cafd11efa65c15fedf847e2efea9af4 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 12 Oct 2023 11:23:26 +0100 Subject: [PATCH 12/27] Added Stand In PC Background Image for Bounty Director PC --- EndlessVendetta/Content/BountySystem/PC_Background.jpg | 3 +++ EndlessVendetta/Content/BountySystem/PC_Background.uasset | 3 +++ EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 EndlessVendetta/Content/BountySystem/PC_Background.jpg create mode 100644 EndlessVendetta/Content/BountySystem/PC_Background.uasset diff --git a/EndlessVendetta/Content/BountySystem/PC_Background.jpg b/EndlessVendetta/Content/BountySystem/PC_Background.jpg new file mode 100644 index 00000000..692b7017 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/PC_Background.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:624ea13a3e1e8d4559e91aa407830dcabd703fb21a7a9a3ab1f6bd26637463db +size 238472 diff --git a/EndlessVendetta/Content/BountySystem/PC_Background.uasset b/EndlessVendetta/Content/BountySystem/PC_Background.uasset new file mode 100644 index 00000000..508b868f --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/PC_Background.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:112f033362de501319bab461fad7a299b4aa4e95f30f506514260da920a3af07 +size 247528 diff --git a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset index 400ff6de..7c571e3c 100644 --- a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:029587dac1de32522f1913c7535e675cdab887348dbe9271aa4823a0e5733550 -size 11826 +oid sha256:1667d1e4b109ae4cc17cb06726cce3314ff7f4528d0b6281d681a7f7c44abc87 +size 15998 From e29a7530151c7402901640503146678b774eedd0 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 12 Oct 2023 12:00:25 +0100 Subject: [PATCH 13/27] Deleted Old Test Bounties --- .../TestBounties/Test_Bounty1/BC_TestBounty1.uasset | 3 --- .../TestBounties/Test_Bounty1/Checkpoints/CC_Test1_1.uasset | 3 --- .../TestBounties/Test_Bounty1/Checkpoints/CC_Test1_2.uasset | 3 --- .../TestBounties/Test_Bounty1/Checkpoints/CC_Test1_3.uasset | 3 --- .../TestSideBounty1/Checkpoints/CC_SideTest1_1.uasset | 3 --- .../Checkpoints/CC_SideTest1_Replacement_1.uasset | 3 --- .../SideBounties/TestSideBounty1/SB_TestSideBounty1.uasset | 3 --- .../TestSideBounty2/Checkpoints/CC_SideTest2_1.uasset | 3 --- .../TestSideBounty2/Checkpoints/CC_SideTest2_2.uasset | 3 --- .../SideBounties/TestSideBounty2/SB_TestSideBounty_2.uasset | 3 --- .../TestBounties/Test_Bounty2/BC_TestBounty2.uasset | 3 --- .../Test_Bounty2/SideBounties/SB_SideTest2_1.uasset | 3 --- .../SideBounties/checkpoints/CC_Replacement_SideTest2_1.uasset | 3 --- .../SideBounties/checkpoints/CC_SideTest2_First.uasset | 3 --- .../TestBounties/Test_Bounty2/checkpoints/CC_Test2_1.uasset | 3 --- 15 files changed, 45 deletions(-) delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_2.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_3.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_Replacement_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/SB_TestSideBounty1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_2.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/SB_TestSideBounty_2.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/SB_SideTest2_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_Replacement_SideTest2_1.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_SideTest2_First.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/checkpoints/CC_Test2_1.uasset diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset deleted file mode 100644 index a8e574e8..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/BC_TestBounty1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72c5dfd7d5c28c07bf90a5870537b16857a6f499d52fee718053eaffd1ae65ca -size 26471 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_1.uasset deleted file mode 100644 index a63f7b7c..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8c2b9772377d7c970c6e0b27eb1c7e70859df8ecc6e37d8e76d6700c63aa93d -size 39590 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_2.uasset deleted file mode 100644 index 9750c92a..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e1236ba19a7d2c62dcc1607f3e73db7b8cb67f0fbcc84d34ff603ca98807050f -size 39541 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_3.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_3.uasset deleted file mode 100644 index e06e3641..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/Checkpoints/CC_Test1_3.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd19115cde54422bb8a86f8de553f1e9de27982bde4fd798eaa08290459f9c1e -size 39540 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_1.uasset deleted file mode 100644 index 8ed2eabd..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a2d30e5ffdcb69db19e7d829035a0ebd1e73cac5fd1b10300e081a7bb67d4a92 -size 39477 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_Replacement_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_Replacement_1.uasset deleted file mode 100644 index 72155b25..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/Checkpoints/CC_SideTest1_Replacement_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14eaef3239f5095b66728601fa95223c30fd67cc9bf4c52b055734aac60a7388 -size 39708 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/SB_TestSideBounty1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/SB_TestSideBounty1.uasset deleted file mode 100644 index 8d8f5cc2..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty1/SB_TestSideBounty1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e13db15ea111f6efb21a5777152b8a4a6a34c5af4aa592b73b6fe7d0b9f0a9c -size 27169 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_1.uasset deleted file mode 100644 index 1f9e13bf..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a87f05fe6854ed82a5db66b2c07fbb381be0d153e5abba8a486f408b2e004b27 -size 39387 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_2.uasset deleted file mode 100644 index d8e02fed..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/Checkpoints/CC_SideTest2_2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cf8bab0d0b5317a555098d30d7d4864b800c47b81dcd522cc64fc142153ac3e -size 39564 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/SB_TestSideBounty_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/SB_TestSideBounty_2.uasset deleted file mode 100644 index a04d5636..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty1/SideBounties/TestSideBounty2/SB_TestSideBounty_2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:646e508a4884b73eaac398d4061f707f16b12a4eccd28bee398496050b16aa9e -size 27303 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset deleted file mode 100644 index f0364734..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/BC_TestBounty2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02a0727628be7a72134a3148e042f64691e43b299dd349c9246c034a40c4f798 -size 22625 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/SB_SideTest2_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/SB_SideTest2_1.uasset deleted file mode 100644 index abd1ec8f..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/SB_SideTest2_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2190aa3998c9523b02ee9f4e31c6baa8797c220bf1f0a024a05110034ac4ef1b -size 23037 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_Replacement_SideTest2_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_Replacement_SideTest2_1.uasset deleted file mode 100644 index ede79440..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_Replacement_SideTest2_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62aabf7b119ce98c1b24d02b5e1f16040b79d1777b6971d344aae896481b93a9 -size 39556 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_SideTest2_First.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_SideTest2_First.uasset deleted file mode 100644 index a83ba390..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/SideBounties/checkpoints/CC_SideTest2_First.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f92ca0a9deafc5e5cad2efc032ff4c6f96ffcfaeeab24074e6dd2cffcdfb765d -size 39558 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/checkpoints/CC_Test2_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/checkpoints/CC_Test2_1.uasset deleted file mode 100644 index ec736e3e..00000000 --- a/EndlessVendetta/Content/BountySystem/TestBounties/Test_Bounty2/checkpoints/CC_Test2_1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ea139267d19360db4dadf77cd0e2684922997ddaec704ff427b261a38051cfab -size 39284 From 82979e32e0f0f40d819af77d9216b521bbc7976c Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 12 Oct 2023 12:01:18 +0100 Subject: [PATCH 14/27] Added Bounty Directors PC Landing Page Layout --- EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset | 4 ++-- .../Source/EndlessVendetta/BountySystem/BountyDirector.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset index 7c571e3c..eb52f6f8 100644 --- a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1667d1e4b109ae4cc17cb06726cce3314ff7f4528d0b6281d681a7f7c44abc87 -size 15998 +oid sha256:b5108f2d9e72c0c5935678a1fca2dda316472ca588e74e85fc321b9c7bf46933 +size 73724 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 4fa18855..f9f7a46e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -202,7 +202,7 @@ void ABountyDirector::Interact() PlayerController->bEnableMouseOverEvents = true; UPC_Display* PC_Display = Cast(PC_DisplayWidget); - bool GameOver = IsValid(ActiveBounty); + bool GameOver = !IsValid(ActiveBounty); PC_Display->PC_Display_Info.IsGameOver = GameOver; if (GameOver) return; From e2561df38c4293ab400cc4c700faca0ddd7a50d0 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Thu, 12 Oct 2023 17:40:24 +0100 Subject: [PATCH 15/27] Implemented Stand in Bounty Director PC Asset --- .../BountySystem/BountyDirector.uasset | 4 ++-- .../BountyDirector/BountyDirector.uasset | 3 +++ .../{ => BountyDirector}/PC_Background.jpg | 0 .../BountyDirector/PC_Background.uasset | 3 +++ .../BountyDirector/WBP_PC_Display.uasset | 3 +++ .../BountyDirector/WBP_StaticPCBG.uasset | 3 +++ .../Content/BountySystem/PC_Background.uasset | 3 --- .../BountySystem/WBP_PC_Display.uasset | 3 --- .../HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 4 ++-- .../Particles/P_Ambient_Dust.uasset | 4 ++-- .../C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset | 4 ++-- .../BountySystem/BountyDirector.cpp | 22 ++++++++++++++++++- .../BountySystem/BountyDirector.h | 3 +++ .../EndlessVendetta/UserWidgets/PC_Display.h | 19 ++++++++++++++-- 14 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset rename EndlessVendetta/Content/BountySystem/{ => BountyDirector}/PC_Background.jpg (100%) create mode 100644 EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset create mode 100644 EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset create mode 100644 EndlessVendetta/Content/BountySystem/BountyDirector/WBP_StaticPCBG.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/PC_Background.uasset delete mode 100644 EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset index 13661ced..1b888d58 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f62b028aaa92370d26281005a26678e2b3d6e2ba93c0ee7ae227a3d2ba6377db -size 18565 +oid sha256:bb8e5904b3c1342d8d6620e5d8d57475d1c42ad4bd07d3f4854238eb7b3b2775 +size 2478 diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset new file mode 100644 index 00000000..5d472e20 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38bc96d6b46050e363e792f2362ef3fdb191cb5efc6f8c176794cb28bcb44b94 +size 21920 diff --git a/EndlessVendetta/Content/BountySystem/PC_Background.jpg b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.jpg similarity index 100% rename from EndlessVendetta/Content/BountySystem/PC_Background.jpg rename to EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.jpg diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset new file mode 100644 index 00000000..9c10c987 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2a0411ac8a6f3df1704187cfb5d62a200088e7d4605f05666b65e18645351d7 +size 247653 diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset new file mode 100644 index 00000000..7f96ce3b --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27c4b4b5d9be3a90d5643aea54f75e7f52f85f5158e6a8cf6806c1e0a8efb346 +size 209883 diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_StaticPCBG.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_StaticPCBG.uasset new file mode 100644 index 00000000..02a4c8b4 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_StaticPCBG.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fd8cfefdb9488ee066675e784fe4fe0ec31f689d82741b5cc8d5cfdbf0b64e4 +size 29059 diff --git a/EndlessVendetta/Content/BountySystem/PC_Background.uasset b/EndlessVendetta/Content/BountySystem/PC_Background.uasset deleted file mode 100644 index 508b868f..00000000 --- a/EndlessVendetta/Content/BountySystem/PC_Background.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:112f033362de501319bab461fad7a299b4aa4e95f30f506514260da920a3af07 -size 247528 diff --git a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset deleted file mode 100644 index eb52f6f8..00000000 --- a/EndlessVendetta/Content/BountySystem/WBP_PC_Display.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b5108f2d9e72c0c5935678a1fca2dda316472ca588e74e85fc321b9c7bf46933 -size 73724 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0f990580..4035333e 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d -size 72364642 +oid sha256:655b999e9a4eece94dfd8ff9f1f36832e15e1f642be1ea42abb55bfefbe9ec4b +size 66790690 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index e9b09590..bf2e4391 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c7ea4b8f4ba84d970fabbc731c246e0744fe104a295e3422823f0ebb8798ae1 -size 53268 +oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d +size 43456 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index a6d9a764..a466798b 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7be067073df07be66cbc1d10a227dbdbdb65550aa37fc9ba7c7c4b7716e2ff41 -size 4397 +oid sha256:833df8f0fca89205f775bf4b28e645ebf10d9a1ef4a621370a8dc01612aa1031 +size 5660 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index f9f7a46e..4d1321e6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -204,8 +204,13 @@ void ABountyDirector::Interact() UPC_Display* PC_Display = Cast(PC_DisplayWidget); bool GameOver = !IsValid(ActiveBounty); PC_Display->PC_Display_Info.IsGameOver = GameOver; + PC_Display->LogoutFromBountyDirectorPC.AddDynamic(this, &ABountyDirector::DestroyBountyDirectorPCWidget); - if (GameOver) return; + if (GameOver) + { + PC_Display->LoadOS(); + return; + } // Info about main bounty PC_Display->PC_Display_Info.MB_Title = GetBountyTitle(); @@ -239,6 +244,21 @@ void ABountyDirector::Interact() PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_2_Cost()); PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_3_Cost()); + PC_Display->PC_Display_Info.PlayersFavourAmount = Favours; + PC_Display->LoadOS(); } +void ABountyDirector::DestroyBountyDirectorPCWidget() +{ + if (IsValid(PC_DisplayWidget)) PC_DisplayWidget->RemoveFromParent(); + + FInputModeGameOnly InputMode; + APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + PlayerController->SetInputMode(InputMode); + PlayerController->bShowMouseCursor = false; + PlayerController->bEnableClickEvents = false; + PlayerController->bEnableMouseOverEvents = false; +} + + diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 790b7d1d..3af1d407 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -65,6 +65,9 @@ protected: UFUNCTION() void DestroyActiveSideBounties(); + UFUNCTION() + void DestroyBountyDirectorPCWidget(); + UFUNCTION() void EarnFavours(int FavoursEarned); diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index f8e50a38..70ff31a2 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -43,18 +43,33 @@ struct FPC_Display_Info UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") TArray CustomBountyAlteration_Cost; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + int PlayersFavourAmount; }; +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLogoutFromBountyDirectorPC); + UCLASS() class ENDLESSVENDETTA_API UPC_Display : public UUserWidget { GENERATED_BODY() +protected: + UFUNCTION(BlueprintCallable, Category = "PC_Display") + void LogoutButtonPressed() + { + LogoutFromBountyDirectorPC.Broadcast(); + } public: + FLogoutFromBountyDirectorPC LogoutFromBountyDirectorPC; + + UPROPERTY(BlueprintReadOnly) + FPC_Display_Info PC_Display_Info; + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") void LoadOS(); - UPROPERTY(BlueprintReadOnly) - FPC_Display_Info PC_Display_Info; + }; From 80216b098e8b1fa574babc54e0fb1b60e27826f1 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Thu, 12 Oct 2023 19:45:54 +0100 Subject: [PATCH 16/27] Implemented Navigating Bounty Directors PC Interface --- .../Content/BountySystem/BountyDirector/WBP_PC_Display.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index 7f96ce3b..b6a73b5f 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27c4b4b5d9be3a90d5643aea54f75e7f52f85f5158e6a8cf6806c1e0a8efb346 -size 209883 +oid sha256:60ead9907ef868f4417c4e7764b108261bc1bcbd8c14c12961f14e7abef1daba +size 783643 From 3efc8f088da87790261e4127c5e2c4279ec59d38 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Thu, 12 Oct 2023 20:47:27 +0100 Subject: [PATCH 17/27] Implemented Load OS BP Implementable Event Sets up what values the player sees on the in games pc's display, values such as what bounty they're on or how much a favour will cost them --- .../BountySystem/BountyDirector/WBP_PC_Display.uasset | 4 ++-- .../Source/EndlessVendetta/BountySystem/BountyDirector.cpp | 1 - .../Source/EndlessVendetta/UserWidgets/PC_Display.h | 5 +---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index b6a73b5f..20b851f2 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60ead9907ef868f4417c4e7764b108261bc1bcbd8c14c12961f14e7abef1daba -size 783643 +oid sha256:7fa3dc6f87da5e22b1363a0276b090306de54d36ac05c86024a47d05c8d92ae3 +size 1088257 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 4d1321e6..56242ca9 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -214,7 +214,6 @@ void ABountyDirector::Interact() // Info about main bounty PC_Display->PC_Display_Info.MB_Title = GetBountyTitle(); - PC_Display->PC_Display_Info.MB_Icon = GetBountyIcon(); PC_Display->PC_Display_Info.MB_Desc = GetBountyDescription(); PC_Display->PC_Display_Info.MB_Reward = GetBountyReward(); diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 70ff31a2..49b7ae9b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -16,10 +16,7 @@ struct FPC_Display_Info UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") FString MB_Title; - - UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - UTexture2D* MB_Icon; - + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") FString MB_Desc; From 58a2d791b4d91095eea8ed67d4533a209eacd1be Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Thu, 12 Oct 2023 21:18:51 +0100 Subject: [PATCH 18/27] Implemented a new Test Bounty with Side Bounties --- .../Content/BountySystem/BountyDirector/BountyDirector.uasset | 4 ++-- .../FavourSystemBountyTest/MainBounty/CP_MB.uasset | 3 +++ .../FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/CP_1.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/CP_2.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/CP_3.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/SB_1.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/SB_2.uasset | 3 +++ .../FavourSystemBountyTest/SideBounties/SB_3.uasset | 3 +++ .../StarterContent/Blueprints/Blueprint_CeilingLight.uasset | 4 ++-- .../StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 4 ++-- .../BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset | 4 ++-- .../BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset | 3 +++ 13 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/CP_MB.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_1.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_2.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_3.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset create mode 100644 EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset create mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset index 5d472e20..a8ea05a4 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/BountyDirector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38bc96d6b46050e363e792f2362ef3fdb191cb5efc6f8c176794cb28bcb44b94 -size 21920 +oid sha256:29a1d4cf6379012b45e215995cc8014963f61fb618fbba839ce738f0633cff33 +size 22149 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/CP_MB.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/CP_MB.uasset new file mode 100644 index 00000000..822f2d62 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/CP_MB.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4630de4ea95731ea1488ab3b135b07396a1dd842f9909c6380d2a7934c2aa8d7 +size 63981 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset new file mode 100644 index 00000000..6f761952 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c8679edb7c4684bced79a1e13965b2d538b29f62e18877f90a6db950e9a0075 +size 23646 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_1.uasset new file mode 100644 index 00000000..79086246 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd5b80d48c39e4dbd4f62dafaecb54ec5c7fa2a1d12dfbdd1f9be85cc74b368a +size 64021 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_2.uasset new file mode 100644 index 00000000..30c128aa --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d27935ca0589d21ab1e7ca9ebd3de80fa4666c43fdc239cbe4cd13358ecb5d71 +size 64015 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_3.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_3.uasset new file mode 100644 index 00000000..7804ed1b --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/CP_3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:127a3c5d1ddd972ed32552a4e0e61f4d72d94ed978d98ad9eec8933e2711c6c0 +size 64009 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset new file mode 100644 index 00000000..73fae848 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b4f7e4727df3fdaa5f0429402569cf93c1d04ebc346334354e6fa4bbd3488fb +size 22713 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset new file mode 100644 index 00000000..5660d5fb --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e06809196ddcbfe04fb42919352cccbc820ce09c2163c572a7b9feea87587750 +size 22775 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset new file mode 100644 index 00000000..32c81b99 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b86280d1949eeb45d49b83a6e7a55b2c843444ad84b5ffb639e9be3218b6035e +size 22708 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index c5c3b84e..84700dde 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 -size 158206 +oid sha256:f28941ae2bfc99b505a220cbcfbed1524eee0b1c03d1b387ae857d2d94a94356 +size 43745 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 4035333e..0f990580 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:655b999e9a4eece94dfd8ff9f1f36832e15e1f642be1ea42abb55bfefbe9ec4b -size 66790690 +oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d +size 72364642 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset index a466798b..df604f34 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/C/N1/E7M6U3RRQJ0NKZWADRZU2F.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:833df8f0fca89205f775bf4b28e645ebf10d9a1ef4a621370a8dc01612aa1031 -size 5660 +oid sha256:68858de7c5f528fefe1d4332ecb6d02bbb53a59f6ecb51c4c2f2d3920bf33ca5 +size 5710 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset new file mode 100644 index 00000000..2f24fd5a --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f21ce76c3ff1a7c8f442419e5f2a4b248d6badac41b1d5e6a52c3ab5933ea2bf +size 5108 From 7296353c73bc183aeed9d3c80e28d849826305ee Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Thu, 12 Oct 2023 21:29:19 +0100 Subject: [PATCH 19/27] Fixed Being Unable to Complete a Main Bounty --- .../BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset | 3 --- .../Source/EndlessVendetta/BountySystem/BountyDirector.cpp | 1 + .../Source/EndlessVendetta/BountySystem/BountyDirector.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset deleted file mode 100644 index 2f24fd5a..00000000 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/BountySystemTestLevel/D/FV/ZSSIWWVFPEB062T3V49ZY5.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f21ce76c3ff1a7c8f442419e5f2a4b248d6badac41b1d5e6a52c3ab5933ea2bf -size 5108 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 56242ca9..d94226dc 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -190,6 +190,7 @@ void ABountyDirector::BuyFavours() void ABountyDirector::Interact() { + UpdateBountyProgression(); FInputModeUIOnly InputMode; APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 3af1d407..5469ddc1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -42,7 +42,7 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor TArray ActiveSideBounties; // Checks if completed the bounty, and moves onto the next if so - UFUNCTION(BlueprintCallable, Category = "Bounty") + //UFUNCTION(BlueprintCallable, Category = "Bounty") void UpdateBountyProgression(); void SpawnBountyAndItsSideBounties(); From 1746dad55ce91d4c1e514eb4c534293734f74fce Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Fri, 13 Oct 2023 15:47:25 +0100 Subject: [PATCH 20/27] Bugfix Crashing After an Enemy is Killed Handled Death in AI Control Hub --- .../Source/EndlessVendetta/AI/AICharacter.cpp | 55 ++++++++++--------- .../Source/EndlessVendetta/AI/AICharacter.h | 2 + .../EndlessVendetta/AI/AIControlHub.cpp | 5 ++ .../Source/EndlessVendetta/AI/AIControlHub.h | 1 + .../EndlessVendetta/AI/EnemyCharacter.cpp | 14 +++++ .../EndlessVendetta/AI/EnemyCharacter.h | 1 + 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.cpp index 8e976d0a..6a2debfc 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.cpp @@ -25,7 +25,6 @@ AAICharacter::AAICharacter() void AAICharacter::BeginPlay() { Super::BeginPlay(); - } // Called every frame @@ -54,31 +53,7 @@ float AAICharacter::TakeDamage(const float DamageAmount, FDamageEvent const& Dam CurrentHealth = 0; UE_LOG(LogTemp, Display, TEXT("%s is dead"), *CharacterName.ToString()); - /*const AAI_EnemyController* AIController = Cast(GetController()); - AIController->GetBrainComponent()->StopLogic(" is dead");*/ - this->Tags.Add(FName("Dead")); - //Ragdoll - DetachFromControllerPendingDestroy(); - UCapsuleComponent* CapsuleComp = GetCapsuleComponent(); - CapsuleComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); - CapsuleComp->SetCollisionResponseToAllChannels(ECR_Ignore); - - GetMesh()->SetCollisionProfileName(TEXT("Ragdoll")); - SetActorEnableCollision(true); - - GetMesh()->SetAllBodiesSimulatePhysics(true); - GetMesh()->SetSimulatePhysics(true); - GetMesh()->WakeAllRigidBodies(); - GetMesh()->bBlendPhysics = true; - - if (UCharacterMovementComponent* CharacterComp = Cast(GetMovementComponent())) - { - CharacterComp->StopMovementImmediately(); - CharacterComp->DisableMovement(); - CharacterComp->SetComponentTickEnabled(false); - } - - SetLifeSpan(30.0f); + OnDeath(); } return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser); } @@ -98,3 +73,31 @@ void AAICharacter::SetupStimuliSourceComponent() } } +void AAICharacter::OnDeath() +{ + /*const AAI_EnemyController* AIController = Cast(GetController()); + AIController->GetBrainComponent()->StopLogic(" is dead");*/ + this->Tags.Add(FName("Dead")); + //Ragdoll + DetachFromControllerPendingDestroy(); + UCapsuleComponent* CapsuleComp = GetCapsuleComponent(); + CapsuleComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); + CapsuleComp->SetCollisionResponseToAllChannels(ECR_Ignore); + + GetMesh()->SetCollisionProfileName(TEXT("Ragdoll")); + SetActorEnableCollision(true); + + GetMesh()->SetAllBodiesSimulatePhysics(true); + GetMesh()->SetSimulatePhysics(true); + GetMesh()->WakeAllRigidBodies(); + GetMesh()->bBlendPhysics = true; + + if (UCharacterMovementComponent* CharacterComp = Cast(GetMovementComponent())) + { + CharacterComp->StopMovementImmediately(); + CharacterComp->DisableMovement(); + CharacterComp->SetComponentTickEnabled(false); + } + + SetLifeSpan(30.0f); +} diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.h b/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.h index 44bbd309..09d63741 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/AI/AICharacter.h @@ -35,6 +35,8 @@ protected: class UAIPerceptionStimuliSourceComponent* StimuliSourceComponent; void SetupStimuliSourceComponent(); + virtual void OnDeath(); + public: // Called every frame virtual void Tick(float DeltaTime) override; diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.cpp b/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.cpp index 75f4a7f1..6c14c0cc 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.cpp @@ -74,3 +74,8 @@ void AAIControlHub::SetPlayerLastKnownLocation(FVector Location) PlayerLastKnownLocation = Location; } } + +void AAIControlHub::RemoveEnemyActor(AEnemyCharacter* EnemyActor) +{ + EnemyActors.Remove(EnemyActor); +} diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.h b/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.h index d75b7fd6..bbe2e21e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.h +++ b/EndlessVendetta/Source/EndlessVendetta/AI/AIControlHub.h @@ -35,6 +35,7 @@ public: int GetAlertLevel() const; void OnAlertLevelChanged(); void SetPlayerLastKnownLocation(FVector Location = FVector(0, 0, 0)); + void RemoveEnemyActor(AEnemyCharacter* EnemyActor); private: int AlertLevel = 0; diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp index aa84cb9b..e7e9360c 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp @@ -23,6 +23,16 @@ void AEnemyCharacter::BeginPlay() CharacterName = "Enemy"; } +void AEnemyCharacter::OnDeath() +{ + Super::OnDeath(); + DelegatedControlHub->AlertLevelEvent.Remove(AlertLevelDelegateHandle); + DelegatedControlHub->HuntPlayerEvent.Remove(HuntPlayerDelegateHandle); + AlertLevelDelegateHandle.Reset(); + HuntPlayerDelegateHandle.Reset(); + DelegatedControlHub->RemoveEnemyActor(this); +} + // Called every frame void AEnemyCharacter::Tick(float DeltaTime) { @@ -38,6 +48,8 @@ void AEnemyCharacter::SubscribeToGroupAIEvents(AAIControlHub* ControlHub) void AEnemyCharacter::SetAlertLevel(const int NewAlertLevel) const { + if (!IsValid(this)) return; + if (!IsValid(GetController())) return; Cast(GetController())->GetBlackboardComponent()->SetValueAsInt("AlertLevel", NewAlertLevel); } @@ -49,6 +61,8 @@ void AEnemyCharacter::SetLocalAlertLevel(int NewAlertLevel) const void AEnemyCharacter::HuntPlayer(FVector PlayerLastKnownLocation) { + if (!IsValid(this)) return; + if (!IsValid(GetController())) return; SetAlertLevel(2); Cast(GetController())->GetBlackboardComponent()->SetValueAsVector("LastKnownLocation", PlayerLastKnownLocation); } diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.h b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.h index 6d3deab7..7b6f23f4 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.h @@ -21,6 +21,7 @@ protected: // Called when the game starts or when spawned virtual void BeginPlay() override; class AAIControlHub* DelegatedControlHub; + virtual void OnDeath() override; public: // Called every frame From d2481e79b8f8da380d60d12c7eff85441aafc37b Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sat, 14 Oct 2023 17:10:29 +0100 Subject: [PATCH 21/27] Fixed Text Formatting Issues for PC_Display Widget --- .../BountySystem/BountyDirector/PC_Background.uasset | 2 +- .../BountySystem/BountyDirector/WBP_PC_Display.uasset | 4 ++-- .../MainBounty/MB_TestBounty.uasset | 4 ++-- .../FavourSystemBountyTest/SideBounties/SB_1.uasset | 4 ++-- .../FavourSystemBountyTest/SideBounties/SB_2.uasset | 4 ++-- .../FavourSystemBountyTest/SideBounties/SB_3.uasset | 4 ++-- .../Blueprints/Blueprint_CeilingLight.uasset | 4 ++-- .../Content/StarterContent/Props/MaterialSphere.uasset | 4 ++-- .../EndlessVendetta/BountySystem/BountyDirector.cpp | 4 ++-- .../Source/EndlessVendetta/BountySystem/MainBountyClass.h | 8 ++++---- .../Source/EndlessVendetta/BountySystem/SideBountyClass.h | 4 ++++ 11 files changed, 25 insertions(+), 21 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset index 9c10c987..0e0a8514 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e2a0411ac8a6f3df1704187cfb5d62a200088e7d4605f05666b65e18645351d7 +oid sha256:69b27343598f650b7535e6394e8f71edd12579339b4bbf6a5530e2058f984463 size 247653 diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index 20b851f2..d93799c6 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fa3dc6f87da5e22b1363a0276b090306de54d36ac05c86024a47d05c8d92ae3 -size 1088257 +oid sha256:13c33ca82184ce691baedd731c38c0cb26674a52fa498cfeed21268ef352e0c2 +size 1059571 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset index 6f761952..0a5cc2ff 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2c8679edb7c4684bced79a1e13965b2d538b29f62e18877f90a6db950e9a0075 -size 23646 +oid sha256:5ebf04e857c15279c330ed46442aed92c243b554eb5f28b4fc387cca379a866e +size 23639 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset index 73fae848..d88016a5 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6b4f7e4727df3fdaa5f0429402569cf93c1d04ebc346334354e6fa4bbd3488fb -size 22713 +oid sha256:e89aba9e6af5b1bd48b5b2b48242eb1d057a63f552b22ea6122091a81556d9d6 +size 22765 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset index 5660d5fb..f61482fd 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e06809196ddcbfe04fb42919352cccbc820ce09c2163c572a7b9feea87587750 -size 22775 +oid sha256:8ae78ca79d0f944fd9ae21df42c30f3993f595e6a750455a5960cd0e4b890143 +size 22827 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset index 32c81b99..f575b5b1 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/SideBounties/SB_3.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b86280d1949eeb45d49b83a6e7a55b2c843444ad84b5ffb639e9be3218b6035e -size 22708 +oid sha256:736bb99394a031e33b1a14f712b0ad0b6540cc047153933347b449746f46ffc5 +size 22761 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index 84700dde..c5c3b84e 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f28941ae2bfc99b505a220cbcfbed1524eee0b1c03d1b387ae857d2d94a94356 -size 43745 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 56bddfc9..34eb8e6b 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 -size 47333 +oid sha256:8fe02baa138e086ccfe9f77f87f3898fb489e4e132a4164798fbbb9a6680bef2 +size 47710 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index d94226dc..e549ad7a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -225,11 +225,11 @@ void ABountyDirector::Interact() PC_Display->PC_Display_Info.SB_Reward.Reset(); for (ASideBountyClass* SideBounty : ActiveSideBounties) { - if (!IsValid(SideBounty)) continue; + if (!IsValid(SideBounty) || SideBounty->IsCompleted()) continue; PC_Display->PC_Display_Info.SB_Title.Add(SideBounty->GetBountyTitle()); PC_Display->PC_Display_Info.SB_Icon.Add(SideBounty->GetActiveWaypointIcon()); PC_Display->PC_Display_Info.SB_Desc.Add(SideBounty->GetBountyDesc()); - PC_Display->PC_Display_Info.SB_Reward.Add(SideBounty->GetBountyrewardMoney()); + PC_Display->PC_Display_Info.SB_Reward.Add(SideBounty->GetRewardInFavours()); } // Info about main bounty alterations diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index f2a3aca3..2ca99a55 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -65,13 +65,13 @@ public: UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_2_Description() { - return CustomBountyAlteration_Description.Num() < 1 ? FString("") : CustomBountyAlteration_Description[1]; + return CustomBountyAlteration_Description.Num() <= 1 ? FString("") : CustomBountyAlteration_Description[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_3_Description() { - return CustomBountyAlteration_Description.Num() < 2 ? FString("") : CustomBountyAlteration_Description[2]; + return CustomBountyAlteration_Description.Num() <= 2 ? FString("") : CustomBountyAlteration_Description[2]; } UFUNCTION(BlueprintCallable, Category = "Bounty") @@ -83,13 +83,13 @@ public: UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_2_Cost() { - return CustomBountyAlteration_Cost.Num() < 1 ? 0 : CustomBountyAlteration_Cost[1]; + return CustomBountyAlteration_Cost.Num() <= 1 ? 0 : CustomBountyAlteration_Cost[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_3_Cost() { - return CustomBountyAlteration_Cost.Num() < 2 ? 0 : CustomBountyAlteration_Cost[2]; + return CustomBountyAlteration_Cost.Num() <= 2 ? 0 : CustomBountyAlteration_Cost[2]; } // ------------- Simple Bounty Alterations ------------- diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h index 35d481fd..758c1e77 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h @@ -24,4 +24,8 @@ public: virtual void IncrementBountyCheckpoint() override; void DestroyCheckpoints(); + int GetRewardInFavours() + { + return FavoursEarnedForCompletion; + } }; From d922ceec10a358731d3c0ec6402c5470581c9ed5 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sat, 14 Oct 2023 17:20:17 +0100 Subject: [PATCH 22/27] Fixed Missing Custom Bounty Alteration Behaviour --- .../FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset index 0a5cc2ff..fff63939 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ebf04e857c15279c330ed46442aed92c243b554eb5f28b4fc387cca379a866e -size 23639 +oid sha256:e520486c08be16c37c2a57ef464db44baa0bfba73be3fa2e2ffe00891adc5961 +size 23685 From 8b4a78435dbc88186e23b8d01a12d5b86c2824ba Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sat, 14 Oct 2023 17:54:03 +0100 Subject: [PATCH 23/27] Added First Buy Buttons Delegate --- .../BountySystem/BountyDirector/WBP_PC_Display.uasset | 4 ++-- .../MainBounty/MB_TestBounty.uasset | 4 ++-- .../EndlessVendetta/BountySystem/BountyDirector.cpp | 9 ++++++--- .../Source/EndlessVendetta/BountySystem/BountyDirector.h | 4 ++-- .../Source/EndlessVendetta/UserWidgets/PC_Display.h | 7 +++++-- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index d93799c6..c5d78681 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13c33ca82184ce691baedd731c38c0cb26674a52fa498cfeed21268ef352e0c2 -size 1059571 +oid sha256:e18f1c5b5a87200f0a39ce1a55e9b8e5f1def9f890d5974e8fe5c767efe868d3 +size 1025165 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset index fff63939..f805cb3d 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e520486c08be16c37c2a57ef464db44baa0bfba73be3fa2e2ffe00891adc5961 -size 23685 +oid sha256:27d63c0acfd4fdceacc37b252fac625161c9feddfe9b2ccaeff6b4e84f1d9857 +size 25558 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index e549ad7a..75d4ae39 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -131,7 +131,7 @@ void ABountyDirector::BuyCustomBountyAlteration_1() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_1_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_1(); } @@ -141,7 +141,7 @@ void ABountyDirector::BuyCustomBountyAlteration_2() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_2_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_2(); } @@ -150,7 +150,7 @@ void ABountyDirector::BuyCustomBountyAlteration_3() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_3_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_3(); } @@ -245,6 +245,9 @@ void ABountyDirector::Interact() PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_3_Cost()); PC_Display->PC_Display_Info.PlayersFavourAmount = Favours; + + // Button Delegates + PC_Display->BuyCba_1.AddDynamic(this, &ABountyDirector::BuyCustomBountyAlteration_1); PC_Display->LoadOS(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 5469ddc1..a2a64d45 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -53,7 +53,7 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor void Interact() override; protected: - int Favours = 0; + int Favours = 20; // Called when the game starts or when spawned virtual void BeginPlay() override; @@ -71,7 +71,7 @@ protected: UFUNCTION() void EarnFavours(int FavoursEarned); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyCustomBountyAlteration_1(); UFUNCTION(BlueprintCallable, Category = "Bounty Director") diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 49b7ae9b..0a2df784 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -46,6 +46,7 @@ struct FPC_Display_Info }; DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLogoutFromBountyDirectorPC); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyCBA_1); UCLASS() class ENDLESSVENDETTA_API UPC_Display : public UUserWidget @@ -60,10 +61,12 @@ protected: public: FLogoutFromBountyDirectorPC LogoutFromBountyDirectorPC; - + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyCBA_1 BuyCba_1; + UPROPERTY(BlueprintReadOnly) FPC_Display_Info PC_Display_Info; - + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") void LoadOS(); From d32b2fc6f556c8765380273ae62c30335c114aab Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sun, 15 Oct 2023 13:07:20 +0100 Subject: [PATCH 24/27] Implemented All Favour Buying Buttons --- .../BountyDirector/WBP_PC_Display.uasset | 4 +-- .../MainBounty/MB_TestBounty.uasset | 4 +-- .../HDRI/HDRI_Epic_Courtyard_Daylight.uasset | 4 +-- .../Props/MaterialSphere.uasset | 4 +-- .../BountySystem/BountyDirector.cpp | 32 ++++++++++------- .../BountySystem/BountyDirector.h | 28 +++++++-------- .../BountySystem/MainBountyClass.cpp | 30 ++++++++-------- .../BountySystem/MainBountyClass.h | 13 +++---- .../EndlessVendetta/UserWidgets/PC_Display.h | 34 ++++++++++++++----- 9 files changed, 91 insertions(+), 62 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index c5d78681..5e266442 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e18f1c5b5a87200f0a39ce1a55e9b8e5f1def9f890d5974e8fe5c767efe868d3 -size 1025165 +oid sha256:acab50641ebfd8ec73bda00d7ce661f23e7773e4b88863de1982b34b52ebc114 +size 1026639 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset index f805cb3d..0309cf1b 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27d63c0acfd4fdceacc37b252fac625161c9feddfe9b2ccaeff6b4e84f1d9857 -size 25558 +oid sha256:3bee98bbd8e50e208c8f9ee6c2a8560f183a2bba774f090b183ab236ba7ebd22 +size 38649 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0f990580..92a6630d 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d -size 72364642 +oid sha256:121885d21829880bc9b29a22c541e1e2113f964beb1a5307902cd6b2d550bea5 +size 66790690 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index 34eb8e6b..56bddfc9 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8fe02baa138e086ccfe9f77f87f3898fb489e4e132a4164798fbbb9a6680bef2 -size 47710 +oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 +size 47333 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 75d4ae39..e11b7841 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -37,7 +37,6 @@ void ABountyDirector::BeginPlay() } SpawnBountyAndItsSideBounties(); - UpdateBountyDisplay(); } void ABountyDirector::SpawnBountyAndItsSideBounties() @@ -97,12 +96,10 @@ void ABountyDirector::FinishActiveBounty() { UE_LOG(LogTemp, Warning, TEXT("Finished all bounties currently available in the game :)")); ActiveBounty = nullptr; - UpdateBountyDisplay(); return; } SpawnBountyAndItsSideBounties(); - UpdateBountyDisplay(); } void ABountyDirector::DestroyActiveSideBounties() @@ -116,8 +113,6 @@ void ABountyDirector::DestroyActiveSideBounties() SideBounty->DestroyCheckpoints(); SideBounty->Destroy(); } - - UpdateBountyDisplay(); } // ----------- Favour Shop --------------- @@ -133,7 +128,8 @@ void ABountyDirector::BuyCustomBountyAlteration_1() int Cost = ActiveBounty->GetCustomBountyAlteration_1_Cost(); if (Cost == 0 || Favours < Cost) return; Favours -= Cost; - ActiveBounty->BuyCustomBountyAlteration_1(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivateCustomBountyAlteration_1(); } @@ -143,7 +139,8 @@ void ABountyDirector::BuyCustomBountyAlteration_2() int Cost = ActiveBounty->GetCustomBountyAlteration_2_Cost(); if (Cost == 0 || Favours < Cost) return; Favours -= Cost; - ActiveBounty->BuyCustomBountyAlteration_2(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivateCustomBountyAlteration_2(); } void ABountyDirector::BuyCustomBountyAlteration_3() @@ -152,7 +149,8 @@ void ABountyDirector::BuyCustomBountyAlteration_3() int Cost = ActiveBounty->GetCustomBountyAlteration_3_Cost(); if (Cost == 0 || Favours < Cost) return; Favours -= Cost; - ActiveBounty->BuyCustomBountyAlteration_3(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivateCustomBountyAlteration_3(); } void ABountyDirector::BuyAmmoDrop() @@ -160,7 +158,8 @@ void ABountyDirector::BuyAmmoDrop() if (!IsValid(ActiveBounty)) return; if (Favours < 1) return; Favours--; - ActiveBounty->BuySpawnAmmoDrops(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->SpawnAmmoDrops(); } void ABountyDirector::BuyHealthDrop() @@ -168,7 +167,8 @@ void ABountyDirector::BuyHealthDrop() if (!IsValid(ActiveBounty)) return; if (Favours < 1) return; Favours--; - ActiveBounty->BuySpawnHealthDrops(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->SpawnHealthDrops(); } void ABountyDirector::BuyEnemyRadio() @@ -176,7 +176,8 @@ void ABountyDirector::BuyEnemyRadio() if (!IsValid(ActiveBounty)) return; if (Favours < 1) return; Favours--; - ActiveBounty->BuyEnemyRadio(); + PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivateEnemyRadio(); } void ABountyDirector::BuyFavours() @@ -184,6 +185,7 @@ void ABountyDirector::BuyFavours() if (PlayerChar->Money < FavourCost) return; PlayerChar->Money -= FavourCost; Favours++; + PC_Display->UpdateFavourCount(Favours); } // ----------- PC Display --------------- @@ -202,7 +204,7 @@ void ABountyDirector::Interact() PlayerController->bEnableClickEvents = true; PlayerController->bEnableMouseOverEvents = true; - UPC_Display* PC_Display = Cast(PC_DisplayWidget); + PC_Display = Cast(PC_DisplayWidget); bool GameOver = !IsValid(ActiveBounty); PC_Display->PC_Display_Info.IsGameOver = GameOver; PC_Display->LogoutFromBountyDirectorPC.AddDynamic(this, &ABountyDirector::DestroyBountyDirectorPCWidget); @@ -248,6 +250,12 @@ void ABountyDirector::Interact() // Button Delegates PC_Display->BuyCba_1.AddDynamic(this, &ABountyDirector::BuyCustomBountyAlteration_1); + PC_Display->BuyCba_2.AddDynamic(this, &ABountyDirector::BuyCustomBountyAlteration_2); + PC_Display->BuyCba_3.AddDynamic(this, &ABountyDirector::BuyCustomBountyAlteration_3); + PC_Display->BuyAmmoDrop.AddDynamic(this, &ABountyDirector::BuyAmmoDrop); + PC_Display->BuyHealthDrop.AddDynamic(this, &ABountyDirector::BuyHealthDrop); + PC_Display->BuyRadio.AddDynamic(this, &ABountyDirector::BuyEnemyRadio); + PC_Display->BuyFavour.AddDynamic(this, &ABountyDirector::BuyFavours); PC_Display->LoadOS(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index a2a64d45..41fc840c 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -33,6 +33,8 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor UUserWidget* PC_DisplayWidget; + UPC_Display* PC_Display; + int CurrentBountyIndex = 0; UPROPERTY(VisibleAnywhere, Category = "Bounty") @@ -42,7 +44,6 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor TArray ActiveSideBounties; // Checks if completed the bounty, and moves onto the next if so - //UFUNCTION(BlueprintCallable, Category = "Bounty") void UpdateBountyProgression(); void SpawnBountyAndItsSideBounties(); @@ -50,46 +51,45 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor // Collect reward for current Bounty and prepare for the next void FinishActiveBounty(); + // Opens up Bounty Director PC Interface void Interact() override; protected: int Favours = 20; + // Called when the game starts or when spawned virtual void BeginPlay() override; - - /** Blueprint implemented function called from c++, handles aesthetic changes to bounty display - based on data from ActiveBC and ActiveSBC */ - UFUNCTION(BlueprintImplementableEvent, Category = "bounty") - void UpdateBountyDisplay(); - + UFUNCTION() void DestroyActiveSideBounties(); UFUNCTION() void DestroyBountyDirectorPCWidget(); + // Listens for when a side bounty is completed UFUNCTION() void EarnFavours(int FavoursEarned); - + +// -------- Buy Buttons -------- UFUNCTION() void BuyCustomBountyAlteration_1(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyCustomBountyAlteration_2(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyCustomBountyAlteration_3(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyAmmoDrop(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyHealthDrop(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyEnemyRadio(); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyFavours(); public: diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp index 714fb672..f6cc0edd 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp @@ -3,22 +3,24 @@ #include "MainBountyClass.h" -void AMainBountyClass::BuySpawnAmmoDrops() +void AMainBountyClass::SpawnAmmoDrops() { - FActorSpawnParameters SpawnParameters; - SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - for (FTransform Spawn : AmmoDropSpawnTransforms) - { - GetWorld()->SpawnActor(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); - } + UE_LOG(LogTemp, Display, TEXT("Bought Ammo Drops, but its not implemented yet")); + // FActorSpawnParameters SpawnParameters; + // SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + // for (FTransform Spawn : AmmoDropSpawnTransforms) + // { + // GetWorld()->SpawnActor(AmmoDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + // } } -void AMainBountyClass::BuySpawnHealthDrops() +void AMainBountyClass::SpawnHealthDrops() { - FActorSpawnParameters SpawnParameters; - SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - for (FTransform Spawn : HealthDropSpawnTransforms) - { - GetWorld()->SpawnActor(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); - } + UE_LOG(LogTemp, Display, TEXT("Bought Health Drops, but its not implemented yet")); + // FActorSpawnParameters SpawnParameters; + // SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + // for (FTransform Spawn : HealthDropSpawnTransforms) + // { + // GetWorld()->SpawnActor(HealthDropClass, Spawn.GetLocation(), Spawn.GetRotation().Rotator(), SpawnParameters); + // } } \ No newline at end of file diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index 2ca99a55..47109d1e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -48,13 +48,13 @@ public: // ------------- Custom Bounty Alterations ------------- UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_1(); + void ActivateCustomBountyAlteration_1(); UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_2(); + void ActivateCustomBountyAlteration_2(); UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") - void BuyCustomBountyAlteration_3(); + void ActivateCustomBountyAlteration_3(); UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_1_Description() @@ -93,12 +93,13 @@ public: } // ------------- Simple Bounty Alterations ------------- - void BuySpawnAmmoDrops(); + void SpawnAmmoDrops(); - void BuySpawnHealthDrops(); + void SpawnHealthDrops(); - void BuyEnemyRadio() + void ActivateEnemyRadio() { + UE_LOG(LogTemp, Display, TEXT("Bought Radio, but it's not implemented yet")); HasEnemyRadio = true; } diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 0a2df784..e2d8a2ca 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -47,29 +47,47 @@ struct FPC_Display_Info DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLogoutFromBountyDirectorPC); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyCBA_1); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyCBA_2); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyCBA_3); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyAmmoDrop); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyHealthDrop); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyRadio); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyFavour); UCLASS() class ENDLESSVENDETTA_API UPC_Display : public UUserWidget { GENERATED_BODY() -protected: - UFUNCTION(BlueprintCallable, Category = "PC_Display") - void LogoutButtonPressed() - { - LogoutFromBountyDirectorPC.Broadcast(); - } - public: + // Button Delegates + UPROPERTY(BlueprintCallable, Category = PC_Display) FLogoutFromBountyDirectorPC LogoutFromBountyDirectorPC; UPROPERTY(BlueprintCallable, Category = PC_Display) FBuyCBA_1 BuyCba_1; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyCBA_2 BuyCba_2; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyCBA_3 BuyCba_3; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyAmmoDrop BuyAmmoDrop; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyHealthDrop BuyHealthDrop; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyRadio BuyRadio; + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyFavour BuyFavour; + // USTRUCT UPROPERTY(BlueprintReadOnly) FPC_Display_Info PC_Display_Info; - + + // Takes USTRUCT and uses its values to fill in widget UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") void LoadOS(); + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") + void UpdateFavourCount(int NewFavourCount); + }; From 8ad1393ffb79d78fa79ec4add71d35f98106081a Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sun, 15 Oct 2023 13:16:59 +0100 Subject: [PATCH 25/27] Fixed Buying a Bounty Alteration Multiple Times Player can now only buy each bounty alteration once per bounty --- .../BountySystem/BountyDirector.cpp | 18 ++++++++++++------ .../BountySystem/MainBountyClass.h | 10 ++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index e11b7841..56ed2056 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -126,9 +126,10 @@ void ABountyDirector::BuyCustomBountyAlteration_1() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_1_Cost(); - if (Cost == 0 || Favours < Cost) return; + if (Cost == 0 || Favours < Cost || ActiveBounty->ActivatedCBA_1) return; Favours -= Cost; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivatedCBA_1 = true; ActiveBounty->ActivateCustomBountyAlteration_1(); } @@ -137,9 +138,10 @@ void ABountyDirector::BuyCustomBountyAlteration_2() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_2_Cost(); - if (Cost == 0 || Favours < Cost) return; + if (Cost == 0 || Favours < Cost || ActiveBounty->ActivatedCBA_2) return; Favours -= Cost; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivatedCBA_2 = true; ActiveBounty->ActivateCustomBountyAlteration_2(); } @@ -147,36 +149,40 @@ void ABountyDirector::BuyCustomBountyAlteration_3() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_3_Cost(); - if (Cost == 0 || Favours < Cost) return; + if (Cost == 0 || Favours < Cost || ActiveBounty->ActivatedCBA_3) return; Favours -= Cost; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivatedCBA_3 = true; ActiveBounty->ActivateCustomBountyAlteration_3(); } void ABountyDirector::BuyAmmoDrop() { if (!IsValid(ActiveBounty)) return; - if (Favours < 1) return; + if (Favours < 1 || ActiveBounty->ActivateAmmoDrops) return; Favours--; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivateAmmoDrops = true; ActiveBounty->SpawnAmmoDrops(); } void ABountyDirector::BuyHealthDrop() { if (!IsValid(ActiveBounty)) return; - if (Favours < 1) return; + if (Favours < 1 || ActiveBounty->ActivatedHealthDrops) return; Favours--; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivatedHealthDrops = true; ActiveBounty->SpawnHealthDrops(); } void ABountyDirector::BuyEnemyRadio() { if (!IsValid(ActiveBounty)) return; - if (Favours < 1) return; + if (Favours < 1 || ActiveBounty->ActivatedRadio) return; Favours--; PC_Display->UpdateFavourCount(Favours); + ActiveBounty->ActivatedRadio = true; ActiveBounty->ActivateEnemyRadio(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index 47109d1e..96dc99cc 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -56,6 +56,10 @@ public: UFUNCTION(BlueprintImplementableEvent, Category = "Bounty") void ActivateCustomBountyAlteration_3(); + bool ActivatedCBA_1 = false; + bool ActivatedCBA_2 = false; + bool ActivatedCBA_3 = false; + UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_1_Description() { @@ -95,14 +99,20 @@ public: void SpawnAmmoDrops(); + bool ActivateAmmoDrops = false; + void SpawnHealthDrops(); + bool ActivatedHealthDrops = false; + void ActivateEnemyRadio() { UE_LOG(LogTemp, Display, TEXT("Bought Radio, but it's not implemented yet")); HasEnemyRadio = true; } + bool ActivatedRadio = false; + // Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned bool CheckIfHasEnemyRadio() { From 131b1977ba3cb92076904a9253a4f99d64d1197b Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Mon, 16 Oct 2023 14:00:13 +0100 Subject: [PATCH 26/27] Added AI Control HUB to Tutorial Hit Level --- EndlessVendetta/Config/DefaultEngine.ini | 4 ++-- .../Content/BountySystem/BountyDirector/PC_Background.uasset | 2 +- .../Content/LevelPrototyping/Scenes/TutorialHit.umap | 4 ++-- .../Source/EndlessVendetta/AI/Tasks/BTTask_AttackPlayer.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/EndlessVendetta/Config/DefaultEngine.ini b/EndlessVendetta/Config/DefaultEngine.ini index 280d5d43..d2549656 100644 --- a/EndlessVendetta/Config/DefaultEngine.ini +++ b/EndlessVendetta/Config/DefaultEngine.ini @@ -4,7 +4,7 @@ +EditProfiles=(Name="Trigger",CustomResponses=((Channel=Projectile, Response=ECR_Ignore))) [/Script/EngineSettings.GameMapsSettings] -EditorStartupMap=/Game/FirstPerson/Maps/GunMechanicTester.GunMechanicTester +EditorStartupMap=/Game/LevelPrototyping/Scenes/TutorialHit.TutorialHit LocalMapOptions= TransitionMap=None bUseSplitscreen=True @@ -13,7 +13,7 @@ ThreePlayerSplitscreenLayout=FavorTop FourPlayerSplitscreenLayout=Grid bOffsetPlayerGamepadIds=False GameInstanceClass=/Script/Engine.GameInstance -GameDefaultMap=/Game/FirstPerson/Maps/GunMechanicTester.GunMechanicTester +GameDefaultMap=/Game/LevelPrototyping/Scenes/TutorialHit.TutorialHit ServerDefaultMap=/Engine/Maps/Entry.Entry GlobalDefaultGameMode=/Game/FirstPerson/GunMechanicWorld.GunMechanicWorld_C GlobalDefaultServerGameMode=None diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset index 0e0a8514..5dc905ef 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:69b27343598f650b7535e6394e8f71edd12579339b4bbf6a5530e2058f984463 +oid sha256:4d1bd2827e82ba55e60dba3a42e89bd1877b0ba33adb9894603ec46705d99243 size 247653 diff --git a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap index 7e581a43..a39599bd 100644 --- a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap +++ b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ffb6c31ffcde26ae8a0f677a27ced553a7f10e9a7a41786f4c7a319f02205bc -size 411380 +oid sha256:1c712cf9883033d3111fd9d1caf88fe4ea56784215d573436cf8e0752f3cae2f +size 413690 diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/Tasks/BTTask_AttackPlayer.cpp b/EndlessVendetta/Source/EndlessVendetta/AI/Tasks/BTTask_AttackPlayer.cpp index d7371066..0a866247 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/Tasks/BTTask_AttackPlayer.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/AI/Tasks/BTTask_AttackPlayer.cpp @@ -19,7 +19,7 @@ EBTNodeResult::Type UBTTask_AttackPlayer::ExecuteTask(UBehaviorTreeComponent& Ow { FVector const Origin = AIController->GetPawn()->GetActorLocation(); FVector const PlayerLocation = Blackboard->GetValueAsVector("TargetLocation"); - DrawDebugLine(GetWorld(), Origin, PlayerLocation, FColor::Green, false, 1.f, 0, 1.f); + //DrawDebugLine(GetWorld(), Origin, PlayerLocation, FColor::Green, false, 1.f, 0, 1.f); FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded); return EBTNodeResult::Succeeded; From 05ca404a7faa4e43af44705834ecd7f658861fd9 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Mon, 16 Oct 2023 15:27:22 +0100 Subject: [PATCH 27/27] Deleted Doors from Tutorial Hit --- .../FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset | 4 ++-- .../Content/LevelPrototyping/Scenes/TutorialHit.umap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset index 6e0e13d4..fbbc1d32 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d593d68d5b9a9fc58b1b7ecc44936b84e361aaa1762ab04c5924e36bfd45bee9 -size 61494 +oid sha256:511de8633b9a821219aa62eb16918529e83282a370301627484865a83a470109 +size 62122 diff --git a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap index a39599bd..dfc5e57a 100644 --- a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap +++ b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c712cf9883033d3111fd9d1caf88fe4ea56784215d573436cf8e0752f3cae2f -size 413690 +oid sha256:2be413996287b89ce886902c79a65c948770ca63fb50fe29c142907ebc90056e +size 380456