Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Imported = Imported || {};
- Imported.Coolie_SuikodenGodspeedRune = true;
- var Coolie = Coolie || {};
- Coolie.SGS = Coolie.SGS || {};
- Coolie.SGS.version = 1.00;
- /*:
- * @plugindesc v1.01 Replicates the effect of the Godspeed Rune from Suikoden
- * @author William Couillard (Coolie)
- *
- * @help
- * -----------------------------------------------------------------------------
- * ABOUT THIS PLUGIN
- * -----------------------------------------------------------------------------
- * The Godspeed Rune in Suikoden is a special rune that has two effects.
- * 1. When the bearer of the rune is in your battle party, you can dash faster!
- * 2. When the bearer of the rune is in your battle party, escape never fails!
- *
- * This plugin will recreate those effects for your chosen actor.
- *
- * 1. When the chosen actor is in the battle party and all conditions set in the
- * parameters returns a true result, escape is guaranteed. Otherwise, the
- * normal escape process chance will occur.
- *
- * 2. When the chosen actor is in the battle party, your dash speed is doubled!
- * Walking speed is NOT affected!
- *
- * This plugin overwrites the default escape chance processing and the default
- * setting for movement speed outside of battle. Any other plugins that may
- * also alter these default functions may make this plugin incompatible with
- * your project, so please test accordingly.
- *
- * Overwritten: BattleManager.processEscape [rpg_managers.js]
- * Overwritten: Game_CharacterBase.prototype.distancePerFrame [rpg_objects.js]
- *
- * -----------------------------------------------------------------------------
- * TERMS OF USE
- * -----------------------------------------------------------------------------
- * It is OK to use this plugin in both commercial and non-commercial
- * projects.
- *
- * Credit is appreciated, but not required.
- *
- * -----------------------------------------------------------------------------
- * VERSION & UPDATE HISTORY
- * -----------------------------------------------------------------------------
- * - v1.00 : Initial release.
- * March 4th, 2023
- * -----------------------------------------------------------------------------
- * @param Escape Settings
- *
- * @param Actor ID
- * @parent Escape Settings
- * @type number
- * @min 1
- * @desc The actor ID that will guarantee escaping from battle.
- * Default: 1
- * @default 1
- *
- * @param Must Be Alive?
- * @parent Escape Settings
- * @type boolean
- * @on Yes
- * @off No
- * @desc Does the actor have to be alive to guarantee escape?
- * Yes/True: Must be alive No/False: Can be dead
- * @default true
- *
- * @param Can Move?
- * @parent Escape Settings
- * @type boolean
- * @on Yes
- * @off No
- * @desc Does the actor have to be able to move to guarantee escape?
- * Yes/True: Must be able to move No/False: Can be restricted
- * @default true
- */
- Coolie.Parameters = PluginManager.parameters('Coolie_SuikodenGodspeedRune');
- Coolie.Param = Coolie.Param || {};
- Coolie.Param.SGSactorId = Number(Coolie.Parameters['Actor ID']);
- Coolie.Param.SGSmustBeAlive = eval(String(Coolie.Parameters['Must Be Alive?']));
- Coolie.Param.SGScanMove = eval(String(Coolie.Parameters['Can Move?']));
- var coolieMBA = Coolie.Param.SGSmustBeAlive;
- var coolieCM = Coolie.Param.SGScanMove;
- // -----------------------------------------------------------------------------
- // Overwrite: BattleManager.processEscape
- // -----------------------------------------------------------------------------
- BattleManager.processEscape = function() {
- $gameParty.performEscape();
- SoundManager.playEscape();
- if ($gameActors.actor(Coolie.Param.SGSactorId).isBattleMember() && coolieMBA === false && coolieCM === false) {
- var success = true;
- } else if ($gameActors.actor(Coolie.Param.SGSactorId).isBattleMember() && coolieMBA && coolieCM === false) {
- if ($gameActors.actor(Coolie.Param.SGSactorId).hp >= 1) {
- var success = true;
- } else {
- var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
- }
- } else if ($gameActors.actor(Coolie.Param.SGSactorId).isBattleMember() && coolieMBA === false && coolieCM) {
- if ($gameActors.actor(Coolie.Param.SGSactorId).canMove()) {
- var success = true;
- } else {
- var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
- }
- } else if ($gameActors.actor(Coolie.Param.SGSactorId).isBattleMember() && coolieMBA && coolieCM) {
- if ($gameActors.actor(Coolie.Param.SGSactorId).hp >= 1) {
- if ($gameActors.actor(Coolie.Param.SGSactorId).canMove()) {
- var success = true;
- } else {
- var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
- }
- } else {
- var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
- }
- } else {
- }
- if (success) {
- this.displayEscapeSuccessMessage();
- this._escaped = true;
- this.processAbort();
- } else {
- this.displayEscapeFailureMessage();
- this._escapeRatio += 0.1;
- $gameParty.clearActions();
- this.startTurn();
- }
- return success;
- };
- // -----------------------------------------------------------------------------
- // Overwrite: Game_CharacterBase.prototype.distancePerFrame
- // -----------------------------------------------------------------------------
- Game_CharacterBase.prototype.distancePerFrame = function() {
- if ($gameActors.actor(Coolie.Param.SGSactorId).isBattleMember() && this.isDashing()) {
- return Math.pow(2, this.realMoveSpeed()) / 192;
- } else {
- return Math.pow(2, this.realMoveSpeed()) / 256;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement