Skip to content

feat(AutoEssence): 基质筛选功能新增内置基质规划计算器#1144

Merged
weinibuliu merged 2 commits intoMaaEnd:mainfrom
jason-xuan:main
Mar 9, 2026
Merged

feat(AutoEssence): 基质筛选功能新增内置基质规划计算器#1144
weinibuliu merged 2 commits intoMaaEnd:mainfrom
jason-xuan:main

Conversation

@jason-xuan
Copy link
Contributor

@jason-xuan jason-xuan commented Mar 9, 2026

概要

此 PR 在基质筛选任务完成后,新增本地预刻写方案推荐功能,在日志中按刷取地点输出最优方案。See #511

这里内嵌了一个简单的基质基质计算器功能,后续如果有更详细的计算器参数需求可以在此基础上修改。

新增特性

  1. 枚举基础属性(slot1)C(5,3)=10
    种组合,结合各重度能量淤积点可用的附加属性(slot2)/技能属性(slot3)池,计算每个方案可满足多少未毕业武器需求。
  2. 按满足需求数 DESC、匹配目标武器数 DESC 排序,每个地点输出前 2 个最优方案。
  3. 稀有度过滤:仅将用户已选稀有度的武器列入未毕业需求。
  4. weapons_data.json 新增 5 个重度能量淤积点的 slot2/slot3 可用技能 ID 数据。

Summary by Sourcery

在 EssenceFilter 流程中添加一个可选的内置“预刻印计划”推荐器,并增强构建脚本以避免 Windows 控制台编码问题。

New Features:

  • 引入本地预刻印计划计算器,在一次 EssenceFilter 运行之后,为每个刷图地点枚举最优的属性/技能组合,并记录最高优先级的推荐方案。
  • 在武器数据库和数据文件中添加武器掉落地点的元数据,包括可用的 slot2 和 slot3 技能,以支持基于地点的规划。
  • 暴露一个新的 EssenceFilter 选项,用于启用或禁用导出“计算器风格”的推荐输出。

Bug Fixes:

  • 通过强制使用 UTF-8 代码页并对子进程输出采用更宽容的解码方式,防止在 Windows 上使用 Python 3.14+ 时 build_and_install.py 出现 UnicodeDecodeError

Enhancements:

  • 在 EssenceFilter 的 UI 日志中以基于稀有度的颜色和更丰富的 HTML 来格式化推荐武器列表,以提升可读性。

Build:

  • build_and_install.py 中通过为 go 和 C++ 构建步骤指定带替换策略的 UTF-8 编码,放宽对子进程输出的解码限制。
Original summary in English

Summary by Sourcery

Add an optional built-in pre-engraving plan recommender to the EssenceFilter flow and harden the build script against Windows console encoding issues.

New Features:

  • Introduce a local pre-engraving plan calculator that enumerates optimal attribute/skill combinations per farming location after an EssenceFilter run and logs the top recommendations.
  • Add weapon drop location metadata, including available slot2 and slot3 skills, to the weapon database and data files to support location-aware planning.
  • Expose a new EssenceFilter option to enable or disable exporting the calculator-style recommendation output.

Bug Fixes:

  • Prevent UnicodeDecodeError in build_and_install.py on Windows with Python 3.14+ by forcing UTF-8 code page and tolerant decoding of subprocess output.

Enhancements:

  • Format recommended weapon lists with rarity-based coloring and richer HTML in the EssenceFilter UI logs for better readability.

Build:

  • Relax subprocess output decoding in build_and_install.py by specifying UTF-8 encoding with replacement for go and C++ build steps.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出一些总体反馈:

  • logCalculatorResult 中的 enumPlans 闭包会对每个位置和每个 slot1 组合重新计算匹配;如果技能池或目标列表变大,这会变得开销很大,因此建议预先按 slot1/slot2/slot3 的 ID 对目标组合建立索引,以避免重复的全量扫描。
  • logCalculatorResultweaponListHTML 中的 HTML 片段包含大量行内样式和重复的格式模式;可以考虑将通用的样式字符串集中管理,或者使用一些小的辅助函数来生成,从而让模板输出更易维护,并在后续调整 UI 时更不容易出错。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- The `enumPlans` closure in `logCalculatorResult` recomputes matches for every location and every slot1 combination; if the skill pools or target lists grow this could become expensive, so consider pre-indexing target combinations by slot1/slot2/slot3 IDs to avoid repeated full scans.
