sheeshkebab1812

Veteran
Veteran
Joined
Feb 3, 2022
Messages
35
Reaction score
11
First Language
English
Primarily Uses
RMMV
I'm using the Yanfly's Barrier plugin and I was wondering if there is a way to make a Barrier that will regenerate per turn but only up to the amount of shield they have. So if a barrier is 50% of their hp then heal 20% of that barrier per turn.

 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
set up a state to go along with the barrier in which every turn start or end it calculates what you need.
 

sheeshkebab1812

Veteran
Veteran
Joined
Feb 3, 2022
Messages
35
Reaction score
11
First Language
English
Primarily Uses
RMMV
set up a state to go along with the barrier in which every turn start or end it calculates what you need.
What would I put in the state and will it only affect the barrier from the armour or all barriers that the user will get?
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
state:
Code:
<custom turn start effect>
   //get the battler hp rate
   var userHP = user.hpRate();

   //create variable to store the points to be regen'ed. here they start off as the max hp
   var rPoints = user.mhp;
 
   //do you math below. in this example, it restores the remaining hp rate as barrier points
   rPoints = Math.floor(rPoints * userHP);

   //add the barrier points. those are unexpiring points. to make then expire, change zero to a number of turns
   user.gainBarrier(rPoints, 0);
</custom turn start effect>

all of this could have been done without creating variables, but i wanted to make things easier to understand and edit.
 

sheeshkebab1812

Veteran
Veteran
Joined
Feb 3, 2022
Messages
35
Reaction score
11
First Language
English
Primarily Uses
RMMV
state:
Code:
<custom turn start effect>
   //get the battler hp rate
   var userHP = user.hpRate();

   //create variable to store the points to be regen'ed. here they start off as the max hp
   var rPoints = user.mhp;
 
   //do you math below. in this example, it restores the remaining hp rate as barrier points
   rPoints = Math.floor(rPoints * userHP);

   //add the barrier points. those are unexpiring points. to make then expire, change zero to a number of turns
   user.gainBarrier(rPoints, 0);
</custom turn start effect>

all of this could have been done without creating variables, but i wanted to make things easier to understand and edit.
Thank you so much
 

Latest Threads

Latest Posts

Latest Profile Posts

Well, I hope things go well tomorrow. I think I might be coming down with a cold, so gonna warm up some chicken soup and sleep.
Status too sad. Pls delete, mods. Thanks.
The most important thing to design your game for is fun. If a game isn't fun, why would anyone want to play it? Well, that and "can you play the game?". Anything else is incidental.
I just realized that I have been on this site for nearly 1/3 of my life...
How awesome is that?! Just in love with those eyes!!
Made by @Kato-A !
Hakuen double size_Kato.png

Forum statistics

Threads
124,678
Messages
1,165,183
Members
163,486
Latest member
Alerxuwu
Top