OpalWysty

Mainly scared and confused
Member
Joined
Dec 3, 2021
Messages
4
Reaction score
4
First Language
English
Primarily Uses
RMMV
I have a skill that should remove a random negative state from an actor. Like a "cure".

I've been playing around with the program but can't seem to find the answer. Do I have to use a plugin?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,165
Reaction score
1,869
First Language
English
Primarily Uses
RMMV
Yes, because in the default engine there's no such thing as a "negative" state, there are just states. You can use something like Yanfly's State Categories to add positive and negative labels, and then manipulate those with skills.
 

pawsplay

Veteran
Veteran
Joined
Mar 29, 2012
Messages
365
Reaction score
122
First Language
English
Primarily Uses
RMMV
If you already know the states you want to remove, you can just a random number.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,165
Reaction score
1,869
First Language
English
Primarily Uses
RMMV
True, you could create an array of the IDs of your states that you consider to be negative, check if the target has each one and make a new array (presuming you want it to be guaranteed to remove a negative status if possible)...it's getting a bit complicated for a damage formula, and you'd have to manually add to the list every time you make a new state that should be negative.

But, for example...
var negStates=[5, 21, 33, 56]; var targStates=[]; for (var i=0; i<negStates.length; i++) {if (b.isStateAffected(negStates[i]) targStates.push(negStates[i]);}; if (targStates.length>1) b.removeState(targStates[Math.randomInt(targStates.length)]); Your healing formula here

And you replace the numbers listed in the brackets after negStates= with all of the IDs of negative states you want the skill to be able to remove.

If I typed that mess out correctly, that should remove a random negative state that the target has before healing them.
 

Latest Threads

Latest Posts

Latest Profile Posts

You thought kids rooms were messy. Look at this.
Back in the house and I'm hungry
Yoshi!
DNPwhy.gif

You're using that item wrong... TwT

Trying to get the mechanics down for a cute, story-driven board game! I think I've accomplished dice movement, item effects, and activating a space's event when you land on it. Art is WIP. Hope to open a thread about the game soon!
My entire family and I have Covid... If it's this bad with the vaccine, without must be terrible. Stay safe, everyone. This thing is a doozy.

Forum statistics

Threads
118,527
Messages
1,116,642
Members
155,543
Latest member
meekaachrive
Top