I am essentially making a boss that is an endurance match, and the way to win is making it use all it's MP. And the idea is that when it gets below 30% HP it will use a skill that costs 50 MP to fully heal itself. The boss has 300 MP, and the idea is that on top of the 50 MP heal, the boss is also using other skills that use MP. So you just have to do high damage and endure. But the problem is I don't know how to make it use the heal skill but still have it use MP, because using a force action command in the troop to have it use the skill, when tested, it just uses the skill and doesn't lose MP, as the boss used it more than 6 times in testing. And ranking the skill as 9 in the move set wasn't guaranteed and the boss could easily be killed before intended.
is there a way to force an action and still have MP apply?
RPG Maker MV SupportIf it only uses this skill as part of the event, one easy approach is to just manually check the mp of the boss and subtract 50 if it has enough remaining
I don't see anything to manually check the MP of an enemy. I checked conditional branches, the conditions for the troop event, and the battle section. Didn't see anything, or I'm just blind.
Oh yeah, I don't think there's a specific conditiona type for it but you can have a conditional with the following script line like:
$gameTroop.members()[0].mp < 50
$gameTroop.members()[0].mp < 50
The situation could be the consequence of a plugin interfering there.
The default plugins do include paying the skill's cost.
The default plugins do include paying the skill's cost.
JavaScript:
BattleManager.startAction = function() {
var subject = this._subject;
var action = subject.currentAction();
var targets = action.makeTargets();
this._phase = 'action';
this._action = action;
this._targets = targets;
subject.useItem(action.item()); // <============
this._action.applyGlobal();
this.refreshStatus();
this._logWindow.startAction(subject, action, targets);
};
BattleManager.processForcedAction = function() {
if (this._actionForcedBattler) {
this._turnForced = true;
this._subject = this._actionForcedBattler;
this._actionForcedBattler = null;
this.startAction(); // <============
this._subject.removeCurrentAction();
}
};
Game_Battler.prototype.useItem = function(item) {
if (DataManager.isSkill(item)) {
this.paySkillCost(item);
} else if (DataManager.isItem(item)) {
this.consumeItem(item);
}
};
Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-force-an-action-and-still-have-mp-apply.158775/