1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 21:33:28 +08:00
This commit is contained in:
2024-09-02 22:51:24 +08:00
parent 3a2821a2c1
commit 421cfd230e
6 changed files with 52 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
## Changlog ## Changlog
* 2.3.25
+ New feature: `Enable warp without space warpers`
* 2.3.24 * 2.3.24
+ `Complete Dyson Sphere Shells instantly`: Fix a bug that may cause negative power in some cases + `Complete Dyson Sphere Shells instantly`: Fix a bug that may cause negative power in some cases
* 2.3.23 * 2.3.23
@@ -127,6 +129,8 @@
## 更新日志 ## 更新日志
* 2.3.25
+ 新功能:`无需空间翘曲器即可曲速飞行`
* 2.3.24 * 2.3.24
+ `立即完成戴森壳建造`:修复了在某些情况下可能导致发电为负的问题 + `立即完成戴森壳建造`:修复了在某些情况下可能导致发电为负的问题
* 2.3.23 * 2.3.23

View File

@@ -58,6 +58,8 @@ public class CheatEnabler : BaseUnityPlugin
"Can do terraform without enough soil piless"); "Can do terraform without enough soil piless");
PlayerPatch.InstantTeleportEnabled = Config.Bind("Player", "InstantTeleport", false, PlayerPatch.InstantTeleportEnabled = Config.Bind("Player", "InstantTeleport", false,
"Enable instant teleport (like that in Sandbox mode)"); "Enable instant teleport (like that in Sandbox mode)");
PlayerPatch.WarpWithoutSpaceWarpersEnabled = Config.Bind("Player", "WarpWithoutWarper", false,
"Enable warp without warper");
DysonSpherePatch.SkipBulletEnabled = Config.Bind("DysonSphere", "SkipBullet", false, DysonSpherePatch.SkipBulletEnabled = Config.Bind("DysonSphere", "SkipBullet", false,
"Skip bullet"); "Skip bullet");
DysonSpherePatch.SkipAbsorbEnabled = Config.Bind("DysonSphere", "SkipAbsorb", false, DysonSpherePatch.SkipAbsorbEnabled = Config.Bind("DysonSphere", "SkipAbsorb", false,

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit; using System.Reflection.Emit;
using BepInEx.Configuration; using BepInEx.Configuration;
using CommonAPI.Systems; using CommonAPI.Systems;

View File

@@ -8,16 +8,20 @@ namespace CheatEnabler;
public static class PlayerPatch public static class PlayerPatch
{ {
public static ConfigEntry<bool> InstantTeleportEnabled; public static ConfigEntry<bool> InstantTeleportEnabled;
public static ConfigEntry<bool> WarpWithoutSpaceWarpersEnabled;
public static void Init() public static void Init()
{ {
InstantTeleportEnabled.SettingChanged += (_, _) => InstantTeleport.Enable(InstantTeleportEnabled.Value); InstantTeleportEnabled.SettingChanged += (_, _) => InstantTeleport.Enable(InstantTeleportEnabled.Value);
WarpWithoutSpaceWarpersEnabled.SettingChanged += (_, _) => WarpWithoutSpaceWarpers.Enable(WarpWithoutSpaceWarpersEnabled.Value);
InstantTeleport.Enable(InstantTeleportEnabled.Value); InstantTeleport.Enable(InstantTeleportEnabled.Value);
WarpWithoutSpaceWarpers.Enable(WarpWithoutSpaceWarpersEnabled.Value);
} }
public static void Uninit() public static void Uninit()
{ {
InstantTeleport.Enable(false); InstantTeleport.Enable(false);
WarpWithoutSpaceWarpers.Enable(false);
} }
private static class InstantTeleport private static class InstantTeleport
@@ -57,4 +61,37 @@ public static class PlayerPatch
return matcher.InstructionEnumeration(); return matcher.InstructionEnumeration();
} }
} }
}
private static class WarpWithoutSpaceWarpers
{
private static Harmony _patch;
public static void Enable(bool on)
{
if (on)
{
_patch ??= Harmony.CreateAndPatchAll(typeof(WarpWithoutSpaceWarpers));
}
else
{
_patch?.UnpatchSelf();
_patch = null;
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Mecha), nameof(Mecha.HasWarper))]
private static bool Mecha_HasWarper_Prefix(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(Mecha), nameof(Mecha.UseWarper))]
private static void Mecha_UseWarper_Postfix(ref bool __result)
{
__result = true;
}
}
}

