chore:微调写法

This commit is contained in:
ShakeFlower 2025-08-14 10:16:01 +08:00
parent a91952851e
commit dac0442df9

View File

@ -472,8 +472,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var sy = one.sy || 0; var sy = one.sy || 0;
var x = one.x || 0, y = one.y || 0; var x = one.x || 0, y = one.y || 0;
if (onMap && core.bigmap.v2) { if (onMap && core.bigmap.v2) {
if (x > 32 * core.bigmap.posX + core.__PIXELS__ + 32 || x + width < 32 * core.bigmap.posX - 32 if (x > 32 * core.bigmap.posX + core.__PIXELS__ + 32 || x + width < 32 * core.bigmap.posX - 32 ||
|| y > 32 * core.bigmap.posX + core.__PIXELS__ + 32 || y + height < 32 * core.bigmap.posY - 32) { y > 32 * core.bigmap.posX + core.__PIXELS__ + 32 || y + height < 32 * core.bigmap.posY - 32) {
return; return;
} }
x -= 32 * core.bigmap.posX; x -= 32 * core.bigmap.posX;
@ -1963,25 +1963,19 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 有事件,不清 // 有事件,不清
if (hasEvent) return false; if (hasEvent) return false;
// 有特定特殊属性的怪不清 // 有特定特殊属性的怪不清
if (core.hasSpecial(e.special, 12) // 中毒 if (
|| core.hasSpecial(e.special, 12) || // 中毒
core.hasSpecial(e.special, 13) // 衰弱 core.hasSpecial(e.special, 13) || // 衰弱
|| core.hasSpecial(e.special, 14) || // 诅咒
core.hasSpecial(e.special, 14) // 诅咒 core.hasSpecial(e.special, 19) || // 自爆
|| core.hasSpecial(e.special, 21) || // 退化
core.hasSpecial(e.special, 19) // 自爆 core.hasSpecial(e.special, 26) || // 支援
|| core.hasSpecial(e.special, 27) || // 捕捉:逻辑上应该让怪物来找角色
core.hasSpecial(e.special, 21) // 退化 core.hasSpecial(e.special, 28) || // 追猎:逻辑上应该让怪物来找角色
||
core.hasSpecial(e.special, 26) // 支援
||
core.hasSpecial(e.special, 27) // 捕捉:逻辑上应该让怪物来找角色
||
core.hasSpecial(e.special, 28) // 追猎:逻辑上应该让怪物来找角色
||
core.hasSpecial(e.special, 29) // 败移:特殊战后事件 core.hasSpecial(e.special, 29) // 败移:特殊战后事件
) ) {
return false; return false;
}
const damage = core.getDamageInfo(enemy, void 0, x, y)?.damage; const damage = core.getDamageInfo(enemy, void 0, x, y)?.damage;
// 0伤或负伤 // 0伤或负伤
if (has(damage) && damage <= 0) return true; if (has(damage) && damage <= 0) return true;
@ -2256,7 +2250,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
flags.__statistics__ = false; flags.__statistics__ = false;
flags.__forbidSave__ = before; flags.__forbidSave__ = before;
core.updateStatusBar(); core.updateStatusBar();
}; }
}, },
"scrollingText": function () { "scrollingText": function () {
// 本插件用于绘制在线留言 // 本插件用于绘制在线留言
@ -2806,7 +2800,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.strokeRoundRect(ctx, x, y, w, h, radius, strokeStyle, lineWidth, angle); core.strokeRoundRect(ctx, x, y, w, h, radius, strokeStyle, lineWidth, angle);
core.fillText(ctx, this.text, x + w / 2, y + h / 2 + 5, fontStyle, font); core.fillText(ctx, this.text, x + w / 2, y + h / 2 + 5, fontStyle, font);
} }
}; }
} }
class IconBtn extends ButtonBase { class IconBtn extends ButtonBase {
@ -4349,8 +4343,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
const toorBarConfig = core.getLocalStorage('toorBarConfig' + type, defaultConfig[type]); const toorBarConfig = core.getLocalStorage('toorBarConfig' + type, defaultConfig[type]);
const key = isVertical() ? 'vertical' : 'horizontal'; const key = isVertical() ? 'vertical' : 'horizontal';
if (type === 'replay' if (type === 'replay' &&
&& (['fly', 'shop', 'load', 'settings', 'btnAlt', 'rollback', 'undoRollback', 'btnAlt'].includes(value))) { (['fly', 'shop', 'load', 'settings', 'btnAlt', 'rollback', 'undoRollback', 'btnAlt'].includes(value))) {
core.drawFailTip('该按钮不允许放在录像模式下!'); core.drawFailTip('该按钮不允许放在录像模式下!');
return; return;
} // 录像模式下的按键处理有一套专门的逻辑在_sys_onkeyUp_replay实际上并不能读取自动档 } // 录像模式下的按键处理有一套专门的逻辑在_sys_onkeyUp_replay实际上并不能读取自动档
@ -5140,7 +5134,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.drawLine(ctx, this.x + 2, this.y + 2, this.x + this.w - 2, this.y + this.h - 2, 'red', 2); core.drawLine(ctx, this.x + 2, this.y + 2, this.x + this.w - 2, this.y + this.h - 2, 'red', 2);
core.drawLine(ctx, this.x + 2, this.y + this.h - 2, this.x + this.w - 2, this.y + 2, 'red', 2); core.drawLine(ctx, this.x + 2, this.y + this.h - 2, this.x + this.w - 2, this.y + 2, 'red', 2);
} else core.drawIcon(ctx, this.icon, this.x, this.y, this.w, this.h); } else core.drawIcon(ctx, this.icon, this.x, this.y, this.w, this.h);
}; }
} }
class ToolBarBtn extends ButtonBase { class ToolBarBtn extends ButtonBase {
@ -6010,7 +6004,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
class StreamLoader { class StreamLoader {
constructor(url) { constructor(url) {
/** 传输目标 Set<IStreamReader>*/ /** 传输目标 Set<IStreamReader> */
this.target = new Set(); this.target = new Set();
this.loading = false; this.loading = false;
} }
@ -6064,8 +6058,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.loading = false; this.loading = false;
targets.forEach((v) => v.end(true)); targets.forEach((v) => v.end(true));
//
} }
cancel(reason) { cancel(reason) {
@ -6075,6 +6067,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.target.forEach((v) => v.end(false, reason)); this.target.forEach((v) => v.end(false, reason));
} }
} }
/** @type {[string, number[]][]} */
const fileSignatures = [ const fileSignatures = [
[AudioType.Mp3, [0x49, 0x44, 0x33]], [AudioType.Mp3, [0x49, 0x44, 0x33]],
[AudioType.Ogg, [0x4f, 0x67, 0x67, 0x53]], [AudioType.Ogg, [0x4f, 0x67, 0x67, 0x53]],
@ -6083,6 +6077,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
[AudioType.Aac, [0xff, 0xf1]], [AudioType.Aac, [0xff, 0xf1]],
[AudioType.Aac, [0xff, 0xf9]], [AudioType.Aac, [0xff, 0xf9]],
]; ];
/** @type {[string, number[]][]} */
const oggHeaders = [ const oggHeaders = [
[AudioType.Opus, [0x4f, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64]], [AudioType.Opus, [0x4f, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64]],
]; ];