lust-oni/www/js/plugins/ShakingChange.js
2025-10-26 23:43:42 -05:00

44 lines
No EOL
1.4 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*:
* @plugindesc 画面シェイクを縦揺れに変更するよ
* @author ゆわか
*
* @param Switch ID
* @desc 揺れ方を変更するスイッチのIDです。
* @default 0
*
* @help このプラグインには、プラグインコマンドはありません。
*
* パラメータで指定した番号のスイッチを
* ONにすると縦揺れに変更、OFFにすると横揺れに戻ります。
* 
* フロントビュー戦闘でダメージを受けたときの揺れも
* 同じように変更されるのでご注意ください。
*
* 使用報告不要・クレジット不要・改変可・商用利用可。
* もし何か問題が起きても、当方は一切責任を負いません。ご了承ください。
*/
(function() {
var parameters = PluginManager.parameters('ShakingChange');
var switchId = Number(parameters['Switch ID'] || 0);
//rpg_sprites.js より抜粋
Spriteset_Base.prototype.updatePosition = function() {
var screen = $gameScreen;
var scale = screen.zoomScale();
this.scale.x = scale;
this.scale.y = scale;
this.x = Math.round(-screen.zoomX() * (scale - 1));
this.y = Math.round(-screen.zoomY() * (scale - 1));
//揺れ方向
if($gameSwitches.value(switchId)){
this.y += Math.round(screen.shake());
} else {
this.x += Math.round(screen.shake());
}
};
})();