Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
237
Reaction score
85
First Language
english
Primarily Uses
N/A
Hello, everyone.


I was wondering if it was possible to check if a state is active on an Ally and then not let the spell affect them if they have the state? 


I made a character have a spell that gives a state that increases the Allies MHP by 10% for the entire battle. To make it so the player doesn't go from, say, 100/100 to 100/110 MHP and be missing the 10% MHP I made it so that it also heals that player by 10% of their MHP. I want the spell to not work if the player already has the state on them so that the spell can't be used to heal the Ally by 10% of their MHP if they already have the buff(heal abuse). Is this possible without scripts/JS? 
 

Joewoof

Veteran
Veteran
Joined
Oct 28, 2015
Messages
123
Reaction score
56
First Language
English
Try giving the spell an Element and have it inflict a State that grants 0% weakness against that Element. Make sure you use the formula box to heal, not the Effects list.
 

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
114
Reaction score
155
First Language
English
Primarily Uses
RMVXA
If MV works like Ace, then you can put this in the damage formula box (I can't test this right now but i'm almost sure this should work)


Type: hp heal


    b.state?(x) : b.hp_rate*0.1 ? b.add_state(x)


Replace x with the id of your state
 
Last edited by a moderator:

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,458
First Language
Portuguese
Primarily Uses
The idea that @7Soul mention works, but the code will not work on MV. (in fact this code woudn't work even on VXAce).


var result = b.isStateAffected(X) ?  0  : b.mhp * 0.1; b.addState(X); result;
 
Last edited by a moderator:

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
237
Reaction score
85
First Language
english
Primarily Uses
N/A
Try giving the spell an Element and have it inflict a State that grants 0% weakness against that Element. Make sure you use the formula box to heal, not the Effects list.

I tried this and for some reason it heals me BEFORE it buffs me so im still 10% short on HP :(

The idea that @7Soul mention works, but the code will not work on MV. (in fact this code woudn't work even on VXAce).


var result = b.isStateAffected(X) ?  0  : b.mhp * 0.1; b.addState(X); result;

I copied that and put the State that buffs me in for X but it doesnt heal me. It says "0" for when it attempts to heal me.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,458
First Language
Portuguese
Primarily Uses
I copied that and put the State that buffs me in for X but it doesnt heal me. It says "0" for when it attempts to heal me.

Did you notice that there are two "X" in the formula (one for isStateAffected and one for  addState) , right?


I tested it here and it worked fine.


If you added the two values, can you paste the code you used here?
 
Last edited by a moderator:

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
237
Reaction score
85
First Language
english
Primarily Uses
N/A
Did you notice that there are two "X" in the formula (one for isStateAffected and one for  addState) , right?


I tested it here and it worked fine.


If you added the two values, can you paste the code you used here?

My bad! Tested and it works! Thank you so much!
 

Latest Threads

Latest Profile Posts

You look like you had a rough day...Here, have a Baby Panda!

A certain person better sell his stock while he still can, because it looks like it's going to take an unrecoverable nose dive.
7 years of trying to plan this project... and it got an official plotline today. 7 years. I really just have no concept of order huh GHJGSJHGVGHASFH.
Doing RPG Maker News for 24th October 2021

I'm not sure how to do this so I'll just ask here, Wheres a good place to post your game (for free) once its done?

Forum statistics

Threads
116,063
Messages
1,095,442
Members
151,425
Latest member
EarthToEvan
Top