See title, I tried adding an MP regen effect to the Attack skill but of course that just regenerates the MP of whatever you are attacking. Is there any way to make it regen the MP of the attacker instead? I also tried making a state but any effects are just applied to the scope, which in this case is the target. Thanks for help!
Attack that regens MP
RPG Maker MV SupportShaz just helped me out with this same thing in another thread. You can do something like
a.gainMp(10); a.atk * 4 - b.def * 2
That would be the simple normal attack, but the a.gainMp(10) part would regenerate 10 MP each time you attack.
a.gainMp(10); a.atk * 4 - b.def * 2
That would be the simple normal attack, but the a.gainMp(10) part would regenerate 10 MP each time you attack.
You rock, thanks! So just to be sure, the a stands for attacker and b is for target, right?
Yes, that is correct.
It doesn't seem to be working with percentages however. I tried a.gainMp(20%); a.atk * 4 - b.def * 2 so I guess I'm doing the syntax wrong. Would it be something like a.gainMp(a.mmp * .2); a.atk * 4 - b.def * 2 ?
Hmm, you know that totally worked, but know I am getting decimals in my hp... lol
Also, is there any way to have it show the blue numbers when they gain mp? I suppose that might be getting into plugin territory.. maybe the action sequences plugin?
Try using math.floor(a.gainMP(a.mmp * .2);a.atk * 4 - b.def * 2) That should round the final number down to the nearest integer, getting rid of your decimals in HP.
Thanks much! But it seems as though now my attack is just doing 0 damage. I also tried
math.floor(a.gainMP(a.mmp * .2)); a.atk * 4 - b.def * 2
But no luck.
math.floor(a.gainMP(a.mmp * .2)); a.atk * 4 - b.def * 2
But no luck.
Let's try a.gainMP(math.floor(a.mmp * .2)); a.atk * 4 - b.def * 2 That should only round the percent portion down, letting everything else operate as normal. If you don't mind, what are the atk/def that you are using for your control characters in this case?
Shouldn't you write it as 0.2 instead of just a .2?
Tried it but the attack is still for 0 and no mana regen.
Possibly? Not very experienced with javascript, so not sure if it requires a 0 in front of a decimal or not.
To OP, was the MP regen portion working? Just trying to verify if all we're trying to work out now is just the damage, or the whole thing still. On another note, it seems java is case sensitive, so capitalize the M in Math.floor.
To OP, was the MP regen portion working? Just trying to verify if all we're trying to work out now is just the damage, or the whole thing still. On another note, it seems java is case sensitive, so capitalize the M in Math.floor.
Oh no, that wasnt meant to be a fix. I just thought that MV uses the same system as ACE where you need to use 0.2 instead of just .2
Don't mind me. I did not even realize I was in the MV section. I was sure that I clicked on the ACE section
you are doing 0 damage because you got
a.gainMP
but it should be
a.gainMp <--- with a lowercase p
i made that mistake myself and did 0 damage, that's how i know 😀 haha... well, at least you posted it with an uppercase P
a.gainMP
but it should be
a.gainMp <--- with a lowercase p
i made that mistake myself and did 0 damage, that's how i know 😀 haha... well, at least you posted it with an uppercase P
:headshake: Sorry about that, going through the posts I see I capitalized the P originally, didn't even realize I did till now.
a.gainMp(Math.floor(a.mmp * 0.2)); a.atk * 4 - b.def * 2
Works perfectly! thanks guys for your help!!
Original thread: https://forums.rpgmakerweb.com/threads/attack-that-regens-mp.47734/