refactor(game): 重构英雄数据结构和添加状态栏更新功能

- 将hero_data重命名为hero并调整属性结构
- 添加hp/mp初始值和最大值
- 新增暴击率(crt)属性
- 增加金币初始值
- 在MissionComp中添加状态栏(hp/mp/exp)更新逻辑
This commit is contained in:
walkpan
2026-01-02 19:21:41 +08:00
parent 8c88e84fae
commit 10e287c134
3 changed files with 2362 additions and 2183 deletions

View File

@@ -60,7 +60,7 @@ export class SingletonModuleComp extends ecs.Comp {
max_mission:4,//最大关卡
coin:0,
},
hero_data:{
hero:{
name:'',
path:'',
as:0,
@@ -68,20 +68,21 @@ export class SingletonModuleComp extends ecs.Comp {
lv:0,
exp:0,
exp_max:0,
hp:0,
ho_max:0,
mp:0,
mp_max:0,
hp:50,
hp_max:100,
mp:50,
mp_max:100,
def:0,
ap:0,
dis:0,
crt:0,
speed:0,
skills:[],
buff:[],
tal:[],
info:'',
},
gold: 100, // 金币数据MVVM绑定字段
gold: 200, // 金币数据MVVM绑定字段
};
vmAdd() {
VM.add(this.vmdata, "data");