Advertisement
jeneeus

EscapeStateFix

Oct 29th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //==============================================================================
  2. // ** Escape Fix
  3. // by: Jeneeus Guruman
  4. //------------------------------------------------------------------------------
  5.  
  6.  
  7. var Imported = Imported || {};
  8.  
  9. /*:
  10.  * @plugindesc v1.0.1 Fixes the escape command to not remove the states if failed to escape.
  11.  * @author Jeneeus Guruman
  12.  *
  13.  * @help Just put this above all plugins but directly below Yanfly Battle Core.
  14.  *
  15.  *   Changelog:
  16.  *
  17.  *     * v1.0.1: Now compatible with Yanfly Battle Core v1.07.
  18.  */
  19.  
  20. if (Imported.YEP_BattleEngineCore) {
  21. BattleManager.processEscape = function() {
  22.     var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
  23.     if (success) {
  24.         $gameParty.removeBattleStates();
  25.     }
  26.     $gameParty.performEscape();
  27.     SoundManager.playEscape();
  28.     if (success) {
  29.         $gameParty.performEscapeSuccess();
  30.         this.displayEscapeSuccessMessage();
  31.         this._escaped = true;
  32.         this.processAbort();
  33.     } else {
  34.         this.displayEscapeFailureMessage();
  35.         this._escapeRatio += this._escapeFailBoost;
  36.         $gameParty.clearActions();
  37.         this.startTurn();
  38.     }
  39.     return success;
  40. };
  41. }
  42.  
  43. else {
  44. BattleManager.processEscape = function() {
  45.     var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
  46.     if (success) {
  47.         $gameParty.removeBattleStates();
  48.     }
  49.     $gameParty.performEscape();
  50.     SoundManager.playEscape();
  51.     if (success) {
  52.         this.displayEscapeSuccessMessage();
  53.         this._escaped = true;
  54.         this.processAbort();
  55.     } else {
  56.         this.displayEscapeFailureMessage();
  57.         this._escapeRatio += 0.1;
  58.         $gameParty.clearActions();
  59.         this.startTurn();
  60.     }
  61.     return success;
  62. };
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement