Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // RSM_CustomizeStockBattlebacks.js
- // Rafael_Sol_Maker's Customize Stock Battlebacks MV v1.1.
- // This work is licensed under a Creative Commons Attribution 4.0 International License.
- //=============================================================================
- //Changelog: ////////////////////////////////////////////////////////////////////////////
- // 1.0 -> 1.1: * Compatibility with functions of Plugin Manager for RPG Maker mV 1.5+.
- // * Possibility to easily change default battleback as well.
- // * Now part of Imported and parameters can be found in RSMTweaks
- /////////////////////////////////////////////////////////////////////////////////////////
- // Here we go again...
- var Imported = Imported || {};
- var RSMTweaks = RSMTweaks || {};
- Imported.RSM_Battlebacks = true;
- Imported.RSM_Battlebacks.version = 1.1;
- RSMTweaks.Battlebacks = RSMTweaks.Battlebacks || {};
- /*:
- * @plugindesc RSM's Customize Stock Battlebacks MV v1.1.
- * Allows you to customize battlebacks. Requires RPG Maker 1.5 or newer.
- * @author Rafael_Sol_Maker (www.condadobraveheart.com/forum)
- *
- * @param default
- * @text Default Battlebacks
- * @desc The battlebacks files in default cases.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Grassland","battleback2":"Grassland"}
- *
- * @param ship
- * @text Ship Battlebacks
- * @desc The battlebacks files for boat and ship (in vehicle).
- * @type struct<DualBattleback>
- * @default {"battleback1":"Ship","battleback2":"Ship"}
- *
- * @param grassland
- * @text Grassland Battlebacks
- * @desc The battlebacks files for normal grasslands.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Grassland","battleback2":"Grassland"}
- *
- * @param wasteland
- * @text Wasteland Battlebacks
- * @desc The battlebacks files for wastelands.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Wasteland","battleback2":"Wasteland"}
- *
- * @param desert
- * @text Desert Battlebacks
- * @desc The battlebacks files for deserts.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Desert","battleback2":"Desert"}
- *
- * @param snowfield
- * @text Snowfield Battlebacks
- * @desc The battlebacks files for snowfields.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Snowfield","battleback2":"Snowfield"}
- *
- * @param clouds
- * @text Cloud Battlebacks
- * @desc The battlebacks files for clouds.
- * @type struct<DualBattleback>
- * @default {"battleback1":"Clouds","battleback2":"Clouds"}
- *
- * @param poisonswamp
- * @text Poison Swamp Battlebacks
- * @desc The battlebacks files for poison swamps.
- * @type struct<DualBattleback>
- * @default {"battleback1":"PoisonSwamp","battleback2":"PoisonSwamp"}
- *
- * @param lava
- * @text Lava Battlebacks
- * @desc The (3) battlebacks files for lava. See help for details on this one.
- * @type struct<LavaBattleback>
- * @default {"battleback":"Lava","battlefloor1":"Lava1","battlefloor2":"Lava2"}
- *
- * @param forest
- * @text Forest Superposition
- * @desc The battleback file for forest superposition (for Grassland).
- * @type file
- * @dir img/battlebacks2
- * @default Forest
- *
- * @param cliff
- * @text Cliff Superposition
- * @desc The battleback file for cliff superposition (for Grassland).
- * @type file
- * @dir img/battlebacks2
- * @default Cliff
- *
- * @param dirtfield
- * @text Dirt Field Superposition
- * @desc The battleback file for dirtfield superposition floor (for Wasteland).
- * @type file
- * @dir img/battlebacks1
- * @default DirtField
- *
- * @help
- * This Plugin has one command available:
- * ChangeBattleback <type> filename
- * # Changes the chosen battleback for the specified file.
- *
- * <type> can be: defaultX, grasslandX, shipX, wastelandX, desertX,
- * snowfieldX, cloudsX, poisonswampX OR lavafloorX.
- * Where X you put 1 or 2 to decide which one you would like to change.
- * The non-numbered battlebacks are lavaback, forest, dirtfield OR cliff.
- * Filename will be your image. Example: ChangeBattleback desert1 Arabia
- *
- * Depending on context, the folder where it will come from will be different.
- * Most of battlebacks ending in 1 will be from battlebacks1 (floors)
- * And ending in 2 will be the background (clouds, mountains, etcetera.)
- * For the exceptions and non-numbered ones, please continue reading.
- *
- * Please repair that the non-numbered are the ones that will be used for
- * superposition in special occasions (battlebacks2 folder).
- * For lava, there are 2 "floors" (battlebacks1 folder), lavafloor1 &
- * lavafloor2, and only one "wall" or "back", lavaback (battlebacks2 folder).
- *
- * The working of the original system was not changed at all. All regions are
- * hardcoded and relative to the default tileset. In a future version I would
- * allow this to be changed and you will * be able to apply any set of
- * battlebacks to any tileset you want. Please stay tuned!
- *
- * If you have any questions, criticisms or suggestions, please let me know.
- * Best regards,
- * ~RAFAEL_SOL_MAKER
- */
- /*~struct~DualBattleback:
- * @param battleback1
- * @text Battleback 01 (Floor)
- * @type file
- * @dir img/battlebacks1
- *
- * @param battleback2
- * @text Battleback 01 (Back)
- * @type file
- * @dir img/battlebacks2
- */
- /*~struct~LavaBattleback:
- *
- * @param battleback
- * @text Lava Back
- * @type file
- * @dir img/battlebacks2
- *
- * @param battlefloor1
- * @text Ground Floor
- * @type file
- * @dir img/battlebacks1
- *
- * @param battlefloor2
- * @text Lava Floor
- * @type file
- * @dir img/battlebacks1
- */
- /*
- #==============================================================================
- # ** PARAMETERS, COMMANDS & MISC
- #------------------------------------------------------------------------------
- # Let's handle these values first
- #==============================================================================
- */
- (function() {
- // First let's have the parameters
- var parameters = PluginManager.parameters('RSM_CustomizeStockBattlebacks');
- RSMTweaks.Battlebacks.default = JSON.parse(parameters['default']);
- RSMTweaks.Battlebacks.grassland = JSON.parse(parameters['grassland']);
- RSMTweaks.Battlebacks.ship = JSON.parse(parameters['ship']);
- RSMTweaks.Battlebacks.wasteland = JSON.parse(parameters['wasteland']);
- RSMTweaks.Battlebacks.desert = JSON.parse(parameters['desert']);
- RSMTweaks.Battlebacks.snowfield = JSON.parse(parameters['snowfield']);
- RSMTweaks.Battlebacks.clouds = JSON.parse(parameters['clouds']);
- RSMTweaks.Battlebacks.poisonswamp = JSON.parse(parameters['poisonswamp']);
- RSMTweaks.Battlebacks.lava = JSON.parse(parameters['lava']);
- RSMTweaks.Battlebacks.forest = parameters['forest'] || 'Forest';
- RSMTweaks.Battlebacks.cliff = parameters['cliff'] || 'Cliff';
- RSMTweaks.Battlebacks.dirtfield = parameters['dirtfield'] || 'Dirtfield';
- // Dealing with our commands here
- var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function(command, args) {
- _Game_Interpreter_pluginCommand.call(this, command, args);
- if (command === 'ChangeBattleback') {
- // Plugin Commands Goes Here
- switch (args[0]) {
- case 'default1':
- RSMTweaks.Battlebacks.default.battleback1 = args[1];
- break;
- case 'default2':
- RSMTweaks.Battlebacks.default.battleback2 = args[1];
- break;
- case 'grassland1':
- RSMTweaks.Battlebacks.grassland.battleback1 = args[1];
- break;
- case 'grassland2':
- RSMTweaks.Battlebacks.grassland.battleback2 = args[1];
- break;
- case 'ship1':
- RSMTweaks.Battlebacks.ship.battleback1 = args[1];
- break;
- case 'ship2':
- RSMTweaks.Battlebacks.ship.battleback2 = args[1];
- break;
- case 'wasteland1':
- RSMTweaks.Battlebacks.wasteland.battleback1 = args[1];
- break;
- case 'wasteland2':
- RSMTweaks.Battlebacks.wasteland.battleback2 = args[1];
- break;
- case 'desert1':
- RSMTweaks.Battlebacks.desert.battleback1 = args[1];
- break;
- case 'desert2':
- RSMTweaks.Battlebacks.desert.battleback2 = args[1];
- break;
- case 'snowfield1':
- RSMTweaks.Battlebacks.snowfield.battleback1 = args[1];
- break;
- case 'snowfield2':
- RSMTweaks.Battlebacks.snowfield.battleback2 = args[1];
- break;
- case 'clouds1':
- RSMTweaks.Battlebacks.clouds.battleback1 = args[1];
- break;
- case 'clouds2':
- RSMTweaks.Battlebacks.clouds.battleback2 = args[1];
- break;
- case 'poisonswamp1':
- RSMTweaks.Battlebacks.poisonswamp.battleback1 = args[1];
- break;
- case 'poisonswamp2':
- RSMTweaks.Battlebacks.poisonswamp.battleback2 = args[1];
- break;
- case 'lavafloor1':
- RSMTweaks.Battlebacks.lava.battlefloor1 = args[1];
- break;
- case 'lavafloor2':
- RSMTweaks.Battlebacks.lava.battlefloor2 = args[1];
- break;
- case 'lavaback':
- RSMTweaks.Battlebacks.lava.battleback = args[1];
- break;
- case 'forest':
- RSMTweaks.Battlebacks.forest = args[1];
- break;
- case 'cliff':
- RSMTweaks.Battlebacks.cliff = args[1];
- break;
- case 'dirtfield':
- RSMTweaks.Battlebacks.dirtfield = args[1];
- break;
- };
- };
- };
- /*
- #==============================================================================
- # ** Spriteset_Battle
- #------------------------------------------------------------------------------
- # Handles the sprites in battle, duh.
- #==============================================================================
- */
- Spriteset_Battle.prototype.terrainBattleback1Name = function(type) {
- switch (type) {
- case 24: case 25:
- return RSMTweaks.Battlebacks.wasteland.battleback1;
- case 26: case 27:
- return RSMTweaks.Battlebacks.dirtfield;
- case 32: case 33:
- return RSMTweaks.Battlebacks.desert.battleback1;
- case 34:
- return RSMTweaks.Battlebacks.lava.battlefloor1;
- case 35:
- return RSMTweaks.Battlebacks.lava.battlefloor2;
- case 40: case 41:
- return RSMTweaks.Battlebacks.snowfield.battleback1;
- case 42:
- return RSMTweaks.Battlebacks.clouds.battleback1;
- case 4: case 5:
- return RSMTweaks.Battlebacks.poisonswamp.battleback1;
- default:
- return null;
- };
- };
- Spriteset_Battle.prototype.terrainBattleback2Name = function(type) {
- switch (type) {
- case 20: case 21:
- return RSMTweaks.Battlebacks.forest;
- case 22: case 30: case 38:
- return RSMTweaks.Battlebacks.cliff;
- case 24: case 25: case 26: case 27:
- return RSMTweaks.Battlebacks.wasteland.battleback2;
- case 32: case 33:
- return RSMTweaks.Battlebacks.desert.battleback2;
- case 34: case 35:
- return RSMTweaks.Battlebacks.lava.battleback;
- case 40: case 41:
- return RSMTweaks.Battlebacks.snowfield.battleback2;
- case 42:
- return RSMTweaks.Battlebacks.clouds.battleback2;
- case 4: case 5:
- return RSMTweaks.Battlebacks.poisonswamp.battleback2;
- };
- };
- Spriteset_Battle.prototype.defaultBattleback1Name = function() {
- return RSMTweaks.Battlebacks.default.battleback1;
- };
- Spriteset_Battle.prototype.defaultBattleback2Name = function() {
- return RSMTweaks.Battlebacks.default.battleback2;
- };
- Spriteset_Battle.prototype.shipBattleback1Name = function() {
- return RSMTweaks.Battlebacks.ship.battleback1;
- };
- Spriteset_Battle.prototype.shipBattleback2Name = function() {
- return RSMTweaks.Battlebacks.ship.battleback2;
- };
- /*
- #==============================================================================
- # ** END OF CODE
- #==============================================================================
- */
- })(); //Don't remove this!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement