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 Profile Posts

Fun question - how do you manage the scope of your projects? All of my projects seem to balloon until they pop and they are suddenly nonexistent!
no I did not just have to write a song three different times because my music software doesn't support tempo changes!!
I WILL defeat this demonic USB connection notification bug
ScreenShot_8_15_2022_6_22_24.png
Mike trying to dodge the Memory Pawns invading Bantam Street. I like how the filters I used on the map almost make it look like the street is wet in a sense.
Come watch as Studio Blue plays OMORI live on the final RPG Maker Critiques stream!

Forum statistics

Threads
124,568
Messages
1,164,450
Members
163,385
Latest member
goonfuture
Top