refactor(属性): 统一默认属性定义并移除调试属性
- 新增 defaultAttrs 对象集中定义 BACK_CHANCE、DODGE、CON_RES 的默认值 - 修改 Hero 和 Monster 初始化逻辑,使用 defaultAttrs 代替硬编码值 - 移除 HeroAttrsComp 中未使用的 debugMode 装饰器属性 - 简化日志消息,移除重复的组件名前缀 - 修复 SingletonModuleComp 中属性名错误(speed 改为 dodge)
This commit is contained in:
@@ -6,7 +6,7 @@ import { BoxSet, FacSet, IndexSet } from "../common/config/GameSet";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||
import { BuffConf, SkillSet } from "../common/config/SkillSet";
|
||||
import { getNeAttrs, getAttrs ,Attrs} from "../common/config/HeroAttrs";
|
||||
import { getNeAttrs, getAttrs ,Attrs, defaultAttrs} from "../common/config/HeroAttrs";
|
||||
import { getMonAttr, MonType } from "../map/RogueConfig";
|
||||
import { HeroViewComp } from "./HeroViewComp";
|
||||
import { HeroSkillsComp } from "./HeroSkills";
|
||||
@@ -128,8 +128,8 @@ export class Monster extends ecs.Entity {
|
||||
model.Attrs[Attrs.DEF] = def;
|
||||
model.Attrs[Attrs.AP] = ap;
|
||||
model.Attrs[Attrs.SPEED] = speed; // 使用成长后的速度
|
||||
model.Attrs[Attrs.BACK_CHANCE]=15
|
||||
model.Attrs[Attrs.CON_RES]=10
|
||||
model.Attrs[Attrs.BACK_CHANCE]=defaultAttrs[Attrs.BACK_CHANCE]
|
||||
model.Attrs[Attrs.CON_RES]=defaultAttrs[Attrs.CON_RES]
|
||||
// ✅ 初始化技能数据(迁移到 HeroSkillsComp)
|
||||
skillsComp.initSkills(hero.skills, uuid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user