fix(技能触发): 将call技能触发时机从入场时改为落地后

确保英雄和怪物在完全落地并设置好碰撞组后再触发call技能,避免潜在的时序问题
This commit is contained in:
walkpan
2026-04-15 20:48:07 +08:00
parent dff9983e38
commit ba3e416ab0
2 changed files with 24 additions and 24 deletions

View File

@@ -143,18 +143,6 @@ export class Hero extends ecs.Entity {
move.moving = false;
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 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.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();
}

View File

@@ -197,18 +197,6 @@ export class Monster extends ecs.Entity {
move.baseY = dropToY;
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 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.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();
// 维护关卡内怪物数量统计