refactor(card): 合并技能卡配置到统一卡片池并更新属性名
- 移除独立的 SkillCardList 配置,将技能卡属性直接集成到 CardPoolList - 更新 SkillBoxComp 和 CardComp 中技能卡配置的获取方式,改为从 CardPoolList 查找 - 统一技能卡属性命名(如 is_inst 替代 is_instant),提升配置一致性
This commit is contained in:
@@ -36,6 +36,14 @@ export interface CardConfig {
|
|||||||
pool_lv: CardLV
|
pool_lv: CardLV
|
||||||
hero_lv?: number
|
hero_lv?: number
|
||||||
card_lv?:number
|
card_lv?:number
|
||||||
|
|
||||||
|
// 技能卡扩展属性
|
||||||
|
name?: string // 卡牌名称
|
||||||
|
info?: string // 卡牌描述信息
|
||||||
|
is_inst?: boolean // 是否即时起效
|
||||||
|
t_times?: number // 触发次数
|
||||||
|
t_inv?: number // 触发间隔(秒)
|
||||||
|
d_rds?: number // 持续回合数
|
||||||
}
|
}
|
||||||
export const CardsUpSet: Record<number, number> = {
|
export const CardsUpSet: Record<number, number> = {
|
||||||
1: 50,
|
1: 50,
|
||||||
@@ -81,14 +89,14 @@ export const CardPoolList: CardConfig[] = [
|
|||||||
{ uuid: 5304, type: CardType.Hero, cost: 3, weight: 25, pool_lv: 5, kind: CKind.Hero, hero_lv: 1 },
|
{ uuid: 5304, type: CardType.Hero, cost: 3, weight: 25, pool_lv: 5, kind: CKind.Hero, hero_lv: 1 },
|
||||||
|
|
||||||
// 技能卡牌 (以增益/辅助为主,因为在备战期没有敌人)
|
// 技能卡牌 (以增益/辅助为主,因为在备战期没有敌人)
|
||||||
{ uuid: 6401, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1 }, // 单体攻击
|
{ uuid: 6401, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体攻击", info: "随机1个友方+5攻击", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6402, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1 }, // 单体生命
|
{ uuid: 6402, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体生命", info: "随机1个友方+20最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6403, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1 }, // 单体全能
|
{ uuid: 6403, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "单体全能", info: "随机1个友方+2攻击,+10最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6404, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1 }, // 群体攻击
|
{ uuid: 6404, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体攻击", info: "随机3个友方+2攻击", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6405, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1 }, // 群体生命
|
{ uuid: 6405, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体生命", info: "随机3个友方+10最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6406, type: CardType.Skill, cost: 5, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1 }, // 群体全能
|
{ uuid: 6406, type: CardType.Skill, cost: 5, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体全能", info: "为随机3个友方单位增加攻击力和生命上限", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1 }, // 群体治疗
|
{ uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "神圣治疗", info: "恢复场上随机3个友方单位的生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
{ uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1 }, // 群体护盾
|
{ uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体护盾", info: "随机3个友方获得2次伤害免疫", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
|
||||||
|
|
||||||
{ uuid: 7001, type: CardType.SpecialUpgrade, cost: 6, weight: 16, pool_lv: 1 ,kind: CKind.Card },
|
{ uuid: 7001, type: CardType.SpecialUpgrade, cost: 6, weight: 16, pool_lv: 1 ,kind: CKind.Card },
|
||||||
{ uuid: 7002, type: CardType.SpecialUpgrade, cost: 6, weight: 14, pool_lv: 2 ,kind: CKind.Card },
|
{ uuid: 7002, type: CardType.SpecialUpgrade, cost: 6, weight: 14, pool_lv: 2 ,kind: CKind.Card },
|
||||||
@@ -120,23 +128,6 @@ export interface SpecialRefreshCardConfig extends CardConfig {
|
|||||||
refreshHeroType: SpecialRefreshHeroType
|
refreshHeroType: SpecialRefreshHeroType
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 技能卡牌配置补充 */
|
|
||||||
export interface SkillCardConfig extends CardConfig {
|
|
||||||
name: string
|
|
||||||
info: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SkillCardList: Record<number, SkillCardConfig> = {
|
|
||||||
6401: { uuid: 6401, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体攻击", info: "随机1个友方+5攻击" },
|
|
||||||
6402: { uuid: 6402, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体生命", info: "随机1个友方+20最大生命值" },
|
|
||||||
6403: { uuid: 6403, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "单体全能", info: "随机1个友方+2攻击,+10最大生命值" },
|
|
||||||
6404: { uuid: 6404, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体攻击", info: "随机3个友方+2攻击" },
|
|
||||||
6405: { uuid: 6405, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体生命", info: "随机3个友方+10最大生命值" },
|
|
||||||
6406: { uuid: 6406, type: CardType.Skill, cost: 5, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体全能", info: "为随机3个友方单位增加攻击力和生命上限" },
|
|
||||||
6304: { uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "神圣治疗", info: "恢复场上随机3个友方单位的生命值" },
|
|
||||||
6305: { uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体护盾", info: "随机3个友方获得2次伤害免疫" },
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 功能卡定义表 */
|
/** 功能卡定义表 */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { mLogger } from "../common/Logger";
|
|||||||
import { _decorator, Animation, AnimationClip, EventTouch, Label, Node, NodeEventType, Sprite, SpriteAtlas, Tween, tween, UIOpacity, Vec3, resources, Light } from "cc";
|
import { _decorator, Animation, AnimationClip, EventTouch, Label, Node, NodeEventType, Sprite, SpriteAtlas, Tween, tween, UIOpacity, Vec3, resources, Light } from "cc";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { CardConfig, CardType, SpecialRefreshCardList, SpecialUpgradeCardList, CKind, SkillCardList } from "../common/config/CardSet";
|
import { CardConfig, CardType, SpecialRefreshCardList, SpecialUpgradeCardList, CKind, CardPoolList } from "../common/config/CardSet";
|
||||||
import { HeroInfo } from "../common/config/heroSet";
|
import { HeroInfo } from "../common/config/heroSet";
|
||||||
import { SkillSet } from "../common/config/SkillSet";
|
import { SkillSet } from "../common/config/SkillSet";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
@@ -426,7 +426,7 @@ export class CardComp extends CCComp {
|
|||||||
this.info_node.getChildByName("hp").getChildByName("val").getComponent(Label).string = `${(hero?.hp ?? 0) * heroLv}`;
|
this.info_node.getChildByName("hp").getChildByName("val").getComponent(Label).string = `${(hero?.hp ?? 0) * heroLv}`;
|
||||||
}else if(this.card_type===CardType.Skill){
|
}else if(this.card_type===CardType.Skill){
|
||||||
const skill = SkillSet[this.card_uuid];
|
const skill = SkillSet[this.card_uuid];
|
||||||
const skillCard = SkillCardList[this.card_uuid];
|
const skillCard = CardPoolList.find(c => c.uuid === this.card_uuid);
|
||||||
const card_lv = Math.max(1, Math.floor(this.cardData.card_lv ?? 1));
|
const card_lv = Math.max(1, Math.floor(this.cardData.card_lv ?? 1));
|
||||||
const spSuffix = card_lv >= 2 ? "★".repeat(card_lv - 1) : "";
|
const spSuffix = card_lv >= 2 ? "★".repeat(card_lv - 1) : "";
|
||||||
this.setLabel(this.name_node, `${spSuffix}${skillCard?.name || skill?.name || ""}${spSuffix}`);
|
this.setLabel(this.name_node, `${spSuffix}${skillCard?.name || skill?.name || ""}${spSuffix}`);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { mLogger } from "../common/Logger";
|
|||||||
import { _decorator, Node, Prefab, Sprite, Label, Vec3, resources, SpriteAtlas } from "cc";
|
import { _decorator, Node, Prefab, Sprite, Label, Vec3, resources, SpriteAtlas } from "cc";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { SkillCardList } from "../common/config/CardSet";
|
import { CardPoolList } from "../common/config/CardSet";
|
||||||
import { SkillSet } from "../common/config/SkillSet";
|
import { SkillSet } from "../common/config/SkillSet";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
@@ -50,12 +50,12 @@ export class SkillBoxComp extends CCComp {
|
|||||||
this.s_uuid = uuid;
|
this.s_uuid = uuid;
|
||||||
this.card_lv = card_lv;
|
this.card_lv = card_lv;
|
||||||
|
|
||||||
const config = SkillCardList[uuid];
|
const config = CardPoolList.find(c => c.uuid === uuid);
|
||||||
if (config) {
|
if (config) {
|
||||||
this.is_instant = config.is_instant ?? true;
|
this.is_instant = config.is_inst ?? true;
|
||||||
this.trigger_times = config.trigger_times ?? 1;
|
this.trigger_times = config.t_times ?? 1;
|
||||||
this.trigger_interval = config.trigger_interval ?? 0;
|
this.trigger_interval = config.t_inv ?? 0;
|
||||||
this.duration_rounds = config.duration_rounds ?? 1;
|
this.duration_rounds = config.d_rds ?? 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.current_round = 0;
|
this.current_round = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user