1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 20:53:28 +08:00

UXAssist 1.2.14 & CheatEnabler 2.3.27

This commit is contained in:
2025-01-24 19:20:51 +08:00
parent f224b72838
commit 0a8fa9971c
9 changed files with 63 additions and 38 deletions

View File

@@ -1,5 +1,7 @@
## Changlog
* 2.3.27
+ `Skip bullet period` & `Eject anyway`: Fix compatibility with `Dyson Sphere Program v0.10.32.25496`.
* 2.3.26
+ Refactor codes to adapt to UXAssist 1.2.0
- You should update UXAssist to 1.2.0 or later before using this version.
@@ -141,6 +143,8 @@
## 更新日志
* 2.3.27
+ `跳过子弹阶段``全球弹射`:修复了与`戴森球计划 v0.10.32.25496`的兼容性
* 2.3.26
+ 重构代码以适应UXAssist 1.2.0
- 在使用此版本之前您应先更新UXAssist到1.2.0或更高版本。
@@ -153,7 +157,7 @@
<details>
<summary>更早的版本</summary>
2.3.24
* 2.3.24
+ `立即完成戴森壳建造`:修复了在某些情况下可能导致发电为负的问题
* 2.3.23
+ 新功能:`立即完成戴森壳建造`

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.cheatenabler</BepInExPluginGuid>
<Description>DSP MOD - CheatEnabler</Description>
<Version>2.3.26</Version>
<Version>2.3.27</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>CheatEnabler</PackageId>

View File

@@ -179,11 +179,11 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
).Advance(1);
var end = matcher.Pos;
matcher.Start().Advance(start).RemoveInstructions(end - start).Insert(
new CodeInstruction(OpCodes.Ldarg_2),
new CodeInstruction(OpCodes.Ldarg_3),
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.orbitId))),
new CodeInstruction(OpCodes.Ldloc_S, 8),
new CodeInstruction(OpCodes.Ldloc_S, 10),
new CodeInstruction(OpCodes.Ldloc_S, 9),
new CodeInstruction(OpCodes.Ldloc_S, 11),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(SkipBulletPatch), nameof(SkipBulletPatch.AddDysonSail)))
);
return matcher.InstructionEnumeration();
@@ -391,26 +391,25 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
private static IEnumerable<CodeInstruction> EjectorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
var matcher = new CodeMatcher(instructions, generator);
matcher.MatchForward(false,
matcher.End().MatchBack(false,
new CodeMatch(instr => instr.opcode == OpCodes.Ldc_R8 && Math.Abs((double)instr.operand - 0.08715574) < 0.00000001)
);
var start = matcher.Pos - 3;
matcher.MatchForward(false,
new CodeMatch(OpCodes.And)
).Advance(1).MatchForward(false,
new CodeMatch(OpCodes.And)
new CodeMatch(OpCodes.Ldarg_0),
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.bulletCount)))
);
var end = matcher.Pos - 2;
/* Remove angle checking codes, then add:
* V_13 = this.bulletCount > 0;
*/
matcher.Start().Advance(start).RemoveInstructions(end - start).Insert(
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.bulletCount))),
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Cgt),
new CodeInstruction(OpCodes.Stloc_S, 13)
var end = matcher.Pos;
matcher.Start().Advance(start).RemoveInstructions(end - start).MatchForward(false,
new CodeMatch(ci => ci.IsStloc())
).Advance(1);
start = matcher.Pos;
matcher.MatchForward(false,
new CodeMatch(OpCodes.Ldarg_0),
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.autoOrbit)))
);
end = matcher.Pos;
matcher.Start().Advance(start).RemoveInstructions(end - start);
return matcher.InstructionEnumeration();
}
}
@@ -419,7 +418,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
{
[HarmonyTranspiler]
[HarmonyPatch(typeof(EjectorComponent), nameof(EjectorComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> EjectAndSiloComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
private static IEnumerable<CodeInstruction> EjectComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
var matcher = new CodeMatcher(instructions, generator);
/* Add a multiply to ejector speed */
@@ -472,7 +471,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
{
[HarmonyTranspiler]
[HarmonyPatch(typeof(SiloComponent), nameof(SiloComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> EjectAndSiloComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
private static IEnumerable<CodeInstruction> SiloComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
var matcher = new CodeMatcher(instructions, generator);
/* Add a multiply to ejector speed */

View File

@@ -1,6 +1,6 @@
{
"name": "CheatEnabler",
"version_number": "2.3.26",
"version_number": "2.3.27",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler",
"description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测",
"dependencies": [