paradise-succubus-ac/www/js/plugins/MPP_PreLoadAnime.js
2026-06-24 05:29:56 -05:00

102 lines
3.2 KiB
JavaScript

//=============================================================================
// MPP_PreLoadAnime.js
//=============================================================================
// Copyright (c) 2017 Mokusei Penguin
// Released under the MIT license
// http://opensource.org/licenses/mit-license.php
//=============================================================================
/*:
* @plugindesc 【ver.1.1】画像を先に読み込むことでアニメーション表示をスムーズにします。
* @author 木星ペンギン
*
* @help
* ●読み込みタイミング
* ・戦闘中のスキル実行
* 実行するスキルを決定した時点で、そのアニメーションを読み込みます。
* アクターの場合はスキル・アイテムの決定時、
* エネミーの場合はターン開始時となります。
*
* ================================
* 制作 : 木星ペンギン
* URL : http://woodpenguin.blog.fc2.com/
*
*/
(function() {
var Alias = {};
var RequestAnime = function(animation) {
if (animation) {
var name1 = animation.animation1Name;
var name2 = animation.animation2Name;
var hue1 = animation.animation1Hue;
var hue2 = animation.animation2Hue;
ImageManager.requestAnimation(name1, hue1);
ImageManager.requestAnimation(name2, hue2);
}
};
//-----------------------------------------------------------------------------
// Game_Battler
Game_Battler.prototype.requestItemAnimation = function(item) {
if (item) {
var animationId = item.animationId;
if (animationId < 0) {
if (this.isActor()) {
RequestAnime($dataAnimations[this.attackAnimationId1()]);
RequestAnime($dataAnimations[this.attackAnimationId2()]);
}
} else {
RequestAnime($dataAnimations[animationId]);
}
}
};
Game_Battler.prototype.requestActionsAnimation = function() {
for (var i = 0; i < this.numActions(); i++) {
var action = this.action(i);
this.requestItemAnimation(action ? action.item() : null);
}
};
//-----------------------------------------------------------------------------
// Game_Actor
//732
Alias.GaAc_makeActions = Game_Actor.prototype.makeActions;
Game_Actor.prototype.makeActions = function() {
Alias.GaAc_makeActions.call(this);
this.requestActionsAnimation();
};
//-----------------------------------------------------------------------------
// Game_Enemy
//278
Alias.GaEn_makeActions = Game_Enemy.prototype.makeActions;
Game_Enemy.prototype.makeActions = function() {
Alias.GaEn_makeActions.call(this);
this.requestActionsAnimation();
};
//-----------------------------------------------------------------------------
// Scene_Battle
//359
Alias.ScBa_onSkillOk = Scene_Battle.prototype.onSkillOk;
Scene_Battle.prototype.onSkillOk = function() {
BattleManager.actor().requestItemAnimation(this._skillWindow.item());
Alias.ScBa_onSkillOk.call(this);
};
//372
Alias.ScBa_onItemOk = Scene_Battle.prototype.onItemOk;
Scene_Battle.prototype.onItemOk = function() {
BattleManager.actor().requestItemAnimation(this._itemWindow.item());
Alias.ScBa_onItemOk.call(this);
};
})();