- Joined
- Oct 15, 2022
- Messages
- 6
- Reaction score
- 1
- First Language
- Portuguese
- Primarily Uses
- RMMV
I'm making an accessory inspired by the pokémon's air balloon, it gives immunity to an element until the user suffers an attack from another type of element. I did this by creating a state with a trait that gives immunity to the psychic type, and giving that passive state to the aluminum hat. I found a code and tried to adapt it to my purpose, but I don't know java and the effect isn't removed when damaged. If anyone can help, I'd be grateful!
That's the code I found and put on the state notetag:
Here is the link to the trend I got the link from:
forums.rpgmakerweb.com
That's the code I found and put on the state notetag:
Code:
<Custom Apply Effect>
var atkcount = 1; //This is the attack counter. Change it to fit your purpose
target._attackCount = atkcount;
target.setStateCounter(44, target._attackCount); //Set a counter to your state. Change X to your state ID
</Custom Apply Effect>
<Custom React Effect>
//Check if actor takes dmg
if (value > 0 && !this.isHpRecover()){
//Decrease the attack counter by 1
target._attackCount -= 1;
//Set a counter to your state. Change X to your state ID
target.setStateCounter(44, target._attackCount);
//Check if attack counter reaches 0
if (target._attackCount <=0){
//Remove the state. Change X to your state ID
target.removeState(44);}}
</Custom React Effect>
<Custom Remove Effect>
user._attackCount = undefined;
</Custom Remove Effect>
Here is the link to the trend I got the link from:
(Shield)State from item that is removed after one hit?
Im stumped trying to make an item that increases defence by 50% until you take damage, once each battle (a sort of consumable armor buff). I created the state which increases DEF and is removed by damage. Then I use Yanfly auto passive to put it on my shield, however the state will never be...
