Slimsy Platypus

Veteran
Veteran
Joined
May 17, 2016
Messages
117
Reaction score
132
Primarily Uses
Is there a way for a state to do damage based on how many turns it has remaining? For example, I'd like to have a damage/heal over time do 400 damage when the there are 4 turns left, 300 when there are 3 turns left, 200 when there are 2 turns left, etc.

I'm currently using Yanfly's Buffs and States as well as Extended Damage over Time but I haven't found any syntax that can return the number of turns on a state ID that can be used in a damage formula.

Thanks in advance for any assistance!
 

M.I.A.

Goofball Extraordinaire
Veteran
Joined
Jul 13, 2012
Messages
915
Reaction score
783
First Language
English
Primarily Uses
If you don't get an affirmative response on this one using Yanfly's plugins, there is a "Progressive States" plug in (I forgot who made it..) that you could use. You would just need 4 states to accomplish this.

State 400 - heals for 400HP, progresses into State 300.
State 300 - heals for 300HP, progresses into State 200.. etc.

Best,
MIA :)
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
698
Reaction score
219
First Language
Vietnamese
Primarily Uses
RMMV
I think i can help you. However, i haven't tested this so i cannot guarantee that it will work properly.

<Custom Apply Effect>
//Setup a flag to remember target's turn. Remember to set your turns to remove this state in your Database equal to this number. If you want to reset turn counter when this state is applied, just remove target._turnCounter ||
target._turnCounter = target._turnCounter || 4;
</Custom Apply Effect>


<Custom Regenerate Effect>
//Check if target's turn is higher than 0
if (target._turnCounter > 0){
//Get the amount of HP recovered
var heal = target._turnCounter * 100;
//Heal target
target.gainHp(heal);
//Decrease target's turns by 1
target._turnCounter -= 1;}
</Custom Regenerate Effect>

<Custom Remove Effect>

//Remove target's turn counter when the state is gone.
target._turnCounter = undefined;
</Custome Remove Effect>
 

Slimsy Platypus

Veteran
Veteran
Joined
May 17, 2016
Messages
117
Reaction score
132
Primarily Uses
@JamesRyan That works perfectly as intended. Thanks so much for your time.

Unfortunately I am getting a conflict with another plugin during the Custom Remove Effect and I just don't understand well enough to get around it. I'm thinking through some workarounds now, thanks again!
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
698
Reaction score
219
First Language
Vietnamese
Primarily Uses
RMMV
The <Custom Remove Effect> part is important, so you should do something with this incompatibility (even get rid of the plugin causing it if there is no other choices).
 

Latest Threads

Latest Posts

Latest Profile Posts

Wondering how big I can make Dorothy's skill menu before the game just becomes irredeemably bad.
Studio Blue is playing the RPG Maker game Phil Alone live now! Phil may be alone, but you don't have to be, come join us in chat!

I'm in desperate need of environment sprites and tilesets for my game. If anyone is interested please DM me im willing to pay.
All badges and prizes for the Let's Make a Scene Heart Edition event SHOULD be out. If you participated and haven't received either or both, send me a PM.

Forum statistics

Threads
109,208
Messages
1,043,068
Members
141,724
Latest member
DonTaco
Top