Last active
September 23, 2019 11:58
-
-
Save triacontane/22f99e2dc59ef13c195dadbe4a95361c to your computer and use it in GitHub Desktop.
StateMessageRemoveTarget.jsのメモ欄指定可能版。既存メソッド上書き構造のため一般公開はしません。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*============================================================================= | |
StateMessageRemoveTargetOver.js | |
---------------------------------------------------------------------------- | |
(C)2019 Triacontane | |
This software is released under the MIT License. | |
http://opensource.org/licenses/mit-license.php | |
---------------------------------------------------------------------------- | |
Version | |
1.0.0 2019/09/23 初版 | |
---------------------------------------------------------------------------- | |
[Blog] : https://triacontane.blogspot.jp/ | |
[Twitter]: https://twitter.com/triacontane/ | |
[GitHub] : https://github.com/triacontane/ | |
=============================================================================*/ | |
/*: | |
* @plugindesc StateMessageRemoveTargetPlugin | |
* @author triacontane | |
* | |
* @help StateMessageRemoveBattlerOver.js | |
* ステートメッセージの先頭に自動付与される「対象者の名前」を消去します。 | |
* ステートのメモ欄に<NoTargetMessage>と記述したステートが対象です。 | |
* | |
* このプラグインにはプラグインコマンドはありません。 | |
* | |
* This plugin is released under the MIT License. | |
*/ | |
/*:ja | |
* @plugindesc ステートメッセージから対象者の名前を消去するプラグイン | |
* @author トリアコンタン | |
* | |
* @help StateMessageRemoveBattlerOver.js | |
* ステートメッセージの先頭に自動付与される「対象者の名前」を消去します。 | |
* ステートのメモ欄に<NoTargetMessage>と記述したステートが対象です。 | |
* | |
* このプラグインにはプラグインコマンドはありません。 | |
* | |
* 利用規約: | |
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) | |
* についても制限はありません。 | |
* このプラグインはもうあなたのものです。 | |
*/ | |
(function() { | |
'use strict'; | |
Game_BattlerBase.prototype.mostImportantState = function() { | |
var states = this.states(); | |
for (var i = 0; i < states.length; i++) { | |
if (states[i].message3) { | |
return states[i]; | |
} | |
} | |
return null; | |
}; | |
Game_Actor.prototype.showRemovedStates = function() { | |
this.result().removedStateObjects().forEach(function(state) { | |
if (state.message4) { | |
if (state.meta.NoTargetMessage) { | |
$gameMessage.add(state.message4); | |
} else { | |
$gameMessage.add(this._name + state.message4); | |
} | |
} | |
}, this); | |
}; | |
Window_BattleLog.prototype.displayCurrentState = function(subject) { | |
var state = subject.mostImportantState(); | |
if (state && state.message3) { | |
if (state.meta.NoTargetMessage) { | |
this.push('addText', state.message3); | |
} else { | |
this.push('addText', subject.name() + state.message3); | |
} | |
this.push('wait'); | |
this.push('clear'); | |
} | |
}; | |
Window_BattleLog.prototype.displayAddedStates = function(target) { | |
target.result().addedStateObjects().forEach(function(state) { | |
var stateMsg = target.isActor() ? state.message1 : state.message2; | |
if (state.id === target.deathStateId()) { | |
this.push('performCollapse', target); | |
} | |
if (stateMsg) { | |
this.push('popBaseLine'); | |
this.push('pushBaseLine'); | |
if (state.meta.NoTargetMessage) { | |
this.push('addText', stateMsg); | |
} else { | |
this.push('addText', target.name() + stateMsg); | |
} | |
this.push('waitForEffect'); | |
} | |
}, this); | |
}; | |
Window_BattleLog.prototype.displayRemovedStates = function(target) { | |
target.result().removedStateObjects().forEach(function(state) { | |
if (state.message4) { | |
this.push('popBaseLine'); | |
this.push('pushBaseLine'); | |
if (state.meta.NoTargetMessage) { | |
this.push('addText', state.message4); | |
} else { | |
this.push('addText', target.name() + state.message4); | |
} | |
} | |
}, this); | |
}; | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment