英雄升级改为仅等级升级,slv根据等级确定,下步修改抽卡,改为以此抽多次卡

This commit is contained in:
walkpan
2025-01-18 17:56:09 +08:00
parent dba96359ab
commit 55061ec37c
25 changed files with 6809 additions and 6618 deletions

View File

@@ -1,4 +1,4 @@
import { _decorator, Color, Label, Sprite } from "cc";
import { _decorator, Color, Label, ProgressBar, Sprite } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroHomeComp } from "../map/HeroHomeComp";
@@ -6,7 +6,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { smc } from "../common/SingletonModuleComp";
import { HeroInfo } from "../common/config/heroSet";
import { ColorSet } from "../common/config/BoxSet";
import { SlvUp } from "../common/config/RoleSet";
import { getUpChipByLv, SlvUp } from "../common/config/RoleSet";
const { ccclass, property } = _decorator;
@@ -44,28 +44,31 @@ export class HeroCardComp extends CCComp {
let slv = this.node.getChildByName("slv")
this.node.getChildByName("lv").getComponent(Label).string=smc.heros[this.h_uuid].lv.toString()+"级"
if(smc.heros[this.h_uuid].slv==0){
this.node.getChildByName("lock").active=true
slv.active=false
}else{
slv.active=true
this.node.getChildByName("lock").active=false
slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
}
let slvneed=HeroInfo[this.h_uuid].slvexp*smc.heros[this.h_uuid].slv
let slvnum=smc.heros[this.h_uuid].num
this.node.getChildByName("up").active=slvnum>=slvneed
switch(HeroInfo[this.h_uuid].quality){
case 1:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
break;
case 2:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
break;
case 3:
this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
break;
}
// if(smc.heros[this.h_uuid].slv==0){
// this.node.getChildByName("lock").active=true
// slv.active=false
// }else{
// slv.active=true
// this.node.getChildByName("lock").active=false
// slv.getChildByName("slv").getComponent(Label).string=smc.heros[this.h_uuid].slv.toString()
// }
let lvneed=(getUpChipByLv(smc.heros[this.h_uuid].lv)-HeroInfo[this.h_uuid].lvexp)*smc.heros[this.h_uuid].lv
let lvnum=smc.heros[this.h_uuid].num
this.node.getChildByName("up").active=lvnum>=lvneed
this.node.getChildByName("need").getComponent(Label).string = lvneed.toString()
this.node.getChildByName("num").getComponent(Label).string = lvnum.toString()
this.node.getChildByName("bar").getComponent(ProgressBar).progress = lvnum/lvneed
// switch(HeroInfo[this.h_uuid].quality){
// case 1:
// this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["BLUE"]);
// break;
// case 2:
// this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["YELLOW"]);
// break;
// case 3:
// this.node.getChildByName("bg").getComponent(Sprite).color= new Color().fromHEX(ColorSet["RED"]);
// break;
// }
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {