Compare commits

2 Commits
Author SHA1 Message Date
soarqin b566256748 work in progress 2025-05-27 02:04:12 +08:00
soarqin f956032596 work in progress 2025-05-25 21:17:01 +08:00
+4
View File
@@ -194,6 +194,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.direction)))
).Advance(2);
var end = matcher.Pos;
CheatEnabler.Logger.LogDebug($"{start} {end}");
matcher.Start().Advance(start).RemoveInstructions(end - start).Insert(
new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldarg_3),
@@ -209,6 +210,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{
var index = swarm.starData.index;
var orbitId = ejector.orbitId;
CheatEnabler.Logger.LogDebug($"AddDysonSail {index} {orbitId}");
var delta1 = endVec - swarm.starData.uPosition;
var delta2 = VectorLF3.Cross(endVec - uPos, swarm.orbits[orbitId].up).normalized * Math.Sqrt(swarm.dysonSphere.gravity / swarm.orbits[orbitId].radius);
var bulletCount = ejector.bulletCount;
@@ -221,6 +223,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
SetSailsCacheCapacity(index, 256);
cache = _sailsCache[index];
}
CheatEnabler.Logger.LogDebug("B");
if (_fireAllBullets)
{
var capacity = _sailsCacheCapacity[index];
@@ -231,6 +234,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{
capacity *= 2;
} while (leastCapacity > capacity);
CheatEnabler.Logger.LogDebug($"New Capacity: {capacity}");
SetSailsCacheCapacity(index, capacity);
cache = _sailsCache[index];
}