Hello, I'm trying to figure out a way to check if a certain actor deals physical or magic damage (determined by skill type not element) and to then apply a stacking buff for the other damage type until it is dealt (i.e. they use 4 physical attacks and get 4x stacks of magic attack buff, then when they do a magic attack it consumes all magic buff stacks and would give a stack of physical attack buff). I have yanfly plugins and assume something with notetags would help achieve this, though I'm not opposed to other solutions
MV Applying state to actor when dealing certain damage types
RPG Maker MV SupportHmmm, something like this:
EDIT: corrected the value stack calculation
<Custom Initiate Effect>if (this.isPhysical()) {user._magicalStack = user._magicalStack || 0;user._magicalStack += 1;}if (this.isMagical()) {user._physicalStack = user._physicalStack || 0;user._physicalStack += 1;}</Custom Initiate Effect><Custom Confirm Effect>if (this.isPhysical() && user._physicalStack) {value = value * (1 + 0.2 * user._physicalStack);delete user._physicalStack;}if (this.isMagical() && user._magicalStack) {value = value * (1 + 0.2 * user._magicalStack);delete user._magicalStack;}</Custom Confirm Effect>EDIT: corrected the value stack calculation
awesome! I assume this requires buff states core, right? Or is there another additional plugin I'd need?
also if this isn't too much to ask, if I were to want something like this but with elements, what would that look like in place of
Code:
(this.isPhysical())
Yeah Buff&States. Didn't test that though.
For the element I think it was:
For the element I think it was:
this.item().damage.elementId === Xalright it took a bit but I finally put it in the engine, and I don't know if it's working exactly as it should..? Though regardless, is there a way I can make the passive apply stacks of another state for buffing either damage type? I feel like having two separate states would communicate the current buff to the player better. Apologies for asking so many questions
If I could just make the passive state itself apply a separate buff state for either damage type that clears itself when it's respective damage type is dealt I should also be able to see what (if anything) is going wrong easier, which is why I'm not even sure how to describe what may or may not be going wrong
Seemed to work for me when I tested it quickly.
So did you give the actor a passive state with those notetags that is active?
But yeah I think the problem is that you said skill type, I thought you meant hit type (physical attack vs magical attack). That code checked hit type.
If you want to check skill type, you need to alter the conditionals. I think the script was like:
So did you give the actor a passive state with those notetags that is active?
But yeah I think the problem is that you said skill type, I thought you meant hit type (physical attack vs magical attack). That code checked hit type.
If you want to check skill type, you need to alter the conditionals. I think the script was like:
if (this.item().stypeId === id) (change id to number to check)Oh no it was supposed to be hit type. Something does happen when you gain one stack and use another, but instead of the damage simply increasing two damage numbers show up? I guess I should have done more debugging but mathematically the new total of the two numbers is more than 20% higher. It's a little weird is all
alright I actually found the solution- the numbers I was using were simply too small for the percentages to work intuitively. Is there a way I could just add a flat buff to atk/mat with the states?
Original thread: https://forums.rpgmakerweb.com/threads/applying-state-to-actor-when-dealing-certain-damage-types.182510/