feat(STS) 添加角色技能测试场景

This commit is contained in:
chicrobot committed 2026-01-14 02:38:24 +08:00
1 parent f16f7b6bbd
commit e0ba6f1c9e
6 files changed
+810 -3

No files matched your search

+43
View File
@@ -309,11 +309,54 @@ export class InputSystem {
return this.isMouseOnMiniMap(pointer) ||
this.isMouseOnJoystick(pointer) ||
this.isMouseOnSkillWheel(pointer) ||
this.isMouseOnSidebar(pointer) ||
this.isMouseOnInventoryUI(pointer) ||
this.isMouseOnItemListUI(pointer);
}
/**
* 检查鼠标是否在技能轮盘上
* @param {Object} pointer - 指针事件对象
* @returns {boolean} - 如果鼠标在技能轮盘上返回true,否则返回false
*/
isMouseOnSkillWheel(pointer) {
// 检查场景中是否有技能轮盘
if (!this.scene.skillWheel) {
return false;
}
// 获取技能轮盘实例
const skillWheel = this.scene.skillWheel;
// 获取鼠标在屏幕上的坐标
const mouseX = pointer.x;
const mouseY = pointer.y;
// 计算技能轮盘的边界(包括轮盘和操作区域)
const skillWheelRadius = skillWheel.radius * 3; // 操作区域是轮盘半径的三倍,考虑技能按钮的位置
const skillWheelLeft = skillWheel.centerX - skillWheelRadius; // 轮盘左边界
const skillWheelRight = skillWheel.centerX + skillWheelRadius; // 轮盘右边界
const skillWheelTop = skillWheel.centerY - skillWheelRadius; // 轮盘上边界
const skillWheelBottom = skillWheel.centerY + skillWheelRadius; // 轮盘下边界
// 检查鼠标是否在操作区域内
if (mouseX >= skillWheelLeft && mouseX <= skillWheelRight &&
mouseY >= skillWheelTop && mouseY <= skillWheelBottom) {
return true;
}
// 检查是否点击在技能按钮上
for (const button of skillWheel.skillButtons) {
const buttonBounds = button.getBounds();
if (mouseX >= buttonBounds.x && mouseX <= buttonBounds.right &&
mouseY >= buttonBounds.y && mouseY <= buttonBounds.bottom) {
return true;
}
}
return false;
}
/**
* 检查当前是否处于种植或收获模式
* @returns {boolean} - 如果处于种植或收获模式返回true,否则返回false