mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 06:41:29 +08:00
Merge branch 'main' of http://junepve.top:3000/chicrobot/CINC
This commit is contained in:
commit
4205af8413
1 file changed
+36
-11
@@ -749,8 +749,17 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
this.castPuppetSkill3Second();
|
this.castPuppetSkill3Second();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // 技能4:傀儡快速移动并拉本体
|
case 4: // 技能4:傀儡快速移动并拉本体 / 切换到本体控制(当处于技能3控制状态时)
|
||||||
if (this.puppet && this.isControllingPuppet) {
|
if (this.puppet && this.isControllingPuppet) {
|
||||||
|
// 检查是否处于3技能第二次按下后的控制期间
|
||||||
|
const isInSkill3Control = this.puppetSkill3State && this.puppetSkill3State.hasSecondCast;
|
||||||
|
|
||||||
|
if (isInSkill3Control) {
|
||||||
|
// 处于3技能控制期间:只切换到本体控制,不执行移动和拉近逻辑
|
||||||
|
// 切换到本体控制(保持傀儡存在)
|
||||||
|
this.switchToYuange(false);
|
||||||
|
} else {
|
||||||
|
// 正常情况:执行傀儡快速移动并拉本体的逻辑
|
||||||
// 使用轮盘相对方向计算目标位置
|
// 使用轮盘相对方向计算目标位置
|
||||||
const maxDistance = 200;
|
const maxDistance = 200;
|
||||||
const distance = Math.sqrt(directionX * directionX + directionY * directionY);
|
const distance = Math.sqrt(directionX * directionX + directionY * directionY);
|
||||||
@@ -799,14 +808,23 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
|
|
||||||
yuange.setVelocity(0, 0);
|
yuange.setVelocity(0, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 控制本体时的技能
|
// 控制本体时的技能
|
||||||
switch (skillIndex) {
|
switch (skillIndex) {
|
||||||
case 1: // 技能1:扔出傀儡或收回傀儡
|
case 1: // 技能1:扔出傀儡或收回傀儡
|
||||||
|
|
||||||
|
// 禁用移动能力
|
||||||
|
yuange.canMove = false;
|
||||||
|
// 停顿
|
||||||
|
yuange.setVelocity(0, 0);
|
||||||
|
|
||||||
|
// 延迟(0.2秒)后释放技能
|
||||||
|
this.time.delayedCall(200, () => {
|
||||||
if (this.puppet) {
|
if (this.puppet) {
|
||||||
// 有傀儡存在:立即收回并销毁傀儡
|
// 有傀儡存在:收回并销毁傀儡
|
||||||
this.switchToYuange();
|
this.switchToYuange();
|
||||||
} else {
|
} else {
|
||||||
// 没有傀儡:创建新傀儡
|
// 没有傀儡:创建新傀儡
|
||||||
@@ -851,12 +869,13 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
// 自动锁定相机到傀儡
|
// 自动锁定相机到傀儡
|
||||||
mod.setCameraLocked(true);
|
mod.setCameraLocked(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 技能释放完成后,恢复移动能力
|
|
||||||
setTimeout(() => {
|
|
||||||
yuange.canMove = true;
|
|
||||||
}, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 立即恢复透明度
|
||||||
|
yuange.alpha = 1;
|
||||||
|
|
||||||
|
|
||||||
|
}, [], this);
|
||||||
break;
|
break;
|
||||||
case 2: // 技能2:扇形飞镖攻击
|
case 2: // 技能2:扇形飞镖攻击
|
||||||
this.castFanDartSkill();
|
this.castFanDartSkill();
|
||||||
@@ -1108,7 +1127,7 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
this.puppet.clearTarget();
|
this.puppet.clearTarget();
|
||||||
|
|
||||||
// 一段时间后自动销毁傀儡,切换到本体控制
|
// 一段时间后自动销毁傀儡,切换到本体控制
|
||||||
this.time.delayedCall(3000, () => {
|
this.puppetDestructionTimer = this.time.delayedCall(3000, () => {
|
||||||
if (this.puppet) {
|
if (this.puppet) {
|
||||||
// 销毁眩晕特效
|
// 销毁眩晕特效
|
||||||
if (this.stunEffect) {
|
if (this.stunEffect) {
|
||||||
@@ -1131,11 +1150,8 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
this.controlInfoText.setText('当前控制: 元歌');
|
this.controlInfoText.setText('当前控制: 元歌');
|
||||||
|
|
||||||
// 恢复本体的移动能力
|
// 恢复本体的移动能力
|
||||||
const yuange = this.currentlyControlled;
|
|
||||||
if (yuange) {
|
|
||||||
yuange.canMove = true;
|
yuange.canMove = true;
|
||||||
yuange.setVelocity(0, 0);
|
yuange.setVelocity(0, 0);
|
||||||
}
|
|
||||||
|
|
||||||
// 更新技能轮盘显示为元歌本体的技能
|
// 更新技能轮盘显示为元歌本体的技能
|
||||||
this.updateSkillWheelDisplay();
|
this.updateSkillWheelDisplay();
|
||||||
@@ -1157,6 +1173,9 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
firstCastTime: 0,
|
firstCastTime: 0,
|
||||||
secondCastTime: 0
|
secondCastTime: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 清除计时器引用
|
||||||
|
this.puppetDestructionTimer = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1518,6 +1537,12 @@ export default class AttackSkillTestScene extends Phaser.Scene {
|
|||||||
*/
|
*/
|
||||||
switchToYuange(destroyPuppet = true) {
|
switchToYuange(destroyPuppet = true) {
|
||||||
if (destroyPuppet && this.puppet) {
|
if (destroyPuppet && this.puppet) {
|
||||||
|
// 清除定时销毁任务
|
||||||
|
if (this.puppetDestructionTimer) {
|
||||||
|
this.puppetDestructionTimer.remove();
|
||||||
|
this.puppetDestructionTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
// 删除傀儡
|
// 删除傀儡
|
||||||
this.puppet.destroy();
|
this.puppet.destroy();
|
||||||
this.puppet = null;
|
this.puppet = null;
|
||||||
|
|||||||
Reference in new issue
Block a user