ezmash

Change Battle Mode (MV)

Oct 24th, 2015
2,310
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Battle Mode
  3. // by Shaz
  4. // Last Updated: 2015.10.21
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc Allows side view and front view battles in the same game
  9.  * @author Shaz
  10.  *
  11.  * @help This plugin does not provide plugin commands.
  12.  *
  13.  * Prefix a troop name with SV to set battles with that troop to side view
  14.  * Prefix a troop name with FV to set battles with that troop to front view
  15.  * Prefix a troop name with RV to set a random view for each battle with that troop
  16.  * Leave out the prefix to take the system default
  17.  *
  18.  */
  19.  
  20. (function() {
  21.   var _Game_System_isSideView = Game_System.prototype.isSideView;
  22.   Game_System.prototype.isSideView = function() {
  23.     if ($gameParty.inBattle) {
  24.       var sv = $gameTroop.isSideView();
  25.       if (sv === null) {
  26.         return _Game_System_isSideView.call(this);
  27.       } else {
  28.         return sv;
  29.       }
  30.     } else {
  31.       return _Game_System_isSideView.call(this);
  32.     }
  33.   };
  34.  
  35.   var _Game_Troop_setup = Game_Troop.prototype.setup;
  36.   Game_Troop.prototype.setup = function(troopId) {
  37.     _Game_Troop_setup.call(this, troopId);
  38.  
  39.     if (this.troop().name.match(/^SV/)) {
  40.       this._isSideView = true;
  41.     } else if (this.troop().name.match(/^FV/)) {
  42.       this._isSideView = false;
  43.     } else if (this.troop().name.match(/^RV/)) {
  44.       this._isSideView = Math.random() < 0.5;
  45.     } else {
  46.       this._isSideView = null;
  47.     }
  48.   };
  49.  
  50.   Game_Troop.prototype.isSideView = function() {
  51.     return this._isSideView;
  52.   };
  53. })();
RAW Paste Data