From 13067761de9e6a31fbc91822c05dc6e23bc85cda Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Thu, 2 Mar 2023 10:52:53 -0500 Subject: [PATCH] * syntax for mass generation to use it, the element input must start with an asterisk * if it is exactly "*all" (without the quotes), generation will be done for every element otherwise, you have flags; **the string has to start with an asterisk; do not put an asterisk before any flags besides the first one in the element input string** if the "noauto" flag is present (regardless of any others), generation will run only on non-generated elements if the "auto" flag is present, generation will be limited to *only* generated elements; this can be combined with the lower flags: "nofairies": exclude fairies "nocreepers": exclude creepers "noclouds": exclude clouds "nospouts": exclude spouts "nobombs": exclude bombs --- mods/generator_prompt.js | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/mods/generator_prompt.js b/mods/generator_prompt.js index cd69fd7b..cc1636cb 100644 --- a/mods/generator_prompt.js +++ b/mods/generator_prompt.js @@ -95,6 +95,56 @@ elements.generator_prompt = { }; function parseForLateGenerationParameter(input) { + if(input.startsWith("*")) { + var elemList = Object.keys(elements); + input = input.toLowerCase().substring(1); + if(input === "all") { + return elemList; + } else { + input = input.split(" "); //'*nocreeper nofairy' to ['nocreeper' 'nofairy'] + //include no auto elements + if(input.includes("noauto")) { + return Object.keys(elements).filter(function(name) { return elements[name].autoType === undefined }); + }; + + + var filteredList = elemList; + + //include only auto elements + if(input.includes("auto")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== undefined }); + //console.log("limit to autogens", filteredList.length); + }; + //exclude fairies + if(input.includes("nofairy") || input.includes("nofairies")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== "fairy" }); + //console.log("remove fairies", filteredList.length); + }; + //exclude spouts + if(input.includes("nospout") || input.includes("nospouts")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== "spout" }); + //console.log("remove spouts", filteredList.length); + }; + //exclude creepers + if(input.includes("nocreeper") || input.includes("nocreepers")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== "creeper" }); + //console.log("remove creepers", filteredList.length); + }; + //exclude clouds + if(input.includes("nocloud") || input.includes("noclouds")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== "cloud" }); + //console.log("remove clouds", filteredList.length); + }; + //exclude bombs + if(input.includes("nobomb") || input.includes("nobombs")) { + filteredList = filteredList.filter(function(name) { return elements[name].autoType !== "bomb" }); + //console.log("remove bombs", filteredList.length); + }; + + //console.log(input); + return filteredList; + }; + }; if(typeof(input) === "string") { //it should be an array, so string check input = input.replace(/ /g,"_"); //console.log("String detected");