diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index 3a17ae9..0022705 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -390,6 +390,8 @@ void AFortPlayerControllerAthena::ServerTeleportToPlaygroundLobbyIslandHook(AFor void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerController* Controller, APawn* Pawn) { static auto AcknowledgedPawnOffset = Controller->GetOffset("AcknowledgedPawn"); + + const APawn* OldAcknowledgedPawn = Controller->Get(AcknowledgedPawnOffset); Controller->Get(AcknowledgedPawnOffset) = Pawn; auto ControllerAsFort = Cast(Controller); @@ -399,6 +401,11 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl if (!PawnAsFort) return; + if (OldAcknowledgedPawn != PawnAsFort) + { + PawnAsFort->SetShield(StartingShield); + } + if (Globals::bNoMCP) { static auto CustomCharacterPartClass = FindObject("/Script/FortniteGame.CustomCharacterPart"); diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index ec4523a..9c2d317 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -203,9 +203,25 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll }; LoopMutators(AddInventoryOverrideTeamLoadouts); - - WorldInventory->Update(); } + + const auto& ItemInstances = WorldInventory->GetItemList().GetItemInstances(); + + for (int i = 0; i < ItemInstances.Num(); ++i) + { + auto ItemInstance = ItemInstances.at(i); + + if (!ItemInstance) continue; + + auto WeaponItemDefinition = Cast(ItemInstance->GetItemEntry()->GetItemDefinition()); + + if (!WeaponItemDefinition) continue; + + ItemInstance->GetItemEntry()->GetLoadedAmmo() = WeaponItemDefinition->GetClipSize(); + WorldInventory->GetItemList().MarkItemDirty(ItemInstance->GetItemEntry()); + } + + WorldInventory->Update(); } } else diff --git a/Project Reboot 3.0/extra.cpp b/Project Reboot 3.0/extra.cpp index 0f8a52a..32d48af 100644 --- a/Project Reboot 3.0/extra.cpp +++ b/Project Reboot 3.0/extra.cpp @@ -32,7 +32,7 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa GameState->Get(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase; SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); - if (NewLateGameSafeZonePhase == 5) + if (NewLateGameSafeZonePhase == EndReverseZonePhase) { bReversing = false; } @@ -45,7 +45,7 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa LOG_WARN(LogZone, "Invalid SafeZoneIndicator!"); } - if (NewLateGameSafeZonePhase >= 7) // This means instead of going to the 8th phase its gonna go down. + if (NewLateGameSafeZonePhase >= StartReverseZonePhase) // This means instead of going to the 8th phase its gonna go down. { bReversing = true; } @@ -128,12 +128,12 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa GameState->Get(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase; SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); - if (NewLateGameSafeZonePhase == 5) + if (NewLateGameSafeZonePhase == EndReverseZonePhase) { bReversing = false; } - if (NewLateGameSafeZonePhase >= 7) // This means instead of going to the 8th phase its gonna go down. + if (NewLateGameSafeZonePhase >= StartReverseZonePhase) // This means instead of going to the 8th phase its gonna go down. { bReversing = true; } diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 3e741a5..898dd61 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -63,6 +63,9 @@ #define LOADOUT_PLAYERTAB 4 #define FUN_PLAYERTAB 5 +extern inline int StartReverseZonePhase = 7; +extern inline int EndReverseZonePhase = 5; +extern inline float StartingShield = 0; extern inline bool bEnableReverseZone = false; extern inline int AmountOfPlayersWhenBusStart = 0; extern inline bool bHandleDeath = true; @@ -82,6 +85,7 @@ extern inline bool bEnableCombinePickup = false; extern inline int AmountOfBotsToSpawn = 0; extern inline bool bEnableRebooting = false; extern inline bool bEngineDebugLogs = false; +extern inline bool bStartedBus = false; extern inline int AmountOfHealthSiphon = 0; // THE BASE CODE IS FROM IMGUI GITHUB @@ -96,7 +100,11 @@ static inline void CleanupDeviceD3D(); static inline void ResetDevice(); static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -extern inline bool bStartedBus = false; +static inline void SetIsLategame(bool Value) +{ + Globals::bLateGame.store(Value); + StartingShield = 100; +} static inline void Restart() // todo move? { @@ -532,7 +540,7 @@ static inline DWORD WINAPI LateGameThread(LPVOID) if (SafeZoneLocations.Num() < 4) { LOG_WARN(LogLateGame, "Unable to find SafeZoneLocation! Disabling lategame.."); - Globals::bLateGame.store(false); + SetIsLategame(false); return 0; } @@ -681,8 +689,8 @@ static inline void MainUI() if (!bStartedBus) { bool bWillBeLategame = Globals::bLateGame.load(); - ImGui::Checkbox("Lategame (HIGHLY EXPERIMENTAL)", &bWillBeLategame); - Globals::bLateGame.store(bWillBeLategame); + ImGui::Checkbox("Lategame", &bWillBeLategame); + SetIsLategame(bWillBeLategame); } ImGui::Text(std::format("Joinable {}", Globals::bStartedListening).c_str()); @@ -1065,9 +1073,26 @@ static inline void MainUI() static std::string ItemToGrantEveryone; static int AmountToGrantEveryone = 1; + ImGui::InputFloat("Starting Shield", &StartingShield); ImGui::InputText("Item to Give", &ItemToGrantEveryone); ImGui::InputInt("Amount to Give", &AmountToGrantEveryone); + if (ImGui::Button("Destroy all player builds")) + { + auto AllBuildingSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ABuildingSMActor::StaticClass()); + + for (int i = 0; i < AllBuildingSMActors.Num(); i++) + { + auto CurrentBuildingSMActor = (ABuildingSMActor*)AllBuildingSMActors.at(i); + + if (!CurrentBuildingSMActor->IsPlayerPlaced()) continue; + + CurrentBuildingSMActor->K2_DestroyActor(); + } + + AllBuildingSMActors.Free(); + } + if (ImGui::Button("Give Item to Everyone")) { auto ItemDefinition = FindObject(ItemToGrantEveryone, nullptr, ANY_PACKAGE); @@ -1142,6 +1167,12 @@ static inline void MainUI() else if (Tab == LATEGAME_TAB) { ImGui::Checkbox("Enable Reverse Zone (EXPERIMENTAL)", &bEnableReverseZone); + + if (bEnableReverseZone) + { + ImGui::InputInt("Start Reversing Phase", &StartReverseZonePhase); + ImGui::InputInt("End Reversing Phase", &EndReverseZonePhase); + } } else if (Tab == DEVELOPER_TAB) { @@ -1324,7 +1355,7 @@ static inline void PregameUI() { bool bWillBeLategame = Globals::bLateGame.load(); ImGui::Checkbox("Lategame", &bWillBeLategame); - Globals::bLateGame.store(bWillBeLategame); + SetIsLategame(bWillBeLategame); } if (HasEvent())