Advertisement
kura2yamato

GWCombo v1

May 13th, 2024 (edited)
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //---------------------------------------------------------
  2. // GWComboSwitch.js
  3. // Copyright (c) 2024 GBison. All rights reserved.
  4. // Released under the MIT license.
  5. // http://opensource.org/licenses/mit-license.php
  6. //=========================================================
  7.  
  8. /*:
  9.  * @plugindesc Combo System By Checking the Switch.
  10.  * @author Gbison
  11.  * @version 1
  12.  *
  13.  * @help
  14.  * Copyright (c) 2024 GBison. All rights reserved.
  15.  * Released under the MIT license.
  16.  * ===================================================================
  17.  * The Idea from JoeBumpster
  18.  *
  19.  * @param Plugin Version
  20.  * @desc Version for the Plugins
  21.  *
  22.  * @param Version
  23.  * @type number
  24.  * @default 0
  25.  * @parent Plugin Version
  26.  *
  27.  * @param Sub Version
  28.  * @type number
  29.  * @range 0,99
  30.  * @desc Variable to Use
  31.  * @default 0
  32.  * @parent Plugin Version
  33.  *
  34.  * @param Condition
  35.  * @desc Condition For Action
  36.  *
  37.  * @param Condition Name
  38.  * @desc All Condition Name
  39.  * @type string[]
  40.  * @default ["Combo","Slice","Strike","Stab"]
  41.  * @parent Condition
  42.  *
  43.  * @param Condition Switch
  44.  * @desc All Condition Switch to Check
  45.  * @type switch[]
  46.  * @default ["10","11","12","13"]
  47.  * @parent Condition
  48.  *
  49.  * @param Condition Variable
  50.  * @desc All Condition Variable to update
  51.  * @type variable[]
  52.  * @default ["10","11","12","13"]
  53.  * @parent Condition
  54.  *
  55.  */
  56.  (function() {
  57.     // parameters
  58.     var _thisPluinName = 'GWComboSwitch'; //change with your filename.
  59.     var parameters = PluginManager.parameters(_thisPluinName);
  60.  
  61.     var listCondName = JSON.parse(parameters['Condition Name'] || "[]");
  62.     var listCondSwitch = JSON.parse(parameters['Condition Switch'] || "[]");
  63.     var listCondVariable = JSON.parse(parameters['Condition Variable'] || "[]");
  64.  
  65.     var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  66.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  67.         _Game_Interpreter_pluginCommand.call(this, command, args);
  68.         runPlugins = false;
  69.         if (command === 'GWComboStat') {
  70.             switch (args[0]) {
  71.                 case 'ComboIncrease':
  72.                     $gameSystem.ComboIncrease();
  73.                     runPlugins = [command, args];
  74.                     break;
  75.             }
  76.  
  77.         }
  78.  
  79.     };
  80.  
  81.     Game_System.prototype.ComboIncrease = function() {
  82.         let nPos = 0;
  83.         for (nPos = 0; nPos < listCondName.length; nPos++) {
  84.             let condName = listCondName[nPos] || -1;
  85.             let switchID = listCondSwitch[nPos] || -1;
  86.             let varID = listCondVariable[nPos] || -1;
  87.             if (condName != -1) {
  88.                 let oldValue = $gameVariables.value(varID);
  89.                 let switchStat = $gameSwitches.value(switchID);
  90.                 if (switchStat) {
  91.                     $gameVariables.setValue(varID, ++oldValue);
  92.                     $gameSwitches.setValue(switchID, 0);
  93.                 }
  94.             } else {
  95.                 /*console.log('not active ' + condName, switchID, varID);*/
  96.             }
  97.         }
  98.  
  99.  
  100.     };
  101.  
  102. })();
  103.  
  104. /*
  105. The Idea from JoeBumpster
  106.  https://forums.rpgmakerweb.com/index.php?threads/no-idea-why-this-switch-wont-flip.168634/
  107.  
  108. Must Read
  109. https://forums.rpgmakerweb.com/index.php?threads/parameter-structs.105978/
  110. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement