mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(cheatenabler): keep the rare-recipe preference for belt statistics
The planner migration switched belt-signal upstream statistics to each item's standard recipe. Capture the native RecipeProto.Explicit flag in the production catalog and let the belt preset prefer explicit recipes again, which include the rare-resource alternatives such as Graphene from Fire Ice and Diamond from Kimberlite Ore. As before, explicit recipes that consume their own product (X-ray Cracking and Reforming Refine) never supply an item, and natural items stay raw. Proliferation modes now follow the selected recipe.
This commit is contained in:
1 parent
402d4008fb
commit
c000debdc1
6 files changed
+51
-8
No files matched your search
@@ -4,7 +4,7 @@
|
||||
## Changlog
|
||||
|
||||
* 2.4.8 - Unreleased
|
||||
* `Belt signal item generation`: Calculate raw-material, intermediate, and proliferator statistics from the game's current recipe data, using each item's standard recipe and counting by-products and consumption separately. If an item's recipe data is incomplete, only its upstream statistics pause, with the reason logged; item generation is unaffected.
|
||||
* `Belt signal item generation`: Calculate raw-material, intermediate, and proliferator statistics from the game's current recipe data, counting by-products and consumption separately. If an item's recipe data is incomplete, only its upstream statistics pause, with the reason logged; item generation is unaffected.
|
||||
* 2.4.7
|
||||
* `Dev Shortcuts`: Work immediately when enabled after loading a save, and process each key press once per frame at accelerated game speeds.
|
||||
* Extend `Unlock Tech with Key-Modifiers` with a downgrade mode.
|
||||
@@ -204,7 +204,7 @@
|
||||
## 更新日志
|
||||
|
||||
* 2.4.8 - Unreleased
|
||||
* `传送带信号物品生成`:原料、中间产物和增产剂的统计改为按游戏当前配方数据计算,采用各物品的标准配方,并分别计入副产物和消耗。某物品的配方数据不完整时,仅暂停该物品的上游统计并在日志中说明原因,不影响物品生成。
|
||||
* `传送带信号物品生成`:原料、中间产物和增产剂的统计改为按游戏当前配方数据计算,并分别计入副产物和消耗。某物品的配方数据不完整时,仅暂停该物品的上游统计并在日志中说明原因,不影响物品生成。
|
||||
* 2.4.7
|
||||
* `开发模式快捷键`:修复载入存档后启用时不生效的问题;加速游戏时每次按键仍只执行一次。
|
||||
* `使用组合键点击解锁科技` 新增降级模式。
|
||||
|
||||
@@ -113,11 +113,27 @@ internal static class BeltSignalSourcePreset
|
||||
if (catalog.Items.ContainsKey(externalItemId)) request.ExternalMaterials.Add(externalItemId);
|
||||
}
|
||||
|
||||
// Keep the legacy preference for explicit recipes, which include the rare-resource alternatives. Explicit
|
||||
// recipes that consume their own product, X-ray Cracking and Reforming Refine, never supply an item.
|
||||
foreach (var recipe in catalog.Recipes.Values
|
||||
.Where(recipe => recipe.Explicit && !recipe.Outputs.Keys.Any(recipe.Inputs.ContainsKey))
|
||||
.OrderBy(recipe => recipe.Id))
|
||||
{
|
||||
foreach (var outputId in recipe.Outputs.Keys)
|
||||
{
|
||||
if (request.RecipeByItem.ContainsKey(outputId) || request.ExternalMaterials.Contains(outputId) ||
|
||||
!catalog.Items.TryGetValue(outputId, out var output) || output.IsNatural) continue;
|
||||
request.RecipeByItem[outputId] = recipe.Id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!useProliferator) return request;
|
||||
if (sprayDeliveredItem) request.SprayDeliveredItems.Add(itemId);
|
||||
foreach (var item in catalog.Items.Values)
|
||||
{
|
||||
if (!catalog.Recipes.TryGetValue(item.DefaultRecipeId, out var recipe) ||
|
||||
var recipeId = request.RecipeByItem.TryGetValue(item.Id, out var selectedRecipeId)
|
||||
? selectedRecipeId : item.DefaultRecipeId;
|
||||
if (!catalog.Recipes.TryGetValue(recipeId, out var recipe) ||
|
||||
!recipe.Outputs.ContainsKey(item.Id) || recipe.Inputs.Count == 0) continue;
|
||||
request.ProliferationModeByItem[item.Id] = ItemIds.NoProliferationItemIds.Contains(item.Id)
|
||||
? ProliferationMode.None
|
||||
|
||||
Reference in new issue
Block a user