View File

@@ -47,6 +47,7 @@
+ Mecha/Combat: + Mecha/Combat:
+ Mecha and Drones/Fleets invicible + Mecha and Drones/Fleets invicible
+ Buildings invicible + Buildings invicible
+ Enable warp without space warpers
+ Teleport to outer space + Teleport to outer space
+ Teleport to selected astronomical + Teleport to selected astronomical
@@ -102,9 +103,12 @@
+ 快速吸收 + 快速吸收
+ 全球弹射 + 全球弹射
+ 立即完成戴森壳建造 + 立即完成戴森壳建造
+ 战斗: + 机甲/战斗:
+ 机甲和战斗无人机无敌 + 机甲和战斗无人机无敌
+ 建筑无敌 + 建筑无敌
+ 无需空间翘曲器即可曲速飞行
+ 传送到外太空
+ 传送到选定的天体
## 注意事项 ## 注意事项
* 如果和[BlueprintTweaks](https://dsp.thunderstore.io/package/kremnev8/BlueprintTweaks/)一起使用,请升级`BepInEx`到5.4.21或更高版本,以避免可能的冲突 * 如果和[BlueprintTweaks](https://dsp.thunderstore.io/package/kremnev8/BlueprintTweaks/)一起使用,请升级`BepInEx`到5.4.21或更高版本,以避免可能的冲突

View File

@@ -66,6 +66,7 @@ public static class UIConfigWindow
I18N.Add("Instant teleport (like that in Sandbox mode)", "Instant teleport (like that in Sandbox mode)", "快速传送(和沙盒模式一样)"); I18N.Add("Instant teleport (like that in Sandbox mode)", "Instant teleport (like that in Sandbox mode)", "快速传送(和沙盒模式一样)");
I18N.Add("Mecha and Drones/Fleets invicible", "Mecha and Drones/Fleets invicible", "机甲和战斗无人机无敌"); I18N.Add("Mecha and Drones/Fleets invicible", "Mecha and Drones/Fleets invicible", "机甲和战斗无人机无敌");
I18N.Add("Buildings invicible", "Buildings invincible", "建筑无敌"); I18N.Add("Buildings invicible", "Buildings invincible", "建筑无敌");
I18N.Add("Enable warp without space warpers", "Enable warp without space warpers", "无需空间翘曲器即可曲速飞行");
I18N.Add("Teleport to outer space", "Teleport to outer space", "传送到外太空"); I18N.Add("Teleport to outer space", "Teleport to outer space", "传送到外太空");
I18N.Add("Teleport to selected astronomical", "Teleport to selected astronomical", "传送到选中的天体"); I18N.Add("Teleport to selected astronomical", "Teleport to selected astronomical", "传送到选中的天体");
I18N.Apply(); I18N.Apply();
@@ -215,6 +216,8 @@ public static class UIConfigWindow
wnd.AddCheckBox(x, y, tab5, CombatPatch.MechaInvincibleEnabled, "Mecha and Drones/Fleets invicible"); wnd.AddCheckBox(x, y, tab5, CombatPatch.MechaInvincibleEnabled, "Mecha and Drones/Fleets invicible");
y += 36f; y += 36f;
wnd.AddCheckBox(x, y, tab5, CombatPatch.BuildingsInvincibleEnabled, "Buildings invicible"); wnd.AddCheckBox(x, y, tab5, CombatPatch.BuildingsInvincibleEnabled, "Buildings invicible");
y += 36f;
wnd.AddCheckBox(x, y, tab5, PlayerPatch.WarpWithoutSpaceWarpersEnabled, "Enable warp without space warpers");
x = 400f; x = 400f;
y = 10f; y = 10f;
wnd.AddButton(x, y, 200f, tab5, "Teleport to outer space", 16, "button-teleport-to-outer-space", PlayerFunctions.TeleportToOuterSpace); wnd.AddButton(x, y, 200f, tab5, "Teleport to outer space", 16, "button-teleport-to-outer-space", PlayerFunctions.TeleportToOuterSpace);