Compare commits
2 Commits
f114fca2ce
...
9ddf5b99c5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ddf5b99c5 | ||
|
|
f7f6c57b56 |
@@ -3453,12 +3453,7 @@
|
||||
"BG_node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"pool_lv_node": {
|
||||
"__id__": 172
|
||||
},
|
||||
"lvl_node": {
|
||||
"__id__": 187
|
||||
},
|
||||
"lvl_node": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface CardConfig {
|
||||
pool_lv: CardLV
|
||||
hero_lv?: number
|
||||
card_lv?:number
|
||||
base_pool_lv?: number
|
||||
|
||||
// 技能卡扩展属性
|
||||
name?: string // 卡牌名称
|
||||
@@ -116,7 +117,8 @@ HeroList.forEach(uuid => {
|
||||
weight: baseWeight,
|
||||
pool_lv: pLv as CardLV,
|
||||
kind: CKind.Hero,
|
||||
hero_lv: targetHeroLv
|
||||
hero_lv: targetHeroLv,
|
||||
base_pool_lv: basePoolLv
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -111,6 +111,7 @@ export class Hero extends ecs.Entity {
|
||||
model.hero_name = hero.name;
|
||||
model.lv = hero_lv;
|
||||
model.pool_lv = pool_lv;
|
||||
model.base_pool_lv = hero.pool_lv ?? 1;
|
||||
model.type = hero.type;
|
||||
model.fac = FacSet.HERO;
|
||||
model.dis = hero.dis ?? 720;
|
||||
|
||||
@@ -20,6 +20,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
hero_name: string = "hero";
|
||||
lv: number = 1;
|
||||
pool_lv: number = 1;
|
||||
base_pool_lv: number = 1;
|
||||
type: number = 0; // 0近战 1远程 2辅助
|
||||
fac: number = 0; // 0:hero 1:monster
|
||||
// ==================== 基础属性(有初始值) ====================
|
||||
|
||||
@@ -548,7 +548,7 @@ export class CardComp extends CCComp {
|
||||
this.isLongPressed = true;
|
||||
const heroUuid = this.card_uuid;
|
||||
const heroLv = Math.max(1, this.cardData.hero_lv ?? 1);
|
||||
const poolLv = Math.max(1, this.cardData.pool_lv ?? 1);
|
||||
const poolLv = Math.max(1, this.cardData.base_pool_lv ?? this.cardData.pool_lv ?? 1);
|
||||
oops.gui.remove(UIID.HInfo);
|
||||
oops.gui.open(UIID.HInfo, { heroUuid, heroLv, poolLv });
|
||||
}
|
||||
@@ -607,10 +607,11 @@ export class CardComp extends CCComp {
|
||||
const kindName = CKind[this.cardData.kind];
|
||||
|
||||
if (this.BG_node) {
|
||||
const bgLv = this.cardData.base_pool_lv ?? this.cardData.pool_lv;
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
const bg = child.getComponent(CardBgComp);
|
||||
if (bg) child.active ? bg.apply(this.cardData.pool_lv) : bg.clear();
|
||||
if (bg) child.active ? bg.apply(bgLv) : bg.clear();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -678,9 +679,8 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
|
||||
if(this.card_type===CardType.Hero){
|
||||
// 英雄卡:显示英雄名 + AP/HP
|
||||
const hero = HeroInfo[this.card_uuid];
|
||||
const heroLv = Math.max(1, hero?.lv);
|
||||
const heroLv = Math.max(1, this.cardData.hero_lv ?? hero?.lv ?? 1);
|
||||
this.setLabel(this.name_node, `${hero?.name || ""}`);
|
||||
if (this.lvl_node) {
|
||||
this.lvl_node.string = `Lv.${heroLv}`;
|
||||
|
||||
@@ -220,10 +220,11 @@ export class CardLiteComp extends CCComp {
|
||||
const kindName = CKind[this.cardData.kind];
|
||||
|
||||
if (this.BG_node) {
|
||||
const bgLv = this.cardData.base_pool_lv ?? this.cardData.pool_lv;
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
const bg = child.getComponent(CardBgComp);
|
||||
if (bg) child.active ? bg.apply(this.cardData.pool_lv) : bg.clear();
|
||||
if (bg) child.active ? bg.apply(bgLv) : bg.clear();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ export class HInfoComp extends CCComp {
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
const bg = child.getComponent(CardBgComp);
|
||||
if (bg) child.active ? bg.apply(this.model.pool_lv ?? 1) : bg.clear();
|
||||
if (bg) child.active ? bg.apply(this.model.base_pool_lv ?? this.model.pool_lv ?? 1) : bg.clear();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,11 @@ export class HerosListComp extends CCComp {
|
||||
|
||||
this.cards_node.removeAllChildren()
|
||||
|
||||
for (const uuid of HeroList) {
|
||||
const sorted = [...HeroList].sort((a, b) => {
|
||||
return (HeroInfo[a]?.pool_lv ?? 1) - (HeroInfo[b]?.pool_lv ?? 1);
|
||||
});
|
||||
|
||||
for (const uuid of sorted) {
|
||||
const hero = HeroInfo[uuid]
|
||||
if (!hero) continue
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ export class VictoryComp extends CCComp {
|
||||
if (hbNode) hbNode.active = false;
|
||||
|
||||
// ---- 卡牌等级标识 ----
|
||||
const cardLvStr = `lv${mvp.pool_lv || 1}`;
|
||||
const cardLvStr = `lv${mvp.base_pool_lv || mvp.pool_lv || 1}`;
|
||||
if (lv_node) {
|
||||
lv_node.children.forEach(child => {
|
||||
if (child.name === "light") {
|
||||
|
||||
Reference in New Issue
Block a user