英雄界面基本完成

This commit is contained in:
2024-12-06 15:23:58 +08:00
parent 8c295dbbed
commit 4bac3c6d86
5 changed files with 3122 additions and 1850 deletions

View File

@@ -57,6 +57,7 @@ export class SingletonModuleComp extends ecs.Comp {
enemy_pos:any =[]
vmdata: any = {
name : "纸片精灵大乱斗",
gold:9999999,
game_over:false,
game_pause:false,
mission:{

View File

@@ -1,3 +1,4 @@
import { Talents } from "./TalentSet"
export const HeroInfo = {
9001: {
@@ -5,18 +6,21 @@ export const HeroInfo = {
lvexp:2,slvexp:2, speed: 100,aep:1,uaep:1,dep:10,sk1:[9001,9001,9001,9001,9001],sk2: [2002,2002,2002,2002,2002],pw:0,pwm:15,pws:1,
akr:[10,20,30,40,50],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
9002: {
uuid:9001,name: "狂暴骑士",path:"k2",type:1,hp: 10, hp_up:10,def:10,def_up:1,ap:20,ap_up:2,atp:1,vun:0,crit:20,crit_add:0,dodge:0,dis:100,a_cd:1.5,
lvexp:2,slvexp:2, speed: 100,aep:1,uaep:1,dep:10,sk1:[9001,9001,9001,9001,9001],sk2: [2002,2002,2002,2002,2002],pw:0,pwm:15,pws:1,
akr:[10,20,30,40,50],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
9003: {
uuid:9001,name: "防御骑士",path:"k3",type:1,hp: 10, hp_up:10,def:10,def_up:1,ap:20,ap_up:2,atp:1,vun:0,crit:20,crit_add:0,dodge:0,dis:100,a_cd:1.5,
lvexp:2,slvexp:2, speed: 100,aep:1,uaep:1,dep:10,sk1:[9001,9001,9001,9001,9001],sk2: [2002,2002,2002,2002,2002],pw:0,pwm:15,pws:1,
akr:[10,20,30,40,50],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
}

View File

@@ -7,6 +7,7 @@ import { smc } from "../common/SingletonModuleComp";
import { UIID } from "../common/config/GameUIConfig";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { Items } from "../common/config/Items";
import { SkillSet } from "../common/config/SkillSet";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -42,12 +43,22 @@ export class HeroHomeComp extends CCComp {
let hero =smc.heros[uuid]
this.h_uuid=uuid
let slv_node=this.node.getChildByName("name").getChildByName("slv");
let tal=this.node.getChildByName("slvup").getChildByName("tal");
let sk_node= this.node.getChildByName("sk");
let skill = SkillSet[hero.sk2[0]]
var sk_path = "game/skills/skill_icon"
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(hero.path);
});
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
const sprite = sk_node.getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(skill.path);
});
sk_node.getChildByName("name").getComponent(Label).string = skill.name;
sk_node.getChildByName("info").getComponent(Label).string = skill.info;
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=hero.name
this.node.getChildByName("name").getChildByName("lv").getComponent(Label).string = role.lv.toString()+"级";
if( role.slv>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
@@ -61,6 +72,11 @@ export class HeroHomeComp extends CCComp {
this.node.getChildByName("attr").getChildByName("acd").getChildByName("val").getComponent(Label).string = hero.a_cd
this.node.getChildByName("attr").getChildByName("speed").getChildByName("val").getComponent(Label).string = hero.speed
this.node.getChildByName("attr").getChildByName("dis").getChildByName("val").getComponent(Label).string = hero.dis
tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = hero.tals[0]
tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = hero.tals[1]
tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = hero.tals[2]
tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = hero.tals[3]
tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = hero.tals[4]
}
lv_selcet(e:any,val:any){
let active = this.node.getChildByName("menu").getChildByName("active")