flower-that-blooms-in-summe.../js/plugins/FollowerLookPlayerEvent.js
2026-07-25 13:17:23 -05:00

31 lines
No EOL
708 B
JavaScript

/*:
* @target MZ
* @plugindesc イベント実行中、先頭フォロワーがプレイヤーの方を向く
* @author ノラ
*/
(() => {
function oppositeDirection(dir) {
switch (dir) {
case 2: return 8;
case 4: return 6;
case 6: return 4;
case 8: return 2;
default: return dir;
}
}
const _Game_Follower_update = Game_Follower.prototype.update;
Game_Follower.prototype.update = function() {
_Game_Follower_update.call(this);
if (!$gameMap.isEventRunning()) return;
if (this.isMoving()) return;
if ($gamePlayer.followers().data()[0] !== this) return;
this.turnTowardCharacter($gamePlayer);
};
})();