Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------
- // GWComboSwitch.js
- // Copyright (c) 2024 GBison. All rights reserved.
- // Released under the MIT license.
- // http://opensource.org/licenses/mit-license.php
- //=========================================================
- /*:
- * @plugindesc Combo System By Checking the Switch.
- * @author Gbison
- * @version 1
- *
- * @param Plugin Version
- * @desc Version for the Plugins
- *
- * @param Version
- * @type number
- * @default 0
- * @parent Plugin Version
- *
- * @param Sub Version
- * @type number
- * @range 0,99
- * @desc Variable to Use
- * @default 0
- * @parent Plugin Version
- *
- * @param Condition
- * @desc Condition For Action
- *
- * @param Combo Condition
- * @desc Condition For Combo
- * @parent Condition
- *
- * @param Combo Switch
- * @type switch
- * @default 10
- * @desc Switch to use
- * @parent Combo Condition
- *
- * @param Combo Variable
- * @type variable
- * @default 10
- * @desc Variable to Use
- * @parent Combo Condition
- *
- * @param Slice Condition
- * @desc Condition For Slice
- * @parent Condition
- *
- * @param Slice Switch
- * @type switch
- * @default 11
- * @desc Switch to use
- * @parent Slice Condition
- *
- * @param Slice Variable
- * @type variable
- * @default 11
- * @desc Variable to Use
- * @parent Slice Condition
- *
- * @param Strike Condition
- * @desc Condition For Strike
- * @parent Condition
- *
- * @param Strike Switch
- * @type switch
- * @default 12
- * @desc Switch to use
- * @parent Strike Condition
- *
- * @param Strike Variable
- * @type variable
- * @default 12
- * @desc Variable to Use
- * @parent Strike Condition
- *
- * @param Stab Condition
- * @desc Condition For Stab
- * @parent Condition
- *
- * @param Stab Switch
- * @type switch
- * @default 13
- * @desc Switch to use
- * @parent Stab Condition
- *
- * @param Stab Variable
- * @type variable
- * @default 13
- * @desc Variable to Use
- * @parent Stab Condition
- *
- * @help
- * Copyright (c) 2024 GBison. All rights reserved.
- * Released under the MIT license.
- * ===================================================================
- * The Idea from JoeBumpster
- * https://forums.rpgmakerweb.com/index.php?threads/no-idea-why-this-switch-wont-flip.168634/
- * To use this, just run plugin
- * GWComboStat ComboIncrease
- */
- (function() {
- // parameters
- var _thisPluinName = 'GWComboSwitch'; //change with your filename.
- var parameters = PluginManager.parameters(_thisPluinName);
- var _combo = {
- "switch": Number(parameters['Combo Switch'] || 10),
- "variable": Number(parameters['Combo Variable'] || 10)
- };
- var _slice = {
- "switch": Number(parameters['Slice Switch'] || 11),
- "variable": Number(parameters['Slice Variable'] || 11)
- };
- var _strike = {
- "switch": Number(parameters['Strike Switch'] || 12),
- "variable": Number(parameters['Strike Variable'] || 12)
- };
- var _stab = {
- "switch": Number(parameters['Stab Switch'] || 13),
- "variable": Number(parameters['Stab Variable'] || 13)
- };
- var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function(command, args) {
- _Game_Interpreter_pluginCommand.call(this, command, args);
- runPlugins = false;
- if (command === 'GWComboStat') {
- switch (args[0]) {
- case 'ComboIncrease':
- $gameSystem.ComboIncrease();
- runPlugins = [command, args];
- break;
- }
- }
- };
- Game_System.prototype.ComboIncrease = function() {
- let listCond = [];
- let switchID = 0;
- let varID = 0;
- let oldValue = 0;
- let switchStat = 0;
- //=====combo=================
- listCond = _combo;
- switchID = listCond.switch;
- varID = listCond.variable;
- oldValue = $gameVariables.value(varID);
- switchStat = $gameSwitches.value(switchID);
- /*Check result*/
- if (switchStat) {
- $gameVariables.setValue(varID, ++oldValue);
- $gameSwitches.setValue(switchID, 0);
- }
- //=====SLICE=================
- listCond = _slice;
- switchID = listCond.switch;
- varID = listCond.variable;
- oldValue = $gameVariables.value(varID);
- switchStat = $gameSwitches.value(switchID);
- /*Check result*/
- if (switchStat) {
- $gameVariables.setValue(varID, ++oldValue);
- $gameSwitches.setValue(switchID, 0);
- }
- //=====STRIKE=================
- listCond = _strike;
- switchID = listCond.switch;
- varID = listCond.variable;
- oldValue = $gameVariables.value(varID);
- switchStat = $gameSwitches.value(switchID);
- /*Check result*/
- if (switchStat) {
- $gameVariables.setValue(varID, ++oldValue);
- $gameSwitches.setValue(switchID, 0);
- }
- //=====STAB=================
- listCond = _stab;
- switchID = listCond.switch;
- varID = listCond.variable;
- oldValue = $gameVariables.value(varID);
- switchStat = $gameSwitches.value(switchID);
- /*Check result*/
- if (switchStat) {
- $gameVariables.setValue(varID, ++oldValue);
- $gameSwitches.setValue(switchID, 0);
- }
- };
- })();
- /*
- The Idea from JoeBumpster
- https://forums.rpgmakerweb.com/index.php?threads/no-idea-why-this-switch-wont-flip.168634/
- I have a combo system in my game which increases a variable by 1 for each time you land a hit. The way I have it registering if the attack landed or not is by flipping a switch on whenever
- Source:
- https://forums.rpgmakerweb.com/index.php?threads/no-idea-why-this-switch-wont-flip.168634/
- Refference:
- https://forums.rpgmakerweb.com/index.php?threads/parameter-structs.105978/
- https://docs.google.com/document/d/1Ep71x_l0BVbNkyW2-b_63Li8UFZcAyJQVSNQL-C7ETI/edit?usp=sharing
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement