Attack that regens MP

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
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!
 

TaraIzumi

Villager
Member
Joined
Oct 27, 2015
Messages
25
Reaction score
13
First Language
German
Shaz 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.
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
You rock, thanks! So just to be sure, the a stands for attacker and b is for target, right?
 
Last edited by a moderator:

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
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?
 
Last edited by a moderator:

okugi

Villager
Member
Joined
Oct 27, 2015
Messages
28
Reaction score
6
First Language
English
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.
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

okugi

Villager
Member
Joined
Oct 27, 2015
Messages
28
Reaction score
6
First Language
English
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?
 
Last edited by a moderator:

Sinweaver

Veteran
Veteran
Joined
Aug 11, 2015
Messages
598
Reaction score
418
First Language
English
Primarily Uses
Shouldn't you write it as 0.2 instead of just a .2?
 

okugi

Villager
Member
Joined
Oct 27, 2015
Messages
28
Reaction score
6
First Language
English
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.   
 
Last edited by a moderator:

Sinweaver

Veteran
Veteran
Joined
Aug 11, 2015
Messages
598
Reaction score
418
First Language
English
Primarily Uses
Tried it but the attack is still for 0 and no mana regen.
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
 

TaraIzumi

Villager
Member
Joined
Oct 27, 2015
Messages
25
Reaction score
13
First Language
German
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 :D haha... well, at least you posted it with an uppercase P
 

okugi

Villager
Member
Joined
Oct 27, 2015
Messages
28
Reaction score
6
First Language
English
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 :D 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.
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
: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!!
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top