From 68fe5a432870ccbbd2156e8fec6aa2fe3690ff6b Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Mon, 5 Jan 2026 21:41:41 +0100 Subject: [PATCH] Add stealth cheat --- The Callisto Protocol/dllmain.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/The Callisto Protocol/dllmain.cpp b/The Callisto Protocol/dllmain.cpp index 0035984..8d03564 100644 --- a/The Callisto Protocol/dllmain.cpp +++ b/The Callisto Protocol/dllmain.cpp @@ -37,6 +37,7 @@ static bool g_Fog_fix_enabled = false; static bool g_TimeDilation_fix_enabled = false; static bool g_GodMode_fix_enabled = false; static bool g_Invulnerable_fix_enabled = false; +static bool g_Stealth_fix_enabled = false; static int g_AdditionalFOVValue = 0; static int g_CameraOffset = 0; static float g_WorldTimeDilationValue = 1.f; @@ -199,6 +200,7 @@ extern "C" __declspec(dllexport) void SetFixesEnabled(GameFixes fix, bool enable if (fix == GameFixes::TimeDilation) { g_TimeDilation_fix_enabled = enabled; EnableCheats(Cheat::TimeDilation); } if (fix == GameFixes::GodMode) { g_GodMode_fix_enabled = enabled; EnableCheats(Cheat::GodMode); } if (fix == GameFixes::Invulnerable) { g_Invulnerable_fix_enabled = enabled; EnableCheats(Cheat::Invulnerability); } + if (fix == GameFixes::Stealth) { g_Stealth_fix_enabled = enabled; EnableCheats(Cheat::Stealth); } } extern "C" __declspec(dllexport) void SetFOV(int fov) { @@ -506,38 +508,41 @@ static void EnableCheats(Cheat cheat) { ULONGLONG now = GetTickCount64(); if (now - lastScanTick < DEFAULT_ACTORS_SCAN_BETWEEN_TICKS) return; - lastScanTick = now; + UWorld* world = UWorld::GetWorld(); if (!world) return; APawn* pawn = GetPawnFromWorld(world); if (!pawn) return; - // Enemies time dilation, + + // Enemies time dilation & stealth for (int i = 0; i < world->Levels.Num(); i++) { // Loop through level to find actors ULevel* Level = world->Levels[i]; if (!Level) continue; for (int j = 0; j < Level->Actors.Num(); j++) { // Loop through actors AActor* actor = Level->Actors[j]; - if (!actor) continue; - if (actor == pawn) continue; // We don't want to affect Jacob - if (!actor->IsA(ACharacter::StaticClass()) && !actor->IsA(APawn::StaticClass())) - continue; // We want to affect only enemies - + if (!actor || actor == pawn) continue; // We don't want to affect Jacob + if (!actor->IsA(APhxAICharacter::StaticClass())) continue; // We want to affect enemies only actor->CustomTimeDilation = g_TimeDilation_fix_enabled ? g_AITimeDilationValue : 1.f; + // Stealth + APhxAICharacter* aiChar = static_cast(actor); + if (!aiChar || !aiChar->SenseComponent) continue; // UPhxAISenseComponent class + aiChar->SenseComponent->EnableSensing(!g_Stealth_fix_enabled); // Enemies won't be aware of Jacob } } // God mode AActor* jacob = static_cast(pawn); - if (jacob) jacob->bCanBeDamaged = g_GodMode_fix_enabled ? false : true; // Jacob won't be hurt - // Invulnerability + if (jacob) jacob->bCanBeDamaged = !g_GodMode_fix_enabled; // Jacob won't be hurt + // Ignore hits APhxCharacter* phxChar = GetPhxCharacterFromPawn(pawn); - if (phxChar) phxChar->bInvulnerable = g_Invulnerable_fix_enabled ? true : false; // Make Jacob invulnerable + if (phxChar) phxChar->bInvulnerable = g_Invulnerable_fix_enabled; // Jacob can't be hit }); } if (cheat == Cheat::TimeDilation) logger->info("Time dilation cheat {}", g_TimeDilation_fix_enabled ? "enabled" : "disabled"); if (cheat == Cheat::GodMode) logger->info("God mode cheat {}", g_GodMode_fix_enabled ? "enabled" : "disabled"); if (cheat == Cheat::Invulnerability) logger->info("Ignore hits cheat {}", g_Invulnerable_fix_enabled ? "enabled" : "disabled"); + if (cheat == Cheat::Stealth) logger->info("Stealth cheat {}", g_Stealth_fix_enabled ? "enabled" : "disabled"); } static void FogFixEnabled() {