This commit is contained in:
panw
2025-08-05 17:25:34 +08:00
parent 3db3cc78eb
commit 6f9529ada2
20 changed files with 3120 additions and 1623 deletions

View File

@@ -72,8 +72,7 @@ export class CardsCompComp extends CCComp {
switch(e){
case GameEvent.HeroSelect:
console.log("[CardsComp]:显示英雄选择卡牌",data)
let title="选择伙伴"
if(data.is_master) title="选择英雄"
let title="选择英雄"
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string=title
this.hero_select(data)
break
@@ -126,16 +125,11 @@ export class CardsCompComp extends CCComp {
this.card3c.enhancement_select(list[2])
}
hero_select(data:any){
let list=[]
if(data.is_master){ //1是主将,0 是伙伴
list=getRandomCardsByType(cardType.HERO,3,1)
}else{
list=getRandomCardsByType(cardType.HERO,3,0)
}
let list=getRandomCardsByType(cardType.HERO,3,0)
console.log("[CardsComp]:英雄选择卡牌列表",list)
this.card1c.hero_select(list[0],data.is_master)
this.card2c.hero_select(list[1],data.is_master)
this.card3c.hero_select(list[2],data.is_master)
this.card1c.hero_select(list[0])
this.card2c.hero_select(list[1])
this.card3c.hero_select(list[2])
// this.card4c.hero_select(list[3])
}