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

@@ -3,7 +3,6 @@ import { HeroInfo, HeroList, HType } from "./heroSet"
import { FightSet, SKILL_CARD_WAVES } from "./GameSet"
import { oops } from "db://oops-framework/core/Oops"
import { SkillOverrides, TGroup } from "./SkillSet"
import { EquipCardData, isEquipmentCard, getEquipmentFieldCount } from "./EquipSet"
class I18nString {
constructor(private key: string, private params?: any[]) { }
@@ -166,7 +165,11 @@ const waveToCardLv: Record<number, number> = {};
SKILL_CARD_WAVES.forEach((w, i) => { waveToCardLv[w] = i + 1; });
const SkillCardData: any[] = [
// ==================== wave 5 档(范围攻击卡ap 递增,间隔缩短 ====================
// ==================== wave 1 档(基础强度 ====================
// 装备卡Field 类型)已迁移至 EquipSet.ts此处仅保留技能卡
// ==================== wave 5 档(强度 ×2 ====================
// --- 范围攻击卡ap 递增,间隔缩短) ---
{ uuid: 8261, skill: 6201, wave: SKILL_CARD_WAVES[1], name: "雷墙+", info: "召唤雷墙阻挡敌人,有概率击晕", is_inst: false, t_inv: 5, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 150 } },
{ uuid: 8262, skill: 6202, wave: SKILL_CARD_WAVES[1], name: "火墙+", info: "召唤火墙阻挡敌人,有概率击晕", is_inst: false, t_inv: 5, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 150 } },
{ uuid: 8263, skill: 6203, wave: SKILL_CARD_WAVES[1], name: "飓风+", info: "召唤飓风攻击敌人,有概率击晕", is_inst: false, t_inv: 5, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 150 } },
@@ -174,13 +177,16 @@ const SkillCardData: any[] = [
{ uuid: 8265, skill: 6205, wave: SKILL_CARD_WAVES[1], name: "风墙+", info: "召唤风墙困住敌人,有概率击晕", is_inst: false, t_inv: 5, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 150 } },
{ uuid: 8266, skill: 6206, wave: SKILL_CARD_WAVES[1], name: "陨石术+", info: "召唤陨石范围攻击敌人,有概率击晕", is_inst: false, t_inv: 5, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 150 } },
// ==================== wave 8 档范围攻击卡ap 最高,间隔最短) ====================
// ==================== wave 8 档(强度 ×3 ====================
{ uuid: 8361, skill: 6201, wave: SKILL_CARD_WAVES[2], name: "雷墙++", info: "召唤雷墙阻挡敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
{ uuid: 8362, skill: 6202, wave: SKILL_CARD_WAVES[2], name: "火墙++", info: "召唤火墙阻挡敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
{ uuid: 8363, skill: 6203, wave: SKILL_CARD_WAVES[2], name: "飓风++", info: "召唤飓风攻击敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
{ uuid: 8364, skill: 6204, wave: SKILL_CARD_WAVES[2], name: "水墙++", info: "召唤水墙阻挡敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
{ uuid: 8365, skill: 6205, wave: SKILL_CARD_WAVES[2], name: "风墙++", info: "召唤风墙困住敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
{ uuid: 8366, skill: 6206, wave: SKILL_CARD_WAVES[2], name: "陨石术++", info: "召唤陨石范围攻击敌人,有概率击晕", is_inst: false, t_inv: 4, keep_waves: -1, trigger_type: CardTriggerType.Interval, overrides: { ap: 250 } },
// --- 范围攻击卡ap 最高,间隔最短) ---
];
SkillCardData.forEach(data => {
@@ -209,29 +215,6 @@ SkillCardData.forEach(data => {
});
});
// 装备卡统一从 EquipSet 注册到 CardPoolListtrigger_type=Fieldkeep_waves=-1
EquipCardData.forEach(data => {
const cardLv = waveToCardLv[data.wave] ?? 1;
CardPoolList.push({
uuid: data.uuid,
type: CardType.Skill,
cost: data.cost ?? 0,
weight: 10,
pool_lv: CardLV.LV1,
wave: data.wave,
kind: CKind.Skill,
card_lv: cardLv,
name: data.name,
info: data.info,
is_inst: false,
t_times: 999,
t_inv: 0,
keep_waves: -1,
field: data.field,
trigger_type: CardTriggerType.Field,
});
});
export enum SpecialRefreshHeroType {
Any = 0,
@@ -291,9 +274,8 @@ const clampCardLv = (lv: number): CardLV => {
return CardLV.LV1;
}
// ============ 装备(光环类技能卡)语义化封装 ============
// 装备判定逻辑已迁移至 EquipSet.ts此处 re-export 保持外部引用兼容。
export { isEquipmentCard, getEquipmentFieldCount };
// ============ 装备相关语义已迁移至 EquipSet.ts ============
// 装备卡池EquipPoolList独立管理不再混入 CardPoolList
/** 单次按权重抽取一张卡 */
const weightedPick = (cards: CardConfig[]): CardConfig | null => {
@@ -376,7 +358,6 @@ export const drawCardsByRule = (
targetPoolLv?: number
wave?: number
unique?: boolean
excludeEquipment?: boolean
} = {}
): CardConfig[] => {
const count = Math.max(0, Math.floor(options.count ?? 4))
@@ -406,11 +387,6 @@ export const drawCardsByRule = (
})
}
// 装备卡已改为商店直购,不再参与抽卡
if (options.excludeEquipment) {
pool = pool.filter(card => !isEquipmentCard(card));
}
const picked = pickCards(pool, count, options.unique)
return picked
}