fix(技能触发): 将call技能触发时机从入场时改为落地后
确保英雄和怪物在完全落地并设置好碰撞组后再触发call技能,避免潜在的时序问题
This commit is contained in:
@@ -143,18 +143,6 @@ export class Hero extends ecs.Entity {
|
|||||||
move.moving = false;
|
move.moving = false;
|
||||||
hv.as.idle();
|
hv.as.idle();
|
||||||
|
|
||||||
// 触发 call 技能
|
|
||||||
if (hero.call && hero.call.length > 0) {
|
|
||||||
hero.call.forEach(uuid => {
|
|
||||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
|
||||||
s_uuid: uuid,
|
|
||||||
heroAttrs: model,
|
|
||||||
heroView: hv,
|
|
||||||
triggerType: 'call'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 依据下落距离自适应入场时长,保证手感稳定
|
// 依据下落距离自适应入场时长,保证手感稳定
|
||||||
const dropDistance = Math.abs(pos.y - dropToY);
|
const dropDistance = Math.abs(pos.y - dropToY);
|
||||||
const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200));
|
const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200));
|
||||||
@@ -175,6 +163,18 @@ export class Hero extends ecs.Entity {
|
|||||||
collider.group = BoxSet.HERO;
|
collider.group = BoxSet.HERO;
|
||||||
collider.apply();
|
collider.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 落地后触发 call 技能
|
||||||
|
if (hero.call && hero.call.length > 0) {
|
||||||
|
hero.call.forEach(uuid => {
|
||||||
|
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||||
|
s_uuid: uuid,
|
||||||
|
heroAttrs: model,
|
||||||
|
heroView: hv,
|
||||||
|
triggerType: 'call'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,18 +197,6 @@ export class Monster extends ecs.Entity {
|
|||||||
move.baseY = dropToY;
|
move.baseY = dropToY;
|
||||||
move.moving = false;
|
move.moving = false;
|
||||||
|
|
||||||
// 触发 call 技能
|
|
||||||
if (hero.call && hero.call.length > 0) {
|
|
||||||
hero.call.forEach((uuid: number) => {
|
|
||||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
|
||||||
s_uuid: uuid,
|
|
||||||
heroAttrs: model,
|
|
||||||
heroView: view,
|
|
||||||
triggerType: 'call'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 依据下落距离自适应入场时长,确保观感一致
|
// 依据下落距离自适应入场时长,确保观感一致
|
||||||
const dropDistance = Math.abs(pos.y - dropToY);
|
const dropDistance = Math.abs(pos.y - dropToY);
|
||||||
const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200));
|
const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200));
|
||||||
@@ -229,6 +217,18 @@ export class Monster extends ecs.Entity {
|
|||||||
collider.group = BoxSet.MONSTER;
|
collider.group = BoxSet.MONSTER;
|
||||||
collider.apply();
|
collider.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 落地后触发 call 技能
|
||||||
|
if (hero.call && hero.call.length > 0) {
|
||||||
|
hero.call.forEach((uuid: number) => {
|
||||||
|
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||||
|
s_uuid: uuid,
|
||||||
|
heroAttrs: model,
|
||||||
|
heroView: view,
|
||||||
|
triggerType: 'call'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.start();
|
.start();
|
||||||
// 维护关卡内怪物数量统计
|
// 维护关卡内怪物数量统计
|
||||||
|
|||||||
Reference in New Issue
Block a user