AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
In my project I've replaced the default buffs with states and I wanted to implement a feature to prevent accidental uses of buffing skills when they aren't necessary to use since the buff states don't disappear over turns like the default buffs.

<Custom Requirement>
if ($gameParty.gold() > 1000) {
value = true;
} else {
value = false;
}
</Custom Requirement>

What I would like to do is have the skill be disabled if all of the active battle party members have specific states (the highest tiers of the buffs). So let's say the skill raises 'offensive parameters' (both the ATK and M.ATK parameters). The custom requirement would be that if all the active party members in battle have the max tier states for both ATK and M.ATK, the skill in question should be disabled.

Would anyone know how to write the syntax for this?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,149
Reaction score
10,714
First Language
Czech
Primarily Uses
RMMV
for (i in $gameParty.members()) {
if (!$gameParty.members()[0],isStateAffected(4))... Rest is easy :)
 
Last edited:

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
The notetag would be:

<Custom Requirement>
var states = [id1, id2, id3]; // Add as many state ids as you want checked.
var members = $gameParty.aliveMembers();
var stateCheck = members.every(function(mem) {
return mem._states.contains(states);
});
condition = !stateCheck;
</Custom Requirement>

Haven't tested it, but it should work.
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
I tested it on a offense boosting skill using states 52 and 56, as those are the states for the highest tier buffs for ATK and M.ATK.

<Custom Requirement>
var states = [52, 56];
var members = $gameParty.aliveMembers();
var stateCheck = members.every(function(mem) {
return mem._states.contains(states);
});
condition = !stateCheck;
</Custom Requirement>

But I was still able to pick the skill when all the party members in the active battle party had those states.
 

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,087
Messages
1,095,653
Members
151,462
Latest member
julienrg
Top