Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Maliki's Base Power Text
- // MalBasePowerText.js
- // version 1.0
- //=============================================================================
- /*:
- * @plugindesc ver1.0 - Allows Devs to calculate the base damage for skills and show them in description windows.
- * @author Maliki79
- *
- * @param variableUsed
- * @desc The desired Variable to be used for this plugin.
- * Default: 1
- * @default 1
- *
- * @help To use this plugin, you must first choose a dedicated variable from your list in the database.
- * (It might be a good idea to name it in your database as well.)
- *
- * Once done, simply add the variable shortcut to the description of the skill.
- * for example: Skill does the following base damage: \V[1]
- * assuming the variable used is number 1 in the database.
- *
- * For those that incorporate target stats that need to be removed from the base damage calulations or have multiple hits etc.,
- * another damage formula may be used.
- * use the following notetag in your skill notes:
- * <baseDamageForm: formula>
- * This formula follows the same rules as the normal one, but should not refer to the target at all.
- * (Obviously, this does not take variance into account when showing the Base Power.)
- */
- let MalBPTvariableUsed = Number(PluginManager.parameters('MalBasePowerText')['variableUsed']);
- let MalBasePowerSMBActor = Scene_MenuBase.prototype.actor
- Scene_MenuBase.prototype.actor = function() {
- $gameParty.focusedActor = this._actor;
- return MalBasePowerSMBActor.call(this);
- };
- let MalBasePowerBMActor = BattleManager.actor;
- BattleManager.actor = function() {
- let actor = this._actorIndex >= 0 ? $gameParty.members()[this._actorIndex] : null;
- $gameParty.focusedActor = actor;
- return MalBasePowerBMActor.call(this);
- };
- let MalBasePowerWHsetItem = Window_Help.prototype.setItem
- Window_Help.prototype.setItem = function(item) {
- $gameVariables.setValue(MalBPTvariableUsed, this.getBaseDamage(item));
- MalBasePowerWHsetItem.call(this, item);
- };
- Window_Help.prototype.getBaseDamage = function(item) {
- if (!DataManager.isSkill(item)) return 0;
- if (!item) return 0;
- let value = 0;
- let a = $gameParty.focusedActor;
- let b = a; //for now
- let v = $gameVariables._data;
- if (item.meta.baseDamageForm) {
- value = Math.max(eval(item.meta.baseDamageForm), 0);
- } else {
- if (item.damage.formula) value = Math.max(eval(item.damage.formula), 0);
- }
- if (isNaN(value)) value = 0;
- return value;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement