mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 14:13:31 +08:00
WIP
This commit is contained in:
@@ -169,34 +169,47 @@ public class CheatEnabler : BaseUnityPlugin
|
|||||||
|
|
||||||
private class AlwaysInfiniteResource
|
private class AlwaysInfiniteResource
|
||||||
{
|
{
|
||||||
[HarmonyTranspiler]
|
|
||||||
[HarmonyPatch(typeof(GameDesc), "isInfiniteResource", MethodType.Getter)]
|
|
||||||
private static IEnumerable<CodeInstruction> ForceInfiniteResource(IEnumerable<CodeInstruction> instructions)
|
|
||||||
{
|
|
||||||
yield return new CodeInstruction(OpCodes.Ldc_I4, 1);
|
|
||||||
yield return new CodeInstruction(OpCodes.Ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyTranspiler]
|
[HarmonyTranspiler]
|
||||||
[HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool))]
|
[HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool))]
|
||||||
[HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool), typeof(int), typeof(int),
|
[HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool), typeof(int), typeof(int),
|
||||||
typeof(int))]
|
typeof(int))]
|
||||||
|
[HarmonyPatch(typeof(ItemProto), "GetPropValue")]
|
||||||
|
[HarmonyPatch(typeof(PlanetTransport), "GameTick")]
|
||||||
[HarmonyPatch(typeof(UIMinerWindow), "_OnUpdate")]
|
[HarmonyPatch(typeof(UIMinerWindow), "_OnUpdate")]
|
||||||
|
[HarmonyPatch(typeof(UIMiningUpgradeLabel), "Update")]
|
||||||
|
[HarmonyPatch(typeof(UIPlanetDetail), "OnPlanetDataSet")]
|
||||||
|
[HarmonyPatch(typeof(UIPlanetDetail), "RefreshDynamicProperties")]
|
||||||
|
[HarmonyPatch(typeof(UIStarDetail), "OnStarDataSet")]
|
||||||
|
[HarmonyPatch(typeof(UIStarDetail), "RefreshDynamicProperties")]
|
||||||
|
[HarmonyPatch(typeof(UIStationStorage), "RefreshValues")]
|
||||||
[HarmonyPatch(typeof(UIVeinCollectorPanel), "_OnUpdate")]
|
[HarmonyPatch(typeof(UIVeinCollectorPanel), "_OnUpdate")]
|
||||||
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
||||||
{
|
{
|
||||||
foreach (var instruction in instructions)
|
foreach (var instruction in instructions)
|
||||||
{
|
{
|
||||||
if (instruction.opcode == OpCodes.Ldc_R4 && instruction.OperandIs(99.5f))
|
if (instruction.opcode == OpCodes.Ldfld && instruction.OperandIs(AccessTools.Field(typeof(GameHistoryData), "miningCostRate")))
|
||||||
{
|
{
|
||||||
|
yield return new CodeInstruction(OpCodes.Pop);
|
||||||
yield return new CodeInstruction(OpCodes.Ldc_R4, 0f);
|
yield return new CodeInstruction(OpCodes.Ldc_R4, 0f);
|
||||||
}
|
}
|
||||||
|
else if (instruction.opcode == OpCodes.Ldfld && instruction.OperandIs(AccessTools.Field(typeof(GameHistoryData), "miningSpeedScale")))
|
||||||
|
{
|
||||||
|
yield return new CodeInstruction(OpCodes.Pop);
|
||||||
|
yield return new CodeInstruction(OpCodes.Ldc_R4, 720f);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yield return instruction;
|
yield return instruction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix, HarmonyPatch(typeof(BuildTool_BlueprintPaste), "get_bMeetTech")]
|
||||||
|
private static bool BuildTool_BlueprintPaste_get_bMeetTech_Prefix(ref bool __result)
|
||||||
|
{
|
||||||
|
__result = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class UnlockTechOnGameStart
|
private class UnlockTechOnGameStart
|
||||||
|
|||||||
Reference in New Issue
Block a user