- The HTML snippets in `logCalculatorResult` and `weaponListHTML` embed a lot of inline styles and repeated format patterns; centralizing common style strings or using small helper functions would make the output templates easier to maintain and less error-prone when tweaking UI later.

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的代码审查。
Original comment in English

Hey - I've left some high level feedback:

  • The enumPlans closure in logCalculatorResult recomputes matches for every location and every slot1 combination; if the skill pools or target lists grow this could become expensive, so consider pre-indexing target combinations by slot1/slot2/slot3 IDs to avoid repeated full scans.
  • The HTML snippets in logCalculatorResult and weaponListHTML embed a lot of inline styles and repeated format patterns; centralizing common style strings or using small helper functions would make the output templates easier to maintain and less error-prone when tweaking UI later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `enumPlans` closure in `logCalculatorResult` recomputes matches for every location and every slot1 combination; if the skill pools or target lists grow this could become expensive, so consider pre-indexing target combinations by slot1/slot2/slot3 IDs to avoid repeated full scans.
- The HTML snippets in `logCalculatorResult` and `weaponListHTML` embed a lot of inline styles and repeated format patterns; centralizing common style strings or using small helper functions would make the output templates easier to maintain and less error-prone when tweaking UI later.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- 新增 logCalculatorResult:枚举基础属性(slot1) C(5,3)=10 种组合,结合
  各重度能量淤积点可用的附加属性(slot2)/技能属性(slot3)池,按"满足未毕业
  需求数 DESC, 匹配目标武器数 DESC"排序,每地点输出前 2 个最优方案
- 新增 calcPlan 结构体及 weaponListHTML 辅助函数
- weapons_data.json 追加 5 个刷取地点的 slot2/slot3 可用技能 ID 数据
- types.go 新增 Location 结构体并加入 WeaponDatabase
- 稀有度过滤:仅将用户已选稀有度的武器列入未毕业需求
- 预建 slot1→slot2/slot3 索引,避免枚举方案时重复全量扫描目标列表
- 提取 spanColor、planCardHTML 辅助函数,消除重复的行内样式模板
- 在推荐标题下方列出所有未毕业武器名称
- 调整方案序号、地点名称的颜色,提升在深色背景下的可读性
@weinibuliu weinibuliu merged commit efc728e into MaaEnd:main Mar 9, 2026
17 checks passed
MistEO pushed a commit that referenced this pull request Mar 9, 2026
## 概要

  此 PR 在基质筛选任务完成后,新增**本地预刻写方案推荐**功能,在日志中按刷取地点输出最优方案。See #511
  
  这里内嵌了一个简单的基质基质计算器功能,后续如果有更详细的计算器参数需求可以在此基础上修改。

  ### 新增特性

  1. 枚举基础属性(slot1)C(5,3)=10
  种组合,结合各**重度能量淤积点**可用的附加属性(slot2)/技能属性(slot3)池,计算每个方案可满足多少未毕业武器需求。
  2. 按满足需求数 DESC、匹配目标武器数 DESC 排序,每个地点输出前 2 个最优方案。
  3. 稀有度过滤:仅将用户已选稀有度的武器列入未毕业需求。
  4. `weapons_data.json` 新增 5 个重度能量淤积点的 slot2/slot3 可用技能 ID 数据。

## Summary by Sourcery

在 EssenceFilter 流程中添加一个可选的内置“预刻印计划”推荐器,并增强构建脚本以避免 Windows 控制台编码问题。

New Features:
- 引入本地预刻印计划计算器,在一次 EssenceFilter 运行之后,为每个刷图地点枚举最优的属性/技能组合,并记录最高优先级的推荐方案。
- 在武器数据库和数据文件中添加武器掉落地点的元数据,包括可用的 slot2 和 slot3 技能,以支持基于地点的规划。
- 暴露一个新的 EssenceFilter 选项,用于启用或禁用导出“计算器风格”的推荐输出。

Bug Fixes:
- 通过强制使用 UTF-8 代码页并对子进程输出采用更宽容的解码方式,防止在 Windows 上使用 Python 3.14+ 时
`build_and_install.py` 出现 `UnicodeDecodeError`。

Enhancements:
- 在 EssenceFilter 的 UI 日志中以基于稀有度的颜色和更丰富的 HTML 来格式化推荐武器列表,以提升可读性。

