feat: 拆分特殊卡类型并实现升级和刷新功能
- 将 CardType.Special 拆分为 SpecialUpgrade 和 SpecialRefresh - 新增特殊卡使用逻辑:升级功能卡可随机升级场上英雄,刷新功能卡可筛选卡池 - 添加 drawCardsByRule 函数支持按类型、英雄类型和等级抽取卡牌 - 在 MissionCardComp 中处理特殊卡使用事件并更新UI
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 } 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, SpecialCardList } from "../common/config/CardSet";
|
||||
import { CardConfig, CardType, SpecialRefreshCardList, SpecialUpgradeCardList } from "../common/config/CardSet";
|
||||
import { CardUseComp } from "./CardUseComp";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
@@ -367,10 +367,13 @@ export class CardComp extends CCComp {
|
||||
this.info_node.getChildByName("ap").getChildByName("val").getComponent(Label).string = `${HeroInfo[this.card_uuid].ap*this.cardData.hero_lv}`;
|
||||
this.info_node.getChildByName("hp").getChildByName("val").getComponent(Label).string = `${HeroInfo[this.card_uuid].hp*this.cardData.hero_lv}`;
|
||||
}else{
|
||||
this.setLabel(this.name_node, `${SpecialCardList[this.card_uuid].name}Lv.${this.cardData.lv}`);
|
||||
const specialCard = this.card_type === CardType.SpecialUpgrade
|
||||
? SpecialUpgradeCardList[this.card_uuid]
|
||||
: SpecialRefreshCardList[this.card_uuid];
|
||||
this.setLabel(this.name_node, `${specialCard?.name || ""}Lv.${this.cardData.lv}`);
|
||||
this.info_node.active = false;
|
||||
this.oinfo_node.active = true;
|
||||
this.oinfo_node.getChildByName("info").getComponent(Label).string = `${SpecialCardList[this.card_uuid].info}`;
|
||||
this.oinfo_node.getChildByName("info").getComponent(Label).string = `${specialCard?.info || ""}`;
|
||||
}
|
||||
|
||||
this.setLabel(this.cost_node, `${this.card_cost}`);
|
||||
|
||||
Reference in New Issue
Block a user