refactor(card): 合并技能卡配置到统一卡片池并更新属性名
- 移除独立的 SkillCardList 配置,将技能卡属性直接集成到 CardPoolList - 更新 SkillBoxComp 和 CardComp 中技能卡配置的获取方式,改为从 CardPoolList 查找 - 统一技能卡属性命名(如 is_inst 替代 is_instant),提升配置一致性
This commit is contained in:
@@ -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 { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
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 { SkillSet } from "../common/config/SkillSet";
|
||||
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}`;
|
||||
}else if(this.card_type===CardType.Skill){
|
||||
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 spSuffix = card_lv >= 2 ? "★".repeat(card_lv - 1) : "";
|
||||
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 { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
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 { oops } from "db://oops-framework/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
@@ -50,12 +50,12 @@ export class SkillBoxComp extends CCComp {
|
||||
this.s_uuid = uuid;
|
||||
this.card_lv = card_lv;
|
||||
|
||||
const config = SkillCardList[uuid];
|
||||
const config = CardPoolList.find(c => c.uuid === uuid);
|
||||
if (config) {
|
||||
this.is_instant = config.is_instant ?? true;
|
||||
this.trigger_times = config.trigger_times ?? 1;
|
||||
this.trigger_interval = config.trigger_interval ?? 0;
|
||||
this.duration_rounds = config.duration_rounds ?? 1;
|
||||
this.is_instant = config.is_inst ?? true;
|
||||
this.trigger_times = config.t_times ?? 1;
|
||||
this.trigger_interval = config.t_inv ?? 0;
|
||||
this.duration_rounds = config.d_rds ?? 1;
|
||||
}
|
||||
|
||||
this.current_round = 0;
|
||||
|
||||
Reference in New Issue
Block a user