Re: 自作プラグイン改変依頼(ターン終了時のステート関連のプラグインです)
Posted: 2016年11月20日(日) 16:48
トリアコンタンさんさっそくの修正ありがとうございます。
問題のない動作を確認いたしました。
このたびはご助力いただきありがとうございました。
問題のない動作を確認いたしました。
このたびはご助力いただきありがとうございました。
ツクール素材を公開・リクエストしたり、質問ができるフォーラムです。
https://tm.yumineko.com/
コード: 全て選択
//=============================================================================
// BattleManager
// ターン終了直前にステートスキルの実行を呼び出します。
//=============================================================================
var _BattleManager_startTurn = BattleManager.startTurn;
BattleManager.startTurn = function() {
_BattleManager_startTurn.apply(this, arguments);
this.allBattleMembers().forEach(function(battler) {
battler.clearExecuteTurnEndSkill();
});
};
var _BattleManager_endTurn = BattleManager.endTurn;
BattleManager.endTurn = function() {
this.allBattleMembers().some(function(battler) {
return battler.applyTurnEndSkill();
});
// ステートスキルが実行された場合、本来のターン終了は行わずに終了する。
if (this.isActionForced()) return;
_BattleManager_endTurn.apply(this, arguments);
};
//=============================================================================
// Game_Battler
// ターン終了ステートスキルを実行します。
//=============================================================================
Game_Battler.prototype.clearExecuteTurnEndSkill = function() {
this._executeTurnEndSkills = [];
};
Game_Battler.prototype.applyTurnEndSkill = function() {
for (var i = BBSmin; i < BBSmax + 1; i++) {//パラメータで指定したステートの範囲を判定
if (this.isStateAffected(i) && !this._executeTurnEndSkills.contains(i)) {//判定中にそのステートにかかっているバトラーがいた場合
var SkillID = $dataStates[i].meta.state_skill;//ステートのメモに書いてあるIDをSkillIDに
this.forceAction(SkillID, -2);
BattleManager.forceAction(this);
this._executeTurnEndSkills.push(i);
return true;
}
}
return false;
};