fix(map,card): 优化卡牌抽取逻辑,新增去重机制
1. 为drawCardsByRule新增unique参数,实现抽取卡牌不重复 2. 修复 fallback 抽取时的重复问题,优先选择未抽到过的卡牌 3. 修复驻场技能卡的图标显示逻辑,使用FieldSkillSet配置
This commit is contained in:
@@ -13,7 +13,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { CardConfig, CardType, CKind, CardPoolList } from "../common/config/CardSet";
|
||||
import { CardBgComp } from "./CardBgComp";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { FieldSkillSet, SkillSet } from "../common/config/SkillSet";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -272,7 +272,14 @@ export class SCardComp extends CCComp {
|
||||
if (iconNode) {
|
||||
iconNode.setScale(new Vec3(1, 1, 1));
|
||||
this.clearIconAnimation(iconNode);
|
||||
const iconId = skill?.icon || `${s_uuid}`;
|
||||
// 驻场技能卡(skill=undefined 但有 field)使用 FieldSkillSet 中的图标
|
||||
let iconId: string;
|
||||
if (!this.cardData.skill && this.cardData.field && this.cardData.field.length > 0) {
|
||||
const fieldUuid = this.cardData.field[0];
|
||||
iconId = FieldSkillSet[fieldUuid]?.icon || `${fieldUuid}`;
|
||||
} else {
|
||||
iconId = skill?.icon || `${s_uuid}`;
|
||||
}
|
||||
this.updateIcon(iconNode, iconId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user