装备ui 等级和品质 表现
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@ import { smc } from '../common/SingletonModuleComp';
|
||||
import { EquipInfo, EquipType, EquipAttrTarget, EquipSpecialAttr} from '../common/config/Equips';
|
||||
import { BuffAttr, DebuffAttr, geDebuffNum, getBuffNum } from '../common/config/SkillSet';
|
||||
import { FightSet } from '../common/config/Mission';
|
||||
import { Quality } from '../common/config/CardSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EquipsComp')
|
||||
@@ -109,31 +110,65 @@ export class EquipsComp extends Component {
|
||||
}
|
||||
show_weapon(uuid:number){
|
||||
let icon = this.boxs.getChildByName("weapon").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.getChildByName("lv1").active=EquipInfo[uuid].lv==1
|
||||
icon.getChildByName("lv2").active=EquipInfo[uuid].lv==2
|
||||
icon.getChildByName("lv3").active=EquipInfo[uuid].lv==3
|
||||
icon.getChildByName("lv4").active=EquipInfo[uuid].lv==4
|
||||
icon.getChildByName("lv5").active=EquipInfo[uuid].lv==5
|
||||
icon.getChildByName("q1").active=EquipInfo[uuid].quality==Quality.WHITE
|
||||
icon.getChildByName("q2").active=EquipInfo[uuid].quality==Quality.GREEN
|
||||
icon.getChildByName("q3").active=EquipInfo[uuid].quality==Quality.BLUE
|
||||
icon.getChildByName("q4").active=EquipInfo[uuid].quality==Quality.PURPLE
|
||||
icon.getChildByName("q5").active=EquipInfo[uuid].quality==Quality.ORANGE
|
||||
|
||||
}
|
||||
show_armor(uuid:number){
|
||||
let icon = this.boxs.getChildByName("armor").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.getChildByName("lv1").active=EquipInfo[uuid].lv==1
|
||||
icon.getChildByName("lv2").active=EquipInfo[uuid].lv==2
|
||||
icon.getChildByName("lv3").active=EquipInfo[uuid].lv==3
|
||||
icon.getChildByName("lv4").active=EquipInfo[uuid].lv==4
|
||||
icon.getChildByName("lv5").active=EquipInfo[uuid].lv==5
|
||||
|
||||
icon.getChildByName("q1").active=EquipInfo[uuid].quality==Quality.WHITE
|
||||
icon.getChildByName("q2").active=EquipInfo[uuid].quality==Quality.GREEN
|
||||
icon.getChildByName("q3").active=EquipInfo[uuid].quality==Quality.BLUE
|
||||
icon.getChildByName("q4").active=EquipInfo[uuid].quality==Quality.PURPLE
|
||||
icon.getChildByName("q5").active=EquipInfo[uuid].quality==Quality.ORANGE
|
||||
}
|
||||
show_accessory(uuid:number){
|
||||
let icon = this.boxs.getChildByName("accessory").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips2"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(EquipInfo[uuid].path);
|
||||
});
|
||||
icon.getChildByName("lv1").active=EquipInfo[uuid].lv==1
|
||||
icon.getChildByName("lv2").active=EquipInfo[uuid].lv==2
|
||||
icon.getChildByName("lv3").active=EquipInfo[uuid].lv==3
|
||||
icon.getChildByName("lv4").active=EquipInfo[uuid].lv==4
|
||||
icon.getChildByName("lv5").active=EquipInfo[uuid].lv==5
|
||||
|
||||
icon.getChildByName("q1").active=EquipInfo[uuid].quality==Quality.WHITE
|
||||
icon.getChildByName("q2").active=EquipInfo[uuid].quality==Quality.GREEN
|
||||
icon.getChildByName("q3").active=EquipInfo[uuid].quality==Quality.BLUE
|
||||
icon.getChildByName("q4").active=EquipInfo[uuid].quality==Quality.PURPLE
|
||||
icon.getChildByName("q5").active=EquipInfo[uuid].quality==Quality.ORANGE
|
||||
|
||||
|
||||
}
|
||||
count_attrs(){
|
||||
// 重置所有属性
|
||||
@@ -295,12 +330,15 @@ export class EquipsComp extends Component {
|
||||
this.boxs.getChildByName("weapon").getChildByName("get").active =false
|
||||
this.boxs.getChildByName("weapon").getChildByName("light").active=false
|
||||
this.boxs.getChildByName("weapon").getChildByName("tip").active=false
|
||||
this.boxs.getChildByName("weapon").getChildByName("icon").active =false
|
||||
this.boxs.getChildByName("armor").getChildByName("get").active =false
|
||||
this.boxs.getChildByName("armor").getChildByName("light").active=false
|
||||
this.boxs.getChildByName("armor").getChildByName("tip").active=false
|
||||
this.boxs.getChildByName("armor").getChildByName("icon").active =false
|
||||
this.boxs.getChildByName("accessory").getChildByName("get").active =false
|
||||
this.boxs.getChildByName("accessory").getChildByName("light").active=false
|
||||
this.boxs.getChildByName("accessory").getChildByName("tip").active=false
|
||||
this.boxs.getChildByName("accessory").getChildByName("icon").active =false
|
||||
}
|
||||
|
||||
private show_equip_change(e:string){
|
||||
|
||||
Reference in New Issue
Block a user