Hey guys & girls,
is there a script call command to change a battlers element rate (increase or decrease the incoming elemental dmg)?
You can get these rates by battler.elementRate(<elementId>) but I haven't found a way to change it. Apparently battler.setElementRate(<elementId>, <rate>) doesn't exist. I'm using Yanfly's Element Core, but there is nothing of a funktion to do so. To be clear, I would like to change it inside of my states attach/detach method, or where ever, but I don't have the command for that yet.
Does anyone if there is a command for that?
Do you have Yanfly's Buff and States Core? If so, you can use:
<Custom Apply Effect>
code
</Custom Apply Effect>
<Custom Remove Effect>
code
</Custom Remove Effect>
These will run the code when the state is applied or removed. But I feel like you're over-complicating the problem. Can't you just alter the element rate through a trait?
Sure, I use the Buff and State Core 🙂
To specify what I'd like to do: I wanted to create states, which can be applied to either an ally or an enemy. Depending on wether the "victim" of that state is an actor (if(user.isActor()) or not, the state should act differently. For example I have the "Life Orb" - state, which, when attached to an ally will heal him at the end of his turn, but when attached to an enemy, the enemy has a chance on healing his target when he hits it. I have six different types of orbs with similar effects (all depend on wether the victim is an actor or not), but they also all (should) increase the damage of a specific element if the victim is an actor (easily done with Yanfly's Element Core, "user.elementMagnifyRate(id, x%)), but increase the incoming damage if the victim is an enemy. If so, the only way of getting that done is by altering the element rate in the states traits, just as you said. But that also would alter the element rate of the victim, if it was an actor, and that is something I certainly don't want.
So the easiest way of solving this is to use a script call similar to the "user.elementMagnifyRate(id, x%)" for the elementRate.
What I did now is to simply create twelve states, six states for actors and six states for enemies.
So I already did something to avoid that problem, but if anyone knows this command, I still would appreciate that intel 🙂