Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Place file inside /js/plugins
- // Remember to save after adding plugins or changing parameters.
- /*:
- *
- * @plugindesc V.2016-03-26-1152. Escape via TP
- * @author https://ellyeblog.wordpress.com/ || http://steamcommunity.com/id/Ellye
- */
- (function() {
- Game_Unit.prototype.avgTP = function() {
- var members = this.members();
- if (members.length === 0) {
- return 1;
- }
- var sum = members.reduce(function(r, member) {
- return r + member.tpRate();
- }, 0);
- return sum / members.length;
- };
- BattleManager.makeEscapeRatio = function() {
- this._escapeRatio = $gameParty.avgTP();
- };
- _alias_pe = BattleManager.processEscape;
- BattleManager.processEscape = function() {
- this.makeEscapeRatio();
- _alias_pe.call(this);
- };
- })();
RAW Paste Data