Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ICF-Soft Plugins - Tp distribution addon for srd stat distribution plugin
- // ICFSoft_SRDTpDistAddon.js
- //=============================================================================
- var Imported = Imported || {};
- Imported.ICFSoft_SRDTpDistAddon = true;
- var ICF = ICF || {};
- ICF.SRDTpDistAddon = ICF.SRDTpDistAddon || {};
- ICF.SRDTpDistAddon.Version = 100; // 1.00
- //=============================================================================
- /*:
- * @plugindesc v1.00 This plugin allows you to increase max tp througth srd stat
- * distribution plugin.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introduction
- * ============================================================================
- *
- * This plugin allows you to increase max tp througth srd stat distribution
- * plugin.
- *
- * It is based on Stat Distribution v1.07 and TP Upgrade v3.03 SumRndmDde plugins.
- * Place below them.
- *
- * ============================================================================
- * How to use
- * ============================================================================
- *
- * Just use mtp as a upgradeable stat.
- *
- * If you have DistributionStats.json file in data folder you should delete it
- * or change it's name as backup. A new file will be created with a mtp field.
- *
- * ============================================================================
- * Incompatibilities
- * ============================================================================
- *
- * There's no known incompatible plugins yet.
- *
- * ============================================================================
- * Known isues
- * ============================================================================
- *
- * Not yet.
- *
- * ============================================================================
- *
- * For commercial and non-commercial games.
- * Credit to ICF-Soft.
- * This entire header must be included with plugin.
- *
- * ============================================================================
- */
- //=============================================================================
- /*:es
- * @plugindesc v1.00 Permite incrementar el tp máximo mediante el complemento de
- * srd stat distribution.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introducción
- * ============================================================================
- *
- * Este plugin permite incrementar el tp máximo mediante el complemento de
- * SumRndmDde stat distribution.
- *
- * Basado en los plugins Stat Distribution v1.07 y TP Upgrade v3.03 de
- * SumRndmDde. Debe estar colocado debajo de ambos.
- *
- * ============================================================================
- * Uso
- * ============================================================================
- *
- * Utiliza mtp como uno de los parámetros que se pueden mejorar.
- *
- * Si tienes el archivo DistributionStats.json en la carpeta data conviene
- * borrarlo o cambiarle el nombre. Se creará un nuevo archivo con un campo para
- * la edición de mtp.
- *
- * ============================================================================
- * Incompatibilidades
- * ============================================================================
- *
- * No se conocen complementos que sean incompatibles hasta la fecha.
- *
- * ============================================================================
- * Problemas conocidos
- * ============================================================================
- *
- * De momento ninguno.
- *
- * ============================================================================
- *
- * Para juegos comerciales y no comerciales.
- * Se debe incluir a ICF-Soft en los créditos.
- * Esta cabecera debe incluirse íntegramente con el plugin.
- *
- * ============================================================================
- */
- //=============================================================================
- //=============================================================================
- // SRD.StatDistribution
- //=============================================================================
- SRD.StatDistribution.checkFileExists = function() {
- FileManager.checkDataExists("DistributionStats.json", JsonEx.stringify({
- "mhp":{"name":"Max HP","description":"The maximum amount of HP for the actor.","cost":"1","gain":"5","max":"500","min_col":"#ffa655","max_col":"#ea7000"},
- "mmp":{"name":"Max MP","description":"The maximum amount of MP for the actor.","cost":"1","gain":"2","max":"200","min_col":"#6666ff","max_col":"#0000ff"},
- "atk":{"name":"Attack","description":"Strengthens the damage of physical skills used by \nthe actor.","cost":"1","gain":"1","max":"100","min_col":"#ff7777","max_col":"#f90000"},
- "def":{"name":"Defense","description":"Reduces the damage of physical skills the actor is \ntargeted with.","cost":"1","gain":"1","max":"100","min_col":"#52ff33","max_col":"#12b700"},
- "mat":{"name":"Magic Attack","description":"Strengthens the damage of magical skills used by \nthe actor.","cost":"1","gain":"1","max":"100","min_col":"#b355ff","max_col":"#a300d9"},
- "mdf":{"name":"Magic Defense","description":"Reduces the damage of magical skills the actor is \ntargeted with.","cost":"1","gain":"1","max":"100","min_col":"#55ffe6","max_col":"#00d7b7"},
- "agi":{"name":"Agility","description":"Determines how soon the actor will be able to \npreform a turn in battle.","cost":"1","gain":"1","max":"100","min_col":"#fbff55","max_col":"#d9d300"},
- "luk":{"name":"Luck","description":"Influences various luck factors for the actor in \ntheir favor.","cost":"1","gain":"1","max":"100","min_col":"#ff55e6","max_col":"#cc00ad"},
- "hit":{"name":"Hit Rate","description":"Increases the chance of skills hitting their \ntarget.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "eva":{"name":"Evasion Rate","description":"Increases the likely-hood of an actor evading\na physical skill.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "cri":{"name":"Critical Rate","description":"Determines how likely an actor will preform \na critical hit.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "cev":{"name":"Critical Evasion Rate","description":"Decreases the likely-hood of skills targeting \nthe actor being critical.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mev":{"name":"Magic Evasion Rate","description":"Increases the likely-hood of an actor evading \na magical skill.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mrf":{"name":"Magic Reflection Rate","description":"The higher the value, the more likely magical \nreflection will occur.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "cnt":{"name":"Counter Attack Rate","description":"The higher the value, the more likely physical \nreflection will occur.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "hrg":{"name":"Hp Regeneration","description":"The rate in which the actor gains HP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mrg":{"name":"Mp Regeneration","description":"The rate in which the actor gains MP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "trg":{"name":"Tp Regeneration","description":"The rate in which the actor gains TP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "tgr":{"name":"Target Rate","description":"Increases the chance of the actor being attacked.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "grd":{"name":"Guard Effect Rate","description":"Increases the effectiveness of the actor's guard","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "rec":{"name":"Recovery Effect Rate","description":"Determines the effectiveness of recovery skills.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "pha":{"name":"Pharmacology","description":"Determines the effectiveness of recovery items.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mcr":{"name":"Mp Cost Rate","description":"The rate in which MP skills cost.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "tcr":{"name":"Tp Charge Rate","description":"The rate in which TP skills cost.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "pdr":{"name":"Physical Damage Rate","description":"The rate in which physical damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mdr":{"name":"Magical Damage Rate","description":"The rate in which magical damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "fdr":{"name":"Floor Damage Rate","description":"The rate in which floor damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "exr":{"name":"Experience Rate","description":"The rate in which the actor gains experience.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff"},
- "mtp":{"name":"Max TP","description":"The maximum amount of TP for the actor.","cost":"1","gain":"2","max":"200","min_col":"#6666ff","max_col":"#0000ff"}
- }));
- };
- //=============================================================================
- // DataManagerEX
- //=============================================================================
- DataManagerEX.getStatDistributionHtmlOptions = function() {
- return `<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>`;
- };
- 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 {
- 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.SRDTpDistAddon.maxTp = Game_Actor.prototype.maxTp;
- Game_Actor.prototype.maxTp = function() {
- if (!this._distributeTP) this._distributeTP = 0;
- return ICF.SRDTpDistAddon.maxTp.apply(this, arguments) + this._distributeTP;
- };
- ICF.SRDTpDistAddon.clearDistributeStats = Game_Actor.prototype.clearDistributeStats;
- Game_Actor.prototype.clearDistributeStats = function() {
- ICF.SRDTpDistAddon.clearDistributeStats.call(this);
- this._distributeTP = 0;
- };
- ICF.SRDTpDistAddon.getAbnormalParam = Game_Actor.prototype.getAbnormalParam;
- Game_Actor.prototype.getAbnormalParam = function(param) {
- if (param == "mtp") return this._distributeTP || 0;
- return ICF.SRDTpDistAddon.getAbnormalParam.apply(this, arguments);
- };
- ICF.SRDTpDistAddon.addAbnormalParam = Game_Actor.prototype.addAbnormalParam;
- Game_Actor.prototype.addAbnormalParam = function(param, value) {
- ICF.SRDTpDistAddon.addAbnormalParam.apply(this, arguments);
- if (param == "mtp") {
- this._distributeTP = this._distributeTP || 0;
- this._distributeTP += value;
- }
- };
- //=============================================================================
- // End of File
- //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement