feat(movement): 添加移动速度属性并调整速度计算逻辑
- 在DBuff和Attrs中新增移动速度相关字段SPEED - 修改getAttrFieldFromDebuff映射,支持移动速度下降Debuff - 修正DbuffConf接口中deV拼写错误 - BattleMoveSystem中使用Attrs.SPEED替代原慢速减值计算速度 - HeroViewComp中修复deV字段拼写并更新减速效果处理逻辑 - 移除未使用和无效的状态类Debuff标记,优化逻辑判断
This commit is contained in:
@@ -29,9 +29,9 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
|
||||
|
||||
if (!shouldStop) { //在攻击范围内停止移动
|
||||
// if(view.fac==1){
|
||||
const hasStun = view.V_DBUFF.some(d => d.debuff === DBuff.STUN);
|
||||
const hasFrost = view.V_DBUFF.some(d => d.debuff === DBuff.FROST);
|
||||
if(view.is_stop||view.is_dead||hasStun||hasFrost) {
|
||||
const isStun = view.V_DBUFF.some(d => d.debuff === DBuff.STUN);
|
||||
const isFrost = view.V_DBUFF.some(d => d.debuff === DBuff.FROST);
|
||||
if(view.is_stop||view.is_dead||isStun||isFrost) {
|
||||
view.status_change("idle");
|
||||
return; //停止移动或者死亡不移动
|
||||
}
|
||||
@@ -40,7 +40,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
|
||||
view.status_change("idle");
|
||||
return;
|
||||
}
|
||||
|
||||
// 英雄阵营特殊逻辑:根据职业区分行为
|
||||
if (view.fac == FacSet.HERO) {
|
||||
const hasEnemies = this.checkEnemiesExist(e);
|
||||
@@ -65,7 +64,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
|
||||
}
|
||||
|
||||
// 继续向敌人方向移动
|
||||
const delta = ((view.speed-view.DEBUFF_SLOW)/3) * this.dt * move.direction;
|
||||
const delta = (view.Attrs[Attrs.SPEED]/3) * this.dt * move.direction;
|
||||
const newX = view.node.position.x + delta;
|
||||
|
||||
// 对于战士,允许更自由的移动范围
|
||||
@@ -92,7 +91,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
|
||||
if (Math.abs(currentX - finalTargetX) > 1) {
|
||||
// 确定移动方向
|
||||
const direction = currentX > finalTargetX ? -1 : 1;
|
||||
const delta = ((view.speed-view.DEBUFF_SLOW)/3) * this.dt * direction;
|
||||
const delta = (view.Attrs[Attrs.SPEED]/3) * this.dt * direction;
|
||||
const newX = view.node.position.x + delta;
|
||||
|
||||
// 设置朝向
|
||||
@@ -124,7 +123,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
|
||||
}
|
||||
|
||||
// 计算移动量
|
||||
const delta = ((view.speed-view.DEBUFF_SLOW)/3) * this.dt * move.direction;
|
||||
const delta =(view.Attrs[Attrs.SPEED]/3) * this.dt * move.direction;
|
||||
const newX = view.node.position.x + delta;
|
||||
|
||||
// 限制移动范围
|
||||
|
||||
Reference in New Issue
Block a user