强化选项 完成

This commit is contained in:
2025-07-16 10:38:47 +08:00
parent 6f2af2f395
commit 82127a81ba
9 changed files with 204 additions and 176 deletions

View File

@@ -96,6 +96,10 @@ export class CardComp extends CCComp {
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.show_enhancement(args)
this.scheduleOnce(() => {
this.node.getChildByName("show").active=true
this.node.getChildByName("Button").active=true
}, 0.1);
}
random_select(){
@@ -176,6 +180,12 @@ export class CardComp extends CCComp {
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=data.name
this.do_card_bg_show(data.rarity)
var icon_path = "game/heros/cards"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = show.getChildByName("mask").getChildByName("func").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(data.icon);
});
show.getChildByName("info").getComponent(Label).string=data.description
}
do_card_bg_show(q:number=Quality.WHITE){
@@ -316,6 +326,11 @@ export class CardComp extends CCComp {
case cardType.ENHANCEMENT:
console.log("[cardcomp]:use_card 强化卡")
oops.message.dispatchEvent(GameEvent.UseEnhancement,this.enhancement_data)
if(this.enhancement_data.lv >=5){
smc.enhancements[this.enhancement_data.type]=this.enhancement_data.lv
}else{
smc.enhancements[this.enhancement_data.type]=this.enhancement_data.lv+1
}
oops.message.dispatchEvent(GameEvent.CardsClose)
break
}