天赋触发和 ui制作完成

This commit is contained in:
2025-07-29 17:08:42 +08:00
parent 3fe8edf88a
commit 16195f4cb4
9 changed files with 16800 additions and 20478 deletions

View File

@@ -27,6 +27,7 @@ export class CardComp extends CCComp {
cost_gold:number=0;
skill_slot:string="skill1"
equip_slot:string="weapon"
talent_slot:string="tal1"
is_master:boolean=false;
enhancement_data:any=null;
onLoad(){
@@ -41,18 +42,21 @@ export class CardComp extends CCComp {
this.node.getChildByName("Button").active=false
this.node.getChildByName("show").active=false
}
talent_select(args: any){
talent_select(args: any,data:any){
this.c_type=cardType.TALENT
this.c_uuid=args.uuid
this.talent_slot=data.slot
this.show_talent(this.c_uuid)
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.show_talent(this.c_uuid)
this.scheduleOnce(() => {
this.node.getChildByName("show").active=true
this.node.getChildByName("Button").active=true
}, 0.1);
}
hero_select(args: any,is_master:boolean=false){
console.log("[cardcomp]:card hero_select",args,is_master)
this.c_type=cardType.HERO
this.c_uuid=args.uuid
console.log("[cardcomp]:card hero_select c_uuid:"+this.c_uuid)
this.is_master=is_master
this.show_hero(this.c_uuid,is_master)
this.node.getChildByName("show").active=false
@@ -64,11 +68,12 @@ export class CardComp extends CCComp {
}
hero_skill_select(args: any,data:any){
this.c_type=cardType.SKILL
console.log("[cardcomp]:card hero_skill_select",args)
// console.log("[cardcomp]:card hero_skill_select",args)
this.c_uuid=args.uuid
this.skill_slot=data.slot
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.show_skill(this.c_uuid,data)
this.show_skill(this.c_uuid)
this.scheduleOnce(() => {
this.node.getChildByName("show").active=true
this.node.getChildByName("Button").active=true
@@ -122,7 +127,7 @@ export class CardComp extends CCComp {
break
}
}
show_talent(uuid:number){
show_talent(uuid:number,){
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=TalentList[uuid].name
this.do_card_bg_show(TalentList[uuid].quality)
@@ -133,13 +138,13 @@ export class CardComp extends CCComp {
sprite.spriteFrame = atlas.getSpriteFrame(TalentList[uuid].path);
});
show.getChildByName("info").getComponent(Label).string=TalentList[uuid].info
console.log("[cardcomp]:show_talent",TalentList[uuid],show)
}
show_skill(uuid:number,data:any){
show_skill(uuid:number){
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=SkillSet[uuid].name
this.do_card_bg_show(SkillSet[uuid].quality)
this.node.getChildByName("show").getChildByName("coins").active=false
this.skill_slot=data.slot
var icon_path = "game/heros/cards"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = show.getChildByName("mask").getChildByName("skill").getComponent(Sprite);
@@ -338,6 +343,11 @@ export class CardComp extends CCComp {
console.log("[cardcomp]:use_card 强化卡",this.enhancement_data,smc.enhancements)
oops.message.dispatchEvent(GameEvent.CardsClose)
break
case cardType.TALENT:
console.log("[cardcomp]:use_card 天赋卡",this.c_uuid)
oops.message.dispatchEvent(GameEvent.UseTalentCard,{uuid:this.c_uuid,slot:this.talent_slot})
oops.message.dispatchEvent(GameEvent.CardsClose)
break
}
this.reset_card()
}