Advertisement
TamFey

No Attack / Guard

Nov 1st, 2015
4,142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // No Attack / Guard v1.1
  3. // by TamFey
  4. // Last Update: 1.11.2015
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc This plugin gives you the option to remove the 'Attack' and/or the 'Guard' command from the Actor Command Window.
  9.  *
  10.  * @author TamFey
  11.  *
  12.  * @param Disable Attack
  13.  * @desc 0: removes 'Attack' command. 1: keeps 'Attack' command
  14.  * @default 0
  15.  *
  16.  * @param Disable Guard
  17.  * @desc 0: removes 'Guard' command. 1: keeps 'Guard' command
  18.  * @default 0
  19.  */
  20. (function() {
  21.   var parameters = PluginManager.parameters('NoAttackGuard');
  22.   var disableAttack = Number(parameters['Disable Attack'] || 0);
  23.   var disableGuard = Number(parameters['Disable Guard'] || 0);
  24.  
  25.   Scene_Battle.prototype.createActorCommandWindow = function() {
  26.       console.log(disableAttack + " " + disableGuard);
  27.       this._actorCommandWindow = new Window_ActorCommand();
  28.       if (disableAttack) {
  29.         this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
  30.       }
  31.       this._actorCommandWindow.setHandler('skill',  this.commandSkill.bind(this));
  32.       if (disableGuard) {
  33.         this._actorCommandWindow.setHandler('guard',  this.commandGuard.bind(this));
  34.       }
  35.       this._actorCommandWindow.setHandler('item',   this.commandItem.bind(this));
  36.       this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
  37.       this.addWindow(this._actorCommandWindow);
  38.   };
  39.  
  40.   Window_ActorCommand.prototype.makeCommandList = function() {
  41.     console.log(disableAttack + " " + disableGuard);
  42.       if (this._actor) {
  43.           if (disableAttack) {
  44.             this.addAttackCommand();
  45.           }
  46.           this.addSkillCommands();
  47.           if (disableGuard) {
  48.             this.addGuardCommand();
  49.           }
  50.           this.addItemCommand();
  51.       }
  52.   };
  53.  
  54. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement