Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ICF-Soft Plugins - Formula Shortcut
- // ICFSoft_FormulaShortcut.js
- //=============================================================================
- var Imported = Imported || {};
- Imported.ICFSoft_FormulaShortcut = true;
- var ICF = ICF || {};
- ICF.FormulaShortcut = ICF.FormulaShortcut || {};
- //=============================================================================
- /*:
- * @plugindesc v1.00 This plugin adds a lot of usefull shortcuts to use in
- * formulas.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introduction
- * ============================================================================
- *
- * In skills and items there are fields to place a formula to determine damage
- * and heal.
- * Also is known that some plugins enables more places to put formulas like in
- * notes, comments, plugin params, etc...
- * Sometimes there isn't enough space or formulas become too complicated.
- *
- * With this plugin you can use some shortcuts and simplify formulas to make
- * the effect you want.
- *
- * ============================================================================
- * How to use
- * ============================================================================
- *
- * You can use shortcuts same way as other params inside formulas:
- *
- * highparam() lowparam()
- *
- * - To check best or worst param.
- *
- * hprate() hppercent()
- *
- * - You can check how much is hp filled in rate (0-1) or percent (0-100).
- * Same is aplicable for mp and tp.
- *
- * wound() mpl() etp()
- *
- * - You can also check how much hp/mp are losed or tp empty.
- * Can also check rate or percent.
- *
- * teamhp() teamwound() allteamwound()
- *
- * - You can check entire team hp remain, hp loss (alive members) and all hp
- * loss (alive and defeated ones). Also for mp and tp.
- *
- * teamatk() avgatk() entireatk()
- *
- * - You can use the attack of the entire alive team, the average attack and
- * the attack of the entire team (alive and defeated ones).
- * Aplicable for def, mat, mdf, agi and luk.
- *
- * ============================================================================
- * 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 Este complemento añade atajos útiles para simplificar las
- * fórmulas.
- * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
- *
- * @help
- * ============================================================================
- * Introducción
- * ============================================================================
- *
- * En las habilidades y objetos hay campos en donde poner una fórmula para
- * calcular el daño y la curación.
- * Además se sabe que hay plugins que permiten poner fórmulas en las notas,
- * comentarios, parámetros en el plugin, etc...
- * Varias veces no hay espacio suficiente o las fórmulas se complican.
- *
- * Con este plugin puedes usar atajos y simplificar fórmulas consiguiendo el
- * efecto deseado.
- *
- * ============================================================================
- * Uso
- * ============================================================================
- *
- * Puedes usar los atajos del mismo modo que otros parámetros en las fórmulas:
- *
- * highparam() lowparam()
- *
- * - Para usar el mejor o el peor parámetro.
- *
- * hprate() hppercent()
- *
- * - Comprobar cuanta vida queda en proporción (0-1) o porcentaje (0-100).
- * También se aplica a mp y tp.
- *
- * wound() mpl() etp()
- *
- * - Además puedes comprobar cuanto hp/mp se ha perdido o tp vacío.
- * Incluso en proporción o porcentaje.
- *
- * teamhp() teamwound() allteamwound()
- *
- * - Para comprobar cuanta hp queda a todo el equipo, el hp perdido de los que
- * siguen en pie o el hp perdido de todos (en pie y caidos).
- * También para mp y tp.
- *
- * teamatk() avgatk() entireatk()
- *
- * - Puedes usar el ataque de todo el equipo en pie, ya media de sus ataques
- * y el ataque de todos (en pie y caidos).
- * También para def, mat, mdf, agi y luk.
- *
- * ============================================================================
- * Incompatibilidades
- * ============================================================================
- *
- * No se conocen complementos que sean incompatibles hasta la fecha.
- *
- * ============================================================================
- * Problemas conocidos
- * ============================================================================
- *
- * Por el 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.
- *
- * ============================================================================
- */
- //=============================================================================
- //=============================================================================
- // Game_BattlerBase
- //=============================================================================
- Game_BattlerBase.prototype.highparam = function() {
- return Math.max(this.param(2),this.param(3),this.param(4),this.param(5),this.param(6),this.param(7));
- };
- Game_BattlerBase.prototype.lowparam = function() {
- return Math.min(this.param(2),this.param(3),this.param(4),this.param(5),this.param(6),this.param(7));
- };
- Game_BattlerBase.prototype.hprate = function() {
- return this.hp / this.mhp;
- };
- Game_BattlerBase.prototype.hppercent = function() {
- return Math.floor(100 * this.hp / this.mhp);
- };
- Game_BattlerBase.prototype.wound = function() {
- return this.mhp - this.hp;
- };
- Game_BattlerBase.prototype.woundrate = function() {
- return 1 - (this.hp / this.mhp);
- };
- Game_BattlerBase.prototype.woundpercent = function() {
- return 100 - Math.floor(100 * this.hp / this.mhp);
- };
- Game_BattlerBase.prototype.mprate = function() {
- return this.mp / this.mmp;
- };
- Game_BattlerBase.prototype.mppercent = function() {
- return Math.floor(100 * this.mp / this.mmp);
- };
- Game_BattlerBase.prototype.mpl = function() {
- return this.mmp - this.mp;
- };
- Game_BattlerBase.prototype.mplrate = function() {
- return 1 - (this.mp / this.mmp);
- };
- Game_BattlerBase.prototype.mplpercent = function() {
- return 100 - Math.floor(100 * this.mp / this.mmp);
- };
- Game_BattlerBase.prototype.tprate = function() {
- return this.tp / this.maxTp();
- };
- Game_BattlerBase.prototype.tppercent = function() {
- return Math.floor(100 * this.tp / this.maxTp());
- };
- Game_BattlerBase.prototype.etp = function() {
- return this.maxTp() - this.tp;
- };
- Game_BattlerBase.prototype.etprate = function() {
- return 1 - (this.tp / this.maxTp());
- };
- Game_BattlerBase.prototype.etppercent = function() {
- return 100 - Math.floor(100 * this.tp / this.maxTp());
- };
- Game_BattlerBase.prototype.teamparam = function(paramid) {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.param(paramid);
- }, 0);
- };
- Game_BattlerBase.prototype.avgparam = function(paramid) {
- var ary = this.friendsUnit().aliveMembers();
- return ary.reduce(function(r, battler) {
- return r + battler.param(paramid);
- }, 0) / ary.length;
- };
- Game_BattlerBase.prototype.entireparam = function(paramid) {
- return this.friendsUnit().members().reduce(function(r, battler) {
- return r + battler.param(paramid);
- }, 0);
- };
- Game_BattlerBase.prototype.teamhp = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.hp;
- }, 0);
- };
- Game_BattlerBase.prototype.teamwound = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.mhp - battler.hp;
- }, 0);
- };
- Game_BattlerBase.prototype.allteamwound = function() {
- return this.friendsUnit().members().reduce(function(r, battler) {
- return r + battler.mhp - battler.hp;
- }, 0);
- };
- Game_BattlerBase.prototype.teammp = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.mp;
- }, 0);
- };
- Game_BattlerBase.prototype.teammpl = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.mmp - battler.mp;
- }, 0);
- };
- Game_BattlerBase.prototype.allteammpl = function() {
- return this.friendsUnit().members().reduce(function(r, battler) {
- return r + battler.mmp - battler.mp;
- }, 0);
- };
- Game_BattlerBase.prototype.teamtp = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.tp;
- }, 0);
- };
- Game_BattlerBase.prototype.teametp = function() {
- return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
- return r + battler.maxTp() - battler.tp;
- }, 0);
- };
- Game_BattlerBase.prototype.allteametp = function() {
- return this.friendsUnit().members().reduce(function(r, battler) {
- return r + battler.maxTp() - battler.tp;
- }, 0);
- };
- Game_BattlerBase.prototype.teamatk = function() {
- return this.teamparam(2);
- };
- Game_BattlerBase.prototype.teamdef = function() {
- return this.teamparam(3);
- };
- Game_BattlerBase.prototype.teammat = function() {
- return this.teamparam(4);
- };
- Game_BattlerBase.prototype.teammdf = function() {
- return this.teamparam(5);
- };
- Game_BattlerBase.prototype.teamagi = function() {
- return this.teamparam(6);
- };
- Game_BattlerBase.prototype.teamluk = function() {
- return this.teamparam(7);
- };
- Game_BattlerBase.prototype.avgatk = function() {
- return this.avgparam(2);
- };
- Game_BattlerBase.prototype.avgdef = function() {
- return this.avgparam(3);
- };
- Game_BattlerBase.prototype.avgmat = function() {
- return this.avgparam(4);
- };
- Game_BattlerBase.prototype.avgmdf = function() {
- return this.avgparam(5);
- };
- Game_BattlerBase.prototype.avgagi = function() {
- return this.avgparam(6);
- };
- Game_BattlerBase.prototype.avgluk = function() {
- return this.avgparam(7);
- };
- Game_BattlerBase.prototype.entireatk = function() {
- return this.entireparam(2);
- };
- Game_BattlerBase.prototype.entiredef = function() {
- return this.entireparam(3);
- };
- Game_BattlerBase.prototype.entiremat = function() {
- return this.entireparam(4);
- };
- Game_BattlerBase.prototype.entiremdf = function() {
- return this.entireparam(5);
- };
- Game_BattlerBase.prototype.entireagi = function() {
- return this.entireparam(6);
- };
- Game_BattlerBase.prototype.entireluk = function() {
- return this.entireparam(7);
- };
- //=============================================================================
- // End of File
- //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement