refactor(game): 拆分装备卡配置与逻辑,独立管理装备系统

1. 将装备卡从原技能卡池拆分至独立的EquipSet.ts配置
2. 新增专用的装备盒实体与事件流程,替换原有技能卡复用逻辑
3. 调整FieldSkillHelper以支持装备卡的属性加成统计
4. 优化装备商店与抽卡逻辑,移除装备卡的抽卡参与
This commit is contained in:
pan
2026-07-22 12:55:57 +08:00
parent e17ffeb2fd
commit fd056b4433
8 changed files with 124 additions and 115 deletions

View File

@@ -24,7 +24,8 @@
* - 销毁时通过 GameEvent.RemoveSkillBox 通知 MissSkillsComp 回收槽位
*
* 依赖:
* - CardPoolList / CardTriggerTypeCardSet—— 查询技能卡的触发配置
* - CardPoolList / CardTriggerTypeCardSet—— 通用卡牌类型定义
* - EquipPoolListEquipSet—— 装备卡池配置(查询触发配置)
* - SkillSet —— 技能静态配置icon 字段)
* - GameEvent —— 各类游戏事件
* - smc.mission —— 游戏运行状态
@@ -34,6 +35,7 @@ import { _decorator, Node, Prefab, Sprite, Label, Vec3, resources, SpriteAtlas,
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { CardPoolList, CardTriggerType } from "../common/config/CardSet";
import { EquipPoolList } from "../common/config/EquipSet";
import { SkillSet, SkillOverrides, FieldSkillSet } from "../common/config/SkillSet";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
@@ -149,7 +151,9 @@ export class EquipBoxComp extends CCComp {
if (!this.initialized) return;
oops.audio.playEffect("music/button");
// 点击时弹出 HInfoComp传入卡牌 UUID 和等级以启用预览模式
const config = CardPoolList.find(c => c.uuid === this.s_uuid || c.skill === this.s_uuid);
// 优先从装备卡池查找,找不到再从技能卡池查找
const config = EquipPoolList.find(c => c.uuid === this.s_uuid || c.skill === this.s_uuid)
?? CardPoolList.find(c => c.uuid === this.s_uuid || c.skill === this.s_uuid);
const cardUuid = config ? config.uuid : this.s_uuid;
oops.gui.remove(UIID.HInfo);
@@ -158,7 +162,7 @@ export class EquipBoxComp extends CCComp {
/**
* 初始化技能卡效果:
* 1. 从 CardPoolList 查询技能卡的触发配置(含 trigger_type
* 1. 从 EquipPoolList 查询装备卡的触发配置(含 trigger_type
* 2. 更新 UI 显示(图标 + 次数)。
* 3. 按 trigger_type 注册对应事件监听并执行首次触发。
*
@@ -168,8 +172,8 @@ export class EquipBoxComp extends CCComp {
init(uuid: number, card_lv: number) {
this.card_lv = card_lv;
// 查询触发配置
const config = CardPoolList.find(c => c.uuid === uuid);
// 装备卡配置已迁移至 EquipPoolList
const config = EquipPoolList.find(c => c.uuid === uuid);
if (config) {
this.s_uuid = config.skill ?? uuid; // 获取实际的技能 UUID
this.is_instant = config.is_inst ?? true;