Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ICF-Soft Plugins - Patch to use params core stats in srd stat distribution plugin
- // ICFSoft_SRD_Distribution.js
- //=============================================================================
- var Imported = Imported || {};
- Imported.ICFSoft_SRD_Distribution = true;
- var ICF = ICF || {};
- ICF.SRD_Distribution = ICF.SRD_Distribution || {};
- ICF.SRD_Distribution.Version = 101; // 1.01
- //=============================================================================
- /*:
- * @plugindesc v1.01 This plugin allows you to increase params created with
- * ICFSoft's Params Core througth srd stat distribution plugin.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introduction
- * ============================================================================
- *
- * This plugin allows you to increase params created with ICFSoft's Params Core
- * througth srd stat distribution plugin. Also works with max tp.
- *
- * It is based on Stat Distribution v1.07 and must be placed before them.
- *
- * ============================================================================
- * How to use
- * ============================================================================
- *
- * Just use mtp and created params as upgradeable stats.
- *
- * ============================================================================
- * Incompatibilities
- * ============================================================================
- *
- * There's no known incompatible plugins yet.
- *
- * ============================================================================
- * Known isues
- * ============================================================================
- *
- * Not yet.
- *
- * ============================================================================
- * Changelog
- * ============================================================================
- *
- * Version 1.01:
- * - Added use of ICF-Soft Params Core CParams.
- *
- * Version 1.00:
- * - Finished plugin!
- *
- * ============================================================================
- *
- * For commercial and non-commercial games.
- * Credit to ICF-Soft.
- * This entire header must be included with plugin.
- *
- * ============================================================================
- */
- //=============================================================================
- /*:es
- * @plugindesc v1.01 Permite incrementar los parámetros creados con ICFSoft's
- * Params Core mediante el complemento de srd stat distribution.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introducción
- * ============================================================================
- *
- * Este plugin permite incrementar los parámetros creados con ICF-Soft Params
- * Core mediante el complemento de SumRndmDde stat distribution así como el tp
- * máximo.
- *
- * Basado en Stat Distribution v1.07 de SumRndmDde.
- * Debe estar colocado debajo de ambos.
- *
- * ============================================================================
- * Uso
- * ============================================================================
- *
- * Utiliza mtp y parámetros creados como parámetros que se pueden mejorar.
- *
- * ============================================================================
- * Incompatibilidades
- * ============================================================================
- *
- * No se conocen complementos que sean incompatibles hasta la fecha.
- *
- * ============================================================================
- * Problemas conocidos
- * ============================================================================
- *
- * De momento ninguno.
- *
- * ============================================================================
- * Historial de versiones
- * ============================================================================
- *
- * Versión 1.01:
- * - Se ha añadido el uso de los CParams.
- *
- * Versión 1.00:
- * - Complemento terminado.
- *
- * ============================================================================
- *
- * Para juegos comerciales y no comerciales.
- * Se debe incluir a ICF-Soft en los créditos.
- * Esta cabecera debe incluirse íntegramente con el plugin.
- *
- * ============================================================================
- */
- //=============================================================================
- //=============================================================================
- // DataManagerEX
- //=============================================================================
- DataManagerEX.getStatDistributionHtmlOptions = function() {
- var options = `<option value="mhp" selected>Max HP</option>
- <option value="mmp">Max MP</option>
- <option value="mtp">Max TP</option>
- <option value="atk">Attack</option>
- <option value="def">Defense</option>
- <option value="mat">Magical Attack</option>
- <option value="mdf">Magical Defense</option>
- <option value="agi">Agility</option>
- <option value="luk">Luck</option>
- <option value="frame"> </option>
- <option value="hit">Hit Rate</option>
- <option value="eva">Evasion Rate</option>
- <option value="cri">Critical Rate</option>
- <option value="cev">Critical Evasion Rate</option>
- <option value="mev">Magic Evasion Rate</option>
- <option value="mrf">Magic Reflection Rate</option>
- <option value="cnt">Counter Attack Rate</option>
- <option value="hrg">Hp Regeneration</option>
- <option value="mrg">Mp Regeneration</option>
- <option value="trg">Tp Regeneration</option>
- <option value="frame"> </option>
- <option value="tgr">Target Rate</option>
- <option value="grd">Guard Effect Rate</option>
- <option value="rec">Recovery Effect Rate</option>
- <option value="pha">Pharmacology</option>
- <option value="mcr">Mp Cost Rate</option>
- <option value="tcr">Tp Charge Rate</option>
- <option value="pdr">Physical Damage Rate</option>
- <option value="mdr">Magical Damage Rate</option>
- <option value="fdr">Floor Damage Rate</option>
- <option value="exr">Experience Rate</option>
- <option value="frame"> </option>`;
- for (var i = 0; i < ICF.Param.NParams.length; i++) {
- if (ICF.Param.NParams[i]) {
- options = options + '<option value="' + ICF.Param.NParams[i] + '">' + ICF.Param.NParamsFullName[i] + '</option>';
- }
- }
- for (var i = 0; i < ICF.Param.PParams.length; i++) {
- if (ICF.Param.PParams[i]) {
- options = options + '<option value="' + ICF.Param.PParams[i] + '">' + ICF.Param.PParamsFullName[i] + '</option>';
- }
- }
- for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
- if (ICF.Param.CParamsMax[i]) {
- options = options + '<option value="' + ICF.Param.CParamsMax[i] + '">' + ICF.Param.CParamsMaxFullName[i] + '</option>';
- }
- }
- return options;
- };
- DataManagerEX.updateStatDistribution = function() {
- const doc = MakerManager.document;
- this._distributeStat = doc.getElementById('StatSelect').value;
- const data = $dataDistributeStats[this._distributeStat];
- if(data) {
- doc.getElementById('name').value = data.name;
- doc.getElementById('description').value = data.description;
- doc.getElementById('cost').value = data.cost;
- doc.getElementById('gain').value = data.gain;
- doc.getElementById('max').value = data.max;
- doc.getElementById('min_col').value = data.min_col;
- doc.getElementById('max_col').value = data.max_col;
- } else if (this._distributeStat == "mtp") {
- $dataDistributeStats[this._distributeStat] = {};
- $dataDistributeStats[this._distributeStat].name = "Max TP";
- $dataDistributeStats[this._distributeStat].description = "The maximum amount of TP for the actor.";
- $dataDistributeStats[this._distributeStat].cost = 1;
- $dataDistributeStats[this._distributeStat].gain = 2;
- $dataDistributeStats[this._distributeStat].max = 200;
- $dataDistributeStats[this._distributeStat].min_col = "#6666ff";
- $dataDistributeStats[this._distributeStat].max_col = "#0000ff";
- DataManagerEX.updateStatDistribution();
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- } else if (ICF.Param.NParams.indexOf(this._distributeStat) > -1) {
- var paramId = ICF.Param.NParams.indexOf(this._distributeStat);
- $dataDistributeStats[this._distributeStat] = {};
- $dataDistributeStats[this._distributeStat].name = ICF.Param.NParamsFullName[paramId];
- $dataDistributeStats[this._distributeStat].description = "Actor's " + ICF.Param.NParamsFullName[paramId] + ".";
- $dataDistributeStats[this._distributeStat].cost = 1;
- $dataDistributeStats[this._distributeStat].gain = 1;
- $dataDistributeStats[this._distributeStat].max = 100;
- $dataDistributeStats[this._distributeStat].min_col = "#ff7777";
- $dataDistributeStats[this._distributeStat].max_col = "#f90000";
- DataManagerEX.updateStatDistribution();
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- } else if (ICF.Param.PParams.indexOf(this._distributeStat) > -1) {
- var paramId = ICF.Param.PParams.indexOf(this._distributeStat);
- $dataDistributeStats[this._distributeStat] = {};
- $dataDistributeStats[this._distributeStat].name = ICF.Param.PParamsFullName[paramId];
- $dataDistributeStats[this._distributeStat].description = "Actor's " + ICF.Param.PParamsFullName[paramId] + ".";
- $dataDistributeStats[this._distributeStat].cost = 1;
- $dataDistributeStats[this._distributeStat].gain = 1;
- $dataDistributeStats[this._distributeStat].max = 100;
- $dataDistributeStats[this._distributeStat].min_col = "#aaaaaa";
- $dataDistributeStats[this._distributeStat].max_col = "#ffffff";
- DataManagerEX.updateStatDistribution();
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- } else if (ICF.Param.CParamsMax.indexOf(this._distributeStat) > -1) {
- var paramId = ICF.Param.CParamsMax.indexOf(this._distributeStat);
- $dataDistributeStats[this._distributeStat] = {};
- $dataDistributeStats[this._distributeStat].name = ICF.Param.CParamsMaxFullName[paramId];
- $dataDistributeStats[this._distributeStat].description = "Actor's " + ICF.Param.CParamsMaxFullName[paramId] + ".";
- $dataDistributeStats[this._distributeStat].cost = 1;
- $dataDistributeStats[this._distributeStat].gain = 5;
- $dataDistributeStats[this._distributeStat].max = 100;
- $dataDistributeStats[this._distributeStat].min_col = "#bb1111";
- $dataDistributeStats[this._distributeStat].max_col = "#ee1111";
- DataManagerEX.updateStatDistribution();
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- } else {
- doc.getElementById('name').value = '';
- doc.getElementById('description').value = '';
- doc.getElementById('cost').value = '';
- doc.getElementById('gain').value = '';
- doc.getElementById('max').value = '';
- doc.getElementById('min_col').value = '';
- doc.getElementById('max_col').value = '';
- }
- };
- //=============================================================================
- // Game_BattlerBase
- //=============================================================================
- Object.defineProperties(Game_BattlerBase.prototype, {
- // Max TP
- mtp: { get: function() { return this.maxTp(); }, configurable: true },
- });
- //=============================================================================
- // Game_Actor
- //=============================================================================
- ICF.SRD_Distribution.actorNParamBase = Game_Actor.prototype.NParamBase;
- Game_Actor.prototype.NParamBase = function(paramId) {
- if (!this._distributeNParams) this._distributeNParams = [];
- return ICF.SRD_Distribution.actorNParamBase.apply(this, arguments) + (this._distributeNParams[paramId] || 0);
- };
- ICF.SRD_Distribution.actorPParamBase = Game_Actor.prototype.PParamBase;
- Game_Actor.prototype.PParamBase = function(pparamId) {
- if (!this._distributePParams) this._distributePParams = [];
- return ICF.SRD_Distribution.actorPParamBase.apply(this, arguments) + (this._distributePParams[pparamId] || 0);
- };
- ICF.SRD_Distribution.actorCParamBase = Game_Actor.prototype.CParamBase;
- Game_Actor.prototype.CParamBase = function(cparamId) {
- if (!this._distributeCParams) this._distributeCParams = [];
- return ICF.SRD_Distribution.actorCParamBase.apply(this, arguments) + (this._distributeCParams[cparamId] || 0);
- };
- ICF.SRD_Distribution.maxTp = Game_Actor.prototype.maxTp;
- Game_Actor.prototype.maxTp = function() {
- if (!this._distributeTP) this._distributeTP = 0;
- return ICF.SRD_Distribution.maxTp.apply(this, arguments) + this._distributeTP;
- };
- ICF.SRD_Distribution.clearDistributeStats = Game_Actor.prototype.clearDistributeStats;
- Game_Actor.prototype.clearDistributeStats = function() {
- ICF.SRD_Distribution.clearDistributeStats.call(this);
- this._distributeTP = 0;
- this._distributeNParams = [];
- this._distributePParams = [];
- this._distributeCParams = [];
- };
- ICF.SRD_Distribution.getAbnormalParam = Game_Actor.prototype.getAbnormalParam;
- Game_Actor.prototype.getAbnormalParam = function(param) {
- if (param == "mtp") return this._distributeTP || 0;
- if (ICF.Param.NParams.indexOf(param) > -1) {
- var paramId = ICF.Param.NParams.indexOf(param);
- if (!this._distributeNParams) this._distributeNParams = [];
- return this._distributeNParams[paramId] || 0;
- } else if (ICF.Param.PParams.indexOf(param) > -1) {
- var paramId = ICF.Param.PParams.indexOf(param);
- if (!this._distributePParams) this._distributePParams = [];
- return this._distributePParams[paramId] || 0;
- } else if (ICF.Param.CParamsMax.indexOf(param) > -1) {
- var paramId = ICF.Param.CParamsMax.indexOf(param);
- if (!this._distributeCParams) this._distributeCParams = [];
- return this._distributeCParams[paramId] || 0;
- }
- return ICF.SRD_Distribution.getAbnormalParam.apply(this, arguments);
- };
- ICF.SRD_Distribution.addAbnormalParam = Game_Actor.prototype.addAbnormalParam;
- Game_Actor.prototype.addAbnormalParam = function(param, value) {
- ICF.SRD_Distribution.addAbnormalParam.apply(this, arguments);
- if (param == "mtp") {
- this._distributeTP = this._distributeTP || 0;
- this._distributeTP += value;
- } else if (ICF.Param.NParams.indexOf(param) > -1) {
- var paramId = ICF.Param.NParams.indexOf(param);
- if (!this._distributeNParams) this._distributeNParams = [];
- this._distributeNParams[paramId] = this._distributeNParams[paramId] || 0;
- this._distributeNParams[paramId] += value;
- } else if (ICF.Param.PParams.indexOf(param) > -1) {
- var paramId = ICF.Param.PParams.indexOf(param);
- if (!this._distributePParams) this._distributePParams = [];
- this._distributePParams[paramId] = this._distributePParams[paramId] || 0;
- this._distributePParams[paramId] += value;
- } else if (ICF.Param.CParamsMax.indexOf(param) > -1) {
- var paramId = ICF.Param.CParamsMax.indexOf(param);
- if (!this._distributeCParams) this._distributeCParams = [];
- this._distributeCParams[paramId] = this._distributeCParams[paramId] || 0;
- this._distributeCParams[paramId] += value;
- }
- };
- //=============================================================================
- // Window_Distribute
- //=============================================================================
- Window_Distribute.prototype.makeCommandList = function() {
- if(this._actor) {
- const stats = this._actor.actor()._sd_stats || SRD.StatDistribution.stats;
- stats.forEach(function(stat) {
- if($dataDistributeStats[stat]) {
- this.addCommand($dataDistributeStats[stat].name, stat);
- } else if (stat == "mtp") {
- $dataDistributeStats[stat] = {};
- $dataDistributeStats[stat].name = "Max TP";
- $dataDistributeStats[stat].description = "The maximum amount of TP for the actor.";
- $dataDistributeStats[stat].cost = 1;
- $dataDistributeStats[stat].gain = 2;
- $dataDistributeStats[stat].max = 200;
- $dataDistributeStats[stat].min_col = "#6666ff";
- $dataDistributeStats[stat].max_col = "#0000ff";
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- this.addCommand($dataDistributeStats[stat].name, stat);
- } else if (ICF.Param.NParams.indexOf(stat) > -1) {
- var paramId = ICF.Param.NParams.indexOf(stat);
- $dataDistributeStats[stat] = {};
- $dataDistributeStats[stat].name = ICF.Param.NParamsFullName[paramId];
- $dataDistributeStats[stat].description = "Actor's " + ICF.Param.NParamsFullName[paramId] + ".";
- $dataDistributeStats[stat].cost = 1;
- $dataDistributeStats[stat].gain = 1;
- $dataDistributeStats[stat].max = 100;
- $dataDistributeStats[stat].min_col = "#ff7777";
- $dataDistributeStats[stat].max_col = "#f90000";
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- this.addCommand($dataDistributeStats[stat].name, stat);
- } else if (ICF.Param.PParams.indexOf(stat) > -1) {
- var paramId = ICF.Param.PParams.indexOf(stat);
- $dataDistributeStats[stat] = {};
- $dataDistributeStats[stat].name = ICF.Param.PParamsFullName[paramId];
- $dataDistributeStats[stat].description = "Actor's " + ICF.Param.PParamsFullName[paramId] + ".";
- $dataDistributeStats[stat].cost = 1;
- $dataDistributeStats[stat].gain = 1;
- $dataDistributeStats[stat].max = 100;
- $dataDistributeStats[stat].min_col = "#aaaaaa";
- $dataDistributeStats[stat].max_col = "#ffffff";
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- this.addCommand($dataDistributeStats[stat].name, stat);
- } else if (ICF.Param.CParamsMax.indexOf(stat) > -1) {
- var paramId = ICF.Param.CParamsMax.indexOf(stat);
- $dataDistributeStats[stat] = {};
- $dataDistributeStats[stat].name = ICF.Param.CParamsMaxFullName[paramId];
- $dataDistributeStats[stat].description = "Actor's " + ICF.Param.CParamsMaxFullName[paramId] + ".";
- $dataDistributeStats[stat].cost = 1;
- $dataDistributeStats[stat].gain = 5;
- $dataDistributeStats[stat].max = 100;
- $dataDistributeStats[stat].min_col = "#bb1111";
- $dataDistributeStats[stat].max_col = "#ee1111";
- FileManager.saveData($dataDistributeStats, "DistributionStats.json");
- this.addCommand($dataDistributeStats[stat].name, stat);
- }
- }, this);
- }
- this.addCommand("Finish", 'finish');
- };
- //=============================================================================
- // End of File
- //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement