1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-03-29 06:37:16 +08:00

Compare commits

..

2 Commits

Author SHA1 Message Date
b566256748 work in progress 2025-05-27 02:04:12 +08:00
f956032596 work in progress 2025-05-25 21:17:01 +08:00

View File

@@ -194,6 +194,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.direction))) new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.direction)))
).Advance(2); ).Advance(2);
var end = matcher.Pos; var end = matcher.Pos;
CheatEnabler.Logger.LogDebug($"{start} {end}");
matcher.Start().Advance(start).RemoveInstructions(end - start).Insert( matcher.Start().Advance(start).RemoveInstructions(end - start).Insert(
new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Ldarg_3), new CodeInstruction(OpCodes.Ldarg_3),
@@ -209,6 +210,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{ {
var index = swarm.starData.index; var index = swarm.starData.index;
var orbitId = ejector.orbitId; var orbitId = ejector.orbitId;
CheatEnabler.Logger.LogDebug($"AddDysonSail {index} {orbitId}");
var delta1 = endVec - swarm.starData.uPosition; 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 delta2 = VectorLF3.Cross(endVec - uPos, swarm.orbits[orbitId].up).normalized * Math.Sqrt(swarm.dysonSphere.gravity / swarm.orbits[orbitId].radius);
var bulletCount = ejector.bulletCount; var bulletCount = ejector.bulletCount;
@@ -221,6 +223,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
SetSailsCacheCapacity(index, 256); SetSailsCacheCapacity(index, 256);
cache = _sailsCache[index]; cache = _sailsCache[index];
} }
CheatEnabler.Logger.LogDebug("B");
if (_fireAllBullets) if (_fireAllBullets)
{ {
var capacity = _sailsCacheCapacity[index]; var capacity = _sailsCacheCapacity[index];
@@ -231,6 +234,7 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{ {
capacity *= 2; capacity *= 2;
} while (leastCapacity > capacity); } while (leastCapacity > capacity);
CheatEnabler.Logger.LogDebug($"New Capacity: {capacity}");
SetSailsCacheCapacity(index, capacity); SetSailsCacheCapacity(index, capacity);
cache = _sailsCache[index]; cache = _sailsCache[index];
} }