Power-Up Punch-esque skill?

So, one of the skills I wanna make in my game is a low-damaging (1d3) skill that, as it's used, raises the user's MAT.


My idea was to use a series of states that raised MAt by 10%, 15%, and 25%, respectively. In theory, the first time the user casts the spell, they would gain the first state. The second time, they would gain the second state and lose the first one, then the third time they would gain the third and lose the second. I tried making a formula to do so, but I'm running into a problem. The skill deals 0 damage every time I use it, and while it does add the second and third states, it doesn't remove any of them. Would someone mind taking a look at my formula and telling me what I've done wrong? (I've cut it to multiple lines to make it easier to read, but in the actual database it's only one line.)


a.isStateAffected(29)? (a.addState(30) && a.removeState(29) && (Math.randomInt(3) + 1 + ((a.mat - 10) * 0.5))) :


a.isStateAffected(28)? (a.addState(29) && a.removeState(28) && (Math.randomInt(3) + 1 + ((a.mat - 10) * 0.5))) :


(a.addState(28) && Math.randomInt(3) + 1 + ((a.mat - 10) * 0.5))


When I look at it, the way it reads to me is "If the user is affected by state 29 (the tier 2 state), add state 30 to the user (tier 3) AND remove state 29 from the user AND deal (0 to 2, plus 1, plus half of the user's MAT stat above 10) damage. If not, if the user is affected by state 28 (tier 1), add state 29 to the user AND remove state 28 from the user AND deal damage. If not, add state 28 to the user AND deal damage." This is obviously not how the program reads it, though. Any idea where I went wrong? Thanks!
Yanfly lunatic destruction will help with this


maybe himes progressive states if it allows for intractability


actually i think there may be a script out there that does this
Well, yeah. I'm certain this could  be done with Yanfly's Lunatic mode. I'm just not sure how to do so. That's the reason I'm asking here. Thanks, though 🙂
Well, yeah. I'm certain this could  be done with Yanfly's Lunatic mode. I'm just not sure how to do so. That's the reason I'm asking here. Thanks, though 🙂

Well, here's how you do it, in that case:


Requirements: YEP_BattleEngineCore (I think. If this doesn't work, I'll look up which one it is.)


1) Create the three states.


2) In the skill you're using, add this notetag:


<After Eval>


var stateOne = [insert ID of tier 1 state];


var stateTwo = [insert ID of tier 2 state];


var stateThree = [insert ID of tier 3 state];


if (user.isStateAffected(stateOne)){


   target.removeState(stateOne);


   target.addState(stateTwo);


}


else if (user.isStateAffected(stateTwo)){


   target.removeState(stateTwo);


   target.addState(stateThree);


}


else if (!user.isStateAffected(stateThree)){


   target.addState(stateOne);


}


</After Eval>


Make absolutely sure that the wording is the exact same as mine (except you can rename the words between "var" and "=" in the first 3 lines). It won't work if it's at all different.
Well, here's how you do it, in that case:


Requirements: YEP_BattleEngineCore (I think. If this doesn't work, I'll look up which one it is.)


1) Create the three states.


2) In the skill you're using, add this notetag:


<After Eval>


var stateOne = [insert ID of tier 1 state];


var stateTwo = [insert ID of tier 2 state];


var stateThree = [insert ID of tier 3 state];


if (user.isStateAffected(stateOne)){


   target.removeState(stateOne);


   target.addState(stateTwo);


}


else if (user.isStateAffected(stateTwo)){


   target.removeState(stateTwo);


   target.addState(stateThree);


}


else if (!user.isStateAffected(stateThree)){


   target.addState(stateOne);


}


</After Eval>


Make absolutely sure that the wording is the exact same as mine (except you can rename the words between "var" and "=" in the first 3 lines). It won't work if it's at all different.



That works, but it applies the states on the target, not the user, so it can't reach the higher tiers anyway. And when I tried to replace target. with user., you were right: doesn't work at that point.
That works, but it applies the states on the target, not the user, so it can't reach the higher tiers anyway. And when I tried to replace target. with user., you were right: doesn't work at that point.

It was supposed to be user. and not target., I mistyped. Oops. I wonder why that didn't work, though.
It was supposed to be user. and not target., I mistyped. Oops. I wonder why that didn't work, though.



Okay, check that.


I changed it back to user. and it's working now. Except that it still isn't applying any of the higher tiers. It's still only applying the first one... Hmm...
Okay, check that.


I changed it back to user. and it's working now. Except that it still isn't applying any of the higher tiers. It's still only applying the first one... Hmm...

I figured out what the problem is: The plugin you need is actually YEP_SkillCore, not YEP_BattleEngineCore. I tested it and looked at the help file of the Skill Core plugin, and yep, that's the problem.
I figured out what the problem is: The plugin you need is actually YEP_SkillCore, not YEP_BattleEngineCore. I tested it and looked at the help file of the Skill Core plugin, and yep, that's the problem.

I have Yanfly's Skill Core, actually. I needed a way to apply HP cost for certain skills, haha XD


Still isn't working right. I can get the first stage but not the later two.
I have Yanfly's Skill Core, actually. I needed a way to apply HP cost for certain skills, haha XD


Still isn't working right. I can get the first stage but not the later two.

I'm not sure why it's not working, then. It works for me, and I used the same solution.
Actually, I just got it to work.


After I removed the vars and made it (user.isStateAffected(28)) instead of (user.isStateAffected(stageOne)) it started working perfectly.


Thanks for all the help, Gugump!
Actually, I just got it to work.


After I removed the vars and made it (user.isStateAffected(28)) instead of (user.isStateAffected(stageOne)) it started working perfectly.


Thanks for all the help, Gugump!

Okay, I just thought of another solution, but I guess that wasn't the problem. And you are welcome!

Original thread: https://forums.rpgmakerweb.com/threads/power-up-punch-esque-skill.62598/