Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc Shows only a listing of all an actor's skills in the
- * actor command window
- * @author Michael Stroud
- * @param showAttackCommand
- * @desc if "1" and if the attack skill is not sealed, show the "Attack" command.
- * @default 0
- * @param showItemCommand
- * @desc if "1", show the "Item" command
- * @default 0
- * @param showGuardCommand
- * @desc if "1" and if the guard skill is not sealed, show the "Guard" command
- * @default 0
- * No warranty, express or implied. I can't guarantee that it will
- * work at all. If it's useful to you, credit is appreciated.
- * You may redistribute, but do not remove any of the above.
- *
- */
- (function(){
- var parameters = PluginManager.parameters('skillsOnlyBattleWindow');
- var showAttackCommand = Number(parameters['showAttackCommand'] || 0);
- var showItemCommand = Number(parameters['showItemCommand'] || 0);
- var showGuardCommand = Number(parameters['showGuardCommand'] || 0);
- Window_ActorCommand.prototype.makeCommandList = function() {
- if (this._actor) {
- this.addEachSkillCommand();
- }
- };
- Window_ActorCommand.prototype.addEachSkillCommand = function() {
- var skills = this._actor.usableSkills();
- if (showAttackCommand && !this._actor.isSkillSealed(1)){
- this.addAttackCommand();
- }
- skills.forEach(function(skill) {
- var name = skill.name;
- this.addCommand(name, 'singleSkill', true, skill);
- }, this);
- if (showGuardCommand && !this._actor.isSkillSealed(2)){
- this.addGuardCommand();
- }
- if (showItemCommand){
- this.addItemCommand();
- }
- };
- Scene_Battle.prototype.commandSingleSkill = function() {
- var skill = this._actorCommandWindow.currentExt();
- var action = BattleManager.inputtingAction();
- action.setSkill(skill.id);
- BattleManager.actor().setLastBattleSkill(skill);
- this.onSelectAction();
- };
- Scene_Battle.prototype.createActorCommandWindow = function() {
- this._actorCommandWindow = new Window_ActorCommand();
- this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
- this._actorCommandWindow.setHandler('singleSkill', this.commandSingleSkill.bind(this));
- this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
- this._actorCommandWindow.setHandler('guard', this.commandGuard.bind(this));
- this._actorCommandWindow.setHandler('item', this.commandItem.bind(this));
- this.addWindow(this._actorCommandWindow);
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement