装备ui 等级和品质 表现

This commit is contained in:
2025-07-04 15:40:36 +08:00
parent 85e4985311
commit 352792b76f
12 changed files with 14379 additions and 3738 deletions

View File

@@ -10,7 +10,7 @@ import { HeroViewComp } from "../hero/HeroViewComp";
import { smc } from "../common/SingletonModuleComp";
import { HeroSkillList, SkillSet } from "../common/config/SkillSet";
import { cardType, getRandomCardUUID, Quality, SuperCards } from "../common/config/CardSet";
import { EquipInfo } from "../common/config/Equips";
import { EquipInfo, EquipType } from "../common/config/Equips";
import { FightSet } from "../common/config/Mission";
const { ccclass, property } = _decorator;
@@ -169,6 +169,13 @@ export class CardComp extends CCComp {
show.getChildByName("mask").getChildByName("equip").active=false
show.getChildByName("mask").getChildByName("hero").active=false
show.getChildByName("mask").getChildByName("func").active=false
show.getChildByName("mask").getChildByName("abg").active=false
show.getChildByName("mask").getChildByName("wbg").active=false
show.getChildByName("mask").getChildByName("lv1").active=false
show.getChildByName("mask").getChildByName("lv2").active=false
show.getChildByName("mask").getChildByName("lv3").active=false
show.getChildByName("mask").getChildByName("lv4").active=false
show.getChildByName("mask").getChildByName("lv5").active=false
switch(this.c_type){
case cardType.HERO:
show.getChildByName("mask").getChildByName("hero").active=true
@@ -180,6 +187,34 @@ export class CardComp extends CCComp {
break
case cardType.EQUIP:
show.getChildByName("mask").getChildByName("equip").active=true
switch(EquipInfo[this.c_uuid].type){
case EquipType.ARMOR:
show.getChildByName("mask").getChildByName("abg").active=true
break
case EquipType.WEAPON:
show.getChildByName("mask").getChildByName("wbg").active=true
break
case EquipType.ACCESSORY:
console.log("[cardcomp]:装备卡 饰品")
break
}
switch(EquipInfo[this.c_uuid].lv){
case 1:
show.getChildByName("mask").getChildByName("lv1").active=true
break
case 2:
show.getChildByName("mask").getChildByName("lv2").active=true
break
case 3:
show.getChildByName("mask").getChildByName("lv3").active=true
break
case 4:
show.getChildByName("mask").getChildByName("lv4").active=true
break
case 5:
show.getChildByName("mask").getChildByName("lv5").active=true
break
}
show.getChildByName("type").getChildByName("name").getComponent(Label).string="装备"
break
case cardType.SPECIAL:
@@ -197,8 +232,8 @@ export class CardComp extends CCComp {
show.getChildByName("mask").getChildByName("q3").active=q==Quality.BLUE
show.getChildByName("mask").getChildByName("q4").active=q==Quality.PURPLE
show.getChildByName("mask").getChildByName("q5").active=q==Quality.ORANGE
this.node.getChildByName("show").getChildByName("coins").active=true
this.node.getChildByName("show").getChildByName("coins").getChildByName("num").getComponent(Label).string=this.get_cost_gold(q).toString()
// this.node.getChildByName("show").getChildByName("coins").active=false
// this.node.getChildByName("show").getChildByName("coins").getChildByName("num").getComponent(Label).string=this.get_cost_gold(q).toString()
}
get_cost_gold(quality:number){
@@ -250,13 +285,13 @@ export class CardComp extends CCComp {
break
case cardType.EQUIP:
console.log("[cardcomp]:use_card 装备卡")
if(!this.cost_gold_check()) return
// if(!this.cost_gold_check()) return
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:
console.log("[cardcomp]:use_card 功能卡")
if(!this.cost_gold_check()) return
// if(!this.cost_gold_check()) return
oops.message.dispatchEvent(GameEvent.UseSpecialCard,{uuid:this.c_uuid})
oops.message.dispatchEvent(GameEvent.CardsClose)
break