diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml index 17e2d619..c9b7b27e 100644 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml +++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml @@ -9,9 +9,31 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BP_Elevator.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BP_Elevator.uasset index f6e4a525..0d93d61b 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BP_Elevator.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BP_Elevator.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a28c44c09d3ee396d17502b08ad02f029c01b5f0927fa3ec295dc77621a87dbf -size 101367 +oid sha256:5beff82bbe966a5aa37576021879acfec5f987482509ebe993e4e6707b215053 +size 2560 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.png b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence1.png similarity index 100% rename from EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.png rename to EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence1.png diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence1.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence1.uasset new file mode 100644 index 00000000..b4d252db --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e81e2f7d112bcd4e902f403c4d849a3354c1017a83dea4ecaf21c53748f0488 +size 194885 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.png b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence2.png similarity index 100% rename from EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.png rename to EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence2.png diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence2.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence2.uasset new file mode 100644 index 00000000..cc517bed --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:872b9cc8108863e79df9c968dcdcadf919ecbb0d24c359f0c062c62acc56ec4f +size 187881 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.png b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence3.png similarity index 100% rename from EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.png rename to EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence3.png diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence3.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence3.uasset new file mode 100644 index 00000000..76517284 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/CinematicFrmaes/TimothyEliminatedSequence3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbce5d68cef6f7648a69c4ab0b49c0718be7e4f827de65f43483df72b4fb7635 +size 46142 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/TargetEliminatedSequence.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/TargetEliminatedSequence.uasset new file mode 100644 index 00000000..354a8d03 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/TargetEliminatedSequence.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2160ce11a03f95044c4aed50c60ef16ba6bf30cfd3a775ea5bf577a0bebc8c4c +size 15353 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/WBP_TimothyEliminated.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/WBP_TimothyEliminated.uasset new file mode 100644 index 00000000..a59440e3 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountyCompleted/WBP_TimothyEliminated.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:149144b6fd8ca68c9504252e87e3dea76145a975072f5f950a31628b7265bc5d +size 93434 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Elevator.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Elevator.uasset new file mode 100644 index 00000000..f454dd0e --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Elevator.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74b407ea0f81176dd53e06508517de1e46f8bd5bb028ef4ff4c240fb16855da5 +size 97327 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CP_ElimTImothyHuntsmer.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/CP_ElimTImothyHuntsmer.uasset deleted file mode 100644 index 13650e05..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CP_ElimTImothyHuntsmer.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:402b1927aa8568280268ea72ed9a74d119cfb7f90b15aea33b51e2c77d676638 -size 98725 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/CP_ElimTImothyHuntsmer.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/CP_ElimTImothyHuntsmer.uasset new file mode 100644 index 00000000..e1163602 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/CP_ElimTImothyHuntsmer.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4011687f5e23d06e47c3eb26866081d1272cf73a2692252cd57fd4b3483a884d +size 95250 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OWCP_Apartment.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OWCP_Apartment.uasset new file mode 100644 index 00000000..fe336fcd --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/Checkpoints/OWCP_Apartment.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b75c5541122da7d86dde09ffc1dca38739137c6fed09f31f953578392aa8e4c +size 24261 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.uasset deleted file mode 100644 index 2fefa4b1..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd48ed44b7418ebe41e2ecfa34fc5255516804e276a362a70ed254c94d1f5948 -size 194853 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.uasset deleted file mode 100644 index 46345e7c..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e831a54780e268243e807dba5db877a6e4a11de39c0cf215bf7a80a4ebd8ae8 -size 187849 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.uasset deleted file mode 100644 index 5b7f3dc1..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2e7637dc22779c553d568c5cba824c68f7adc5bb4d03bd2b05c441b047dd511e -size 46110 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/MB_Apartment.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/MB_Apartment.uasset index 0aa1d885..966102a7 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/MB_Apartment.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/MB_Apartment.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6593629256e5444639af0a54a54707e4bb015e680ceeaba562e76909f9d55f10 -size 25322 +oid sha256:0799a3c8d18c8c3ac88ea74f2106eff00d2f768db80dd3890e59eb95c2a5e09c +size 25631 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/OWCP_Apartment.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/OWCP_Apartment.uasset deleted file mode 100644 index 69c1e83d..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/OWCP_Apartment.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f671cf047ef64679d0a306f563a38958bb751c78b68c615d63c539ec1cf84b92 -size 24453 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/CP_GoToSecurityOffice.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/CP_GoToSecurityOffice.uasset new file mode 100644 index 00000000..cdb1bb70 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/CP_GoToSecurityOffice.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e4033216548f6200b2265883ed20f8c859b0ad6b628540b7cc58c8bdb2da091 +size 81558 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/SB_SecuritySpecialists.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/SB_SecuritySpecialists.uasset new file mode 100644 index 00000000..23d82ca3 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/SideBounties/SecuritySpecialists/SB_SecuritySpecialists.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7424cf05690138802d592e05e23d7ee74ff2e5c680d943715f51dfc8c985552b +size 23371 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/TargetEliminatedSequence.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/TargetEliminatedSequence.uasset deleted file mode 100644 index cc5c5772..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/TargetEliminatedSequence.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59b317daaff6320cb349f0431e5afd1dda081e7ccd94c85e1410a79acb309b5c -size 15321 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/WBP_TimothyEliminated.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/WBP_TimothyEliminated.uasset deleted file mode 100644 index 7288e08b..00000000 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/WBP_TimothyEliminated.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0cf418c167f49075338deb5047703b031ac61ed014b691277846e62a97bca97e -size 105471 diff --git a/EndlessVendetta/Content/Levels/MainMenuLevel.umap b/EndlessVendetta/Content/Levels/MainMenuLevel.umap index 41f224b2..594eec13 100644 --- a/EndlessVendetta/Content/Levels/MainMenuLevel.umap +++ b/EndlessVendetta/Content/Levels/MainMenuLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:77a3ca4ec175668d370773d936ab81f41ddc197ebe0841e24801910512c8dcd0 -size 308710 +oid sha256:ecab0f671c308960a2881e050ca07a1300f04e97819e1f47203ca1ca652f4ccf +size 308758 diff --git a/EndlessVendetta/Content/Levels/TempOpenWorld.umap b/EndlessVendetta/Content/Levels/TempOpenWorld.umap index 4cead22c..d46f6d9e 100644 --- a/EndlessVendetta/Content/Levels/TempOpenWorld.umap +++ b/EndlessVendetta/Content/Levels/TempOpenWorld.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c23c9614eb11e162386c9a60456be49ab400d443ccb643d2defaa76bb8435a5d -size 13865992 +oid sha256:1d77716f252adb75b590d1a27ae726ae52e139032cceb876fc497f4125619a79 +size 13867288 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index e86e7301..80f4790a 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:239ef48ba56a9ad2be8dbba09ec5c54affebabdc535173bc421788faf05f7afa +oid sha256:6764172277cd1d5812197441d69c3897c757be02854b03b5e4a0ddf6cfa563fb size 66790690 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index e96b02ca..977f9ed0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -17,10 +17,18 @@ void ABountyClass::ActivateFirstCheckpoint() BountyCheckpoints[0]->Active = true; BountyCheckpoints[0]->SpawnWaypoint(BountyTitle); - BountyCheckpoints[0]->CheckpointActivated(); + // BountyCheckpoints[0]->CheckpointActivated(); BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint); } +void ABountyClass::DeActivateFirstCheckpoint() +{ + if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return; + + BountyCheckpoints[0]->Active = false; + BountyCheckpoints[0]->DestroyWaypoint(); +} + void ABountyClass::SpawnCheckpoints() { // Spawn all checkpoints associated with this bounty and store them in order @@ -41,38 +49,10 @@ void ABountyClass::SpawnCheckpoints() ACheckpointClass* SpawnedCheckpoint = Cast(GetWorld()->SpawnActor(CheckpointClass, Loc, Rot, SpawnParameters)); BountyCheckpoints.Add(SpawnedCheckpoint); } - - ActivateFirstCheckpoint(); } void ABountyClass::IncrementBountyCheckpoint() { - // --------------------------------------------------------------------------------------------------------------------- - // Broadcast that the first Checkpoint has been completed so that side bounties can be destroyed - // if (!BountyStarted) - // { - // BountyStarted = true; - // CompletedFirstCheckpoint.Broadcast(); - // } - // - // // Bounty Completion Condition - // if (BountyCheckpoints.Num() <= 1) - // { - // Completed = true; - // BountyCheckpoints[0]->Active = false; - // BountyCheckpoints[0]->Destroy(); - // BountyCheckpoints.RemoveAt(0); - // UE_LOG(LogTemp, Warning, TEXT(" You've Completed the Bounty!! Well done")); - // return; - // } - // - // if (BountyCheckpoints[0] == nullptr) - // { - // UE_LOG(LogTemp, Fatal, TEXT("Missing checkpoint in bounty checkpoints, could've failed to spawn or cast")); - // return; - // } - //--------------------------------------------------------------------------------------------------------------------- - if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return; // Destroy Actor and Shrink Array diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 94cb313b..d0039300 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -31,8 +31,7 @@ public: // ------------------- METHODS --------------------------------- private: - // Activate the First Checkpoint in Bounty Checkpoints and Listen for its Completion - void ActivateFirstCheckpoint(); + protected: // Called when a checkpoint is completed, handles moving onto next checkpoint and discarding the old one @@ -44,9 +43,13 @@ public: ABountyClass(); // Spawns and stores this Bounties Checkpoints in order - void SpawnCheckpoints(); + virtual void SpawnCheckpoints(); + // Activate the First Checkpoint in Bounty Checkpoints and Listen for its Completion + void ActivateFirstCheckpoint(); + // De-Activate the First Checkpoint in Bounty Checkpoints + void DeActivateFirstCheckpoint(); @@ -71,10 +74,6 @@ protected: FString BountyDesc; // ----------------------------------------------- - - - - public: // Broadcast when first checkpoint from this bounty is completed FCompletedFirstCheckpoint CompletedFirstCheckpoint; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp index b2938653..34d4d8c8 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp @@ -9,24 +9,6 @@ ACheckpointClass::ACheckpointClass() // 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; BountyTitle = ""; - -} - -// Called when the game starts or when spawned -void ACheckpointClass::BeginPlay() -{ - Super::BeginPlay(); -} - -void ACheckpointClass::SpawnWaypoint(const FString& CurrentBountyTitle) -{ - if (!IsValid(WaypointActorClass) || HideWaypoint) return; - - BountyTitle = CurrentBountyTitle; - FActorSpawnParameters SpawnParams; - SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; - WaypointActor = Cast(GetWorld()->SpawnActor(WaypointActorClass, WaypointLoc, GetActorRotation(), SpawnParams)); - WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle); } void ACheckpointClass::UpdateCheckpointWaypoint(FVector WaypointNewLoc) @@ -40,17 +22,19 @@ void ACheckpointClass::UpdateCheckpointWaypoint(FVector WaypointNewLoc) WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle); } -// Called every frame -void ACheckpointClass::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); - -} - void ACheckpointClass::Destroyed() { - if (WaypointActor) WaypointActor->Destroy(); + DestroyWaypoint(); Super::Destroyed(); } +void ACheckpointClass::SpawnWaypoint(const FString& CurrentBountyTitle) +{ + if (!IsValid(WaypointActorClass) || HideWaypoint) return; + BountyTitle = CurrentBountyTitle; + FActorSpawnParameters SpawnParams; + SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + WaypointActor = Cast(GetWorld()->SpawnActor(WaypointActorClass, WaypointLoc, GetActorRotation(), SpawnParams)); + WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle); +} diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h index 09462ebf..2f541e61 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h @@ -16,8 +16,7 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor { GENERATED_BODY() - FString BountyTitle; - +// ------------------- ATTRIBUTES ------------------------------ // ------ Properties set from Editor ------ UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") FString CheckpointTip; @@ -32,9 +31,25 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") bool HideWaypoint = false; + // Stored Title of Bounty, used by Update Checkpoint Waypoint Func + FString BountyTitle; + + // Ref to Waypoint Actor AWaypointActor* WaypointActor; - // ---------------------------------------- protected: + +public: + // Delegate called when Checkpoint is Completed + FCompletedCheckpoint CompletedCheckpoint; + + // Used by Checkpoint BPs to Determine weather to Run Checkpoint Logic + UPROPERTY(BlueprintReadOnly, Category = "Checkpoint") + bool Active = false; +// ------------------- METHODS --------------------------------- +private: + +protected: + // Used by Checkpoints BPs to broadcast that they're Completed UFUNCTION(BlueprintCallable, Category = "Checkpoint") void BroadcastCompletion() { @@ -42,21 +57,34 @@ protected: Cast(GetWorld()->GetAuthGameMode())->SendEvent("Check", CheckpointTip); } + // Used by Checkpoint BPs to update Checkpoint Loc without Finishing Checkpoint itself UFUNCTION(BlueprintCallable) - void UpdateCheckpointWaypoint(FVector WaypointNewLoc); - // Called when the game starts or when spawned - virtual void BeginPlay() override; + void UpdateCheckpointWaypoint(FVector WaypointNewLoc); + // Used to Destroy any Waypoint Actor Associated with this Checkpoint when it's Destroyed virtual void Destroyed() override; - public: - FCompletedCheckpoint CompletedCheckpoint; - - UPROPERTY(BlueprintReadOnly, Category = "Checkpoint") - bool Active = false; + // Sets default values for this actor's properties + ACheckpointClass(); + // Used by Bounties to Spawn Waypoint for this Checkpoint when it's Activated void SpawnWaypoint(const FString& BountyTitle); + // Destroys Waypoint Associated with this Checkpoint if one Exists + void DestroyWaypoint() + { + if (WaypointActor) WaypointActor->Destroy(); + } + + + + + + + +// ------------------- LEGACY --------------------------------- + +public: UFUNCTION(BlueprintImplementableEvent) void CheckpointActivated(); @@ -81,12 +109,5 @@ public: { return CheckpointSpawnTransform; } - - // --------------------------------------- - - // Sets default values for this actor's properties - ACheckpointClass(); - - // Called every frame - virtual void Tick(float DeltaTime) override; + }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp index 1af830e7..72ca600b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp @@ -25,9 +25,26 @@ void AMainBountyClass::SpawnOpenWorldCheckpoint() OpenWorldcheckpoint->SpawnWaypoint(BountyTitle); } + void AMainBountyClass::SpawnCheckpoints() + { + Super::SpawnCheckpoints(); + ActivateFirstCheckpoint(); + } - - + TArray AMainBountyClass::SpawnAndReturnSideBounties() +{ + TArray SpawnedSideBounties; + for (auto SideBountyClass : SideBountiesToSpawn) + { + if (!IsValid(SideBountyClass)) continue; + ASideBountyClass* SpawnedSideBounty = GetWorld()->SpawnActor(SideBountyClass); + const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true); + SpawnedSideBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules); + SpawnedSideBounty->SpawnCheckpoints(); + SpawnedSideBounties.Add(SpawnedSideBounty); + } + return SpawnedSideBounties; +} void AMainBountyClass::SpawnAmmoDrops() diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index 912449f4..f3ddc5b1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -54,6 +54,9 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass UPROPERTY(EditDefaultsOnly, Category = "Bounty") FTransform PlayerSpawnTransform; + // Used to Spawn Side Bounties Associated with this Main Bounty + UPROPERTY(EditDefaultsOnly, Category = "Bounty") + TArray> SideBountiesToSpawn; protected: @@ -74,6 +77,11 @@ public: // Spawns the Single Checkpoint in the Open World for this Main Bounty void SpawnOpenWorldCheckpoint(); + void SpawnCheckpoints() override; + + // Used by Bounty Character to Spawn and Store Side Bounty Refs when Main Bounty is Updated + TArray SpawnAndReturnSideBounties(); + // Used by Players Character to Determine where to Spawn in the Open World after Completing Main Bounty FTransform GetPlayerSpawnTransform() { @@ -86,8 +94,7 @@ public: // ------------------- LEGACY CODE TO BE REWORKED --------------------------------- protected: - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - TArray> SideBountiesToSpawn; + // ---------------- Bounty Alterations ---------------- UPROPERTY(EditDefaultsOnly, Category = "Bounty") diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp index 6daec97b..7ad9409d 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.cpp @@ -3,22 +3,15 @@ #include "SideBountyClass.h" -void ASideBountyClass::BeginPlay() -{ - Super::BeginPlay(); - -} void ASideBountyClass::IncrementBountyCheckpoint() { Super::IncrementBountyCheckpoint(); - // Rework!!!! - - // if (Completed) - // { - // CompletedSideBounty.Broadcast(FavoursEarnedForCompletion); - // } + if (BountyCheckpoints.IsEmpty()) + { + CompletedSideBounty.Broadcast(FavoursEarnedForCompletion); + } } void ASideBountyClass::DestroyCheckpoints() diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h index 12d66397..2f4118e1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/SideBountyClass.h @@ -27,17 +27,36 @@ UCLASS() class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass { GENERATED_BODY() - -protected: + +// ------------------- ATTRIBUTES ------------------------------ + // Amount of Favours the Player will earn for Completing this Side Bounty UPROPERTY(EditDefaultsOnly, Category = "Side Bounty") int FavoursEarnedForCompletion = 1; - virtual void BeginPlay() override; +protected: + +public: + // Delegate Broadcast when Side Bounty is Completed, Listened to by Bounty Character + FCompletedSideBounty CompletedSideBounty; + + // Struct Containing all Data to be Displayed about the Side Bounty + UPROPERTY(EditDefaultsOnly, Category = "Side Bounty") + FSideBountyStruct SideBountyStruct; + +// ------------------- METHODS --------------------------------- + +private: + +protected: + // Overrides to check if Side Bounty has been Completed + virtual void IncrementBountyCheckpoint() override; +public: + + + + // ------------------- LEGACY --------------------------------- public: - FCompletedSideBounty CompletedSideBounty; - - virtual void IncrementBountyCheckpoint() override; void DestroyCheckpoints(); int GetRewardInFavours() { diff --git a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp index b65da36f..64b93688 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp @@ -14,10 +14,6 @@ void ABountyHunterCharacter::SpawnMainBounty(UEVGameInstance* GI) if (MainBountyClasses.IsEmpty() || MainBountyClasses.Num() <= CurrentMainBountyIndex|| !IsValid(MainBountyClasses[CurrentMainBountyIndex])) { AllBountiesCompleted(); - if (CurrentMainBountyIndex >= 2 && !(UGameplayStatics::GetCurrentLevelName(GetWorld()) == "EnemyAITest")) - { - UGameplayStatics::OpenLevel(GetWorld(), FName("EnemyAITest")); - } return; } @@ -25,8 +21,20 @@ void ABountyHunterCharacter::SpawnMainBounty(UEVGameInstance* GI) const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true); CurrentMainBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules); - UGameplayStatics::GetCurrentLevelName(GetWorld()) == OpenWorldLevelName ? CurrentMainBounty->SpawnOpenWorldCheckpoint() : CurrentMainBounty->SpawnCheckpoints(); MainBountyStruct = CurrentMainBounty->MainBountyStruct; + if (UGameplayStatics::GetCurrentLevelName(GetWorld()) != OpenWorldLevelName) + { + CurrentMainBounty->SpawnCheckpoints(); + return; + } + CurrentMainBounty->SpawnOpenWorldCheckpoint(); + CurrentSideBounties = CurrentMainBounty->SpawnAndReturnSideBounties(); + + SideBountyStructs.Empty(); + for (auto SideBounty : CurrentSideBounties) + { + SideBountyStructs.Add(SideBounty->SideBountyStruct); + } } void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI) diff --git a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.h b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.h index fe0ea38c..0ec2bc2a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.h @@ -30,6 +30,8 @@ class ENDLESSVENDETTA_API ABountyHunterCharacter : public AEndlessVendettaCharac // Reference to the Currently Active Main Bounty AMainBountyClass* CurrentMainBounty; + TArray CurrentSideBounties; + // Index of Currently Active Main Bounty, Used for MainBountyClasses int CurrentMainBountyIndex = 0; @@ -175,13 +177,13 @@ private: FMainBountyStruct MainBountyStruct; - TArray SideBountyStruct; + TArray SideBountyStructs; void UpdateBountyTabInfo() { if (!IsValid(BountiesTab)) return; BountyTabInfo.MainBountyStruct = MainBountyStruct; - BountyTabInfo.SideBountyStructs = SideBountyStruct; + BountyTabInfo.SideBountyStructs = SideBountyStructs; BountiesTab->UpdateBountyTab(BountyTabInfo); }