//============================================================================= // Kpp_WeatherSpring.js //============================================================================= // Copyright (c) 2018-2021 カッピ // // Released under the MIT license // http://opensource.org/licenses/mit-license.php // // ウェブサイト // https://birdwind.net/ // // Twitter // https://twitter.com/kappi_bw /*: * @plugindesc 桜が舞う天候エフェクト * @author カッピ * * @requiredAssets img/system/WeatherSpring * * @param Power * @desc 天候エフェクトの画像を一度に表示する量(1~9の数値) * @default 2 * @type number * @min 1 * @max 9 * * @param Duration * @desc 天候エフェクトの切り替えにかかる時間(1~999の数値) * @default 60 * @type number * @min 1 * @max 999 * * @help 桜が舞う天候エフェクトを再生します。 * * 事前準備として、 * プラグイン配布ページにある「WeatherSpring.png」を、 * img/systemフォルダに入れておいてください。 * * 以下のどちらかのプラグインコマンドで、天候を開始します。 * WeatherSpring * 桜天候 * * 天候を停止するには、 * イベントコマンド「天候の設定」で、 * 種類を「なし」に指定します。 * * [ 更新 2021/4/21 ] * 日本語以外の環境でも、ヘルプやパラメータが表示されるように * テキストを修正 */ (function() { var parameters = PluginManager.parameters('Kpp_WeatherSpring'); var _power = Number(parameters['Power'] || 2); var _duration = Number(parameters['Duration'] || 60); var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); if (command === 'WeatherSpring' || command === '桜天候') { $gameScreen.changeWeather("spring", _power, _duration); } }; var _Weather_createBitmaps = Weather.prototype._createBitmaps; Weather.prototype._createBitmaps = function() { _Weather_createBitmaps.call(this); this._springBitmap = ImageManager.loadSystem('WeatherSpring') }; var _Weather_updateSprite = Weather.prototype._updateSprite; Weather.prototype._updateSprite = function(sprite) { if (this.type == 'spring') this._updateSpringSprite(sprite); _Weather_updateSprite.call(this, sprite); }; Weather.prototype._updateSpringSprite = function(sprite) { sprite.bitmap = this._springBitmap; sprite.opacity -= 1; if (sprite.opacity >= 180) { sprite.ax -= 3; sprite.ay += 1; sprite.rotation -= 0.01; } else if (sprite.opacity >= 120) { sprite.ax -= 1; sprite.ay += 4; sprite.rotation += 0.01; } else { sprite.ax -= 3; sprite.ay += 3; sprite.rotation -= 0.01; } }; })();