Build:
- 在 `build_and_install.py` 中通过为 go 和 C++ 构建步骤指定带替换策略的 UTF-8
编码,放宽对子进程输出的解码限制。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Add an optional built-in pre-engraving plan recommender to the
EssenceFilter flow and harden the build script against Windows console
encoding issues.

New Features:
- Introduce a local pre-engraving plan calculator that enumerates
optimal attribute/skill combinations per farming location after an
EssenceFilter run and logs the top recommendations.
- Add weapon drop location metadata, including available slot2 and slot3
skills, to the weapon database and data files to support location-aware
planning.
- Expose a new EssenceFilter option to enable or disable exporting the
calculator-style recommendation output.

Bug Fixes:
- Prevent UnicodeDecodeError in build_and_install.py on Windows with
Python 3.14+ by forcing UTF-8 code page and tolerant decoding of
subprocess output.

Enhancements:
- Format recommended weapon lists with rarity-based coloring and richer
HTML in the EssenceFilter UI logs for better readability.

Build:
- Relax subprocess output decoding in build_and_install.py by specifying
UTF-8 encoding with replacement for go and C++ build steps.

</details>
MistEO pushed a commit that referenced this pull request Mar 9, 2026
## 概要

  此 PR 在基质筛选任务完成后,新增**本地预刻写方案推荐**功能,在日志中按刷取地点输出最优方案。See #511
  
  这里内嵌了一个简单的基质基质计算器功能,后续如果有更详细的计算器参数需求可以在此基础上修改。

  ### 新增特性

  1. 枚举基础属性(slot1)C(5,3)=10
  种组合,结合各**重度能量淤积点**可用的附加属性(slot2)/技能属性(slot3)池,计算每个方案可满足多少未毕业武器需求。
  2. 按满足需求数 DESC、匹配目标武器数 DESC 排序,每个地点输出前 2 个最优方案。
  3. 稀有度过滤:仅将用户已选稀有度的武器列入未毕业需求。
  4. `weapons_data.json` 新增 5 个重度能量淤积点的 slot2/slot3 可用技能 ID 数据。

## Summary by Sourcery

在 EssenceFilter 流程中添加一个可选的内置“预刻印计划”推荐器,并增强构建脚本以避免 Windows 控制台编码问题。

New Features:
- 引入本地预刻印计划计算器,在一次 EssenceFilter 运行之后,为每个刷图地点枚举最优的属性/技能组合,并记录最高优先级的推荐方案。
- 在武器数据库和数据文件中添加武器掉落地点的元数据,包括可用的 slot2 和 slot3 技能,以支持基于地点的规划。
- 暴露一个新的 EssenceFilter 选项,用于启用或禁用导出“计算器风格”的推荐输出。

Bug Fixes:
- 通过强制使用 UTF-8 代码页并对子进程输出采用更宽容的解码方式,防止在 Windows 上使用 Python 3.14+ 时
`build_and_install.py` 出现 `UnicodeDecodeError`。

Enhancements:
- 在 EssenceFilter 的 UI 日志中以基于稀有度的颜色和更丰富的 HTML 来格式化推荐武器列表,以提升可读性。

Build:
- 在 `build_and_install.py` 中通过为 go 和 C++ 构建步骤指定带替换策略的 UTF-8
编码,放宽对子进程输出的解码限制。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Add an optional built-in pre-engraving plan recommender to the
EssenceFilter flow and harden the build script against Windows console
encoding issues.

New Features:
- Introduce a local pre-engraving plan calculator that enumerates
optimal attribute/skill combinations per farming location after an
EssenceFilter run and logs the top recommendations.
- Add weapon drop location metadata, including available slot2 and slot3
skills, to the weapon database and data files to support location-aware
planning.
- Expose a new EssenceFilter option to enable or disable exporting the
calculator-style recommendation output.

Bug Fixes:
- Prevent UnicodeDecodeError in build_and_install.py on Windows with
Python 3.14+ by forcing UTF-8 code page and tolerant decoding of
subprocess output.

Enhancements:
- Format recommended weapon lists with rarity-based coloring and richer
HTML in the EssenceFilter UI logs for better readability.

Build:
- Relax subprocess output decoding in build_and_install.py by specifying
UTF-8 encoding with replacement for go and C++ build steps.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants