基础主将添加+ 修复第一次伤害计算为穿刺伤害bug

This commit is contained in:
2025-07-06 23:58:10 +08:00
parent 9ebf620ed8
commit f7c231de00
60 changed files with 9355 additions and 414 deletions

View File

@@ -55,12 +55,51 @@ export class CardsCompComp extends CCComp {
}
hero_select(){
let list=getRandomCardsByType(cardType.HERO,3)
show_cards(e:GameEvent,data:any,is_refresh:boolean=false){
this.node.getChildByName("btns").getChildByName("cancel").active=false
switch(e){
case GameEvent.HeroSelect:
console.log("[CardsComp]:显示英雄选择卡牌",data)
let title="选择伙伴"
if(data.is_master) title="选择英雄"
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string=title
this.hero_select(data)
break
case GameEvent.HeroSkillSelect:
console.log("[CardsComp]:显示技能选择卡牌")
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择技能"
this.hero_skill_select(data)
break
case GameEvent.FuncSelect:
console.log("[CardsComp]:显示功能卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择卡牌"
this.func_select()
break
case GameEvent.EquipSelect:
console.log("[CardsComp]:显示装备选择卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备"
this.equip_select(data)
break
}
if(!is_refresh) this.show()
}
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)
}
console.log("[CardsComp]:英雄选择卡牌列表",list)
this.card1c.hero_select(list[0])
this.card2c.hero_select(list[1])
this.card3c.hero_select(list[2])
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.card4c.hero_select(list[3])
}
@@ -125,32 +164,7 @@ export class CardsCompComp extends CCComp {
this.show_cards(nextCard.type, nextCard.data);
}
show_cards(e:GameEvent,data:any,is_refresh:boolean=false){
this.node.getChildByName("btns").getChildByName("cancel").active=false
switch(e){
case GameEvent.HeroSelect:
console.log("[CardsComp]:显示英雄选择卡牌")
this.hero_select()
break
case GameEvent.HeroSkillSelect:
console.log("[CardsComp]:显示技能选择卡牌")
this.hero_skill_select(data)
break
case GameEvent.FuncSelect:
console.log("[CardsComp]:显示功能卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.func_select()
break
case GameEvent.EquipSelect:
console.log("[CardsComp]:显示装备选择卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.equip_select(data)
break
}
if(!is_refresh) this.show()
}
close_cards(e:GameEvent,data:any){
switch(e){
case GameEvent.HeroSelect: