One of the main battle features for the game I'm making is that at turn-start you randomly get between 2 - (Max MP) Mana. I've tried figuring this out, and I've looked all around here and reddit, but I can't seem to find a way to do this. I'd like to ask if anyone has an idea of how I could manage this? Thanks in advance!
(I also have all of those Yanfly Engine plugins, if that helps)
Are you using normal battle system? And do you want the gain mp to happen at turn start (edit: input start) for all or when the actor starts inputting?
If you have normal battle system and it's okay if it happens for everyone at the same time, I think this works (copy paste to notepad, save as .js file to plugin folder and add as plugin):
const _myEdit1_BattleManager_startInput = BattleManager.startInput;
BattleManager.startInput = function() {
_myEdit1_BattleManager_startInput.call(this);
$gameParty.battleMembers().forEach(member => {
if (member.isAlive()) {
const mp = Math.max(2, Math.randomInt(member.mmp+1));
member.gainMp(mp);
member.startDamagePopup();
}
})
};
But yeah, it depends on your system.
EDIT: Then again, if you're using the normal system, Yanfly notetags should work LOL.
EDIT2: Or just troop events. I got a bit confused because with some systems it's not as simple to make a turn start effect when it's not the turn count affecting everyone.
EDIT3: Or actually I take it back, troop events won't work (unless you make end of turn mean start of turn), but yeah whatever, the Yanfly notetags should work.
EDIT4: REEEE actually I think you can't use Yanfly notetags for that either LOL. So use that plugin I posted and ignore my edits.