Open
Conversation
- 新增 scripts/scrape_skills_bilibili.py 从 biligame Wiki 爬取技能数据 - 支持从技能图鉴页面动态获取最新技能列表 - 支持自动重试失败条目直到全部成功 - 输出 CSV 包含属性、分类、耗能、威力、描述、可学习精灵 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 检测到 nrc.db 存在时,先重命名为 nrc.db.bak 备份 - 如果已存在旧备份,先删除旧备份(最多保留 1 份) - 使用 os.rename() 而非复制,确保原子操作
- 新增 import_skills_from_bilibili() 函数,从 skills_bilibili.csv 导入 - --skill-source bilibili: 仅从 bilibili 导入,不整合 wiki 和 all - --skill-source wiki (默认): 从 wiki + all 导入 - 更新文档字符串说明用法
- 执行 import_evolution.py 后更新 nrc.db - evolution 表新增 206 条进化关系 - pokemon 表更新 spirit_no 316 条 - .gitignore 添加 nrc.db.bak 排除备份文件
- 基于 nrc.db 中 491 个技能的 description 重新生成 - 覆盖率:132 手工 + 359 自动生成 = 491/491 (100%) - 无空效果技能
- 创建 src/team_builder.py,包含 TeamBuilder 类和 TYPE_MAP - 从 battle.py 移除 TeamBuilder 类定义(减少 108 行) - 更新 src/main.py、src/server.py 的导入语句 - 更新 4 个测试文件的导入语句 - 修正 battle.py 头部注释(移除"队伍构建"描述) 重构完成,所有导入测试通过,189/201 测试通过(11 个失败为重构前已存在问题) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
新增 25 种性格的加成配置,分为 5 类: - 攻击型:孤僻、固执、调皮、勇敢(+atk) - 防御型:大胆、淘气、无虑、悠闲(+defense) - 魔攻型:保守、稳重、马虎、冷静(+sp_atk) - 魔抗型:沉着、温顺、慎重、狂妄(+sp_defense) - 速度型:胆小、急躁、开朗、天真(+speed) - 平衡型:坦率、害羞、认真、实干、浮躁(无修正) 修正值:+20% 为 0.2,-10% 为 -0.1,无修正为 0.0 提供 get_nature_bonus() 和 is_neutral_nature() 工具函数 数据来源:百度百科 - 洛克王国性格
变更: - Pokemon dataclass 新增 iv_hp, iv_atk, iv_spatk, iv_def, iv_spdef, iv_speed, nature 字段 - calc_combat_stats 移除自动分配逻辑,支持传入 iv_config 和 nature_name - _row_to_dict 只返回种族值,不再计算战斗五维 - TeamBuilder._p() 支持传入 iv_config 和 nature 参数 - _transform_to_guard_queen 和 server.py 使用 calc_combat_stats 计算战斗值 - 移除 scripts/init_db.py 的 recalc_combat_stats 函数 DB 现在只存储种族值,战斗五维根据用户配置的个体值和性格实时计算。 默认个体值全 0,默认性格为坦率(无修正)。 测试:189 passed, 11 failed (均为重构前已存在的问题) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
核心功能: - 阵容编辑器支持个体值配置 (6 项选 3 项=60) - 25 种性格选择,实时显示性格加成 - 战斗值预览 (调用后端 API 计算) - 队伍保存/加载功能 (localStorage 持久化) - 新增 /api/pokemon/calc-stats 和 /api/nature/list 接口 Bug 修复: - 强制换人面板在换人后无法关闭的问题 - 战斗日志 HP/伤害值浮点数精度问题 (显示多位小数) - 修复特性效果未正确加载的问题 (ability_effects undefined) 技术细节: - calc_combat_stats 返回值取整为整数 - Pokemon.__post_init__ 对 hp 和 current_hp 取整 - 所有 HP 修改操作使用 round(x, 2) 避免累积误差 - 日志输出和序列化时对 HP 截断到两位小数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增 scrape_skills_bilibili.py 脚本,从 BiliGame Wiki 爬取技能数据
主要功能
输出字段
技能名、属性、分类、耗能、威力、技能描述、可学习精灵
使用示例
相关文件