fix: 优化属性默认值处理,注释多余赋值逻辑
1. 将heroInfo接口的dis和speed字段改为可选 2. 在实例化时使用??运算符设置默认值 3. 注释掉冗余的call字段赋值代码 4. 移除英雄配置中重复的固定属性值
This commit is contained in:
@@ -111,10 +111,10 @@ export class Hero extends ecs.Entity {
|
||||
model.pool_lv = pool_lv;
|
||||
model.type = hero.type;
|
||||
model.fac = FacSet.HERO;
|
||||
model.dis = hero.dis;
|
||||
model.dis = hero.dis ?? 720;
|
||||
|
||||
// 复制触发技能配置
|
||||
model.call = hero.call;
|
||||
// model.call = hero.call;
|
||||
model.dead = hero.dead;
|
||||
model.fstart = hero.fstart;
|
||||
model.fend = hero.fend;
|
||||
@@ -143,7 +143,7 @@ export class Hero extends ecs.Entity {
|
||||
model.hp = model.hp_max = base_hp;
|
||||
}
|
||||
|
||||
model.speed = hero.speed;
|
||||
model.speed = hero.speed ?? 800;
|
||||
|
||||
// 构建技能表并注入运行时冷却字段 ccd
|
||||
model.skills = {};
|
||||
|
||||
@@ -164,13 +164,13 @@ export class Monster extends ecs.Entity {
|
||||
model.hero_name = hero.name;
|
||||
model.hp = model.hp_max = hero.hp;
|
||||
model.ap = hero.ap;
|
||||
model.speed = hero.speed;
|
||||
model.speed = hero.speed ?? 800;
|
||||
model.type = hero.type;
|
||||
model.fac = FacSet.MON;
|
||||
model.dis = hero.dis;
|
||||
model.dis = hero.dis ?? 720;
|
||||
|
||||
// 复制触发技能配置
|
||||
model.call = hero.call;
|
||||
// model.call = hero.call;
|
||||
model.dead = hero.dead;
|
||||
model.fstart = hero.fstart;
|
||||
model.fend = hero.fend;
|
||||
|
||||
Reference in New Issue
Block a user