YEP_Z_PassiveCases

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,196
First Language
English
Primarily Uses
RMMV
So I'm implementing a custom passive case for this plugin (the lunatic mode added before the following)
// -------------------------------
// Add new effects above this line
// -------------------------------

I wanted to ask if my code was correct since I was mostly just following the provided syntax...
Code:
} else if (data.match(/ONE[ ]HANDED)) {
  if (user.isActor()) {
    condition = !user.equips()[1];
  } else {
    condition = false;
}
So in the state notebox I would put:
JavaScript:
<Passive Condition Cases>
One Handed
</Passive Condition Cases>
Correct?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,117
Reaction score
1,525
First Language
EN
Primarily Uses
RMMZ
For this line:
JavaScript:
} else if (data.match(/ONE[ ]HANDED)) {
I would suggest this instead:
JavaScript:
} else if (data.match(/ONE HANDED/i)) {

Explanation: /ONE HANDED/i is a regular expression. (You forgot to put a / at the end of yours, which will cause an error.) It represents the exact sequence of characters "ONE HANDED". The i immediately after the expression is called a "flag": in this case, it means "case-insensitive", i.e. this will match anything like one handed, ONE HANDED, One Handed, etc. More details on regular expressions can be found here:
:kaopride:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top