mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-22 18:19:02 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c23743b4a2 | ||
|
|
2eae91fa18 | ||
|
|
d728e8b4ae |
No files matched your search
@@ -4,6 +4,7 @@
|
|||||||
## Changlog
|
## Changlog
|
||||||
|
|
||||||
* 2.4.8
|
* 2.4.8
|
||||||
|
* `Mecha and Drones/Fleets invincible`: Fix mecha HP and energy shield protection failing when enabled after taking damage, and restore protection for space fleets.
|
||||||
* `Finish build immediately`: Fix possible errors when starting a new game. Construction begins after the opening cutscene ends or is skipped.
|
* `Finish build immediately`: Fix possible errors when starting a new game. Construction begins after the opening cutscene ends or is skipped.
|
||||||
* `Belt signal item generation`:
|
* `Belt signal item generation`:
|
||||||
* Improve raw-material, intermediate, by-product and proliferator statistics using current recipes, with production and consumption counted separately. Incomplete recipe data only pauses the affected upstream statistics; item generation continues.
|
* Improve raw-material, intermediate, by-product and proliferator statistics using current recipes, with production and consumption counted separately. Incomplete recipe data only pauses the affected upstream statistics; item generation continues.
|
||||||
@@ -207,6 +208,7 @@
|
|||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
* 2.4.8
|
* 2.4.8
|
||||||
|
* `机甲和战斗无人机无敌`:修复受伤后启用时机甲耐久度和能量护盾保护可能失效的问题,并恢复太空编队的无敌保护。
|
||||||
* `建造秒完成`:修复开始新游戏时可能报错的问题。建造会在开场动画播放结束或跳过后开始。
|
* `建造秒完成`:修复开始新游戏时可能报错的问题。建造会在开场动画播放结束或跳过后开始。
|
||||||
* `传送带信号物品生成`:
|
* `传送带信号物品生成`:
|
||||||
* 按当前配方完善原料、中间产物、副产物和增产剂的统计,分别记录生产和消耗。配方数据不完整时,仅暂停受影响物品的上游统计,物品仍会正常生成。
|
* 按当前配方完善原料、中间产物、副产物和增产剂的统计,分别记录生产和消耗。配方数据不完整时,仅暂停受影响物品的上游统计,物品仍会正常生成。
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Linq;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
using UXAssist.Common.ModFeatures;
|
using UXAssist.Common.ModFeatures;
|
||||||
|
using UXAssist.Common.Patching;
|
||||||
|
|
||||||
namespace CheatEnabler.Patches;
|
namespace CheatEnabler.Patches;
|
||||||
|
|
||||||
@@ -48,27 +49,37 @@ public static class CombatPatch
|
|||||||
);
|
);
|
||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
// Harmony transpiler: SkillSystem_DamageObject_Transpiler
|
// Harmony transpiler: Mecha_Invincible_Transpiler
|
||||||
// Target: SkillSystem.DamageGroundObjectByLocalCaster, SkillSystem.DamageGroundObjectByRemoteCaster, SkillSystem.DamageObject
|
// Target: Mecha.TakeDamage, Mecha.EnergyShieldResist (both overloads)
|
||||||
// Fallback: None — patch will fail loudly if the target method body changes.
|
// Fallback: Return original instructions if the invincibility check is not found.
|
||||||
[HarmonyTranspiler]
|
[HarmonyTranspiler]
|
||||||
|
[HarmonyPatch(typeof(Mecha), nameof(Mecha.TakeDamage))]
|
||||||
|
[HarmonyPatch(typeof(Mecha), nameof(Mecha.EnergyShieldResist), [typeof(int)], [ArgumentType.Ref])]
|
||||||
|
[HarmonyPatch(typeof(Mecha), nameof(Mecha.EnergyShieldResist), [typeof(int), typeof(int)], [ArgumentType.Ref, ArgumentType.Out])]
|
||||||
|
private static IEnumerable<CodeInstruction> Mecha_Invincible_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||||
|
{
|
||||||
|
// Repatch the consumers too: an already inlined getter bypasses its own Harmony patch.
|
||||||
|
var original = instructions.ToList();
|
||||||
|
var matcher = new CodeMatcher(original, generator);
|
||||||
|
matcher.MatchForward(false, new CodeMatch(ci => ci.Calls(AccessTools.PropertyGetter(typeof(Player), nameof(Player.invincible)))));
|
||||||
|
if (matcher.IsInvalid) return matcher.Finish(original, CheatEnabler.Logger, nameof(Mecha_Invincible_Transpiler));
|
||||||
|
matcher.Set(OpCodes.Pop, null).Advance(1).Insert(new CodeInstruction(OpCodes.Ldc_I4_1));
|
||||||
|
return matcher.InstructionEnumeration();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
|
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
|
||||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByRemoteCaster))]
|
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByRemoteCaster))]
|
||||||
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageObject))]
|
private static void SkillSystem_DamageGroundObject_Prefix(ref int damage, ref SkillTargetLocal target)
|
||||||
private static IEnumerable<CodeInstruction> SkillSystem_DamageObject_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator, MethodBase __originalMethod)
|
|
||||||
{
|
{
|
||||||
var matcher = new CodeMatcher(instructions, generator);
|
if (target.type == ETargetType.Craft) damage = 0;
|
||||||
matcher.MatchForward(false,
|
}
|
||||||
new CodeMatch(ci => ci.IsLdarg()),
|
|
||||||
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(SkillTargetLocal), nameof(SkillTargetLocal.type))),
|
[HarmonyPrefix]
|
||||||
new CodeMatch(OpCodes.Ldc_I4_6),
|
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageObject))]
|
||||||
new CodeMatch(ci => ci.opcode == OpCodes.Bne_Un || ci.opcode == OpCodes.Bne_Un_S)
|
private static void SkillSystem_DamageObject_Prefix(ref int damage, ref SkillTarget target)
|
||||||
);
|
{
|
||||||
matcher.Repeat(m => m.Advance(4).InsertAndAdvance(
|
if (target.type == ETargetType.Craft) damage = 0;
|
||||||
new CodeInstruction(OpCodes.Ldc_I4_0),
|
|
||||||
new CodeInstruction(OpCodes.Starg_S, __originalMethod.Name == "DamageObject" ? 1 : 2)
|
|
||||||
));
|
|
||||||
return matcher.InstructionEnumeration();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,4 +106,4 @@ public static class CombatPatch
|
|||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,8 @@
|
|||||||
* Keep the highest-production shells and remove the others
|
* Keep the highest-production shells and remove the others
|
||||||
* Duplicate the highest-production shells with a configurable shell count
|
* Duplicate the highest-production shells with a configurable shell count
|
||||||
* Mecha/Combat:
|
* Mecha/Combat:
|
||||||
* Mecha and Drones/Fleets invicible
|
* Mecha and Drones/Fleets invincible
|
||||||
|
* Protects mecha HP and energy shields, ground combat drones, and space fleets, including when enabled during combat.
|
||||||
* Buildings invicible
|
* Buildings invicible
|
||||||
* Enable warp without space warpers
|
* Enable warp without space warpers
|
||||||
* Teleport to outer space
|
* Teleport to outer space
|
||||||
@@ -180,6 +181,7 @@ The item icon selects the output; no hotkey is needed.
|
|||||||
* 从发电量最高的壳复制戴森壳,可设置壳面数量
|
* 从发电量最高的壳复制戴森壳,可设置壳面数量
|
||||||
* 机甲/战斗:
|
* 机甲/战斗:
|
||||||
* 机甲和战斗无人机无敌
|
* 机甲和战斗无人机无敌
|
||||||
|
* 保护机甲耐久度和能量护盾、地面战斗无人机和太空编队,战斗中开启同样生效。
|
||||||
* 建筑无敌
|
* 建筑无敌
|
||||||
* 无需空间翘曲器即可曲速飞行
|
* 无需空间翘曲器即可曲速飞行
|
||||||
* 传送到外太空
|
* 传送到外太空
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
## Changlog
|
## Changlog
|
||||||
|
|
||||||
|
* 1.6.4
|
||||||
|
* `Hide battle-related techs in Peace mode`: Fix an array index error when opening the tech tree after switching from a Peace-mode save to a Combat-mode save in the same game process, including when disabling the option after loading another Peace-mode save.
|
||||||
* 1.6.3
|
* 1.6.3
|
||||||
* `Quick build Mining Machines`:
|
* `Quick build Mining Machines`:
|
||||||
* Add a Factory-tab button to arrange ordinary Mining Machines densely around the nearest solid vein group. Each miner covers at least 3 nodes from that group, without including nearby groups. Layouts are not limited by stock; missing miners remain as ghosts awaiting materials. Placement respects construction range and does not include belts or power facilities. Click again to cancel a search.
|
* Add a Factory-tab button to arrange ordinary Mining Machines densely around the nearest solid vein group. Each miner covers at least 3 nodes from that group, without including nearby groups. Layouts are not limited by stock; missing miners remain as ghosts awaiting materials. Placement respects construction range and does not include belts or power facilities. Click again to cancel a search.
|
||||||
@@ -444,6 +446,8 @@
|
|||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
* 1.6.4
|
||||||
|
* `在和平模式下隐藏战斗相关科技`:修复在同一次游戏运行中从和平模式存档切换到战斗模式存档后打开科技树时的数组越界,以及再次加载和平模式存档后关闭选项时的同类问题。
|
||||||
* 1.6.3
|
* 1.6.3
|
||||||
* `快速铺设采矿机`:
|
* `快速铺设采矿机`:
|
||||||
* 在「工厂」页增加按钮,自动在最近的固体矿脉周围密集铺设普通采矿机。每台至少覆盖选中矿脉的 3 个矿点,不混入附近其他矿脉。布局数量不受库存限制,采矿机不足的位置保留待建造虚影。遵守建造范围,不自动铺设传送带和电力设施。计算期间再次点击可取消。
|
* 在「工厂」页增加按钮,自动在最近的固体矿脉周围密集铺设普通采矿机。每台至少覆盖选中矿脉的 3 个矿点,不混入附近其他矿脉。布局数量不受库存限制,采矿机不足的位置保留待建造虚影。遵守建造范围,不自动铺设传送带和电力设施。计算期间再次点击可取消。
|
||||||
|
|||||||
@@ -222,11 +222,22 @@ public static class TechPatch
|
|||||||
foreach (var item in nodes)
|
foreach (var item in nodes)
|
||||||
{
|
{
|
||||||
var node = item.Value;
|
var node = item.Value;
|
||||||
|
var postTechArray = node.techProto.postTechArray;
|
||||||
|
// A new session can initialize nodes while the peace-mode graph is still filtered.
|
||||||
|
var arrowCount = node.arrows.Length;
|
||||||
|
if (arrowCount < postTechArray.Length)
|
||||||
|
{
|
||||||
|
System.Array.Resize(ref node.arrows, postTechArray.Length);
|
||||||
|
for (var i = arrowCount; i < postTechArray.Length; i++)
|
||||||
|
{
|
||||||
|
node.arrows[i] = UnityEngine.Object.Instantiate(node.arrowPrefab, node.arrowPrefab.parent);
|
||||||
|
node.arrows[i].SetAsFirstSibling();
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach (var arrow in node.arrows)
|
foreach (var arrow in node.arrows)
|
||||||
{
|
{
|
||||||
arrow.gameObject.SetActive(false);
|
arrow.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
var postTechArray = node.techProto.postTechArray;
|
|
||||||
var active = postTechArray.Length > 0;
|
var active = postTechArray.Length > 0;
|
||||||
node.connGroup.gameObject.SetActive(active);
|
node.connGroup.gameObject.SetActive(active);
|
||||||
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];
|
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];
|
||||||
|
|||||||
@@ -171,6 +171,7 @@
|
|||||||
* Buy out techs with their prerequisites
|
* Buy out techs with their prerequisites
|
||||||
* This enables batch buying out techs with their prerequisites. Buy-out buttons are shown for locked techs/upgrades.
|
* This enables batch buying out techs with their prerequisites. Buy-out buttons are shown for locked techs/upgrades.
|
||||||
* Hide battle-related techs in Peace mode
|
* Hide battle-related techs in Peace mode
|
||||||
|
* Battle-related techs and their connections return when disabling the option or loading a Combat-mode save; switching saves does not require restarting the game.
|
||||||
* Unlock all techs with metadata
|
* Unlock all techs with metadata
|
||||||
* Use the config-panel button to confirm the metadata cost and buy out eligible techs in a batch; unlimited upgrade chains are excluded.
|
* Use the config-panel button to confirm the metadata cost and buy out eligible techs in a batch; unlimited upgrade chains are excluded.
|
||||||
* Combat
|
* Combat
|
||||||
@@ -378,6 +379,7 @@
|
|||||||
* 买断科技也同时买断所有前置科技
|
* 买断科技也同时买断所有前置科技
|
||||||
* 可批量买断科技及其前置科技,未解锁的科技和升级会显示买断按钮。
|
* 可批量买断科技及其前置科技,未解锁的科技和升级会显示买断按钮。
|
||||||
* 在和平模式下隐藏战斗相关科技
|
* 在和平模式下隐藏战斗相关科技
|
||||||
|
* 关闭选项或加载战斗模式存档后恢复相关科技及连线,切换存档无需重启游戏。
|
||||||
* 使用元数据解锁所有科技
|
* 使用元数据解锁所有科技
|
||||||
* 在配置面板点击按钮并确认元数据消耗,批量买断符合条件的科技;不包含无限升级科技链。
|
* 在配置面板点击按钮并确认元数据消耗,批量买断符合条件的科技;不包含无限升级科技链。
|
||||||
* 战斗
|
* 战斗
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
||||||
<Description>DSP MOD - UXAssist</Description>
|
<Description>DSP MOD - UXAssist</Description>
|
||||||
<Version>1.6.3</Version>
|
<Version>1.6.4</Version>
|
||||||
<PackageId>UXAssist</PackageId>
|
<PackageId>UXAssist</PackageId>
|
||||||
<RootNamespace>UXAssist</RootNamespace>
|
<RootNamespace>UXAssist</RootNamespace>
|
||||||
<PackHasChangelog>true</PackHasChangelog>
|
<PackHasChangelog>true</PackHasChangelog>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "UXAssist",
|
"name": "UXAssist",
|
||||||
"version_number": "1.6.3",
|
"version_number": "1.6.4",
|
||||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
||||||
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|||||||
Reference in new issue
Block a user