装备 需要完善

This commit is contained in:
2025-07-02 17:45:00 +08:00
parent ebeb5ea04b
commit 11e6ecdf48
9 changed files with 1492 additions and 1332 deletions

View File

@@ -24,6 +24,7 @@ export class CardComp extends CCComp {
is_used:boolean=false;
cost_gold:number=0;
skill_slot:string="skill1"
equip_slot:string="weapon"
onLoad(){
// this.on(GameEvent.HeroSelect,this.hero_select,this)
}
@@ -60,9 +61,10 @@ export class CardComp extends CCComp {
this.node.getChildByName("Button").active=true
}, 0.1);
}
equip_select(args: any){
equip_select(args: any,slot:string="weapon"){
this.c_type=cardType.EQUIP
this.c_uuid=args.uuid
this.equip_slot=slot
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.show_equip(this.c_uuid)
@@ -249,7 +251,7 @@ export class CardComp extends CCComp {
case cardType.EQUIP:
console.log("[cardcomp]:use_card 装备卡")
if(!this.cost_gold_check()) return
oops.message.dispatchEvent(GameEvent.EquipAdd,{uuid:this.c_uuid,type:EquipInfo[this.c_uuid].type})
oops.message.dispatchEvent(GameEvent.EquipAdd,{uuid:this.c_uuid,type:EquipInfo[this.c_uuid].type,slot:this.equip_slot})
oops.message.dispatchEvent(GameEvent.CardsClose)
break
case cardType.SPECIAL: