I have consumables that will permanently increase stats, and want to make it so that, if an actor targeted with one of these items already has the given stat at the maximum value allowed, the item will say it will have no effect. At the moment, I am doing this through a Common Event, with the item inflicting an invisible dummy state to track who the item was used on, and the Common Event intended to refund the item if it would fail to raise a stat.
Where I'm stuck is how to check a character's stats ignoring increases from their equipment and Param Rates. My original plan was to tally up a character's parameter bonuses from their equipped items, and then subtract it to get their "real" stat.
I don't remember everything I've tried (it was a lot thanks tot he Script Call thread), but the final thing I attempted before giving up and making this thread was a Conditional Branch using a script, being:
The intention with the above was to take Actor 1's Attack stat, then check if they had a weapon; if no, nothing would be subtracted from their Attack (since there would be no need), but if they did have a weapon equipped, that weapon's Attack parameter would be subtracted to get the Actor's base value. Regardless, if this resulted in less than the stat limit of 999, then the item would be consumed and increase the Attack stat accordingly. Otherwise, a message would be given saying it won't have any effect, and the item would be refunded. However, the above always returns the "fail" message. I also learned that it would do so if I tried to check equipment, and a given equip slot was unoccupied.
I'm sure there's a much simpler way to get what I want - getting an Actor's given stat without equipment or Param Rates, but factoring in growth from Levels and consumables - butI am not smart and I am out of ideas.
I am using Yanfly's Base Param Control and Equip Core. The latter is important to note, since I intend to have characters able to equip two Accessories.
Where I'm stuck is how to check a character's stats ignoring increases from their equipment and Param Rates. My original plan was to tally up a character's parameter bonuses from their equipped items, and then subtract it to get their "real" stat.
I don't remember everything I've tried (it was a lot thanks tot he Script Call thread), but the final thing I attempted before giving up and making this thread was a Conditional Branch using a script, being:
Code:
$gameActors.actor(1).atk - ($gameActors.actor(1).equips()[0] === null ? 0 : $gameActors.actor(1).equips()[0].params[2];) < 999
I'm sure there's a much simpler way to get what I want - getting an Actor's given stat without equipment or Param Rates, but factoring in growth from Levels and consumables - but
I am using Yanfly's Base Param Control and Equip Core. The latter is important to note, since I intend to have characters able to equip two Accessories.