I'm working on an evolution mechanic for my game (actually a fan remake of an old, no longer existing iOS game called Morphs) but the script for it isn't working. I'm pretty sure the culprit is the part where it checks the actor's class. This is the script:
How do I get the isClass function to work? Do I have to use a number? A string? An actual class variable, somehow? Any help is appreciated!
JavaScript:
for (var i = 0; i < $gameParty.members().length; i++) {
// Checks if selected morph is the Prime class
if($gameParty.members().isClass($dataClasses[0])) {
// Checks if morph is at least level 2
if($gameParty.members().level >= 2) {
// Ember evolution criteria: Fire greater than all other elements
if($gameParty.members().mat >= $gameParty.members().mdf && $gameParty.members().mat >= $gameParty.members().luk) {
$gameParty.members().changeClass(2, true);
$gameMessage.add("\N[1] morphed into an Ember!");
}
// Pebble evolution criteria: Earth greater than all other elements
if($gameParty.members().mdf >= $gameParty.members().mat && $gameParty.members().mdf >= $gameParty.members().luk) {
$gameParty.members().changeClass(3, true);
$gameMessage.add("\N[1] morphed into a Pebble!");
}
// Dew evolution criteria: Water greater than all other elements
if($gameParty.members().luk >= $gameParty.members().mat && $gameParty.members().luk >= $gameParty.members().mdf) {
$gameParty.members().changeClass(4, true);
$gameMessage.add("\N[1] morphed into a Dew!");
}
}
}
}