xxxxxxxxxx
71
// ======================================= FINAL CHOSEN =======================================
// Variables
let last = $gameVariables.value(52);
let type = $gameVariables.value(53);
let world = $gameVariables.value(54);
let birthday = $gameVariables.value(55);
let gender = $gameVariables.value(56);
let traits = $gameVariables.value(57);
let printMost = $gameVariables.value(13);
let totalCount = $gameVariables.value(14);
let activeArray = $gameVariables.value(16);
let biggestName = $gameVariables.value(17);
let chosenKid = $gameActors.actor($gameVariables.value(50))
let guessCards = $gameVariables.value(19); // 8
let traitCards = guessCards * 3;
// Calculates the highest trait, then removes it if it's not in Chosen Kid
function removeHighest(array, number) {
for (let i = 0; i <= number; i++) {
if (array[i] == biggestName) { // with gender, if it's equal to Male (largest)
array[i] = "0";
}
}
}
if (activeArray == 1) { // last name
removeHighest(last, guessCards);
} else if (activeArray == 2) { // type
removeHighest(type, guessCards)
} else if (activeArray == 3) { // world
removeHighest(world, guessCards)
} else if (activeArray == 4) { // birthday
removeHighest(birthday, guessCards)
} else if (activeArray == 5) { // gender
removeHighest(gender, guessCards);
} else if (activeArray == 6) { // traits
removeHighest(traits, traitCards)
}
// Test:
console.log(" :TEST: " + "Chosen Kid: " + chosenKid.name());
console.log(" :TEST: " + "biggestName: " + biggestName);
console.log("No match found. Recalculating...")
//totalCount[activeArray] = 0;
//printMost[activeArray] = 0;
//console.log(" :TEST: " + "totalCount: " + totalCount);
//console.log(" :TEST: " + "printMost: " + printMost);
//console.log(" :TEST: " + "activeArray: " + activeArray);
// ======================================= RETURN VARIABLES =======================================
$gameVariables.setValue(13, printMost);
$gameVariables.setValue(14, totalCount);
//$gameVariables.setValue(15, countMost);
$gameVariables.setValue(16, activeArray);
$gameVariables.setValue(17, biggestName);
console.log("--- LOOP BACK ---")
// Once above is done, trigger the next part
$gameSwitches.setValue(9, true);