接下来测试强化

This commit is contained in:
2025-07-15 23:22:52 +08:00
parent 1780509509
commit 6f2af2f395
5 changed files with 44 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import { HeroSkillList, SkillSet } from "../common/config/SkillSet";
import { cardType, getRandomCardUUID, Quality, SuperCards } from "../common/config/CardSet";
import { EquipInfo, EquipType } from "../common/config/Equips";
import { FightSet } from "../common/config/Mission";
import { EnhancementOptions } from "../common/config/LevelUp";
const { ccclass, property } = _decorator;
@@ -26,6 +27,7 @@ export class CardComp extends CCComp {
skill_slot:string="skill1"
equip_slot:string="weapon"
is_master:boolean=false;
enhancement_data:any=null;
onLoad(){
// this.on(GameEvent.HeroSelect,this.hero_select,this)
}
@@ -88,6 +90,13 @@ export class CardComp extends CCComp {
this.node.getChildByName("Button").active=true
}, 0.1);
}
enhancement_select(args: any){
this.c_type=cardType.ENHANCEMENT
this.enhancement_data=args
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.show_enhancement(args)
}
random_select(){
let card =getRandomCardUUID() //随机获取卡牌类型
@@ -163,6 +172,12 @@ export class CardComp extends CCComp {
show.getChildByName("info").getComponent(Label).string=SuperCards[uuid].info
}
show_enhancement(data:any){
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=data.name
this.do_card_bg_show(data.rarity)
}
do_card_bg_show(q:number=Quality.WHITE){
this.node.getChildByName("Button").getChildByName("Label").getComponent(Label).string=this.check_heros()
let show=this.node.getChildByName("show")
@@ -298,6 +313,11 @@ export class CardComp extends CCComp {
oops.message.dispatchEvent(GameEvent.UseSpecialCard,{uuid:this.c_uuid})
oops.message.dispatchEvent(GameEvent.CardsClose)
break
case cardType.ENHANCEMENT:
console.log("[cardcomp]:use_card 强化卡")
oops.message.dispatchEvent(GameEvent.UseEnhancement,this.enhancement_data)
oops.message.dispatchEvent(GameEvent.CardsClose)
break
}
this.reset_card()
}

View File

@@ -8,6 +8,7 @@ import { smc } from "../common/SingletonModuleComp";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { EquipType } from "../common/config/Equips";
import { getSkills, Quality } from "../common/config/SkillSet";
import { getEnhancement } from "../common/config/LevelUp";
const { ccclass, property } = _decorator;
@@ -84,12 +85,24 @@ export class CardsCompComp extends CCComp {
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择装备"
this.equip_select(data)
break
case GameEvent.EnhancementSelect:
console.log("[CardsComp]:显示强化选择卡牌")
this.node.getChildByName("btns").getChildByName("cancel").active=true
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string="选择强化"
this.enhancement_select(data)
break
}
if(!is_refresh) this.show()
}
enhancement_select(data:any){
let list=getEnhancement([0,0,0,0],3)
console.log("[CardsComp]:强化选择卡牌列表",list)
this.card1c.enhancement_select(data[0])
this.card2c.enhancement_select(data[1])
this.card3c.enhancement_select(data[2])
}
hero_select(data:any){
let list=[]
if(data.is_master){ //1是主将,0 是伙伴