英雄成长完成99.99%

This commit is contained in:
walkpan
2024-12-08 10:55:35 +08:00
parent 02f1c99d7c
commit aebe98577c
4 changed files with 5593 additions and 4999 deletions

View File

@@ -72,23 +72,45 @@ export class HeroHomeComp extends CCComp {
}
update_data(){
let slv_node=this.node.getChildByName("name").getChildByName("slv");
let lvup=this.node.getChildByName("lvup");
let slvup=this.node.getChildByName("slvup");
let attr = this.node.getChildByName("attr");
let attr2 = this.node.getChildByName("attr2").getChildByName("other");
this.node.getChildByName("name").getChildByName("lv").getComponent(Label).string = this.role.lv.toString()+"级";
this.node.getChildByName("lvup").getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*this.role.lv).toString()
this.node.getChildByName("lvup").getChildByName("item").getChildByName("need").getComponent(Label).string = ((LvUp[0]+this.hero.lvexp)*this.role.lv).toString()
this.node.getChildByName("slvup").getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*this.role.slv).toString()
this.node.getChildByName("slvup").getChildByName("item").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]+this.hero.slvexp)*this.role.slv).toString()
lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*this.role.lv).toString()
lvup.getChildByName("item").getChildByName("need").getComponent(Label).string = ((LvUp[0]+this.hero.lvexp)*this.role.lv).toString()
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
slvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*this.role.slv).toString()
slvup.getChildByName("item").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]+this.hero.slvexp)*this.role.slv).toString()
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>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
if( this.role.slv>=2) {slv_node.getChildByName("s2").active=true}else{slv_node.getChildByName("s2").active=false};
if( this.role.slv>=3) {slv_node.getChildByName("s3").active=true}else{slv_node.getChildByName("s3").active=false};
if( this.role.slv>=4) {slv_node.getChildByName("s4").active=true}else{slv_node.getChildByName("s4").active=false};
if( this.role.slv>=5) {slv_node.getChildByName("s5").active=true}else{slv_node.getChildByName("s5").active=false};
this.node.getChildByName("attr").getChildByName("ap").getChildByName("val").getComponent(Label).string = this.hero.ap+this.hero.ap_up* this.role.lv
this.node.getChildByName("attr").getChildByName("hp").getChildByName("val").getComponent(Label).string = this.hero.hp+this.hero.hp_up* this.role.lv
this.node.getChildByName("attr").getChildByName("def").getChildByName("val").getComponent(Label).string = this.hero.ap+this.hero.ap_up* this.role.lv
attr.getChildByName("ap").getChildByName("val").getComponent(Label).string = ((this.hero.ap+this.hero.ap_up* this.role.lv)*(1+this.hero.sap_up/100*this.role.slv)).toFixed(0).toString()
attr.getChildByName("hp").getChildByName("val").getComponent(Label).string = ((this.hero.hp+this.hero.hp_up* this.role.lv)*(1+this.hero.shp_up/100*this.role.slv)).toFixed(0).toString()
attr.getChildByName("def").getChildByName("val").getComponent(Label).string = ((this.hero.ap+this.hero.ap_up* this.role.lv)*(1+this.hero.sdef_up/100*this.role.slv)).toFixed(0).toString()
attr.getChildByName("acd").getChildByName("val").getComponent(Label).string = this.hero.a_cd
attr.getChildByName("speed").getChildByName("val").getComponent(Label).string = this.hero.speed
attr.getChildByName("dis").getChildByName("val").getComponent(Label).string = this.hero.dis
this.node.getChildByName("attr").getChildByName("acd").getChildByName("val").getComponent(Label).string = this.hero.a_cd
this.node.getChildByName("attr").getChildByName("speed").getChildByName("val").getComponent(Label).string = this.hero.speed
this.node.getChildByName("attr").getChildByName("dis").getChildByName("val").getComponent(Label).string = this.hero.dis
attr2.getChildByName("crit").getChildByName("val").getComponent(Label).string = this.hero.crit+"%"
attr2.getChildByName("ca").getChildByName("val").getComponent(Label).string = (150+this.hero.crit_add).toString()+"%"
attr2.getChildByName("ucr").getChildByName("val").getComponent(Label).string = this.hero.ucr+"%"
attr2.getChildByName("dod").getChildByName("val").getComponent(Label).string = this.hero.dodge+"%"
attr2.getChildByName("aep").getChildByName("val").getComponent(Label).string = this.hero.aep
attr2.getChildByName("uaep").getChildByName("val").getComponent(Label).string = this.hero.uaep
attr2.getChildByName("cep").getChildByName("val").getComponent(Label).string = this.hero.cep
attr2.getChildByName("doep").getChildByName("val").getComponent(Label).string = this.hero.doep
attr2.getChildByName("dep").getChildByName("val").getComponent(Label).string = this.hero.dep
}
lv_selcet(e:any,val:any){
let active = this.node.getChildByName("menu").getChildByName("active")