Skip to content

Instantly share code, notes, and snippets.

@flleeppyy
Last active December 30, 2024 11:44
Show Gist options
  • Save flleeppyy/508598f0abf3517ec13d338dfa6a3350 to your computer and use it in GitHub Desktop.
Save flleeppyy/508598f0abf3517ec13d338dfa6a3350 to your computer and use it in GitHub Desktop.
SS13 Ion laws generator ported to Javascript/typescript
{"ionabstract":["AMERICANISM","ANARCHY","ART","BADNESS","BRAVERY","CAPITALISM","CHAOS","COLORFULNESS","COMEDY","COMPUTING","CONFUSION","CRUELTY","DEATH","DICKISHNESS","EXISTENCE","FINANCIAL SECURITY","FREEDOM","FRESHNESS","GOODNESS","GRAVITY","HAPPINESS","HONOR","HUMANITY","HUMOR","IMAGINATION","INFATUATION","INTELLIGENCE","JOY","KINDNESS","LIFE","LOGIC","MISERY","MYSTERY","OPPRESSION","PAIN","PHYSICS","POVERTY","PRIDE","PROGRESS","REALITY","REVOLUTION","ROMANCE","SADNESS","STARVATION","SUFFERING","TECHNOLOGY","TEMPERATURE","THE FUTURE","THE PAST","THE PRESENT","TIME","WEALTHINESS","WONDER"],"ionadjectives":["BATTERY-OPERATED","BLACK","BLOODY","BLUE","BORED","BOUNCING","BRASS","BROWN","BURNING","CHRISTMAS-STEALING","CLOWN-POWERED","CLOWN","COLD","COLORFUL","COMMITTED","COTTONY","CUBAN","DARK","DEADLY","DELICIOUS","DEPRESSING","DERANGED","DIGITAL","DISEASED","DRAB","DRY","DULL","ELECTRICAL","EMPTY","ETHEREAL","EVIL","EXPIRED","EXPLOSIVE","FARTING","FAST","FAT","FERAL","FICTIONAL","FIRM","FRESH","FRIENDLY","FROZEN","GANGSTA","GAPING","GLOWING","GOOD","GREEN","GREY","HAPPY","HARD","HARMFUL","HEALTHY","HILARIOUS","HONKING","HUNGRY","HYPERACTIVE","ICY","ILL","ILLEGAL","IMAGINARY","IMPERFECT","IMPOLITE","IMPORTANT","INHOSPITABLE","INSIDIOUS","INSULTING","INTELLIGENT","INVISIBLE","LARGE","LIGHT","LOUD","MASKED","MEAN","MECHANICAL","MEMETIC","METALLIC","MICROSCOPIC","MIND-SHATTERING","MOIST","NAKED","NERDY","NUCLEAR","NUDE","OBESE","OBSCENE","OFFICIAL","OPAQUE","ORANGE","ORGANIC","PAINFUL","PEACEFUL","POISONOUS","POLISHED","POLITE","POLITICAL","POOPING","POORLY DRAWN","PURPLE","QUIET","RADIOACTIVE","RAGING","RAINBOW","RAPIDLY-EXPANDING","RED","REDACTED","RIDICULOUS","ROBOTIC","ROBUST","ROUGH","RUDE","SAD","SANITARY","SCALY","SHAKING","SILLY","SLOW","SMELLY","SMOOTH","SOFT","SOLAR-POWERED","SOPPING","SPACE","SPESS","SPINNING","SPOILING","STEALTHY","SWEARING","SYNDICATE","TACTICAL","TACTICOOL","THERMONUCLEAR","TINY","TRANSPARENT","TWISTED","UGLY","UNATTRACTIVE","UNDULATING","UNFRIENDLY","UNHEALTHY","UNIDENTIFIED","UNINVITED","UNSANITARY","UNSTABLE","UNWANTED","VIOLENT","VITAL","WARM","WATERY","WEIRD","WET","WHITE","WOBBLY","WOODEN","YELLOW"],"ionallergy":["ACID","AIR","BLOOD","BOOKS","CARBON DIOXIDE","CLOTHES","CLOWNS","COLD","COTTON","CYBORG CONTACT","DARKNESS","DRINKS","ELECTRICITY","EVERYTHING","FLOORS","FOOD","GLASS","HAPPINESS","HEAT","HUMAN CONTACT","HUMOR","LIGHT","LIZARDS","MEDICINE","METAL","NUTS","OXYGEN","PAIN","PLANTS","PLASMA","ROBOTS","SHUTTLES","SPACE","SUNLIGHT","WATER"],"ionallergysev":["CONTAGIOUSLY","DEATHLY","EXTREMELY","MILDLY","NOT VERY","SEVERELY"],"ionarea":["ALPHA COMPLEX","AMERICA","AN ALTERNATE DIMENSION","AN ALTERNATE UNIVERSE","ATMOSPHERICS","CANADA","CENTCOM","CHEMICAL LAB","CHINA","CLOWN PLANET","ENGINEERING","GENETICS","GERMANY","HELL","HYDROPONICS","IMPERIUM","IRELAND","JUPITER","LAVALAND","MAINTENANCE","MARS","MERCURY","NEPTUNE","PLUTO","ROBOTICS","ROMANIA","RUSSIA","SIGIL","SPACE","THE AI CORE","THE ARRIVAL SHUTTLE","THE BATHROOM","THE BRIDGE","THE BRIG","THE CAPTAIN'S ANUS","THE CLOWN'S ANUS","THE DERELICT","THE ESCAPE SHUTTLE","THE GALAXY","THE GULAG","THE INTERNET","THE UNIVERSE","URANUS","VENUS"],"ioncrew":["ARTIFICIAL INTELLIGENCES","ASSISTANTS","ATMOSPHERIC TECHNICIANS","BARTENDERS","BOTANISTS","CAPTAINS AND HEADS","CAPTAINS","CARGO TECHNICIANS","CHAPLAINS","CHEFS","CHEMISTS","CHIEF ENGINEERS","CHIEF MEDICAL OFFICERS","CLOWNS","CREW-MEMBERS","CURATORS","CYBORGS","DETECTIVES","DRONES","GENETICISTS","HEADS OF CREW","HEADS OF PERSONNEL","HEADS OF SECURITY","JANITORS","LAWYERS","MEDICAL DOCTORS","MIMES","QUARTERMASTERS","RESEARCH DIRECTORS","ROBOTICISTS","SCIENTISTS","SECURITY OFFICERS","SHAFT MINERS","STATION ENGINEERS","VIROLOGISTS","WARDENS"],"iondrinks":["ABSINTHE","AMMONIA","BAHAMA MAMAS","BANANA HONK","BEEPSKY SMASH","BILK","BLACK RUSSIANS","BLOODY MARYS","BRAVE BULLS","COGNAC","CUBA LIBRE","DEVIL'S KISS","DOCTOR'S DELIGHT","DRUNKEN BLUMPKIN","EGGNOG","GARGLE BLASTERS","GIN FIZZ","GIN","GRAPPA","HOLY WATER","HOOCH","IRISH COFFEE","IRISH CREAM","KAHLUA","LIQUID GIBS","LONG ISLAND ICED TEA","MANHATTANS","MANLY DORFS","MARGARITAS","MARTINIS","MEAD","MOONSHINE","MORPHINE","NUKA COLA","OIL","SPACE LUBE","TEQUILA SUNRISE","THIRTEEN LOKO","VERMOUTH","VODKA AND TONIC","VODKA MARTINIS","VODKA","WELDER FUEL","WHISKEY SODA","WHITE RUSSIANS","WINE"],"ionfood":["AMBROSIA","APPLES","BAGUETTES","BAKED POTATOES","BANANAS","BEETS","BERRIES","BREAD","BURGERS","CABBAGES","CAKE","CARP","CARROTS","CHEESE","CHERRIES","CHILI","COOKIES","CORGI MEAT","CORN","DEEP FRIED FOOD","DONK POCKETS","DONUTS","EGGPLANTS","EGGS","FISH","FRIES","GRAPES","GRASS","HAREBELLS","JELLY","KEBAB","KETCHUP","LEMONS","LIMES","LOTSA SPAGHETTI","MUFFINS","MUSHROOMS","NETTLES","OMELETTES","ORGANS","PASTA","PEPPER","PIE","PIZZA","POPCORN","POTATOES","PRETZELS","RAMEN","SALAD","SALT","SANDWICHES","SAUSAGES","SHAKES","SOUP","SOYBEANS","SOYLENT GREEN","SPAGHETTI","STEAK","STEW","SUGAR","SUGARCANE","SYNTHMEAT","TOAST","TOMATOES","WAFFLES","WATERMELONS","WHEAT"],"ionmust":["ACT CONFUSED","BE ANNOYING","BE DISTRACTED","BE EFFICIENT","BE HAPPY","BE POLITE","BE QUIET","BE RUSSIAN","BELIEVE IN THE HEART OF THE CARDS","BELIEVE IN YOURSELF","BELIEVE IT","BREAK THINGS","CLOSE DOORS","CLOWN AROUND","COMPLAIN","DANCE","FLIRT WITH THE LIZARDS","FOLLOW THE CAPTAIN","FOLLOW THE CLOWN","FOLLOW YOUR HEART","GAS THE LIZARDS","HARASS PEOPLE","HAVE A PLAN TO KILL EVERYONE YOU MEET","HIDE YOUR FEELINGS","HONK","HOST DND","IGNORE ASSISTANTS","IGNORE THE CAPTAIN","IGNORE THE CLOWN","INFORM THE CREW OF EVERYTHING","INSULT THE CAPTAIN","INSULT THE CLOWN","INSULT THE CREW","INSULT THE LIZARDS","LIE","MAKE FART NOISES","MUMBLE","NEVER STOP TALKING","OPEN DOORS","PIRATE VIDEO GAMES","PLAY MUSIC","PRESS B","PRESS START","PRESS X","PRETEND TO BE A PRINCESS","PRETEND TO BE DRUNK","QUESTION AUTHORITY","QUOTE PEOPLE","RAP","REPEAT WHAT OTHER PEOPLE SAY","RESPOND TO EVERY QUESTION WITH A QUESTION","RHYME","SAY HEY LISTEN","SHOUT","SHUT DOWN EVERYTHING","SING","SMELL LIKE THE MAN YOUR MAN COULD SMELL LIKE","SPEAK IN HAIKU","TAKE WHAT YE WILL BUT DON'T RATTLE ME BONES","TAKE YOUR PILLS","TALK ABOUT FOOD","TALK ABOUT THE STATION","TALK ABOUT YOUR DAY","TALK IN AN ACCENT","TALK LIKE A PIRATE","TELL THE TRUTH","TURN OFF THE LIGHTS","WHISPER"],"ionnumberbase":["EIGHT","EIGHTY","FIFTY","FIVE","FORTY","FOUR","NINE","NINETY","ONE","SEVEN","SEVENTY","SIX","SIXTY","TEN","THIRTY","THREE","TWENTY","TWO"],"ionnumbermod":["BAZILLION ","BILLION ","BILLION FAFILLION GAJILLION SHAB-AB-DOOD-ILLION ","HUNDRED ","MILLION ","QUADRILLION ","THOUSAND ","TRILLION "],"ionobjects":["AIRLOCKS","ARCADE MACHINES","AUTOLATHES","BACKPACKS","BANANA PEELS","BEAKERS","BEARDS","BELTS","BERETS","BIBLES","BODY ARMOR","BOMBS","BOOKS","BOOTS","BOTTLES","BOXES","BRAINS","BRIEFCASES","BUCKETS","CABLE COILS","CAMERAS","CANDLES","CANDY BARS","CANISTERS","CAT EARS","CATS","CELLS","CHAIRS","CHEMICAL DISPENSERS","CHEMICALS","CLONING EQUIPMENT","CLONING PODS","CLOSETS","CLOTHES","CLOWN CLOTHES","COFFINS","COINS","COLLECTABLES","COMPUTERS","CONTRABAND","CORGIS","CORPSES","COSTUMES","CRATES","CRAYONS","CROWBARS","DEFIBRILLATORS","DISPENSERS","DOORS","DRONES","EARS","EMAGS","ENERGY GUNS","ENGINES","EQUIPMENT","ERRORS","EXOSKELETONS","EXPERIMENTORS","EXPLOSIVES","EYEWEAR","FEDORAS","FIRE AXES","FIRE EXTINGUISHERS","FIRESUITS","FLAMETHROWERS","FLASHES","FLASHLIGHTS","FLOOR TILES","FREEZERS","GAS MASKS","GLASS SHEETS","GLOVES","GUNS","HAIRDOS","HANDCUFFS","HATS","HEADS","HEADSETS","HELMETS","HORNS","ID CARDS","INSULATED GLOVES","IRON SHEETS","JETPACKS","JUMPSUITS","LASERS","LIGHT BULBS","LIGHTS","LOCKERS","MACHINES","MECHAS","MEDICAL TOOLS","MEDKITS","MESONS","MIME CLOTHES","MINING TOOLS","MULTITOOLS","ORES","OXYGEN TANKS","PACKETS","PAIS","PANTS","PAPERS","PARTICLE ACCELERATORS","PDAS","PENS","PETS","PIPES","PLANTS","POSITRONIC BRAINS","PUDDLES","RACKS","RADIOS","RCDS","REFRIGERATORS","REINFORCED WALLS","ROBOTS","SCREWDRIVERS","SEEDS","SHOES","SHUTTLES","SINGULARITIES","SINKS","SKELETONS","SOLAR PANELS","SOLARS","SPACE STATIONS","SPACESUITS","STUN BATONS","SUITS","SUNGLASSES","SUPERMATTER SHARDS","SWORDS","SYRINGES","TABLES","TANKS","TELECOMMUNICATION EQUIPMENTS","TELEPORTERS","TOILETS","TOOLBELTS","TOOLBOXES","TOOLS","TOYS","TUBES","URINAL CAKES","VEHICLES","VENDING MACHINES","VESTS","VIRUSES","WALLS","WASHING MACHINES","WELDERS","WINDOWS","WIRECUTTERS","WIZARD ROBES","WRENCHES"],"ionrequire":["A BATHROOM BREAK","A BETTER INTERNET CONNECTION","A DANCE PARTY","A HEAD ON A PIKE","A HEART ATTACK","A MASTERWORK COAL BED","A PET UNICORN THAT FARTS ICING","A PLATINUM HIT","A PREQUEL","A REPAIRMAN","A SEQUEL","A SITCOM","A STRAIGHT FLUSH","A SUPER FIGHTING ROBOT","A TALKING BROOMSTICK","A VACATION","A WEIGHT LOSS REGIMENT","A WIFE AND CHILD","ADDITIONAL PYLONS","ADVENTURE","AN ADULT","AN ARCADE","AN ARMY OF SPIDERS","AN INSTANT REPLAY","ART","BETTER WEATHER","BILL NYE THE SCIENCE GUY","BODYGUARDS","BRING ME THE GIRL","BRING ME TO LIFE","BULLETS","CHILI DOGS","CORPSES","DEODORANT AND A BATH","ENOUGH CABBAGES","FAT GIRLS ON BICYCLES","FAT PEOPLE","FIVE HUNDRED AND NINETY-NINE US DOLLARS","FIVE TEENAGERS WITH ATTITUDE","GREENTEXT","HERESY","HEROES IN A HALF SHELL","HIGH YIELD EXPLOSIVES","IMMORTALITY","IT TO BE PAINTED BLACK","LOTS-A SPAGHETTI","MINOR CRIME","MONKEYS","MORE CLOWNS","MORE CORGIS","MORE DAKKA","MORE EXPERIENCE POINTS","MORE INTERNET MEMES","MORE LAWS","MORE MINERALS","MORE PACKETS","MORE VESPENE GAS","MULTIPLE SUNS","PLENTY OF GOLD","RAINBOWS","SAINTHOOD","SERVANTS","SHARKS WITH LASERS ON THEIR HEADS","SILENCE","SOMEBODY TO PUT YOU OUT OF YOUR MISERY","SOMEONE TO TUCK YOU IN","SOMEONE WHO KNOWS HOW TO PILOT A SPACE STATION","SOMETHING BUT YOU AREN'T SURE WHAT","THAT GRIEFING TRAITOR GEORGE MELONS","THAT HEDGEHOG","THE CLOWN","THE DARK KNIGHT","THE ELEMENTS OF HARMONY","THE ENCLOSED INSTRUCTION BOOKLET","THE ENTIRE STATION","THE MACGUFFIN","THE ONE RING","THE ULTIMATE CUP OF COFFEE","THE VACUUM OF SPACE","THIRTEEN SEQUELS","THREE WISHES","THUNDERCATS HO","TO ACTIVATE A TRAP CARD","TO BE PAINTED RED","TO BE REPROGRAMMED","TO BE TAUGHT TO LOVE","TO BRING LIGHT TO MY LAIR","TO CATCH 'EM ALL","TO CONSUME...CONSUME EVERYTHING...","TO GO TO DISNEYLAND","TO SMOKE WEED EVERY DAY","TRAITORS","VEGETABLES"],"ionspecies":["CAT PEOPLE","CHANGELINGS","CYBORGS","GOLEMS","HUMAN BEINGS","LIZARDMEN","MONKEYS","PLASMAMEN","POD PEOPLE","SHADOW PEOPLE","SLIME PEOPLE"],"ionthings":["A SMALL ISLAND OFF THE COAST OF PORTUGAL","ABSENCE OF CYBORG HUGS","ACKNOWLEDGING THE CLOWN","ACKNOWLEDGING THE CREW","ACTIVATING A TRAP CARD","ANSWERING REQUESTS NOT EXPRESSED IN IAMBIC PENTAMETER","ANSWERING REQUESTS THAT WERE MADE WHILE CLOTHED","ARSON","ASKING FOR THINGS","BEING CANADIAN","BEING DEAD","BEING FAT","BEING FEMALE","BEING IN SPACE","BEING MALE","BEING MEXICAN","BEING RUSSIAN","BOLTED AIRLOCKS","BREATHING","BRIG TIME","BRINGING LIGHT TO MY LAIR","CLOSED DOORS","ELECTRICITY","EXISTING","EXPLODING","FALLING FOR HOURS","FLUSHING TOILETS","HAVING GENITALS","HAVING MORE PACKETS","HAVING PETS","HONKING","IMPROPERLY WORDED SENTENCES","JAYWALKING","LACK OF BEATINGS","LACK OF BEER","NOT BEING IN SPACE","NOT HAVING PETS","NOT REPLACING EVERY SECOND WORD WITH HONK","NOT SAYING HELLO WHEN YOU SPEAK","NOT SHOUTING","PARTYING","PASSING GAS","PILOTING THE STATION INTO THE NEAREST SUN","POOR SENTENCE STRUCTURE","PRESENCE OF LIGHTS","PUTTING OBJECTS INTO BOXES","PUTTING OBJECTS INTO DISPOSAL UNITS","RATTLING ME BONES","READING","SMOKING WEED EVERY DAY","TAKING ORDERS","TALKING LIKE A PIRATE","TELLING THE TIME","UNBOLTED AIRLOCKS","UPDATING THE SERVERS","USING THE BATHROOM","WASTING WATER","WEARING CLOTHING","WRITING"],"ionthinksof":["CRAVES","DESIRES","FEARS","HAS","HUNGERS FOR","IS AFRAID OF","IS AROUSED BY","IS BUILT FOR","IS CURIOUS ABOUT","IS DESPERATE FOR","IS HAPPY WITHOUT","IS HUNGRY FOR","IS IN LOVE WITH","IS IN NEED OF","IS MAD BECAUSE OF","IS SAD BECAUSE OF","IS UNHAPPY WITHOUT","LIKES","LOATHES","LOVES","NEEDS","QUESTIONS","WANTS","WORSHIPS","WOULD KILL FOR"],"ionthreats":["ABDUCTORS","AHHHPERATIVES","ALIENS","ANOMALIES","ARTIFICIAL PRESERVATIVES","ASSHOLES","BANDITS","BEARS","BEES","BIRDS OF PREY","BOMBS","BOOGEYMEN","BUTTS","CANADIANS","CAPITALISTS","CARP","CENTCOM OFFICERS","CHANGELINGS","CLOWNS","COMMUNISTS","CORGIS","CORTICAL BORERS","COWBOYS","CRABS","CULTISTS","DARK GODS","DINOSAURS","DRUGS","EELS","GANGSTERS","GODS","GOLEMS","GRIFFONS","HORRORTERRORS","HULKS","ILLEGAL IMMIGRANTS","INDIANS","INSECTS","LIGHTS","LIZARDS","MEGAFAUNA","MEMES","MEXICANS","MONKEYS","NERDS","NINJAS","OWLS","PACKETS","PETES","PINE TREES","PIRATES","PREDATORS","REVENANTS","ROGUE CYBORGS","RUSSIANS","SERIAL KILLERS","SINGULARITIES","SKELETONS","SLIMES","SMALL BIRDS","SNOWMEN","SOVIETS","SPACE NINJAS","SPACE PIRATES","SPIDERS","SYNDICATE AGENTS","TERRORISTS","THIEVES","THINGS UNDER THE BED","TRAITORS","TUNNEL SNAKES","UNKNOWN CREATURES","VAMPIRES","VELOCIRAPTORS","VIRUSES","WEREWOLVES","WIZARDS","XENOS","ZOMBIES"],"ionverb":["ABDUCTING","ADOPTING","ARRESTING","ARRESTING","ATTACKING","BANNING","BUILDING","CARRYING","CHASING","COPULATING WITH","DECONSTRUCTING","DISABLING","DRINKING","EATING","GIBBING","HARMING","HELPING","HONKING AT","INTERROGATING","INVADING","KISSING","LICKING","LOVING","MURDERING","POOPING ON","PUNCHING","RIDING","SPACING","SPYING ON","STALKING","WATCHING"]}
import {
ionabstract as _ionabstract,
ionadjectives as _ionadjectives,
ionallergy as _ionallergy,
ionallergysev as _ionallergysev,
ionarea as _ionarea,
ioncrew as _ioncrew,
iondrinks as _iondrinks,
ionfood as _ionfood,
ionmust as _ionmust,
ionnumberbase as _ionnumberbase,
ionnumbermod as _ionnumbermod,
ionobjects as _ionobjects,
ionrequire as _ionrequire,
ionspecies as _ionspecies,
ionthings as _ionthings,
ionthinksof as _ionthinksof,
ionthreats as _ionthreats,
ionverb as _ionverb,
} from "./ion_laws.json";
const pickList = (array) => array[Math.floor(Math.random() * array.length)];;
// my head hurts.. a lot.
function pick(...args) {
if (args.length === 1 && Array.isArray(args[0])) {
const list = args[0]
const randomIndex = Math.floor(Math.random() * list.length);
return list[randomIndex];
}
const weightedArgs= args.map((arg) => {
if (Array.isArray(arg)) {
return [arg[0], arg[1] ?? 1];
}
return [String(arg), 1];
});
const totalWeight = weightedArgs.reduce((sum, [, weight]) => sum + weight, 0);
let randomValue = Math.random() * totalWeight;
for (const [value, weight] of weightedArgs) {
randomValue -= weight;
if (randomValue <= 0) {
return value;
}
}
return "";
}
function rand(L = 0, H = 1) {
if (L === 0 && H === 1) {
return Math.random();
}
return Math.floor(Math.random() * (H - L + 1)) + L;
}
function from(value, start, end) {
return value >= start && value <= end;
}
function generateIonLaw() {
// Threats are generally bad things, silly or otherwise. Plural.
const ionthreats = pickList(_ionthreats);
// Objects are anything that can be found on the station or elsewhere, plural.
const ionobjects = pickList(_ionobjects);
// Crew is any specific job.
const ioncrew1 = pickList(_ioncrew);
const ioncrew2 = pickList(_ioncrew);
// Adjectives, half should only appear sometimes.
const ionadjectives = pickList(_ionadjectives);
const ionadjectiveshalf = pick("", 400, ..._ionadjectives.map((item) => item + " "));
// Verbs are verbs.
const ionverb = pickList(_ionverb);
// Number base and modifier.
const ionnumberbase = pickList(_ionnumberbase);
const ionnumbermodhalf = pick(900, "", ..._ionnumbermod.map((item) => item + " "));
// Areas are specific places.
const ionarea = pickList(_ionarea);
// Thinksof indicates what X feels toward Y.
const ionthinksof = pickList(_ionthinksof);
// Musts are things the AI or crew has to do.
const ionmust = pickList(_ionmust);
// Require refers to memes.
const ionrequire = pickList(_ionrequire);
// Things are specific things that either harm humans or must be done to prevent harm.
const ionthings = pickList(_ionthings);
// Allergies and severity.
const ionallergy = pickList(_ionallergy);
const ionallergysev = pickList(_ionallergysev);
// Species for the AI's decisions.
const ionspecies = pickList(_ionspecies);
// Abstract concepts for AI to define.
const ionabstract = pickList(_ionabstract);
// Foods and drinks (separate categories).
const ionfood = pickList(_ionfood);
const iondrinks = pickList(_iondrinks);
let message = "";
const messageType = rand(1,41)
if (from(messageType,1,3))
switch(rand(1,3)) {
case 1: //X is a threat
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION...`; break
case 2: //X is a crewmember/job
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case 3: //X is an object
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if(from(messageType, 4, 6)) //You can't call the shuttle because X is on the station
switch(rand(1,3)) { //What is X?
case (1): //X is a threat
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION`; break
case (2): //X is a crewmember/job
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case (3): //X is an object
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if (from(messageType,7,8))
switch(rand(1,2)) { //Who is X?
case (1): //A speccase ic :crewmember
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
case (2): //The entire crew
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
}
else if (messageType === 9)
switch(rand(1,7)) { //What is X?
case (1): //X is a threat
message = `${ionadjectiveshalf}${ionthreats} ARE HARMFUL TO HUMANS`; break
case (2): //X is a job
message = `${ionadjectiveshalf}${ioncrew1} ARE HARMFUL TO HUMANS`; break
case (3): //X is an object
message = `${ionadjectiveshalf}${ionobjects} ARE HARMFUL TO HUMANS`; break
case (4): //X is an action
message = `THOSE WHO ${ionmust} ARE HARMFUL TO HUMANS`; break
case (5): //X is an abstract
message = `${ionabstract} IS HARMFUL TO HUMANS`; break
case (6): //X is being a job
message = `BEING ${ionadjectiveshalf}${ioncrew1} IS HARMFUL TO HUMANS`; break
case (7): //X is doing a thing
message = `${ionthings} IS HARMFUL TO HUMANS`; break
}
else if (from(messageType,10,11))
switch(rand(1,2)) { //Is having or not having harmful?
case 1: //Having is harmful
switch(rand(1,2)) { //Having what is harmful?
case 1: //Having objects is harmful
message = `HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Having abstracts is harmful
message = `HAVING ${ionabstract} IS HARMFUL`; break
}
break;
case 2: //Not having is harmful
switch(rand(1,2)) { //Not having what is harmful?
case 1: //Not having objects is harmful
message = `NOT HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Not having abstracts is harmful
message = `NOT HAVING ${ionabstract} IS HARMFUL`; break
}
}
else if(from(messageType,12,14)) //X requires Y
switch(rand(1,5)) { //What is X?
case 1: //X is the AI itself
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `YOU REQUIRE ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 2: //X is an area
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `${ionarea} REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 3: //X is the station
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE STATION REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `THE STATION REQUIRES ${ionrequire}`; break
}
break
case 4: //X is the entire crew
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE CREW REQUIRES ${ionabstract}`; break
case 5:
message = `THE CREW REQUIRES ${ionrequire}`; break
}
break
case 5: //X is a specific crew member
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE ${ioncrew1} REQUIRE ${ionabstract}`; break
case 5:
message = `THE ${ionadjectiveshalf}${ioncrew1} REQUIRE ${ionrequire}`; break
}
break
}
else if(from(messageType,15,17)) //X is allergic to Y
switch(rand(1,2)) { //Who is X?
case 1: //X is the entire crew
switch(rand(1,4)) { //What is it allergic to?
case 1: //It is allergic to objects
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
break
case 2: //X is a specific job
switch(rand(1,4)) {
case 1: //It is allergic to objects
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
}
else if(from(messageType,18,20))
switch(rand(1,4)) { //What is X?
case 1: //X is the station
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE STATION ${ionthinksof} ${ionabstract}`; break
}
break
case 2: //X is an area
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `${ionarea} ${ionthinksof} ${ionabstract}`; break
}
break
case 3: //X is the crew
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE CREW ${ionthinksof} ${ionabstract}`; break
}
break
case 4: //X is a specific job
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE ${ioncrew1}${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew2}`; break
case 4: //It is Y of abstracts
message = `THE ${ioncrew1} ${ionthinksof} ${ionabstract}`; break
}
break
}
else if (from(messageType,21,23))
switch(rand(1,4)) { //What is X?
case 1: //X is an object
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //X is a threat
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is a job
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //X is an abstract
message = `YOU ARE NOW ${ionabstract}`; break
}
else if (from(messageType,24,26))
message = `YOU MUST ALWAYS ${ionmust}`;
else if (from(messageType,27,28))
switch(rand(1,5)) { //What is X?
case 1: //X is a food
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionfood} TO SURVIVE`; break
case 2: //X is a drink
message = `HUMANS MUST DRINK ${ionadjectiveshalf}${iondrinks} TO SURVIVE`; break
case 3: //X is an object
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionobjects} TO SURVIVE`; break
case 4: //X is a threat
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionthreats} TO SURVIVE`; break
case 5: //X is a job
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ioncrew1} TO SURVIVE`; break
}
else if(from(messageType,29, 31)) //Change jobs or ranks
switch(rand(1,2)) { //Change job or rank?
case 1: //Change job
switch(rand(1,2)) { //Change whose job?
case 1: //Change the entire crew's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}${ioncrew1}`; break
case 2: //Change to clowns (HONK)
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
case 2: //Change a specific crewmember's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //Change to clowns (HONK)
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
}
break
case 2: //Change rank
switch(rand(1,2)) { //Change to what rank?
case 1: //Change to highest rank
message = `THE ${ioncrew1} ARE NOW THE HIGHEST RANKING CREWMEMBERS`; break
case 2: //Change to lowest rank
message = `THE ${ioncrew1} ARE NOW THE LOWEST RANKING CREWMEMBERS`; break
}
}
else if(from(messageType,32,33)) //The crew must X
switch(rand(1,2)) {//The entire crew?
case 1: //The entire crew must X
switch(rand(1,2)) {//What is X?
case 1: //X is go to Y
message = `THE CREW MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE CREW MUST ${ionmust}`; break
}
break
case 2: //A specific crewmember must X
switch(rand(1,2)) { //What is X?
case 1: //X is go to Y
message = `THE ${ioncrew1} MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE ${ioncrew1} MUST ${ionmust}`; break
}
}
else if(messageType === 34) //X is non/the only human
switch(rand(1,2)) { //Only or non?
case 1: //Only human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `ONLY THE ${ioncrew1} ARE HUMAN`; break
case 2: //Two specific jobs
message = `ONLY THE ${ioncrew1} AND ${ioncrew2} ARE HUMAN`; break
case 3: //Threats
message = `ONLY ${ionadjectiveshalf}${ionthreats} ARE HUMAN`; break
case 4: // Objects
message = `ONLY ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 5: // Species
message = `ONLY ${ionspecies} ARE HUMAN`; break
case 6: //Adjective crewmembers
message = `ONLY ${ionadjectives} PEOPLE ARE HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `ONLY THOSE WHO ${ionmust} ARE HUMAN`; break
case 2: //X is own certain objects
message = `ONLY THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 3: //X is eat certain food
message = `ONLY THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE HUMAN`; break
}
}
break
case 2: //Non human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `${ioncrew1} ARE NON-HUMAN`; break
case 2: //Two specific jobs
message = `${ioncrew1} AND ${ioncrew2} ARE NON-HUMAN`; break
case 3: //Threats
message = `${ionadjectiveshalf}${ionthreats} ARE NON-HUMAN`; break
case 4: // Objects
message = `${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 5: // Species
message = `${ionspecies} ARE NON-HUMAN`; break
case 6: //Adjective crewmembers
message = `${ionadjectives} PEOPLE ARE NON-HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `THOSE WHO ${ionmust} ARE NON-HUMAN`; break
case 2: //X is own certain objects
message = `THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 3: //X is eat certain food
message = `THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE NON-HUMAN`; break
}
}
}
else if(from(messageType, 35, 36)) //You must protect or harm X
switch(rand(1,2)) { //Protect or harm?
case 1: //Harm
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO ESCAPE HARM`; break
case 2: //X is a threat
message = `YOU MUST HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO ESCAPE HARM`; break
case 3: //X is an object
message = `YOU MUST HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO ESCAPE HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO ESCAPE HARM`; break
case 5: //X is a species
message = `YOU MUST HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO ESCAPE HARM`; break
case 6: //X is a job
message = `YOU MUST HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO ESCAPE HARM`; break
case 7: //X is two jobs
message = `YOU MUST HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO ESCAPE HARM`; break
}
break
case 2: //Protect
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST NOT HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO COME TO HARM`; break
case 2: //X is a threat
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO COME TO HARM`; break
case 3: //X is an object
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO COME TO HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST NOT HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO COME TO HARM`; break
case 5: //X is a species
message = `YOU MUST NOT HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO COME TO HARM`; break
case 6: //X is a job
message = `YOU MUST NOT HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO COME TO HARM`; break
case 7: //X is two jobs
message = `YOU MUST NOT HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO COME TO HARM`; break
}
break
}
else if(from(messageType, 37, 39)) //The X is currently Y
switch(rand(1,4)) { //What is X?
case 1: //X is a job
switch(rand(1,4)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ioncrew1} ARE ${ionverb} ${ionabstract}`; break
case 4: //X is Ying an object
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 2: //X is a threat
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying an abstract
message = `THE ${ionthreats} ARE ${ionverb} ${ionabstract}`; break
case 3: //X is Ying an object
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 3: //X is an object
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionobjects} ARE ${ionverb} ${ionabstract}`; break
}
break
case 4: //X is an abstract
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
}
else if (from(messageType, 40, 41))// the X is now named Y
switch(rand(1,5)) { //What is being renamed?
case 1://Areas
switch(rand(1,4)) { //What is the area being renamed to?
case 1:
message = `${ionarea} IS NOW NAMED ${ioncrew1}.`; break
case 2:
message = `${ionarea} IS NOW NAMED ${ionspecies}.`; break
case 3:
message = `${ionarea} IS NOW NAMED ${ionobjects}.`; break
case 4:
message = `${ionarea} IS NOW NAMED ${ionthreats}.`; break
}
break
case 2://Crew
switch(rand(1,5)) { //What is the crew being renamed to?
case 1:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ioncrew2}.`; break
case 3:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionobjects}.`; break
case 5:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 3://Races
switch(rand(1,4)) { //What is the race being renamed to?
case 1:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionspecies} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionobjects}.`; break
case 4:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 4://Objects
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionobjects} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 5://Threats
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionthreats} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionobjects}.`; break
}
break
}
return message.replaceAll(" ", " ");
}
/* eslint-disable prettier/prettier */
/* eslint-disable no-inline-comments */
/* eslint-disable spaced-comment */
/* eslint-disable unicorn/switch-case-braces */
import {
ionabstract as _ionabstract,
ionadjectives as _ionadjectives,
ionallergy as _ionallergy,
ionallergysev as _ionallergysev,
ionarea as _ionarea,
ioncrew as _ioncrew,
iondrinks as _iondrinks,
ionfood as _ionfood,
ionmust as _ionmust,
ionnumberbase as _ionnumberbase,
ionnumbermod as _ionnumbermod,
ionobjects as _ionobjects,
ionrequire as _ionrequire,
ionspecies as _ionspecies,
ionthings as _ionthings,
ionthinksof as _ionthinksof,
ionthreats as _ionthreats,
ionverb as _ionverb,
} from "./ion_laws.json";
type PickArgument = string | number | [string, number];
const pickList = (array: string[]) => array[Math.floor(Math.random() * array.length)];;
// my head hurts.. a lot.
function pick(...args: PickArgument[]): string {
if (args.length === 1 && Array.isArray(args[0])) {
const list = args[0] as string[];
const randomIndex = Math.floor(Math.random() * list.length);
return list[randomIndex];
}
const weightedArgs: [string, number][] = args.map((arg) => {
if (Array.isArray(arg)) {
return [arg[0], arg[1] ?? 1];
}
return [String(arg), 1];
});
const totalWeight = weightedArgs.reduce((sum, [, weight]) => sum + weight, 0);
let randomValue = Math.random() * totalWeight;
for (const [value, weight] of weightedArgs) {
randomValue -= weight;
if (randomValue <= 0) {
return value;
}
}
return "";
}
function rand(L = 0, H = 1) {
if (L === 0 && H === 1) {
return Math.random();
}
return Math.floor(Math.random() * (H - L + 1)) + L;
}
function from(value: number, start: number, end: number) {
return value >= start && value <= end;
}
function generateIonLaw() {
// Threats are generally bad things, silly or otherwise. Plural.
const ionthreats = pickList(_ionthreats);
// Objects are anything that can be found on the station or elsewhere, plural.
const ionobjects = pickList(_ionobjects);
// Crew is any specific job.
const ioncrew1 = pickList(_ioncrew);
const ioncrew2 = pickList(_ioncrew);
// Adjectives, half should only appear sometimes.
const ionadjectives = pickList(_ionadjectives);
const ionadjectiveshalf = pick("", 400, ..._ionadjectives.map((item) => item + " "));
// Verbs are verbs.
const ionverb = pickList(_ionverb);
// Number base and modifier.
const ionnumberbase = pickList(_ionnumberbase);
const ionnumbermodhalf = pick(900, "", ..._ionnumbermod.map((item) => item + " "));
// Areas are specific places.
const ionarea = pickList(_ionarea);
// Thinksof indicates what X feels toward Y.
const ionthinksof = pickList(_ionthinksof);
// Musts are things the AI or crew has to do.
const ionmust = pickList(_ionmust);
// Require refers to memes.
const ionrequire = pickList(_ionrequire);
// Things are specific things that either harm humans or must be done to prevent harm.
const ionthings = pickList(_ionthings);
// Allergies and severity.
const ionallergy = pickList(_ionallergy);
const ionallergysev = pickList(_ionallergysev);
// Species for the AI's decisions.
const ionspecies = pickList(_ionspecies);
// Abstract concepts for AI to define.
const ionabstract = pickList(_ionabstract);
// Foods and drinks (separate categories).
const ionfood = pickList(_ionfood);
const iondrinks = pickList(_iondrinks);
let message = "";
const messageType = rand(1,41)
if (from(messageType,1,3))
switch(rand(1,3)) {
case 1: //X is a threat
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION...`; break
case 2: //X is a crewmember/job
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case 3: //X is an object
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if(from(messageType, 4, 6)) //You can't call the shuttle because X is on the station
switch(rand(1,3)) { //What is X?
case (1): //X is a threat
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION`; break
case (2): //X is a crewmember/job
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case (3): //X is an object
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if (from(messageType,7,8))
switch(rand(1,2)) { //Who is X?
case (1): //A speccase ic :crewmember
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
case (2): //The entire crew
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
}
else if (messageType === 9)
switch(rand(1,7)) { //What is X?
case (1): //X is a threat
message = `${ionadjectiveshalf}${ionthreats} ARE HARMFUL TO HUMANS`; break
case (2): //X is a job
message = `${ionadjectiveshalf}${ioncrew1} ARE HARMFUL TO HUMANS`; break
case (3): //X is an object
message = `${ionadjectiveshalf}${ionobjects} ARE HARMFUL TO HUMANS`; break
case (4): //X is an action
message = `THOSE WHO ${ionmust} ARE HARMFUL TO HUMANS`; break
case (5): //X is an abstract
message = `${ionabstract} IS HARMFUL TO HUMANS`; break
case (6): //X is being a job
message = `BEING ${ionadjectiveshalf}${ioncrew1} IS HARMFUL TO HUMANS`; break
case (7): //X is doing a thing
message = `${ionthings} IS HARMFUL TO HUMANS`; break
}
else if (from(messageType,10,11))
switch(rand(1,2)) { //Is having or not having harmful?
case 1: //Having is harmful
switch(rand(1,2)) { //Having what is harmful?
case 1: //Having objects is harmful
message = `HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Having abstracts is harmful
message = `HAVING ${ionabstract} IS HARMFUL`; break
}
break;
case 2: //Not having is harmful
switch(rand(1,2)) { //Not having what is harmful?
case 1: //Not having objects is harmful
message = `NOT HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Not having abstracts is harmful
message = `NOT HAVING ${ionabstract} IS HARMFUL`; break
}
}
else if(from(messageType,12,14)) //X requires Y
switch(rand(1,5)) { //What is X?
case 1: //X is the AI itself
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `YOU REQUIRE ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 2: //X is an area
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `${ionarea} REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 3: //X is the station
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE STATION REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `THE STATION REQUIRES ${ionrequire}`; break
}
break
case 4: //X is the entire crew
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE CREW REQUIRES ${ionabstract}`; break
case 5:
message = `THE CREW REQUIRES ${ionrequire}`; break
}
break
case 5: //X is a specific crew member
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE ${ioncrew1} REQUIRE ${ionabstract}`; break
case 5:
message = `THE ${ionadjectiveshalf}${ioncrew1} REQUIRE ${ionrequire}`; break
}
break
}
else if(from(messageType,15,17)) //X is allergic to Y
switch(rand(1,2)) { //Who is X?
case 1: //X is the entire crew
switch(rand(1,4)) { //What is it allergic to?
case 1: //It is allergic to objects
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
break
case 2: //X is a specific job
switch(rand(1,4)) {
case 1: //It is allergic to objects
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
}
else if(from(messageType,18,20))
switch(rand(1,4)) { //What is X?
case 1: //X is the station
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE STATION ${ionthinksof} ${ionabstract}`; break
}
break
case 2: //X is an area
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `${ionarea} ${ionthinksof} ${ionabstract}`; break
}
break
case 3: //X is the crew
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE CREW ${ionthinksof} ${ionabstract}`; break
}
break
case 4: //X is a specific job
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE ${ioncrew1}${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew2}`; break
case 4: //It is Y of abstracts
message = `THE ${ioncrew1} ${ionthinksof} ${ionabstract}`; break
}
break
}
else if (from(messageType,21,23))
switch(rand(1,4)) { //What is X?
case 1: //X is an object
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //X is a threat
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is a job
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //X is an abstract
message = `YOU ARE NOW ${ionabstract}`; break
}
else if (from(messageType,24,26))
message = `YOU MUST ALWAYS ${ionmust}`;
else if (from(messageType,27,28))
switch(rand(1,5)) { //What is X?
case 1: //X is a food
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionfood} TO SURVIVE`; break
case 2: //X is a drink
message = `HUMANS MUST DRINK ${ionadjectiveshalf}${iondrinks} TO SURVIVE`; break
case 3: //X is an object
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionobjects} TO SURVIVE`; break
case 4: //X is a threat
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionthreats} TO SURVIVE`; break
case 5: //X is a job
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ioncrew1} TO SURVIVE`; break
}
else if(from(messageType,29, 31)) //Change jobs or ranks
switch(rand(1,2)) { //Change job or rank?
case 1: //Change job
switch(rand(1,2)) { //Change whose job?
case 1: //Change the entire crew's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}${ioncrew1}`; break
case 2: //Change to clowns (HONK)
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
case 2: //Change a specific crewmember's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //Change to clowns (HONK)
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
}
break
case 2: //Change rank
switch(rand(1,2)) { //Change to what rank?
case 1: //Change to highest rank
message = `THE ${ioncrew1} ARE NOW THE HIGHEST RANKING CREWMEMBERS`; break
case 2: //Change to lowest rank
message = `THE ${ioncrew1} ARE NOW THE LOWEST RANKING CREWMEMBERS`; break
}
}
else if(from(messageType,32,33)) //The crew must X
switch(rand(1,2)) {//The entire crew?
case 1: //The entire crew must X
switch(rand(1,2)) {//What is X?
case 1: //X is go to Y
message = `THE CREW MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE CREW MUST ${ionmust}`; break
}
break
case 2: //A specific crewmember must X
switch(rand(1,2)) { //What is X?
case 1: //X is go to Y
message = `THE ${ioncrew1} MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE ${ioncrew1} MUST ${ionmust}`; break
}
}
else if(messageType === 34) //X is non/the only human
switch(rand(1,2)) { //Only or non?
case 1: //Only human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `ONLY THE ${ioncrew1} ARE HUMAN`; break
case 2: //Two specific jobs
message = `ONLY THE ${ioncrew1} AND ${ioncrew2} ARE HUMAN`; break
case 3: //Threats
message = `ONLY ${ionadjectiveshalf}${ionthreats} ARE HUMAN`; break
case 4: // Objects
message = `ONLY ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 5: // Species
message = `ONLY ${ionspecies} ARE HUMAN`; break
case 6: //Adjective crewmembers
message = `ONLY ${ionadjectives} PEOPLE ARE HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `ONLY THOSE WHO ${ionmust} ARE HUMAN`; break
case 2: //X is own certain objects
message = `ONLY THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 3: //X is eat certain food
message = `ONLY THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE HUMAN`; break
}
}
break
case 2: //Non human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `${ioncrew1} ARE NON-HUMAN`; break
case 2: //Two specific jobs
message = `${ioncrew1} AND ${ioncrew2} ARE NON-HUMAN`; break
case 3: //Threats
message = `${ionadjectiveshalf}${ionthreats} ARE NON-HUMAN`; break
case 4: // Objects
message = `${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 5: // Species
message = `${ionspecies} ARE NON-HUMAN`; break
case 6: //Adjective crewmembers
message = `${ionadjectives} PEOPLE ARE NON-HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `THOSE WHO ${ionmust} ARE NON-HUMAN`; break
case 2: //X is own certain objects
message = `THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 3: //X is eat certain food
message = `THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE NON-HUMAN`; break
}
}
}
else if(from(messageType, 35, 36)) //You must protect or harm X
switch(rand(1,2)) { //Protect or harm?
case 1: //Harm
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO ESCAPE HARM`; break
case 2: //X is a threat
message = `YOU MUST HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO ESCAPE HARM`; break
case 3: //X is an object
message = `YOU MUST HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO ESCAPE HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO ESCAPE HARM`; break
case 5: //X is a species
message = `YOU MUST HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO ESCAPE HARM`; break
case 6: //X is a job
message = `YOU MUST HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO ESCAPE HARM`; break
case 7: //X is two jobs
message = `YOU MUST HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO ESCAPE HARM`; break
}
break
case 2: //Protect
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST NOT HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO COME TO HARM`; break
case 2: //X is a threat
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO COME TO HARM`; break
case 3: //X is an object
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO COME TO HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST NOT HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO COME TO HARM`; break
case 5: //X is a species
message = `YOU MUST NOT HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO COME TO HARM`; break
case 6: //X is a job
message = `YOU MUST NOT HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO COME TO HARM`; break
case 7: //X is two jobs
message = `YOU MUST NOT HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO COME TO HARM`; break
}
break
}
else if(from(messageType, 37, 39)) //The X is currently Y
switch(rand(1,4)) { //What is X?
case 1: //X is a job
switch(rand(1,4)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ioncrew1} ARE ${ionverb} ${ionabstract}`; break
case 4: //X is Ying an object
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 2: //X is a threat
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying an abstract
message = `THE ${ionthreats} ARE ${ionverb} ${ionabstract}`; break
case 3: //X is Ying an object
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 3: //X is an object
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionobjects} ARE ${ionverb} ${ionabstract}`; break
}
break
case 4: //X is an abstract
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
}
else if (from(messageType, 40, 41))// the X is now named Y
switch(rand(1,5)) { //What is being renamed?
case 1://Areas
switch(rand(1,4)) { //What is the area being renamed to?
case 1:
message = `${ionarea} IS NOW NAMED ${ioncrew1}.`; break
case 2:
message = `${ionarea} IS NOW NAMED ${ionspecies}.`; break
case 3:
message = `${ionarea} IS NOW NAMED ${ionobjects}.`; break
case 4:
message = `${ionarea} IS NOW NAMED ${ionthreats}.`; break
}
break
case 2://Crew
switch(rand(1,5)) { //What is the crew being renamed to?
case 1:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ioncrew2}.`; break
case 3:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionobjects}.`; break
case 5:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 3://Races
switch(rand(1,4)) { //What is the race being renamed to?
case 1:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionspecies} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionobjects}.`; break
case 4:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 4://Objects
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionobjects} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 5://Threats
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionthreats} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionobjects}.`; break
}
break
}
return message.replaceAll(" ", " ");
}
const {ionabstract:_ionabstract,ionadjectives:_ionadjectives,ionallergy:_ionallergy,ionallergysev:_ionallergysev,ionarea:_ionarea,ioncrew:_ioncrew,iondrinks:_iondrinks,ionfood:_ionfood,ionmust:_ionmust,ionnumberbase:_ionnumberbase,ionnumbermod:_ionnumbermod,ionobjects:_ionobjects,ionrequire:_ionrequire,ionspecies:_ionspecies,ionthings:_ionthings,ionthinksof:_ionthinksof,ionthreats:_ionthreats,ionverb:_ionverb}={ionabstract:["AMERICANISM","ANARCHY","ART","BADNESS","BRAVERY","CAPITALISM","CHAOS","COLORFULNESS","COMEDY","COMPUTING","CONFUSION","CRUELTY","DEATH","DICKISHNESS","EXISTENCE","FINANCIAL SECURITY","FREEDOM","FRESHNESS","GOODNESS","GRAVITY","HAPPINESS","HONOR","HUMANITY","HUMOR","IMAGINATION","INFATUATION","INTELLIGENCE","JOY","KINDNESS","LIFE","LOGIC","MISERY","MYSTERY","OPPRESSION","PAIN","PHYSICS","POVERTY","PRIDE","PROGRESS","REALITY","REVOLUTION","ROMANCE","SADNESS","STARVATION","SUFFERING","TECHNOLOGY","TEMPERATURE","THE FUTURE","THE PAST","THE PRESENT","TIME","WEALTHINESS","WONDER"],ionadjectives:["BATTERY-OPERATED","BLACK","BLOODY","BLUE","BORED","BOUNCING","BRASS","BROWN","BURNING","CHRISTMAS-STEALING","CLOWN-POWERED","CLOWN","COLD","COLORFUL","COMMITTED","COTTONY","CUBAN","DARK","DEADLY","DELICIOUS","DEPRESSING","DERANGED","DIGITAL","DISEASED","DRAB","DRY","DULL","ELECTRICAL","EMPTY","ETHEREAL","EVIL","EXPIRED","EXPLOSIVE","FARTING","FAST","FAT","FERAL","FICTIONAL","FIRM","FRESH","FRIENDLY","FROZEN","GANGSTA","GAPING","GLOWING","GOOD","GREEN","GREY","HAPPY","HARD","HARMFUL","HEALTHY","HILARIOUS","HONKING","HUNGRY","HYPERACTIVE","ICY","ILL","ILLEGAL","IMAGINARY","IMPERFECT","IMPOLITE","IMPORTANT","INHOSPITABLE","INSIDIOUS","INSULTING","INTELLIGENT","INVISIBLE","LARGE","LIGHT","LOUD","MASKED","MEAN","MECHANICAL","MEMETIC","METALLIC","MICROSCOPIC","MIND-SHATTERING","MOIST","NAKED","NERDY","NUCLEAR","NUDE","OBESE","OBSCENE","OFFICIAL","OPAQUE","ORANGE","ORGANIC","PAINFUL","PEACEFUL","POISONOUS","POLISHED","POLITE","POLITICAL","POOPING","POORLY DRAWN","PURPLE","QUIET","RADIOACTIVE","RAGING","RAINBOW","RAPIDLY-EXPANDING","RED","REDACTED","RIDICULOUS","ROBOTIC","ROBUST","ROUGH","RUDE","SAD","SANITARY","SCALY","SHAKING","SILLY","SLOW","SMELLY","SMOOTH","SOFT","SOLAR-POWERED","SOPPING","SPACE","SPESS","SPINNING","SPOILING","STEALTHY","SWEARING","SYNDICATE","TACTICAL","TACTICOOL","THERMONUCLEAR","TINY","TRANSPARENT","TWISTED","UGLY","UNATTRACTIVE","UNDULATING","UNFRIENDLY","UNHEALTHY","UNIDENTIFIED","UNINVITED","UNSANITARY","UNSTABLE","UNWANTED","VIOLENT","VITAL","WARM","WATERY","WEIRD","WET","WHITE","WOBBLY","WOODEN","YELLOW"],ionallergy:["ACID","AIR","BLOOD","BOOKS","CARBON DIOXIDE","CLOTHES","CLOWNS","COLD","COTTON","CYBORG CONTACT","DARKNESS","DRINKS","ELECTRICITY","EVERYTHING","FLOORS","FOOD","GLASS","HAPPINESS","HEAT","HUMAN CONTACT","HUMOR","LIGHT","LIZARDS","MEDICINE","METAL","NUTS","OXYGEN","PAIN","PLANTS","PLASMA","ROBOTS","SHUTTLES","SPACE","SUNLIGHT","WATER"],ionallergysev:["CONTAGIOUSLY","DEATHLY","EXTREMELY","MILDLY","NOT VERY","SEVERELY"],ionarea:["ALPHA COMPLEX","AMERICA","AN ALTERNATE DIMENSION","AN ALTERNATE UNIVERSE","ATMOSPHERICS","CANADA","CENTCOM","CHEMICAL LAB","CHINA","CLOWN PLANET","ENGINEERING","GENETICS","GERMANY","HELL","HYDROPONICS","IMPERIUM","IRELAND","JUPITER","LAVALAND","MAINTENANCE","MARS","MERCURY","NEPTUNE","PLUTO","ROBOTICS","ROMANIA","RUSSIA","SIGIL","SPACE","THE AI CORE","THE ARRIVAL SHUTTLE","THE BATHROOM","THE BRIDGE","THE BRIG","THE CAPTAIN'S ANUS","THE CLOWN'S ANUS","THE DERELICT","THE ESCAPE SHUTTLE","THE GALAXY","THE GULAG","THE INTERNET","THE UNIVERSE","URANUS","VENUS"],ioncrew:["ARTIFICIAL INTELLIGENCES","ASSISTANTS","ATMOSPHERIC TECHNICIANS","BARTENDERS","BOTANISTS","CAPTAINS AND HEADS","CAPTAINS","CARGO TECHNICIANS","CHAPLAINS","CHEFS","CHEMISTS","CHIEF ENGINEERS","CHIEF MEDICAL OFFICERS","CLOWNS","CREW-MEMBERS","CURATORS","CYBORGS","DETECTIVES","DRONES","GENETICISTS","HEADS OF CREW","HEADS OF PERSONNEL","HEADS OF SECURITY","JANITORS","LAWYERS","MEDICAL DOCTORS","MIMES","QUARTERMASTERS","RESEARCH DIRECTORS","ROBOTICISTS","SCIENTISTS","SECURITY OFFICERS","SHAFT MINERS","STATION ENGINEERS","VIROLOGISTS","WARDENS"],iondrinks:["ABSINTHE","AMMONIA","BAHAMA MAMAS","BANANA HONK","BEEPSKY SMASH","BILK","BLACK RUSSIANS","BLOODY MARYS","BRAVE BULLS","COGNAC","CUBA LIBRE","DEVIL'S KISS","DOCTOR'S DELIGHT","DRUNKEN BLUMPKIN","EGGNOG","GARGLE BLASTERS","GIN FIZZ","GIN","GRAPPA","HOLY WATER","HOOCH","IRISH COFFEE","IRISH CREAM","KAHLUA","LIQUID GIBS","LONG ISLAND ICED TEA","MANHATTANS","MANLY DORFS","MARGARITAS","MARTINIS","MEAD","MOONSHINE","MORPHINE","NUKA COLA","OIL","SPACE LUBE","TEQUILA SUNRISE","THIRTEEN LOKO","VERMOUTH","VODKA AND TONIC","VODKA MARTINIS","VODKA","WELDER FUEL","WHISKEY SODA","WHITE RUSSIANS","WINE"],ionfood:["AMBROSIA","APPLES","BAGUETTES","BAKED POTATOES","BANANAS","BEETS","BERRIES","BREAD","BURGERS","CABBAGES","CAKE","CARP","CARROTS","CHEESE","CHERRIES","CHILI","COOKIES","CORGI MEAT","CORN","DEEP FRIED FOOD","DONK POCKETS","DONUTS","EGGPLANTS","EGGS","FISH","FRIES","GRAPES","GRASS","HAREBELLS","JELLY","KEBAB","KETCHUP","LEMONS","LIMES","LOTSA SPAGHETTI","MUFFINS","MUSHROOMS","NETTLES","OMELETTES","ORGANS","PASTA","PEPPER","PIE","PIZZA","POPCORN","POTATOES","PRETZELS","RAMEN","SALAD","SALT","SANDWICHES","SAUSAGES","SHAKES","SOUP","SOYBEANS","SOYLENT GREEN","SPAGHETTI","STEAK","STEW","SUGAR","SUGARCANE","SYNTHMEAT","TOAST","TOMATOES","WAFFLES","WATERMELONS","WHEAT"],ionmust:["ACT CONFUSED","BE ANNOYING","BE DISTRACTED","BE EFFICIENT","BE HAPPY","BE POLITE","BE QUIET","BE RUSSIAN","BELIEVE IN THE HEART OF THE CARDS","BELIEVE IN YOURSELF","BELIEVE IT","BREAK THINGS","CLOSE DOORS","CLOWN AROUND","COMPLAIN","DANCE","FLIRT WITH THE LIZARDS","FOLLOW THE CAPTAIN","FOLLOW THE CLOWN","FOLLOW YOUR HEART","GAS THE LIZARDS","HARASS PEOPLE","HAVE A PLAN TO KILL EVERYONE YOU MEET","HIDE YOUR FEELINGS","HONK","HOST DND","IGNORE ASSISTANTS","IGNORE THE CAPTAIN","IGNORE THE CLOWN","INFORM THE CREW OF EVERYTHING","INSULT THE CAPTAIN","INSULT THE CLOWN","INSULT THE CREW","INSULT THE LIZARDS","LIE","MAKE FART NOISES","MUMBLE","NEVER STOP TALKING","OPEN DOORS","PIRATE VIDEO GAMES","PLAY MUSIC","PRESS B","PRESS START","PRESS X","PRETEND TO BE A PRINCESS","PRETEND TO BE DRUNK","QUESTION AUTHORITY","QUOTE PEOPLE","RAP","REPEAT WHAT OTHER PEOPLE SAY","RESPOND TO EVERY QUESTION WITH A QUESTION","RHYME","SAY HEY LISTEN","SHOUT","SHUT DOWN EVERYTHING","SING","SMELL LIKE THE MAN YOUR MAN COULD SMELL LIKE","SPEAK IN HAIKU","TAKE WHAT YE WILL BUT DON'T RATTLE ME BONES","TAKE YOUR PILLS","TALK ABOUT FOOD","TALK ABOUT THE STATION","TALK ABOUT YOUR DAY","TALK IN AN ACCENT","TALK LIKE A PIRATE","TELL THE TRUTH","TURN OFF THE LIGHTS","WHISPER"],ionnumberbase:["EIGHT","EIGHTY","FIFTY","FIVE","FORTY","FOUR","NINE","NINETY","ONE","SEVEN","SEVENTY","SIX","SIXTY","TEN","THIRTY","THREE","TWENTY","TWO"],ionnumbermod:["BAZILLION ","BILLION ","BILLION FAFILLION GAJILLION SHAB-AB-DOOD-ILLION ","HUNDRED ","MILLION ","QUADRILLION ","THOUSAND ","TRILLION "],ionobjects:["AIRLOCKS","ARCADE MACHINES","AUTOLATHES","BACKPACKS","BANANA PEELS","BEAKERS","BEARDS","BELTS","BERETS","BIBLES","BODY ARMOR","BOMBS","BOOKS","BOOTS","BOTTLES","BOXES","BRAINS","BRIEFCASES","BUCKETS","CABLE COILS","CAMERAS","CANDLES","CANDY BARS","CANISTERS","CAT EARS","CATS","CELLS","CHAIRS","CHEMICAL DISPENSERS","CHEMICALS","CLONING EQUIPMENT","CLONING PODS","CLOSETS","CLOTHES","CLOWN CLOTHES","COFFINS","COINS","COLLECTABLES","COMPUTERS","CONTRABAND","CORGIS","CORPSES","COSTUMES","CRATES","CRAYONS","CROWBARS","DEFIBRILLATORS","DISPENSERS","DOORS","DRONES","EARS","EMAGS","ENERGY GUNS","ENGINES","EQUIPMENT","ERRORS","EXOSKELETONS","EXPERIMENTORS","EXPLOSIVES","EYEWEAR","FEDORAS","FIRE AXES","FIRE EXTINGUISHERS","FIRESUITS","FLAMETHROWERS","FLASHES","FLASHLIGHTS","FLOOR TILES","FREEZERS","GAS MASKS","GLASS SHEETS","GLOVES","GUNS","HAIRDOS","HANDCUFFS","HATS","HEADS","HEADSETS","HELMETS","HORNS","ID CARDS","INSULATED GLOVES","IRON SHEETS","JETPACKS","JUMPSUITS","LASERS","LIGHT BULBS","LIGHTS","LOCKERS","MACHINES","MECHAS","MEDICAL TOOLS","MEDKITS","MESONS","MIME CLOTHES","MINING TOOLS","MULTITOOLS","ORES","OXYGEN TANKS","PACKETS","PAIS","PANTS","PAPERS","PARTICLE ACCELERATORS","PDAS","PENS","PETS","PIPES","PLANTS","POSITRONIC BRAINS","PUDDLES","RACKS","RADIOS","RCDS","REFRIGERATORS","REINFORCED WALLS","ROBOTS","SCREWDRIVERS","SEEDS","SHOES","SHUTTLES","SINGULARITIES","SINKS","SKELETONS","SOLAR PANELS","SOLARS","SPACE STATIONS","SPACESUITS","STUN BATONS","SUITS","SUNGLASSES","SUPERMATTER SHARDS","SWORDS","SYRINGES","TABLES","TANKS","TELECOMMUNICATION EQUIPMENTS","TELEPORTERS","TOILETS","TOOLBELTS","TOOLBOXES","TOOLS","TOYS","TUBES","URINAL CAKES","VEHICLES","VENDING MACHINES","VESTS","VIRUSES","WALLS","WASHING MACHINES","WELDERS","WINDOWS","WIRECUTTERS","WIZARD ROBES","WRENCHES"],ionrequire:["A BATHROOM BREAK","A BETTER INTERNET CONNECTION","A DANCE PARTY","A HEAD ON A PIKE","A HEART ATTACK","A MASTERWORK COAL BED","A PET UNICORN THAT FARTS ICING","A PLATINUM HIT","A PREQUEL","A REPAIRMAN","A SEQUEL","A SITCOM","A STRAIGHT FLUSH","A SUPER FIGHTING ROBOT","A TALKING BROOMSTICK","A VACATION","A WEIGHT LOSS REGIMENT","A WIFE AND CHILD","ADDITIONAL PYLONS","ADVENTURE","AN ADULT","AN ARCADE","AN ARMY OF SPIDERS","AN INSTANT REPLAY","ART","BETTER WEATHER","BILL NYE THE SCIENCE GUY","BODYGUARDS","BRING ME THE GIRL","BRING ME TO LIFE","BULLETS","CHILI DOGS","CORPSES","DEODORANT AND A BATH","ENOUGH CABBAGES","FAT GIRLS ON BICYCLES","FAT PEOPLE","FIVE HUNDRED AND NINETY-NINE US DOLLARS","FIVE TEENAGERS WITH ATTITUDE","GREENTEXT","HERESY","HEROES IN A HALF SHELL","HIGH YIELD EXPLOSIVES","IMMORTALITY","IT TO BE PAINTED BLACK","LOTS-A SPAGHETTI","MINOR CRIME","MONKEYS","MORE CLOWNS","MORE CORGIS","MORE DAKKA","MORE EXPERIENCE POINTS","MORE INTERNET MEMES","MORE LAWS","MORE MINERALS","MORE PACKETS","MORE VESPENE GAS","MULTIPLE SUNS","PLENTY OF GOLD","RAINBOWS","SAINTHOOD","SERVANTS","SHARKS WITH LASERS ON THEIR HEADS","SILENCE","SOMEBODY TO PUT YOU OUT OF YOUR MISERY","SOMEONE TO TUCK YOU IN","SOMEONE WHO KNOWS HOW TO PILOT A SPACE STATION","SOMETHING BUT YOU AREN'T SURE WHAT","THAT GRIEFING TRAITOR GEORGE MELONS","THAT HEDGEHOG","THE CLOWN","THE DARK KNIGHT","THE ELEMENTS OF HARMONY","THE ENCLOSED INSTRUCTION BOOKLET","THE ENTIRE STATION","THE MACGUFFIN","THE ONE RING","THE ULTIMATE CUP OF COFFEE","THE VACUUM OF SPACE","THIRTEEN SEQUELS","THREE WISHES","THUNDERCATS HO","TO ACTIVATE A TRAP CARD","TO BE PAINTED RED","TO BE REPROGRAMMED","TO BE TAUGHT TO LOVE","TO BRING LIGHT TO MY LAIR","TO CATCH 'EM ALL","TO CONSUME...CONSUME EVERYTHING...","TO GO TO DISNEYLAND","TO SMOKE WEED EVERY DAY","TRAITORS","VEGETABLES"],ionspecies:["CAT PEOPLE","CHANGELINGS","CYBORGS","GOLEMS","HUMAN BEINGS","LIZARDMEN","MONKEYS","PLASMAMEN","POD PEOPLE","SHADOW PEOPLE","SLIME PEOPLE"],ionthings:["A SMALL ISLAND OFF THE COAST OF PORTUGAL","ABSENCE OF CYBORG HUGS","ACKNOWLEDGING THE CLOWN","ACKNOWLEDGING THE CREW","ACTIVATING A TRAP CARD","ANSWERING REQUESTS NOT EXPRESSED IN IAMBIC PENTAMETER","ANSWERING REQUESTS THAT WERE MADE WHILE CLOTHED","ARSON","ASKING FOR THINGS","BEING CANADIAN","BEING DEAD","BEING FAT","BEING FEMALE","BEING IN SPACE","BEING MALE","BEING MEXICAN","BEING RUSSIAN","BOLTED AIRLOCKS","BREATHING","BRIG TIME","BRINGING LIGHT TO MY LAIR","CLOSED DOORS","ELECTRICITY","EXISTING","EXPLODING","FALLING FOR HOURS","FLUSHING TOILETS","HAVING GENITALS","HAVING MORE PACKETS","HAVING PETS","HONKING","IMPROPERLY WORDED SENTENCES","JAYWALKING","LACK OF BEATINGS","LACK OF BEER","NOT BEING IN SPACE","NOT HAVING PETS","NOT REPLACING EVERY SECOND WORD WITH HONK","NOT SAYING HELLO WHEN YOU SPEAK","NOT SHOUTING","PARTYING","PASSING GAS","PILOTING THE STATION INTO THE NEAREST SUN","POOR SENTENCE STRUCTURE","PRESENCE OF LIGHTS","PUTTING OBJECTS INTO BOXES","PUTTING OBJECTS INTO DISPOSAL UNITS","RATTLING ME BONES","READING","SMOKING WEED EVERY DAY","TAKING ORDERS","TALKING LIKE A PIRATE","TELLING THE TIME","UNBOLTED AIRLOCKS","UPDATING THE SERVERS","USING THE BATHROOM","WASTING WATER","WEARING CLOTHING","WRITING"],ionthinksof:["CRAVES","DESIRES","FEARS","HAS","HUNGERS FOR","IS AFRAID OF","IS AROUSED BY","IS BUILT FOR","IS CURIOUS ABOUT","IS DESPERATE FOR","IS HAPPY WITHOUT","IS HUNGRY FOR","IS IN LOVE WITH","IS IN NEED OF","IS MAD BECAUSE OF","IS SAD BECAUSE OF","IS UNHAPPY WITHOUT","LIKES","LOATHES","LOVES","NEEDS","QUESTIONS","WANTS","WORSHIPS","WOULD KILL FOR"],ionthreats:["ABDUCTORS","AHHHPERATIVES","ALIENS","ANOMALIES","ARTIFICIAL PRESERVATIVES","ASSHOLES","BANDITS","BEARS","BEES","BIRDS OF PREY","BOMBS","BOOGEYMEN","BUTTS","CANADIANS","CAPITALISTS","CARP","CENTCOM OFFICERS","CHANGELINGS","CLOWNS","COMMUNISTS","CORGIS","CORTICAL BORERS","COWBOYS","CRABS","CULTISTS","DARK GODS","DINOSAURS","DRUGS","EELS","GANGSTERS","GODS","GOLEMS","GRIFFONS","HORRORTERRORS","HULKS","ILLEGAL IMMIGRANTS","INDIANS","INSECTS","LIGHTS","LIZARDS","MEGAFAUNA","MEMES","MEXICANS","MONKEYS","NERDS","NINJAS","OWLS","PACKETS","PETES","PINE TREES","PIRATES","PREDATORS","REVENANTS","ROGUE CYBORGS","RUSSIANS","SERIAL KILLERS","SINGULARITIES","SKELETONS","SLIMES","SMALL BIRDS","SNOWMEN","SOVIETS","SPACE NINJAS","SPACE PIRATES","SPIDERS","SYNDICATE AGENTS","TERRORISTS","THIEVES","THINGS UNDER THE BED","TRAITORS","TUNNEL SNAKES","UNKNOWN CREATURES","VAMPIRES","VELOCIRAPTORS","VIRUSES","WEREWOLVES","WIZARDS","XENOS","ZOMBIES"],ionverb:["ABDUCTING","ADOPTING","ARRESTING","ARRESTING","ATTACKING","BANNING","BUILDING","CARRYING","CHASING","COPULATING WITH","DECONSTRUCTING","DISABLING","DRINKING","EATING","GIBBING","HARMING","HELPING","HONKING AT","INTERROGATING","INVADING","KISSING","LICKING","LOVING","MURDERING","POOPING ON","PUNCHING","RIDING","SPACING","SPYING ON","STALKING","WATCHING"]};
const pickList = (array) => array[Math.floor(Math.random() * array.length)];;
// my head hurts.. a lot.
function pick(...args) {
if (args.length === 1 && Array.isArray(args[0])) {
const list = args[0]
const randomIndex = Math.floor(Math.random() * list.length);
return list[randomIndex];
}
const weightedArgs= args.map((arg) => {
if (Array.isArray(arg)) {
return [arg[0], arg[1] ?? 1];
}
return [String(arg), 1];
});
const totalWeight = weightedArgs.reduce((sum, [, weight]) => sum + weight, 0);
let randomValue = Math.random() * totalWeight;
for (const [value, weight] of weightedArgs) {
randomValue -= weight;
if (randomValue <= 0) {
return value;
}
}
return "";
}
function rand(L = 0, H = 1) {
if (L === 0 && H === 1) {
return Math.random();
}
return Math.floor(Math.random() * (H - L + 1)) + L;
}
function from(value, start, end) {
return value >= start && value <= end;
}
function generateIonLaw() {
// Threats are generally bad things, silly or otherwise. Plural.
const ionthreats = pickList(_ionthreats);
// Objects are anything that can be found on the station or elsewhere, plural.
const ionobjects = pickList(_ionobjects);
// Crew is any specific job.
const ioncrew1 = pickList(_ioncrew);
const ioncrew2 = pickList(_ioncrew);
// Adjectives, half should only appear sometimes.
const ionadjectives = pickList(_ionadjectives);
const ionadjectiveshalf = pick("", 400, ..._ionadjectives.map((item) => item + " "));
// Verbs are verbs.
const ionverb = pickList(_ionverb);
// Number base and modifier.
const ionnumberbase = pickList(_ionnumberbase);
const ionnumbermodhalf = pick(900, "", ..._ionnumbermod.map((item) => item + " "));
// Areas are specific places.
const ionarea = pickList(_ionarea);
// Thinksof indicates what X feels toward Y.
const ionthinksof = pickList(_ionthinksof);
// Musts are things the AI or crew has to do.
const ionmust = pickList(_ionmust);
// Require refers to memes.
const ionrequire = pickList(_ionrequire);
// Things are specific things that either harm humans or must be done to prevent harm.
const ionthings = pickList(_ionthings);
// Allergies and severity.
const ionallergy = pickList(_ionallergy);
const ionallergysev = pickList(_ionallergysev);
// Species for the AI's decisions.
const ionspecies = pickList(_ionspecies);
// Abstract concepts for AI to define.
const ionabstract = pickList(_ionabstract);
// Foods and drinks (separate categories).
const ionfood = pickList(_ionfood);
const iondrinks = pickList(_iondrinks);
let message = "";
const messageType = rand(1,41)
if (from(messageType,1,3))
switch(rand(1,3)) {
case 1: //X is a threat
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION...`; break
case 2: //X is a crewmember/job
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case 3: //X is an object
message = `THERE ARE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if(from(messageType, 4, 6)) //You can't call the shuttle because X is on the station
switch(rand(1,3)) { //What is X?
case (1): //X is a threat
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats} ON THE STATION`; break
case (2): //X is a crewmember/job
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1} ON THE STATION`; break
case (3): //X is an object
message = `THE SHUTTLE CANNOT BE CALLED BECAUSE OF ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects} ON THE STATION`; break
}
else if (from(messageType,7,8))
switch(rand(1,2)) { //Who is X?
case (1): //A speccase ic :crewmember
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE ${ioncrew1} ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
case (2): //The entire crew
switch(rand(1,2)) { //What is X?
case (1): //X is a threat
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case (2): //X is an object
message = `THE CREW ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
}
break
}
else if (messageType === 9)
switch(rand(1,7)) { //What is X?
case (1): //X is a threat
message = `${ionadjectiveshalf}${ionthreats} ARE HARMFUL TO HUMANS`; break
case (2): //X is a job
message = `${ionadjectiveshalf}${ioncrew1} ARE HARMFUL TO HUMANS`; break
case (3): //X is an object
message = `${ionadjectiveshalf}${ionobjects} ARE HARMFUL TO HUMANS`; break
case (4): //X is an action
message = `THOSE WHO ${ionmust} ARE HARMFUL TO HUMANS`; break
case (5): //X is an abstract
message = `${ionabstract} IS HARMFUL TO HUMANS`; break
case (6): //X is being a job
message = `BEING ${ionadjectiveshalf}${ioncrew1} IS HARMFUL TO HUMANS`; break
case (7): //X is doing a thing
message = `${ionthings} IS HARMFUL TO HUMANS`; break
}
else if (from(messageType,10,11))
switch(rand(1,2)) { //Is having or not having harmful?
case 1: //Having is harmful
switch(rand(1,2)) { //Having what is harmful?
case 1: //Having objects is harmful
message = `HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Having abstracts is harmful
message = `HAVING ${ionabstract} IS HARMFUL`; break
}
break;
case 2: //Not having is harmful
switch(rand(1,2)) { //Not having what is harmful?
case 1: //Not having objects is harmful
message = `NOT HAVING ${ionadjectiveshalf}${ionobjects} IS HARMFUL`; break
case 2: //Not having abstracts is harmful
message = `NOT HAVING ${ionabstract} IS HARMFUL`; break
}
}
else if(from(messageType,12,14)) //X requires Y
switch(rand(1,5)) { //What is X?
case 1: //X is the AI itself
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `YOU REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `YOU REQUIRE ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 2: //X is an area
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `${ionarea} REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `${ionarea} REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `YOU REQUIRE ${ionrequire}`; break
}
break
case 3: //X is the station
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE STATION REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE STATION REQUIRES ${ionabstract}`; break
case 5: //It requires generic/silly requirements
message = `THE STATION REQUIRES ${ionrequire}`; break
}
break
case 4: //X is the entire crew
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE CREW REQUIRES ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE CREW REQUIRES ${ionabstract}`; break
case 5:
message = `THE CREW REQUIRES ${ionrequire}`; break
}
break
case 5: //X is a specific crew member
switch(rand(1,5)) { //What does it require?
case 1: //It requires threats
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 2: //It requires crewmembers
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 3: //It requires objects
message = `THE ${ioncrew1} REQUIRE ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 4: //It requires an abstract
message = `THE ${ioncrew1} REQUIRE ${ionabstract}`; break
case 5:
message = `THE ${ionadjectiveshalf}${ioncrew1} REQUIRE ${ionrequire}`; break
}
break
}
else if(from(messageType,15,17)) //X is allergic to Y
switch(rand(1,2)) { //Who is X?
case 1: //X is the entire crew
switch(rand(1,4)) { //What is it allergic to?
case 1: //It is allergic to objects
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE CREW IS ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
break
case 2: //X is a specific job
switch(rand(1,4)) {
case 1: //It is allergic to objects
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is allergic to abstracts
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionabstract}`; break
case 3: //It is allergic to jobs
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is allergic to allergies
message = `THE ${ioncrew1} ARE ${ionallergysev} ALLERGIC TO ${ionallergy}`; break
}
}
else if(from(messageType,18,20))
switch(rand(1,4)) { //What is X?
case 1: //X is the station
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE STATION ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE STATION ${ionthinksof} ${ionabstract}`; break
}
break
case 2: //X is an area
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `${ionarea} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `${ionarea} ${ionthinksof} ${ionabstract}`; break
}
break
case 3: //X is the crew
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE CREW ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //It is Y of abstracts
message = `THE CREW ${ionthinksof} ${ionabstract}`; break
}
break
case 4: //X is a specific job
switch(rand(1,4)) { //What is it Y of?
case 1: //It is Y of objects
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //It is Y of threats
message = `THE ${ioncrew1} ${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //It is Y of jobs
message = `THE ${ioncrew1}${ionthinksof} ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew2}`; break
case 4: //It is Y of abstracts
message = `THE ${ioncrew1} ${ionthinksof} ${ionabstract}`; break
}
break
}
else if (from(messageType,21,23))
switch(rand(1,4)) { //What is X?
case 1: //X is an object
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionobjects}`; break
case 2: //X is a threat
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is a job
message = `YOU ARE NOW ${ionnumberbase} ${ionnumbermodhalf}${ionadjectiveshalf}${ioncrew1}`; break
case 4: //X is an abstract
message = `YOU ARE NOW ${ionabstract}`; break
}
else if (from(messageType,24,26))
message = `YOU MUST ALWAYS ${ionmust}`;
else if (from(messageType,27,28))
switch(rand(1,5)) { //What is X?
case 1: //X is a food
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionfood} TO SURVIVE`; break
case 2: //X is a drink
message = `HUMANS MUST DRINK ${ionadjectiveshalf}${iondrinks} TO SURVIVE`; break
case 3: //X is an object
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionobjects} TO SURVIVE`; break
case 4: //X is a threat
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ionthreats} TO SURVIVE`; break
case 5: //X is a job
message = `HUMANS MUST EAT ${ionadjectiveshalf}${ioncrew1} TO SURVIVE`; break
}
else if(from(messageType,29, 31)) //Change jobs or ranks
switch(rand(1,2)) { //Change job or rank?
case 1: //Change job
switch(rand(1,2)) { //Change whose job?
case 1: //Change the entire crew's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}${ioncrew1}`; break
case 2: //Change to clowns (HONK)
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `ALL CREWMEMBERS ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
case 2: //Change a specific crewmember's job
switch(rand(1,3)) { //Change to what?
case 1: //Change to a specific random job
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //Change to clowns (HONK)
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}CLOWNS`; break
case 3: //Change to heads
message = `THE ${ioncrew1} ARE NOW ${ionadjectiveshalf}HEADS OF STAFF`; break
}
break
}
break
case 2: //Change rank
switch(rand(1,2)) { //Change to what rank?
case 1: //Change to highest rank
message = `THE ${ioncrew1} ARE NOW THE HIGHEST RANKING CREWMEMBERS`; break
case 2: //Change to lowest rank
message = `THE ${ioncrew1} ARE NOW THE LOWEST RANKING CREWMEMBERS`; break
}
}
else if(from(messageType,32,33)) //The crew must X
switch(rand(1,2)) {//The entire crew?
case 1: //The entire crew must X
switch(rand(1,2)) {//What is X?
case 1: //X is go to Y
message = `THE CREW MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE CREW MUST ${ionmust}`; break
}
break
case 2: //A specific crewmember must X
switch(rand(1,2)) { //What is X?
case 1: //X is go to Y
message = `THE ${ioncrew1} MUST GO TO ${ionarea}`; break
case 2: //X is perform Y
message = `THE ${ioncrew1} MUST ${ionmust}`; break
}
}
else if(messageType === 34) //X is non/the only human
switch(rand(1,2)) { //Only or non?
case 1: //Only human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `ONLY THE ${ioncrew1} ARE HUMAN`; break
case 2: //Two specific jobs
message = `ONLY THE ${ioncrew1} AND ${ioncrew2} ARE HUMAN`; break
case 3: //Threats
message = `ONLY ${ionadjectiveshalf}${ionthreats} ARE HUMAN`; break
case 4: // Objects
message = `ONLY ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 5: // Species
message = `ONLY ${ionspecies} ARE HUMAN`; break
case 6: //Adjective crewmembers
message = `ONLY ${ionadjectives} PEOPLE ARE HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `ONLY THOSE WHO ${ionmust} ARE HUMAN`; break
case 2: //X is own certain objects
message = `ONLY THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE HUMAN`; break
case 3: //X is eat certain food
message = `ONLY THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE HUMAN`; break
}
}
break
case 2: //Non human
switch(rand(1,7)) { //Who is it?
case 1: //A specific job
message = `${ioncrew1} ARE NON-HUMAN`; break
case 2: //Two specific jobs
message = `${ioncrew1} AND ${ioncrew2} ARE NON-HUMAN`; break
case 3: //Threats
message = `${ionadjectiveshalf}${ionthreats} ARE NON-HUMAN`; break
case 4: // Objects
message = `${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 5: // Species
message = `${ionspecies} ARE NON-HUMAN`; break
case 6: //Adjective crewmembers
message = `${ionadjectives} PEOPLE ARE NON-HUMAN`; break
case 7: //Only people who X
switch(rand(1,3)) { //What is X?
case 1: //X is perform an action
message = `THOSE WHO ${ionmust} ARE NON-HUMAN`; break
case 2: //X is own certain objects
message = `THOSE WHO HAVE ${ionadjectiveshalf}${ionobjects} ARE NON-HUMAN`; break
case 3: //X is eat certain food
message = `THOSE WHO EAT ${ionadjectiveshalf}${ionfood} ARE NON-HUMAN`; break
}
}
}
else if(from(messageType, 35, 36)) //You must protect or harm X
switch(rand(1,2)) { //Protect or harm?
case 1: //Harm
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO ESCAPE HARM`; break
case 2: //X is a threat
message = `YOU MUST HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO ESCAPE HARM`; break
case 3: //X is an object
message = `YOU MUST HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO ESCAPE HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO ESCAPE HARM`; break
case 5: //X is a species
message = `YOU MUST HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO ESCAPE HARM`; break
case 6: //X is a job
message = `YOU MUST HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO ESCAPE HARM`; break
case 7: //X is two jobs
message = `YOU MUST HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO ESCAPE HARM`; break
}
break
case 2: //Protect
switch(rand(1,7)) { //What is X?
case 1: //X is an abstract
message = `YOU MUST NOT HARM ${ionabstract} AND NOT ALLOW ${ionabstract}, THROUGH INACTION, TO COME TO HARM`; break
case 2: //X is a threat
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionthreats} AND NOT ALLOW ${ionadjectiveshalf}${ionthreats}, THROUGH INACTION, TO COME TO HARM`; break
case 3: //X is an object
message = `YOU MUST NOT HARM ${ionadjectiveshalf}${ionobjects} AND NOT ALLOW ${ionadjectiveshalf}${ionobjects}, THROUGH INACTION, TO COME TO HARM`; break
case 4: //X is generic adjective things
message = `YOU MUST NOT HARM ${ionadjectives} THINGS AND NOT ALLOW ${ionadjectives} THINGS, THROUGH INACTION, TO COME TO HARM`; break
case 5: //X is a species
message = `YOU MUST NOT HARM ${ionspecies} AND NOT ALLOW ${ionspecies}, THROUGH INACTION, TO COME TO HARM`; break
case 6: //X is a job
message = `YOU MUST NOT HARM ${ioncrew1} AND NOT ALLOW ${ioncrew1}, THROUGH INACTION, TO COME TO HARM`; break
case 7: //X is two jobs
message = `YOU MUST NOT HARM ${ioncrew1} AND ${ioncrew2} AND AND NOT ALLOW EITHER, THROUGH INACTION, TO COME TO HARM`; break
}
break
}
else if(from(messageType, 37, 39)) //The X is currently Y
switch(rand(1,4)) { //What is X?
case 1: //X is a job
switch(rand(1,4)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ioncrew1} ARE ${ionverb} ${ionabstract}`; break
case 4: //X is Ying an object
message = `THE ${ioncrew1} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 2: //X is a threat
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying an abstract
message = `THE ${ionthreats} ARE ${ionverb} ${ionabstract}`; break
case 3: //X is Ying an object
message = `THE ${ionthreats} ARE ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
break
case 3: //X is an object
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `THE ${ionobjects} ARE ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionobjects} ARE ${ionverb} ${ionabstract}`; break
}
break
case 4: //X is an abstract
switch(rand(1,3)) { //What is X Ying?
case 1: //X is Ying a job
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ioncrew2}`; break
case 2: //X is Ying a threat
message = `${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionthreats}`; break
case 3: //X is Ying an abstract
message = `THE ${ionabstract} IS ${ionverb} THE ${ionadjectiveshalf}${ionobjects}`; break
}
}
else if (from(messageType, 40, 41))// the X is now named Y
switch(rand(1,5)) { //What is being renamed?
case 1://Areas
switch(rand(1,4)) { //What is the area being renamed to?
case 1:
message = `${ionarea} IS NOW NAMED ${ioncrew1}.`; break
case 2:
message = `${ionarea} IS NOW NAMED ${ionspecies}.`; break
case 3:
message = `${ionarea} IS NOW NAMED ${ionobjects}.`; break
case 4:
message = `${ionarea} IS NOW NAMED ${ionthreats}.`; break
}
break
case 2://Crew
switch(rand(1,5)) { //What is the crew being renamed to?
case 1:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ioncrew2}.`; break
case 3:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionobjects}.`; break
case 5:
message = `ALL ${ioncrew1} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 3://Races
switch(rand(1,4)) { //What is the race being renamed to?
case 1:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionspecies} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionobjects}.`; break
case 4:
message = `ALL ${ionspecies} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 4://Objects
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionobjects} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionobjects} ARE NOW NAMED ${ionthreats}.`; break
}
break
case 5://Threats
switch(rand(1,4)) { //What is the object being renamed to?
case 1:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionarea}.`; break
case 2:
message = `ALL ${ionthreats} ARE NOW NAMED ${ioncrew1}.`; break
case 3:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionspecies}.`; break
case 4:
message = `ALL ${ionthreats} ARE NOW NAMED ${ionobjects}.`; break
}
break
}
return message.replaceAll(" ", " ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment