英雄可升级动画

This commit is contained in:
2025-01-02 16:20:56 +08:00
parent e4722cac4a
commit f516551508
31 changed files with 14757 additions and 3979 deletions

View File

@@ -108,7 +108,7 @@ export class HeroHomeComp extends CCComp {
this.node.getChildByName("show").getChildByName("name").getChildByName("quality").getChildByName("k2").active = this.hero.kind == 2;
this.node.getChildByName("show").getChildByName("name").getChildByName("quality").getChildByName("k3").active = this.hero.kind == 3;
let lvneed=((LvUp[0]+this.hero.lvexp)*this.role.lv)
let lvneed=(this.hero.lvexp*this.role.lv)
// lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*this.role.lv).toString()
lvup.getChildByName("item").getChildByName("btn").getChildByName("need").getComponent(Label).string = lvneed.toString()
lvup.getChildByName("item").getChildByName("btn").getChildByName("num").getComponent(Label).string = smc.vmdata.exp.num.toString()
@@ -117,14 +117,13 @@ export class HeroHomeComp extends CCComp {
}else{
lvup.getChildByName("item").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(255,0,0);
}
lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/lvneed
// lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/lvneed
lvup.getChildByName("info").getChildByName("ap").getComponent(Label).string = "+"+this.hero.ap_up
lvup.getChildByName("info").getChildByName("def").getComponent(Label).string = "+"+this.hero.def_up
lvup.getChildByName("info").getChildByName("hp").getComponent(Label).string = "+"+this.hero.hp_up
lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/((LvUp[0]+this.hero.lvexp)*this.role.lv)
// lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/((LvUp[0]+this.hero.lvexp)*this.role.lv)
// slvup.getChildByName("gold").getChildByName("btn").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*(this.role.slv+1)).toString()
let slvneed=((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
let slvneed=HeroInfo[this.h_uuid].slvexp*this.role.slv
let slvnum=smc.heros[this.h_uuid].num
if( slvnum>=slvneed) {
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).color = color(0,255,0);
@@ -133,18 +132,18 @@ export class HeroHomeComp extends CCComp {
}
slvup.getChildByName("cost").getChildByName("btn").getChildByName("need").getComponent(Label).string = slvneed.toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("num").getComponent(Label).string = slvnum.toString()
slvup.getChildByName("cost").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
// slvup.getChildByName("cost").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
let hchipcomp= slvup.getChildByName("cost").getChildByName("btn").getChildByName("hchip").getComponent(HChipComp)
hchipcomp.update_data(this.h_uuid,0)
slvup.getChildByName("info").getChildByName("ap").getComponent(Label).string = "+"+this.hero.sap_up+"%"
slvup.getChildByName("info").getChildByName("def").getComponent(Label).string = "+"+this.hero.sdef_up+"%"
slvup.getChildByName("info").getChildByName("hp").getComponent(Label).string = "+"+this.hero.shp_up+"%"
if( this.role.slv==5) {
slvup.getChildByName("btned").active=true
}else{
slvup.getChildByName("btned").active=false
};
// if( this.role.slv==5) {
// slvup.getChildByName("btned").active=true
// }else{
// slvup.getChildByName("btned").active=false
// };
if( this.role.slv==0) {
this.node.getChildByName("show").getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
this.node.getChildByName("show").getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString()
@@ -206,11 +205,11 @@ export class HeroHomeComp extends CCComp {
lv_up(){
if(smc.vmdata.exp.num < ((LvUp[0]+this.hero.lvexp)*this.role.lv)){
if(smc.vmdata.exp.num < ((this.hero.lvexp)*this.role.lv)){
oops.gui.toast("资源不足,升级失败");
return
}
smc.vmdata.exp.num -= ((LvUp[0]+this.hero.lvexp)*this.role.lv)
smc.vmdata.exp.num -= ((this.hero.lvexp)*this.role.lv)
this.role.lv++
this.update_data()
}
@@ -219,11 +218,11 @@ export class HeroHomeComp extends CCComp {
oops.gui.toast("已经满星,升阶失败");
return
}
if(smc.heros[this.h_uuid].num < ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))){
if(smc.heros[this.h_uuid].num < (HeroInfo[this.h_uuid].slvexp*this.role.slv)){
oops.gui.toast("资源不足,升阶失败");
return
}
smc.heros[this.h_uuid].num -= SlvUp[this.role.slv]*(1+this.role.slv)
smc.heros[this.h_uuid].num -= (HeroInfo[this.h_uuid].slvexp*this.role.slv)
this.role.slv++
this.update_data()
}