Skip to content

Instantly share code, notes, and snippets.

@GaeaKat
Created November 25, 2018 21:37
Show Gist options
  • Save GaeaKat/13eb8ca678055a5dca26578af64ba426 to your computer and use it in GitHub Desktop.
Save GaeaKat/13eb8ca678055a5dca26578af64ba426 to your computer and use it in GitHub Desktop.
//=============================================================================
// Innu Plugins - Demo Battles
// INNU_DemoBattles.js
//=============================================================================
var Imported = Imported || {};
Imported.INNU_DemoBattles = true;
var Innu = Innu || {};
Innu.DemoBattles = Innu.DemoBattles || {};
Innu.DemoBattles.version = 1.00;
//=============================================================================
/*:
* @plugindesc v1.00 Adds a demo battle command that lets you select a
* single character for the player to battle with
* @author Innu Plugins
*
*
* @help
* =============================================================================
* Introduction
* =============================================================================
* This plugin requires Yanfly's Party System
*
* =============================================================================
* Plugin Commands
* =============================================================================
*
* Here are the plugin commands.
*
* Plugin Command:
* SetupDemoBattle id Sets up the demo battle, id is the id of the actor in party to use
* BreakdownDemoBattle Resets everything to previous settings.
*
*
* =============================================================================
* Changelog
* =============================================================================
*
* Version 1.00:
* - Started plugin.
*/
//=============================================================================
if(Imported.YEP_PartySystem)
{
//---
// Game_Interpreter
//---
Innu.DemoBattles.Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
Innu.DemoBattles.Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'SetupDemoBattle') {
this.setupDemoBattle(args);
} else if (command === 'BreakdownDemoBattle') {
this.breakdownDemoBattle();
}
};
Game_Interpreter.prototype.setupDemoBattle=function (args) {
$gameTemp._partyFocus=Number(args[0]);
$gameTemp._oldHead=$gameParty.members()[0];
$gameParty.swapOrder(0,$gameParty.members().indexOf($gameActors.actor($gameTemp._partyFocus)));
$gameTemp._partySize=$gameParty._BattleMaxSize;
$gameSystem.setBattleFormationEnabled(false);
$gameParty.changeBattleMax(1);
};
Game_Interpreter.prototype.breakdownDemoBattle=function () {
$gameParty.changeBattleMax($gameTemp._partySize);
$gameSystem.setBattleFormationEnabled(true);
$gameParty.swapOrder(0,$gameParty.members().indexOf($gameTemp._oldHead));
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment