Skip to content

Commit

Permalink
Add Zryachiy debug patches
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Oct 9, 2024
1 parent d2beb61 commit 5dc8ffe
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Fika.Core/Coop/Patches/Lighthouse/LighthouseTraderZone_Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public static void Enable()
new LighthouseTraderZone_AddPlayer_Patch().Enable();
new LighthouseTraderZone_RemovePlayer_Patch().Enable();
new LighthouseTraderZone_Awake_Patch().Enable();
new zryachiydebugpatch1().Enable();
new zryachiydebugpatch2().Enable();
}

internal class LighthouseTraderZone_AddPlayer_Patch : ModulePatch
Expand Down Expand Up @@ -146,5 +148,43 @@ public static bool Prefix(LighthouseTraderZone __instance)
return true;
}
}

internal class zryachiydebugpatch1 : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass414).GetMethod(nameof(GClass414.IsEnemyNow));
}

[PatchPostfix]
public static void Postfix(IPlayer person, ref bool __result)
{
Logger.LogInfo($"zryachiydebugpatch1: {person.Id} - Is Enemy: {__result}");
}
}

internal class zryachiydebugpatch2 : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass414).GetMethod(nameof(GClass414.method_6));
}

[PatchPostfix]
public static void Postfix(IPlayer player, ref bool __result)
{
RadioTransmitterRecodableComponent radioTransmitterRecodableComponent = player.FindRadioTransmitter();
bool test = radioTransmitterRecodableComponent != null && radioTransmitterRecodableComponent.Handler.Status == RadioTransmitterStatus.Green;

if(test)
{
Logger.LogInfo($"zryachiydebugpatch2: {player.Id} - Has transmitter: Yes");
}
else
{
Logger.LogInfo($"zryachiydebugpatch2: {player.Id} - Has transmitter: Nope");
}
}
}
}
}

0 comments on commit 5dc8ffe

Please sign in to comment.