Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc Plugin used to disable dashing & stuff.
- * <DSI Limited Dash>
- * @author dsiver144
- *
- * @help Last Updated: 1/27/2018
- * Maybe you don't need help for this plugin, lol. Just play around with those
- * variables.
- *
- * @param defaultMaxStamina
- * @text Set Default Max Stamina
- * @default 100
- *
- * @param maxStaminaVariable
- * @text Set Max Stamina Variable ID
- * @type variable
- * @default 10
- *
- * @param currentStaminaVariable
- * @text Set Current Stamina Variable ID
- * @type variable
- * @default 11
- *
- * @param StaminaTimer
- * @text Set Stamina Timer
- * @default 10
- *
- * @param BurnAmount
- * @text Set Burn Amount
- * @default 5
- *
- * @param RecoverAmount
- * @text Set Recover Amount
- * @default 1
- *
- * @param disableDashSwitchID
- * @text Set Switch for disable dash
- * @type switch
- * @default 10
- */
- var DSIVER144 = DSIVER144 || {};
- var params = $plugins.filter(function(p) { return p.description.contains('<DSI Limited Dash>'); })[0].parameters;
- DSIVER144.maxStamina = Number(params['defaultMaxStamina'] || 100);
- DSIVER144.maxStaminaVarID = Number(params['maxStaminaVariable'] || 10);
- DSIVER144.curStaminaVarID = Number(params['currentStaminaVariable'] || 11);
- DSIVER144.staminaTimer = Number(params['StaminaTimer'] || 10);
- DSIVER144.burnAmount = Number(params['BurnAmount'] || 5);
- DSIVER144.recoverAmount = Number(params['RecoverAmount'] || 1);
- DSIVER144.disableDashSwID = Number(params['disableDashSwitchID'] || 10);
- (function(dsi){
- var _alias_Game_Player_initMembers = Game_Player.prototype.initMembers;
- Game_Player.prototype.initMembers = function() {
- _alias_Game_Player_initMembers.call(this);
- $gameVariables.setValue(dsi.maxStaminaVarID, dsi.maxStamina);
- $gameVariables.setValue(dsi.curStaminaVarID, dsi.maxStamina);
- this._canDash = true;
- this._dashDelayTime = dsi.staminaTimer;
- };
- Game_Player.prototype.updateDashing = function() {
- if (this._dashing === true) {
- if ($gameVariables.value(dsi.curStaminaVarID) > 0) {
- if (this._dashDelayTime === 0) {
- $gameVariables.setValue(dsi.curStaminaVarID, $gameVariables.value(dsi.curStaminaVarID) - dsi.burnAmount);
- this._dashDelayTime = dsi.staminaTimer;
- console.log($gameVariables.value(dsi.curStaminaVarID));
- if ($gameVariables.value(dsi.curStaminaVarID) <= 0) {
- $gameVariables.setValue(dsi.curStaminaVarID, 0);
- this._dashing = false;
- this._canDash = false;
- }
- } else {
- this._dashDelayTime -= 1;
- }
- }
- } else {
- if ($gameVariables.value(dsi.curStaminaVarID) < $gameVariables.value(dsi.maxStaminaVarID)) {
- if (this._dashDelayTime === 0) {
- $gameVariables.setValue(dsi.curStaminaVarID, $gameVariables.value(dsi.curStaminaVarID) + dsi.recoverAmount);
- this._dashDelayTime = dsi.staminaTimer;
- console.log($gameVariables.value(dsi.curStaminaVarID));
- if ($gameVariables.value(dsi.curStaminaVarID) >= 40) {
- this._canDash = true;
- }
- if ($gameVariables.value(dsi.curStaminaVarID) >= $gameVariables.value(dsi.maxStaminaVarID)) {
- $gameVariables.setValue(dsi.curStaminaVarID, $gameVariables.value(dsi.maxStaminaVarID));
- }
- } else {
- this._dashDelayTime -= 1;
- }
- }
- }
- if (this.isMoving()) {
- return;
- }
- if (this.canMove() && !this.isInVehicle() && !$gameMap.isDashDisabled() && this._canDash && !$gameSwitches.value(dsi.disableDashSwID)) {
- this._dashing = this.isDashButtonPressed() || $gameTemp.isDestinationValid();
- } else {
- this._dashing = false;
- }
- };
- })(DSIVER144);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement