pure-full-lily/js/plugins/ARTM_PS_FixLost.js
2025-09-16 10:12:44 -05:00

26 lines
882 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*:
* @target MZ
* @plugindesc PlayerSensorMZ × HalfMove 表示安定パッチ
* @author IvI
* @orderAfter ARTM_PlayerSensorMZ
* @orderAfter HalfMove
*/
(() => {
// === 1. 判定用の微小イプシロンを足して誤差吸収 ===
const EPS = 0.0001;
const _inRange = Game_Event.prototype.isSideSearch;
Game_Event.prototype.isSideSearch = function(...args){
args[6] += EPS; // realX
args[7] += EPS; // realY
return _inRange.apply(this, args);
};
// === 2. sensorStatus が -1 でも視界を残す ===
const _update = Sprite_ViewRange.prototype.update;
Sprite_ViewRange.prototype.update = function(){
const bak = this._character.getSensorStatus();
if (bak === -1) this._character.setSensorStatus(1);
_update.call(this);
if (bak === -1) this._character.setSensorStatus(bak);
};
})();