fix(ASTS) 修复四技能释放期间可以使用技能的问题

This commit is contained in:
chicrobot committed 2026-01-30 17:39:31 +08:00
1 parent a17a396927
commit 43a3803b6f
1 file changed
+12
+12
View File
@@ -41,6 +41,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
this.touchVisualizations = []; // 触摸点可视化元素 this.touchVisualizations = []; // 触摸点可视化元素
this.joysticks = []; // 多个虚拟摇杆 this.joysticks = []; // 多个虚拟摇杆
this.dualJoystickEnabled = false; // 禁用双摇杆,只保留左侧移动摇杆 this.dualJoystickEnabled = false; // 禁用双摇杆,只保留左侧移动摇杆
// 技能释放状态
this.isCastingSkill = false; // 是否正在释放技能
} }
// create方法:当场景创建时自动调用,用于初始化游戏元素 // create方法:当场景创建时自动调用,用于初始化游戏元素
@@ -598,6 +601,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
// 检查是否有当前控制的角色 // 检查是否有当前控制的角色
if (!this.currentlyControlled) return; if (!this.currentlyControlled) return;
// 检查是否正在释放技能(特别是四技能)
if (this.isCastingSkill) return;
// 根据当前控制角色类型和技能索引释放对应技能 // 根据当前控制角色类型和技能索引释放对应技能
if (this.currentlyControlled.type === 'yuange' || this.currentlyControlled.type === 'yuange-puppet') { if (this.currentlyControlled.type === 'yuange' || this.currentlyControlled.type === 'yuange-puppet') {
this.castYuangeSkill(skillIndex, direction); this.castYuangeSkill(skillIndex, direction);
@@ -861,6 +867,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
case 4: // 技能4:本体向技能指向方向移动 case 4: // 技能4:本体向技能指向方向移动
// 确保是本体在控制 // 确保是本体在控制
if (!this.isControllingPuppet) { if (!this.isControllingPuppet) {
// 设置技能释放状态为true,防止释放其他技能
this.isCastingSkill = true;
// 使用轮盘相对方向计算目标位置 // 使用轮盘相对方向计算目标位置
const maxDistance = 200; const maxDistance = 200;
const distance = Math.sqrt(directionX * directionX + directionY * directionY); const distance = Math.sqrt(directionX * directionX + directionY * directionY);
@@ -887,6 +896,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
// 技能释放完成后,恢复移动能力 // 技能释放完成后,恢复移动能力
yuange.canMove = true; yuange.canMove = true;
// 技能释放完成,设置技能释放状态为false
this.isCastingSkill = false;
}, [], this); }, [], this);
} }
break; break;