Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Trilobytes - No MP? No Problem!
- // TLB_NoMPNoProblem.js
- //=============================================================================
- var Imported = Imported || {};
- Imported.TLB_NoMPNoProblem = true;
- var TLB = TLB || {};
- TLB.NoMPNoProblem ??= {};
- TLB.NoMPNoProblem.version = 1.00;
- /*:
- * @target MZ
- * @plugindesc This plugin allows battlers to attack instead of using a skill
- * or item if they couldn't pay the cost.
- * @author John Clifford/Trihan
- *
- * @help
- * ============================================================================
- * Introduction
- * ============================================================================
- *
- * This plugin causes a battler who can't pay the cost for their chosen skill
- * or item to attempt a normal attack instead.
- *
- * ============================================================================
- * Plugin Commands
- * ============================================================================
- *
- * None
- *
- * ============================================================================
- * Plugin Parameters
- * ============================================================================
- *
- * None
- *
- * ============================================================================
- * Compatibility
- * ============================================================================
- *
- * May clash with other plugins that affect BattleManager's processTurn.
- *
- * ============================================================================
- * Changelog
- * ============================================================================
- *
- * Version 1.00:
- * - Finished plugin!
- *
- */
- Game_BattlerBase.prototype.meetsSkillConditionsBesidesCost = function(skill) {
- return (
- this.meetsUsableItemConditions(skill) &&
- this.isSkillWtypeOk(skill) &&
- !this.isSkillSealed(skill.id) &&
- !this.isSkillTypeSealed(skill.stypeId)
- );
- };
- TLB.NoMPNoProblem.BattleManager_processTurn = BattleManager.processTurn;
- BattleManager.processTurn = function() {
- const subject = this._subject;
- const action = subject.currentAction();
- if (action) {
- action.prepare();
- if (!action.isValid() && subject.meetsSkillConditionsBesidesCost(action.item())) {
- action.setAttack();
- }
- }
- TLB.NoMPNoProblem.BattleManager_processTurn.call(this);
- };
Add Comment
Please, Sign In to add comment