Math Maze 2: Game-based Math Practice
JavaScript is required. Please enable it to continue.
Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
<div id="encounter">\ <img src="assets/encounters/bird2.jpg">\ <div id="encounter-text">\ You come across a strange <<en "red" "red" "pulse">> bird on the ground. Is it ok? It's holding its wing out a bit funny and looking up at you with big eyes. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Help the bird"],["Keep walking"], ]>>\ <<c _choices>> /*call on the widget! */\
You go to help the bird but it suddenly jumps up and flies away, leaving a little egg on the ground.
You leave the bird. Maybe it was just beginning to learn how to fly? /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/obelisk.jpg">\ <div id="encounter-text">\ A stone statue covered in writing stands before you. As you start to read, the writing begins to <<en "glow" "blue" "pulse">> bright BLUE and you start <<en "floating" "purple" "fadeOutUp" "delay-3s">> into the air. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Keep reading"],["Stop reading"], ]>>\ <<c _choices>> /*call on the widget! */\
You keep reading the words, and as you finish there is a brilliant <<en "FLASH OF LIGHT" "yellow" "flash" "repeat-1" "delay-3s">> and you feel <<en "REALLY GOOD." "green" "pulse">>
You try to stop reading, but find you cannot. As you finish reading, there is a brilliant <<en "FLASH OF LIGHT" "yellow" "flash" "repeat-1" "delay-3s">> and you feel <<en "REALLY GOOD." "green" "pulse">> /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/pipe.jpg">\ <div id="encounter-text">\ You find a magical looking pipe. The wood is chipped but it doesn’t look to be broken. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Test the pipe"],["Leave the pipe"], ]>>\ <<c _choices>> /*call on the widget! */\
You puff on the pipe and it lets out a cloud of smelly black smoke. It stings your eyes and it really stinks... Suddenly you hear a <<en "roar" "red" "wobble" "fast">> from nearby and a grumpy monster stumbles out of the trees pinching it's nose. It spots you and chases you away.
As you walk past the pipe you notice a monster sleeping under a tree. Next to it is a sign that says //NO SMOKING!// Good thing you didn’t wake him up! /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/statue.jpg">\ <div id="encounter-text">\ A broken statue is <<en "floating" "blue" "slideInDown" "repeat-1">> in mid air. It’s legs have fallen off and are lying in the dust. Looks like it's broken...but maybe dangerous. There's something <<en "gold" "yellow" "heartBeat">> in the statue's belly. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Repair the legs"],["Grab the gold"], ]>>\ <<c _choices>> /*call on the widget! */\
You reconnect the legs and hear a locking sound. Then something falls out of it and lands at your feet. <<en "A ruby!" "red" "bounceInDown" "repeat-1" "delay-3s">> As you take the gem, the statue's legs fall off again.
You reach in and pull a thin <<en "gold" "yellow" "heartBeat">> disk out of the center of the statue. Immediately the rest of the statue crumbles and falls to the ground around you. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/thumper.jpg">\ <div id="encounter-text">\ You come across a giant soldier with a wooden leg. 'They call me <<en "Thumper,'" "purple" "bounce">> he says, standing up and pulling off a horned helmet. 'I give protection in return for coin.' He looks strong, but also kind of crazy... </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Give Thumper money"],["Say no politely"],["Drive him away"], ]>>\ <<c _choices>> /*call on the widget! */\
You agree to pay Thumper 20 gold in return for his protection. That night you are attacked by a group of pigmy goblins but Thumper effortlessly drives them off, laughing madly. Money well spent. The next morning you thank him, and he hums jauntily as he strolls away.
You politely decline Thumper's offer. He frowns, but carries on his way. That night you are attacked by a group of pigmy goblins and take a beating before driving them away. You really could have used Thumper's help after all.
You draw your sword and try to fight Thumper, but he disarms you easily, and laughs as he steals your coin, leaving you with a sore head in the dust. <<set $coins -= $coins>> <<set $hp -= 4>> /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/spider.jpg">\ <div id="encounter-text">\ You come to a gloomy patch of woodland. The trees grow close together and the air is hot. As you move forward it starts to get darker and darker. Suddenly you hear something <<en "gurgling" "purple" "shakeX" "fast">> in the darkness in front of you. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Find your lantern"],["Flee the woods"], ]>>\ <<c _choices>> /*call on the widget! */\
You hold up your lantern and see a <<en "sticky" "green" "rubberBand">> spider’s web with a huge spider in it. You keep your eyes on the creature and carefully step around it, continuing your journey.
You turn to run, but your foot slips on the muddy ground and you fall flat on your face. Wet <<en "sticky" "green" "rubberBand">> webs wrap around your face and arms. Your legs aren’t moving properly. You roll and try to rip the webs off as you feel a <<en "hot" "red" "flash">> jolt of pain in your leg. You limp back out of the woods, your leg swelling from the spider bite... <<set $hp -= 3>> /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/bluepotion.jpg">\ <div id="encounter-text">\ You find a bottle of bright <<en "blue" "blue" "pulse">> potion on the ground. It bubbles and fizzes quietly. You are quite thirsty... </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Have a drink"],["Don't Drink"], ]>>\ <<c _choices>> /*call on the widget! */\
It tastes like fresh berries! You feel a surge of energy and the impulse to <<en "RUN!" "green" "bounce">> You dash off down the path. You can't stop. You run for what feels like hours until you fall down and sleep. When you wake up, your shoes are worn out and your legs ache.
You’re sooo thirsty but that potion looks too magical to risk a drink! You keep walking. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/sheep.jpg">\ <div id="encounter-text">\ You see a wooly sheep <<en "eating grass" "green" "headShake" "slower">> nearby. You decide to try and grab it and shear off some wool.. But how? </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Sneak up on it"],["Give it a treat"], ]>>\ <<c _choices>> /*call on the widget! */\
Doing your best impression of a Ninja, you sneak up behind the sheep. You're just reaching out to grab it when suddenly it turns on you. It <<en "butts" "blue" "wobble">> you with its giant horns before dashing off into the trees.
Holding a fresh apple from your pack, you step cautiously towards the sheep. It watches you, chewing grass lazily. It accepts the apple and munches happily as you shear off some of its wool. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/bookblue1.jpg">\ <div id="encounter-text">\ Why is there a pile of books in the middle of nowhere? The sign says free.. Might as well take one. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Take the blue one"],["Take the red one"],["Take the green one"], ]>>\ <<c _choices>> /*call on the widget! */\
It appears to be a book of poems. You read one... <<en "Potatoes are orange, bananas are red, perhaps I should have stayed in bed." "blue" "fadeInLeft" "slower" "repeat-1">> Wow... thats terrible!
It appears to be a book about warts and how to treat them. <<en "Mash 6 slugs with a teaspoon of honey under a full moon. Spread generously in your armpits and leave for 1 week." "red" "fadeInLeft" "slower" "repeat-1">> Hmmm no thanks...
It appears to be a book of riddles! Try one? <<en "What breaks as soon as you say it's name?" "green" "fadeInLeft" "slower" "repeat-1">> Hmmm... Thats a hard one! /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/critter.jpg">\ <div id="encounter-text">\ A little critter <<en "bounces" "someClass" "bounce" "repeat-2">> out of the trees. “Want to have a picnic with Gingle???” It squeaks. It doesn't //look// dangerous. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Dine with the critter"],["Wait, is this a trick?"], ]>>\ <<c _choices>> /*call on the widget! */\
Uhhh.. Sure? Why not! It looks friendly. Gingle grins as he lays out a picnic of <<en "worms," "red" "shakeX" "repeat-1">> <<en "slugs" "purple" "bounce" "repeat-2">> and <<en "spiders" "green" "tada" "repeat-3">>. Oh no! You hide the insects in your pockets and excuse yourself as quickly as possible.
You stare at the critter, wondering what to do. It bursts into tears, howling, <<en "NOBODY WANTS TO BE GINGLES FRIEND! GINGLE IS A NICE BOY!" "red" "shakeX" "repeat-2" "delay-4s">> before dashing off into the forest. Poor thing, you didnt mean to hurt it's feelings. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/mushrooms.jpg">\ <div id="encounter-text">\ You come across a large crop of mushrooms! A bright <<en "blue bird" "blue" "pulse">> is sitting in the trees above - it looks like he's reading a book. You wonder if it's a nice bird. Should you talk to the bird or try to steal some mushrooms? </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Ask for mushrooms"],["Sneak the mushrooms"], ]>>\ <<c _choices>> /*call on the widget! */\
"Of course you can have some mushrooms youngling!" the bird squawks, not taking his eyes off his book. "I recommend the Agaricus bisporus... They taste lovely. But stay away from the Amanita Muscaria...It's effects can be quite.. unpleasant." You stare back, not understanding a word. "Pick the little white ones," the bird says kindly. "DON'T pick the red spotted ones." You nod and gather your mushrooms before moving on.
You tiptoe towards the mushrooms. "I recommend the Agaricus bisporus," The bird says suddenly. His eyes are still on his book. "They have the most delightful smell! But stay away from the Amanita Muscaria...It's effects can be quite.. unpleasant." The Agari-what? You don't understand. You quickly grab a handful of spotty <<en "red" "red" "pulse">> mushrooms before moving along. That night, you eat some for dinner and get stomach cramps. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/shack.jpg">\ <div id="encounter-text">\ This storm is terrible and you’re wet through. Ahead you see a gloomy but dry looking cave. Nearby is a hut with smoke puffing out of a little metal chimney. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Shelter in the cave"],["Shelter in the hut"], ]>>\ <<c _choices>> /*call on the widget! */\
You're greeted by a grubby little man. He insists you answer a riddle in exchange for shelter in his cave. You're up half the night trying to figure out the answer, and in the morning you are exhausted.
You're met by a tired looking woman in a stained apron. "You can stay," she barks, "As long as you don't tell me any RIDDLES! I had to send Korvin out to the cave because he wouldn't stop asking me this riddle. Usually I wouldn't mind but he's OBSESSED with this one!" She keeps you up half the night trying to figure out the answer to her husband's riddle. In the morning you are tired. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/old_diary.jpg">\ <div id="encounter-text">\ You’ve been welcomed into a friendly creature’s hut for a meal. The creature goes outside to fetch some herbs and you notice a <<en "book" "blue" "pulse">> lying open on the table. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Read the book"],["Don't read the book"], ]>>\ <<c _choices>> /*call on the widget! */\
"27th of January," it reads, "Last week I saw Tharin. He has the most beautiful eyes..." You stop reading. This is a diary! You slam the diary shut just as the creature trots back into the room. "You read my diary didn't you!?" the creature yells, going <<en "red" "red" "pulse">> and kicking you out of the house.
The creature returns and looks at you and the book suspiciously. "I knew it!" the creature yells, going <<en "red" "red" "pulse">> in the face. "You read my diary!" The creature kicks you out of the house. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/snot_monster.jpg">\ <div id="encounter-text">\ A grumpy monster is stomping through the forest. They haven’t seen you yet, better take cover! </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Climb a tree"],["Hide behind a rock"], ]>>\ <<c _choices>> /*call on the widget! */\
You scamper up the nearest tree. The monster passes underneath, picking his nose and sucking his fingers. You're busy trying not to gag when your branch breaks and you drop to the ground. The monster's face goes red. "I WAS JUST SCRATCHING!" he bellows. "Sure you were!" You say before you can stop yourself. The monster tries to grab you, but you slip away.
You peep around the rock. The monster is walking past, picking his nose and sucking his fingers... Gross! /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/slug.jpg">\ <div id="encounter-text">\ A giant slug blocks your path. <<en "'Pleeeeasseee,'" "purple" "shakeY" "delay-2s" "slower">> he whines loudly. 'Play a game with me! I’m SO BORED!' </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Chess"],["Marbles"],["No Thanks"] ]>>\ <<c _choices>> /*call on the widget! */\
You verse the slug in chess. It’s an INCREDIBLY <<en "SLOW" "green" "rubberBand" "slower">> GAME. And you lose. <<en "Fun times." "blue" "swing">>
You decide to play marbles. The slug's <<en "slime" "green" "rubberBand" "slower">> keeps the marbles from rolling at all. You win easily, but the slug doesn't mind. He's just happy to play.
"No thanks," you say, "I've got to keep going." The slug <<en "slimes" "green" "rubberBand" "slower">> away sadly. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/goblin_jeremy.jpg">\ <div id="encounter-text">\ A frowning goblin steps out from behind a tree. “You again! I thought I told you to get lost,” he snarls. You’ve never seen this Goblin before in your life. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Explain the mistake"],["Play along"],["Run for it"] ]>>\ <<c _choices>> /*call on the widget! */\
You tell the goblin there must be some mistake - you've never met him before. "Nonsense Jeremy!" he screeches. "This time you're going to do the job RIGHT!" He grabs you by the scruff of the neck and drags you over to a washing basin filled with filthy dishes. "Last chance Jeremy! I want to see my FACE in these dishes when you're done!" What choice do you have? You roll up your sleeves and start scrubbing.
"Oh, Um yes! You did say that didn't you? I just forgot my..." you glance wildly around, "uhh...my stick!" You snatch a broken stick off the ground and show it to the Goblin. He narrows his eyes, arms folded. "It's my lucky stick.. Sorry to bother you, I'll just be going now!" you stutter. You pat the stick fondly as you back slowly away. The Goblin frowns and watches you go.
You decide to run for it. 'THATS RIGHT JEREMY! YOU'D BETTER <<en "RUN!'" "red" "wobble">> the Goblin screeches at your back. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/crab.jpg">\ <div id="encounter-text">\ A long line of crabs are winding their way down the path. They’re carrying a small <<en "gem" "green" "pulse">> on their backs. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Steal the gem"],["Follow the crabs"], ]>>\ <<c _choices>> /*call on the widget! */\
Crabs don’t need gems! You pluck the gemstone from their little claws. The crabs immediately scuttle into the bushes. Maybe they're off to look for more gems?
Why do crabs have a gemstone? Where are they going? The crabs lead you to a hollowed out tree. It's absolutely STUFFED with <<en "gems!" "green" "pulse">> You still don’t know why crabs need gems, but you take a handful. They ignore you. Interesting... /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/yelling.jpg">\ <div id="encounter-text">\ You hear shouting. It’s two monsters yelling loudly in each others faces. They spot you, and before you know it, they've got you in their beefy hands. “YOU! Puny human! Help Igor and Grook decide. Igor says moon made of cheese but Grook say it made of butter. Who is right?” </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Igor is right"],["Grook is right"], ]>>\ <<c _choices>> /*call on the widget! */\
Well.. They're both wrong. But you have to choose one! You say Igor is right. Igor nods and looks satisfied. "Clever human. Grook dumb. Igor and human clever!" Igor releases you, sending you on your way with a little gift - a chunk of <<en "stinky" "green" "pulse" "slower">> meat.
Well.. They're both wrong. But you have to choose one! You say Grook is right. Grook roars in triumph and punches his brother in the face. The two start fighting again and you run for it. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/branch.jpg">\ <div id="encounter-text">\ A gaping hole in the ground blocks the path. Should you try to jump over it? Or find a log to use as a bridge? </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Use a log"],["Jump over the hole"], ]>>\ <<c _choices>> /*call on the widget! */\
You find a sturdy looking branch nearby. As you're crossing it makes a sickening <<en "CRACK!" "green" "swing" "delay-3s">> sound. You leap for the other side just as it breaks in half and falls into the hole. That was close!
It doesn't look too far... You take a run up, and leap over the hole. You land on the other side, but twist your ankle. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/blue_spiders.jpg">\ <div id="encounter-text">\ You’re being attacked by a swarm of tiny <<en "blue spiders!" "blue" "shakeY">> Their bites sting and itch! </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Jump in the river"],["Swat 'em"], ]>>\ <<c _choices>> /*call on the widget! */\
You jump in the nearby river for some relief. The <<en "water" "blue" "pulse">> is cool on your skin, but the spiders still swarm your head, biting your face. If only you had a snorkle!
You make a swat out of some broad sappy leaves nearby. The tiny spiders don't like the smell of the sap and leave you alone. You collect some of the sap in a bottle for later. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/huge_beast.jpg">\ <div id="encounter-text">\ You turn a bend in the maze and come face to face with a huge beast. You duck under its huge arms as it lunges for you and run past. You can hear it's panting breath behind you. There is a fork in the road ahead. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Turn Left"],["Turn right"], ]>>\ <<c _choices>> /*call on the widget! */\
You dash to the left and encounter a second monster! "RUN!" you scream, waving your arms wildly. The monster looks very confused, watching you as you dash past. The first monster comes barreling around the corner and smashes into the second sending them both sprawling onto the ground. You take your chance to escape.
You dash to the right and encounter a small fluffy critter. "RUN!" you scream, waving your arms wildly. The critter's eyes widen and it begins to flee with you. The monster comes barreling around the corner. It begins to chase the little critter instead of you. Oops. /* ----------------------------------------------- DIVIDER --------------------------------------------------- */
<div id="encounter">\ <img src="assets/encounters/trickster.jpg">\ <div id="encounter-text">\ You bend over a small stream for a drink. You gasp as you catch your reflection in the water - you’ve aged significantly. You look about 80 years old. “It may come to pass!” squeaks a voice behind you, “but perhaps not... If you can pay.” You turn and find a tiny orange creature looking up at you. He looks... <<en "Magical" "yellow" "pulse">> ...and his hand is outstretched. </div>\ <div id="encounter-options"></div>\ </div>\ <<set _choices to [ ["Pay the creature"],["Don't pay"], ]>>\ <<c _choices>> /*call on the widget! */\
You don’t to be 80 years old just yet. You pay the critter some gold. The creature cackles and waves it hands over you, humming softly. You feel nothing... did it work? The critter scampers away laughing.
This smells like a scam! You say no, and the creature frowns and waves its hands over you, muttering. Nothing happens. The creature stares crossly at his hands, and then scampers away grumbling. What just happened? /*----------------------------------------------- TEMPLATE ---------------------------------------------------*/
<<set $encounters to [ "card 1", "card 2", "card 3", "card 4", "card 5", "card 6", "card 7", "card 8", "card 9", "card 10", "card 11", "card 12", "card 13", "card 14", "card 15", "card 16", "card 17", "card 18", "card 19", "card 20", "card 21", "card 22", ]>> <<set _randomEncounter to $encounters.pluck()>> <div id="encounter-page-container"> <<include _randomEncounter>> /*this includes the encounter's root passage (also important for the js encounter function, so it knows what choice passages to get...) */ </div> /*----------------------------------------------- WIDGET ---------------------------------------------------*/
<<widget "c">> /*the name of the widget*/ <<done>> <<append "#bbtext">> <div id="encounter-choices"></div> <div id="continue-button" class="hide" style="height: 84px;"> <div class="centerh centerv"> <<button "Continue">> <<goto "where to next?">> <</button>> </div> </div> <</append>> /*creating array to hold answers (to check for uniqueness) as they get generated in the loop/s below */ <<set _answerarray to []>> /*Loop that gets questions and answers and populates them into encounter options (below encounter text) and encounter choices (in bbtext) */ <<for _i to 0; _i lt _choices.length; _i++>> /*Loop that gets a qna object with a unique answer */ <<for _k to 0; _k lt $qnaObjects.length; _k++>> /* make sure I've got enough qnas to draw from! */ <<if $qnaObjects.length lt 3>> <<set $qnaObjects to clone($qnaObjectsBackup)>> <</if>> /*QUESTION n Answer SETUP */ <<set _randomQna to $qnaObjects.pluck()>> <<set _question to _randomQna.q>> <<set _answer to _randomQna.a>> <<set _instruction to _randomQna.instruction>> /*check if the answer exists in the answer array */ <<if _answerarray.includes(_answer)>> /*found a match! Not unique! */ <<else>> /*stop the loop cos this is a unique answer */ <<set _answerarray.push(_answer)>> <<break>> <</if>> <</for>> /*create encounter options with math question beneath the encounter text*/ <<append "#encounter-options">> <div class="encounter-option" @id='"option"+_i'> ''_choices[_i][0]'' <br><span style="color: #8f8e8e;">_question</span> </div> <</append>> <<set _coinflip to random(0,1)>> /*create the encounter choice links in the bottom bar */ <<if _coinflip is 0>> <<append "#encounter-choices">> <div @id="_i" class="encounter-choice" onclick="encounter(this.id);">_answer</div> <</append>> <<else>> <<prepend "#encounter-choices">> <div @id="_i" class="encounter-choice" onclick="encounter(this.id);">_answer</div> <</prepend>> <</if>> <</for>> <</done>> <</widget>>
/*<<en "text to be animated" "anyClass" "animation1" "animation2" "animation3" "animation4">> (no 'animate__' prefix needed for animation classes)*/ <<widget "en">> /*The Animated Element (and text!)*/ <span id="etext" style="font-weight: bold; font-size: 120%; margin: 0px 2px 0px 2px"> $args[0] </span> <<timed 0.1s>> /*DEFAULT ANIMATION CLASSES (default infinite and slow classes to the element (can be overridden below) */ <<addclass "#etext" "animate__infinite">> /*CUSTOM class (any class, ie a color) to the encounter text element */ <<addclass "#etext" $args[1]>> /*ANIMATION CLASSES (optional)*/ <<if def $args[2]>> <<a "#etext" $args[2]>> <</if>> <<if def $args[3]>> <<a "#etext" $args[3]>> <</if>> <<if def $args[4]>> <<a "#etext" $args[4]>> <</if>> /*remove the element id so that I can animate other elements on the page (after, with the same id!) */ <<script>> document.getElementById("etext").id = ""; <</script>> <</timed>> <</widget>>
/* setting variable so bbar displays correctly */ <<set _challengeType to "scanner">> /*SOUND */ <<audio "scanbeep" play>> /*1. create list of locations with the locations that were just defined in 1 */ <<set setup.locations to [setup.tree,setup.boulder,setup.grass,setup.wall,setup.mushroom,setup.mud,setup.pool,setup.vines,setup.mist]>> /*2. current scan of locations. 1 real target and 2 fake!*/ <<set _locations to setup.locations>> /*A temporary copy of ALL locations */ <<set _currentloc to _locations.pluck()>> /*the REAL target location */ <<set _fakeloc1 to _locations.pluck()>> /*fake location 1*/ <<set _fakeloc2 to _locations.pluck()>> /*fake location 2*/ <<set _fakeloc3 to _locations.pluck()>> /*fake location 3*/ /*CURRECT CHOICE ARRAY VARIABLES */ <<set _choices to [_currentloc["name"],_fakeloc1["name"],_fakeloc2["name"],_fakeloc3["name"]]>> <<set _choices to _choices.shuffle()>> /* set text descriptions of the areas */ <<set _fdesc1 to _fakeloc1["desc"].random()>> <<set _fdesc2 to _fakeloc2["desc"].random()>> <<set _fdesc3 to _fakeloc3["desc"].random()>> <<set _desc to _currentloc["desc"].random()>> /* setting array of the text description of the areas and shuffling it so they come out in a random order */ <<set _descArray to [_desc,_fdesc1,_fdesc2,_fdesc3]>> <<set _descArray to _descArray.shuffle()>> /*3 getting random properties of the target location */ <<set _name to _currentloc["name"]>> <<set _find to _currentloc["find"].random()>> <<set _size to _currentloc["size"].random()>> <<set _shape to _currentloc["shape"].random()>> <<set _age to _currentloc["age"].random()>> <<set _colour to _currentloc["colour"].random()>> <<set _origin to _currentloc["origin"].random()>> <<set _material to _currentloc["material"].random()>> <<set _special to _currentloc["special"].random()>> <<set _purpose to _currentloc["purpose"].random()>> /*4 getting random descriptions for the broader location layout */ <<set _arrival to ["come to","enter","step into","arrive at","discover","walk into","slip into","stumble into","find","are walking past"]>> <<set _arr to _arrival.random()>> <<set _adjectives to ["A darkened","An open","A flagstoned","An overgrown","A lonely","A murky","A well lit","A dull","A big","A small","An oval-shaped","A star-shaped","A bright"]>> <<set _adj to _adjectives.random()>> <<set _chambertypes to ["chamber","corridor","cell","enclosure","courtyard","alcove","nook"]>> <<set _chamber to _chambertypes.random()>> <<set _detectortypes to ["bleeps loudly","begins to chirp","starts to beep","starts beeping","beeps rapidly","goes off","beeps uncertainly","activates","stirs and starts to beep","bursts into a flurry of beeping"]>> <<set _detector to _detectortypes.random()>> <<set _areas to ["towards the back","on the right","to the left","in the center","on one side","in one corner","close to you","in the far corner"]>> <<set _area1 to _areas.pluck()>> <<set _area2 to _areas.pluck()>> <<set _area3 to _areas.pluck()>> /*5 DESCRIPTION OF CHAMBER */ /*HEADING */ <div style="text-align: center"> <h1>_adj _chamber</h1> <hr> </div> /* PICTURE */ <div class="centerh"> <div class="location"> [img[assets/chamber.png]] </div> </div> <div id="scene" style="text-align: center"> /* DESCRIPTION */ /* //Your detector _detector. There might be something valuable in here!// */ /* In the _chamber is _descArray[0] and _descArray[1]. You see _descArray[2] _area2 and _descArray[3] _area3. */ /*SCAN BUTTON */ <<button "Scan the area!">> /* play scan sound*/ <<audio "scan1" play>> /* Clear Scanner text box to start over...*/ <<replace "#NPCText">> <<type 5ms>> ''Detecting item near something...'' <</type>> <</replace>> /* scan beeps and hints */ <<timed 2s>> <<audio "scandetect" play>> <<append "#NPCText">> <<type 10ms>> //<<print either(_size,_shape)>>// <</type>> <</append>> <<next 1.5s>> <<audio "scandetect" stop>> <<audio "scandetect" play>> <<append "#NPCText">> <<type 10ms>> //<<print either(_age,_colour)>>// <</type>> <</append>> <<next 1.5s>> <<audio "scandetect" stop>> <<audio "scandetect" play>> <<append "#NPCText">> <<type 10ms>> //<<print either(_origin,_special)>>// <</type>> <</append>> <<next 1.5s>> <<audio "scandetect" stop>> <<audio "scandetect" play>> <<append "#NPCText">> <<type 10ms>> //<<print either(_material,_purpose)>>// <</type>> <</append>> <</timed>> /* autofocuses in the text box after clicking search */ <<script>> let input = document.getElementById('textbox--code'); input.focus(); input.select(); <</script>> <</button>> /*6 SCANNER AND SCAN RIDDLE DISPLAY ZONES */ /* img path */ <<set _NPCImg to "assets/dwellers/robot.gif">> /*image */ <div class="centerh"> <div style="width:90vmin;"> <div class="dialogue-left"> <div class="dialogue-character"> <img @src="_NPCImg"> </div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText" style="text-align: center">''I have detected an item close by!''</div> </div> </div> </div> </div> /*CHOICE BOXES DISPLAY*/ <div id="story-choice-box"> </div> //Search a location by entering it's math answer!// </div> <div class="debug"> <<button "find items">> <<replace "#finditems">><<include "find items">><</replace>> <</button>> <<button "empty backpack">> <<set $backpack to []>> <</button>> </div> <div id ="finditems"></div>
amber emerald aqua enchanted imperial nomad goblin elven relic
/* hide textbox from scanner passages^^ */ <<addclass ".textenter" "hide">> /*SOUND */ <<audio "finditem1" play>> /* LOCATION AND LEVEL CHECKS */ /*<<set $location to either("forest","cave","wall","grass","village")>> <<set $level to random(1,10)>> You are in the $location and your level is $level.<br> */ /* Does that item exist in this location? <<if _curItem["loc"].includesAny($location)>> You can find this item in this location <<else>> Nope, you can't find that item in this location <</if>> <br> */ /*Does that item exist in this level level? */ /* <<if _curItem.level lte $level>> Yep, you're a high enough level to find this item <<else>> Nope, you're not a high enough level for that item <</if>> <br> */ /*GET RANDOM ITEM! */ <<set _curItem to $items.random()>> /* IS CURITEM A PART OR AN ITEM?? */ <<if _curItem.itemtype is "part">> /* remove this part from items so you can't get it again??*/ <<set delete $items.delete(_curItem)>> You _find and discover a strange looking part. <div class="items"> [img[_curItem.img]]<br> </div> <br> Maybe it belongs to that _curItem.name dweller? /*reveal choices div below */ <<timed 0.2s>><<removeclass "#choices" "hide">><</timed>> <<else>> /*assigning the item random properties from the prototype object it starts out as */ <<set _c to random(0,(_curItem["cond"].length-1))>> /*setting a random number from 0 to the length of the array minus 1 */ <<set _curItem["cond"] to _curItem["cond"][_c]>> /*setting the final colour to the member of the array that matches _c */ /*calculating the item's value*/ <<set _value to _curItem["base"]*(_c+1)>> /*+1 so they're not 0 because the arrays being zero based! */ /*giving the item it's base value */ <<run _curItem["value"] = _value;>> <br> You _find and discover _curItem.cond _curItem.type _curItem.name! <div class="items"> [img[_curItem.img]]<br> </div> This _curItem["name"] is worth about _curItem["value"] resources! <br> <br> /*reveal choices div below */ <<timed 0.2s>><<removeclass "#choices" "hide">><</timed>> <</if>> /* Add the item to your backpack - if you've got room!*/ <<if $backpack.length lt 10>> <<set $backpack.push(_curItem)>> <</if>> /*Head back to town if your backpack is full!*/ <<if $backpack.length is 9>> <<goto "backpack full">> <</if>> <div id="choices" class="hide"> /* Give players a chance to check their current items, otherwise carry on! */ You stow it in your [[backpack|backpack contents]] and [[carry on|where to next?]] through the maze... </div> /* LOOP THROUGH ITEMS OBJECT SO I CAN SEE WHAT IS GOING ON */ <div class="debug"> ITEMS REMAINING IN ITEM LIST: <<for _i to 0; _i lt $items.length; _i++>> <br><<print $items[_i].name>><<print $items[_i].itemtype>> <</for>> </div>
/* HEADING */ <div style="text-align: center"> <h1>Backpack</h1> <hr> </div> /* BACKPACK DISPLAY */ <div id="feedback" style="text-align: center"> <<if $backpack.length is 0>> //Your backpack is empty. You can find treasures in the maze!// <<else>> //Click any items to find out what they are!// <</if>> </div> <div class="centerh"> <div id="backpackbackground"> <div id="backpackinside"></div> </div> </div> /*LOOP THAT GENERATES ITEMS INTO BACKPACK */ <<timed 0.2s>> <<for _b to 0; _b lt $backpack.length; _b++>> /* if your backpack is too full, just display the first 9 */ <<if _b gte 9>> <<break>> <</if>> /* create item links! */ <<capture _b>> /* Create a link list of all items in your backpack */ <<append "#backpackinside">> <div class="backpackitem" @id="_b"> /*When you click an item, get it ready to sell! */ <<link [img[$backpack[_b].img]]>> /*is the item a dweller or part? if so you can't sell it! */ <<replace "#feedback" t8n>> //A $backpack[_b].name $backpack[_b].itemtype// <</replace>> <</link>> </div> <div class="backpackitemtext">$backpack[_b].value</div> <</append>> <</capture>> <</for>> <</timed>> <div style="text-align: center"> /* BACK link */ <<link "Back">> <<set _return to previous()>> <<goto _return>> <</link>> </div>
Your backpack is full! You head back to [[camp]], in high spirits.
/* SOUND */ <<set $playlist to "merchant">> <<playlist $playlist volume 1 shuffle play>> /* HEADING */ <div style="text-align: center"> <h1>Woody's Workshop</h1> </div> <hr> /* VARIABLES */ <<set _NPCImg to "assets/dwellers/woody.gif">> <<set _salevalue to 0>> <<set _sellingArray to []>> <<set _text to ["Woody you resources in return for shiny treasures?","You need resources to rebuild camp settlement yes?","Woody need treasures!","Give Woody treasures, and he give you resources!"]>> <<if $backpack.length is 0>> /* STORY */ <div class="story"> Empty-handed, You head over to Woody's workshop... </div> /*NPC IMG and TEXT BUBBLE */ <div class="centerh"> <div style="width:90vmin;"> <div class="dialogue-left"> /*image */ <div class="dialogue-character"> <img @src="_NPCImg"> </div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText" style="text-align: center"> <<type 20ms>>Ooooh... no shiny treasures this time? Come back to Woody when you have treasures!<</type>> </div> </div> </div> </div> </div> [[Back to camp|camp]] <<else>> <div id="woody"> <div class="story"> You head over to Woody's workshop, your backpack bulging with goodies... </div> /*NPC IMG and TEXT BUBBLE */ <div class="centerh"> <div style="width:90vmin;"> <div class="dialogue-left"> /*image */ <div class="dialogue-character"> <img @src="_NPCImg"> </div> /*text */ <div class="dialogue-box-left"> <div id="NPCText" class="dialogue-text"> <<type 20ms>>Yippee! Shiny maze treasures!<</type>> </div> </div> </div> </div> </div> <<set _i to 0>> <div class="centerh"> <<button "go on...">> <<set _i++>> /* Display next bit of text OR */ <<if _i lt _text.length>> <<replace "#NPCText">> <<type 20ms>> _text[_i] <</type>> <</replace>> /* Replace this button with START QUEST button */ <<else>> <<replace "#woody">> <div class="centerh">[[Back to camp|camp]]</div> <</replace>> <</if>> <</button>> </div> </div> <hr> /*Instructions & sale value div */ <div id="feedback" style="text-align: center"> //Click on any items that you want to sell to Woody!// </div> /* BUY AND SELL DIVS */ <div class="centerh"> <div id="backpackbackground"> <div id="backpackinside"> <<timed 02s>><<include "backpack selling item links">><</timed>> /*this first call has to be timed so the spans exist! */ </div> </div> <div id="sellingbackground"> <div id="sellinginside"> </div> </div> </div> /* SELL BUTTON */ <div class="centerh"> <<button "Sell items!">> /* sound */ <<audio "sell" play>> /*add salevalue to your total resources */ <<stats "resources" _totalValue>> /* clearing the sold items from the sellingarray */ <<set _sellingArray to []>> /*updating backback and selling divs */ <<replace "#sellinginside">><</replace>><<include "shop selling item links">> <<set _totalValue to 0>> <</button>> </div> <br> /* LINK BACK TO CAMP*/ <div class="centerh"> <<link "Back to camp">> /* Loop that empties selling array of UNSOLD items and dumps em back in backpack */ <<for _i to 0; _i lt _sellingArray.length; _i++>> <<set $backpack.push(_sellingArray[_i])>> <</for>> /*go to camp passage*/ <<goto "camp">> <</link>> </div> <</if>>
<<for _b to 0; _b lt $backpack.length; _b++>> /* if your backpack is too full, just display the first 9 */ <<if _b gte 9>> <<break>> <</if>> /* create item links! */ <<capture _b>> /* Create a link list of all items in your backpack */ <<append "#backpackinside">> <div class="backpackitem" @id="_b"> /*When you click an item, get it ready to sell! */ <<link [img[$backpack[_b].img]]>> /*is the item a dweller or part? if so you can't sell it! */ <<if $backpack[_b].itemtype is "dweller" or $backpack[_b].itemtype is "part">> <<audio "error" play>> <<shaketarget `"#" + _b + " img"` 0.5s>> <<replace "#feedback" t8n>> //You can can't sell a dweller $backpack[_b].itemtype to Woody. He is only interested in treasures!// <</replace>> <<else>> /* sound */ <<audio "itemtransfer" play>> /* push the chosen item to the selling array*/ <<set _sellingArray.push($backpack[_b])>> /* Delete the chosen item from the backpack */ <<set $backpack.deleteAt(_b)>> /*update backpack div AND selling divs */ <<replace "#backpackinside">><</replace>><<include "backpack selling item links">> <<replace "#sellinginside">><</replace>><<include "shop selling item links">> <</if>> <</link>> </div> <div class="backpackitemtext">$backpack[_b].value</div> <</append>> <</capture>> <</for>>
/* Create a link list of all items you're about to sell*/ <<for _i to 0; _i lt _sellingArray.length; _i++>> /* if your backpack is too full, just display the first 9 */ <<if _i gte 9>> <<break>> <</if>> /* create item links! */ <<capture _i>> <<append "#sellinginside">> <div class="backpackitem"> /*When you click an item, put it back in the backpack! */ <<link [img[_sellingArray[_i].img]]>> /* sound */ <<audio "itemtransfer" play>> /* push the chosen item back to the backpack */ <<set $backpack.push(_sellingArray[_i])>> /* Delete the chosen item from the selling array */ <<set _sellingArray.deleteAt(_i)>> /*update backpack div AND selling divs */ <<replace "#backpackinside">><</replace>><<include "backpack selling item links">> <<replace "#sellinginside">><</replace>><<include "shop selling item links">> <</link>> </div> <div class="backpackitemtext">_sellingArray[_i].value</div> <</append>> <</capture>> <</for>> /*Calculate the value of the items you're about to sell */ <<set _totalValue to 0>> /*loop through the _sellingArray and add together each item's value */ <<for _v to 0; _v lt _sellingArray.length; _v++>> /*grab an item's value */ <<set _itemValue to _sellingArray[_v].value>> /*add it to the total value */ <<set _totalValue += _itemValue>> <</for>> /* update the value display so the player can see it's value */ <<replace "#feedback" t8n>>''Resource Value: _totalValue''<</replace>>
name = "artifact" type = "nomad" <<set $partsTEST to []>> /* VAULT CONTAINER */ <div id = "vault"> </div> <div id="backpack"></div> <div id="keys">Keys</div> <div id="name">Name</div> <div id="type">Type</div> <div id="test">TEST</div> <div id="dwellers">DWELLERS</div> <div id="parts">PARTS</div> /* <<set $partsTEST to []>> <<set _curItem to setup.island>> curItem is the name to pass to the part maker passage */ /* <<include "part maker">> generating the island parts */ /* <<set _curItem to setup.robot>> curItem is the name to pass to the part maker passage */ /* <<include "part maker">> generating the island parts */ /* GIL, DON"T FORGET TO TAKE THE LINE OUT oF the part maker passage once testing is over!! */ /*1. THESE DWLLERS SHOULD HAVE ALREADY BEEN ADDED IN FIND ITEMS ABOVE ^^ */ /* Adding a new object to Dwellers from dwellers all */ /* <<button "add iceberg">> <<set _name to "iceberg">> <<set $dwellers[_name] to $dwellers_all[_name]>> <</button>> <<button "add robot">> <<set _name to "robot">> <<set $dwellers[_name] to $dwellers_all[_name]>> <</button>> <<button "add island">> <<set _name to "island">> <<set $dwellers[_name] to $dwellers_all[_name]>> <</button>> */ /* 2. CHECK FOR PARTS IN BACKPACK -> ADD THEM TO A LIST */ <<timed 0.2s>> <<for _i to 0; _i lt $backpack.length; _i++>> /* WHAT'S IN THE BACKPACK? */ /* DWELLER -> Clear from your backpack! (It's already stored in $Dwellers) */ <<if $backpack[_i].itemtype is "dweller">> <<set $backpack.delete($backpack[_i])>> <<set _i-->> /*need to subtract one here because otherwise the loop will skip one item (because the length is shorter!) */ <<append "#backpack">>dweller!<</append>> /* PART -> prepare to add to vault!*/ <<elseif $backpack[_i].itemtype is "part">> <<set $partsTEST.push($backpack[_i])>> <<set $backpack.delete($backpack[_i])>> <<set _i-->> /*need to subtract one here because otherwise the loop will skip one item (because the length is shorter!) */ <<append "#backpack">>part!<</append>> /* ITEM - do nothing */ <<else>> <<append "#backpack">>item!<</append>> <</if>> <</for>> <</timed>> /* 3. DEPOSIT THE PARTS INTO THE VAULT! */ <<button "deposit ALL backpack items into VAULT!">> /* INCOMPLETE DWELLERS*/ /* get array of keys for all the dwellers! */ <<set _dwellerkeys to Object.keys($dwellers)>> <<append "#keys">>_dwellerkeys<</append>> /* Loop through each PART */ <<for _i to 0; _i lt $partsTEST.length; _i++>> /* Loop through each Dweller */ <<for _n to 0; _n lt _dwellerkeys.length; _n++>> /* get array of keys for dweller parts */ <<set _partkeys to Object.keys($dwellers[_dwellerkeys[_n]].parts)>> <<append "#keys">>_partkeys<</append>> /* Loop through the parts of current Dweller*/ <<for _t to 0; _t lt _partkeys.length; _t++>> /* FOUND CORRECT DWELLER and CORRECT PART!*/ <<if $dwellers[_dwellerkeys[_n]].name is $partsTEST[_i].name and _partkeys[_t] is $partsTEST[_i].part>> /* STORE THE IMAGE in the dweller object instead of the "false" part that was there */ <<set $dwellers[_dwellerkeys[_n]].parts[_partkeys[_t]] to $partsTEST[_i].img>> <<append "#parts">>CORRECT PART: <<print $dwellers[_dwellerkeys[_n]].parts[_partkeys[_t]]>> <</append>> /* CORRECT DWELLER but WRONG PART! */ <<elseif $dwellers[_dwellerkeys[_n]].name is $partsTEST[_i].name>> <<append "#dwellers">>wrong part!<</append>> /* WRONG DWELLER! */ <<else>> <<append "#dwellers">>wrong dweller!<</append>> <</if>> <</for>> <</for>> <</for>> /* loops through the whole dwellers collection and then displays the parts it finds in their correct divs in the vault */ /* clear the vault container of all divs to start fresh */ <<replace "#vault">><</replace>> /* get array keys for ALL dwellers */ <<set _dwellerkeys to Object.keys($dwellers)>> /* DWELLER LOOP */ <<for _n to 0; _n lt _dwellerkeys.length; _n++>> /* add container divs for each discovered dweller to the vault! */ <<append "#vault">> <div @id="_dwellerkeys[_n]" class="dwellercontainer"></div> <</append>> /* incomplete flag -> by default set to false (COMPLETE!) but if a single empty slot is found for this dweller it will get set to true (INCOMPLETE) */ <<set _incomplete to false>> /* current dweller */ <<append "#dwellers">><<print _dwellerkeys[_n]>><</append>> /* clear the current dweller's item div */ <<replace `"#" + _dwellerkeys[_n]`>><</replace>> /* Add the DWELLER img */ <<append `"#" + _dwellerkeys[_n]`>> <div @id="'_dwellerkeys[_n]' + 'icon'" class="backpackitem dwellericon"> <<link [img[$dwellers[_dwellerkeys[_n]].img]]>> <</link>> </div> <</append>> /* get array of keys for current dweller's parts */ <<set _partkeys to Object.keys($dwellers[_dwellerkeys[_n]].parts)>> /*PART LOOP*/ <<for _t to 0; _t lt _partkeys.length; _t++>> /* current part */ <<append "#parts">><<print _partkeys[_n]>><</append>> /* Now check this position in the Vault - display nothing or if there's an item here...display it!*/ <<append "#test">><<print $dwellers[_dwellerkeys[_n]].parts[_partkeys[_t]]>><</append>> /* EMPTY SLOT! */ <<if $dwellers[_dwellerkeys[_n]].parts[_partkeys[_t]] is false>> <<append "#parts">>empty slot!<</append>> /*Add empty slot to display! */ <<append `"#" + _dwellerkeys[_n]`>> <div class="backpackitem"> [img[assets/nothing.png]] </div> <</append>> /* incomplete flag -> found an empty slot so the dweller is not fixed! */ <<set _incomplete to true>> <<audio "error" play>> /* ITEM! (this part slot that was "false" has been overwritten with the image path of the part */ <<else>> <<append "#parts">>filled slot!<</append>> /*Add part to display! */ <<append `"#" + _dwellerkeys[_n]`>> <div class="backpackitem"> <<link [img[$dwellers[_dwellerkeys[_n]].parts[_partkeys[_t]]]]>> <</link>> </div> <</append>> <<audio "itemtransfer" play>> <</if>> <</for>> /* DWELLER IS completed! the _incomplete flag hasn't triggered! ^^*/ <<if _incomplete is false>> /* SOUND */ <<audio "powerup" play>> /* VARIABLES... */ <<set _name to [_dwellerkeys[_n]]>> <<append "#name">>THIS _name DWELLER IS COMPLETED!! old img: <<print $dwellers[_name].img>><</append>> /* adding the dweller to the completed dwellers object */ <<set $dwellers[_name].img to $dwellers[_name].complete>> <<append "#name">>...new image: <<print $dwellers[_name].complete>><</append>> /* adding the dweller to the COMPLETED DWELLERS object */ <<set $dwellers_complete[_name] to $dwellers[_name]>> <<append "#name">>dwellers_complete DWELLER: <<print $dwellers_complete[_name].name>><</append>> /*DISPLAY GIF! */ <<replace `"#" + _dwellerkeys[_n]`>> <div @id="_dwellerkeys[_n]" class="dwellercontainer"> /* DISPLAY GIF! */ <div class="dwellergif"> [img[$dwellers_complete[_dckeys[_i]].gif]] </div> I AM FIXED! </div> <</replace>> /* remove the dweller from the dwellers object (since it's complete!) */ <<run delete $dwellers[_name]>> <</if>> <</for>> /* COMPLETE DWELLERS -Display GIF! */ <<set _dckeys to Object.keys($dwellers_complete)>> <<for _i to 0; _i lt _dckeys.length; _i++>> /* add container divs for each discovered dweller to the vault! */ <<append "#vault">> <div @id="_dckeys[_n]" class="dwellercontainer"> /* DISPLAY GIF! */ <div class="dwellergif"> [img[$dwellers_complete[_dckeys[_i]].gif]] </div> I AM FIXED! </div> <</append>> <</for>> <</button>> /* OBJECT USAGE EXAMPLES: 1. Accessing the "Strength" key value: Strength is $Object["Strength"] This should display: "Strength is 12" 2. Updating the "Strength" key value: <<set $Object["Strength"] +=2>> This should update the value of Strength to: 14 3. Adding a property to the object, and in this case it's a sugarcube variable: <<set $SugarcubeVariable to 3>> <<run $Object["key3"] = $SugarcubeVariable;>> This should add third property to the object with a key called "key3" and a value that matches whatever the $SugarcubeVariable happens to be 4. Deleting a property: Deleting properties follow the same rules as deleting anything else in JavaScript. To directly use JavaScript in SugarCube, you can use "<<run>>" or "<<script>>" macros) So, for example, to delete a single property you'd go: <<run delete $Object["Constitution"]>> This should delete the property "Constitution" from the object, along with it's matching value Testing all values in a Twine passage: Strength is: $Object["Strength"], Constitution is: $Object["Constitution"], key3 is: $Object["key3"] */ /* If you have “templates” of items which will never change, it’s best to make them on the setup object in the JavaScript section, like this: setup.sixshooter = { rounds: 6, damage: 10 }; */
<<if def $playlist>> /* Fade out and then stop the currently playing playlist. */ <<capture $playlist>> <<playlist $playlist fadeoverto 2 0>> <<timed 2s>> <<playlist $playlist stop>> <<unset $playlist>> <</timed>> <</capture>> <</if>>
/*Qwary show or hide */ <<timed .2s>> <<if tags().includes("qwary")>> <<removeclass "div.qwary-panel" "hide">> /*used to be "a.qwary-lunch-btn" */ <<else>> <<addclass "div.qwary-panel" "hide">> <</if>> /* <<script>> console.log('trying to hide or show qwary element!'); <</script>> */ <</timed>>
/* [[Camp|camp]] [[Quests|quests]] [[Backpack|backpack contents]]*/ <<link "Return to Game">><<set _settings to false>> <<include "settings toggle">> <</link>> <<link "Give Feedback">> <<script>> window.qwarySettings = { surveyId : '3Y6A066rNaDrV17TDvQBN1ILBa5a-X3XKhFV2Mh9ZIU=', popupHeight : '500px', popupWidth : '650px', layout : 'popup', showLunchButton: false, qwaryBranding: false }; qwary.survey(); <</script>> <</link>>
/* <<textbox "$destination" "">> <<button "Go!">> <<goto $destination>> <</button>><br> */ /* <div class="debug"> <div class="centerh"> <<timed 3s>>$currentmap<</timed>> </div> <div class="centerh">[[skip|where to next?]] </div> <div class="centerh">[[choose quest]]</div> </div> */ /*CHECK FULLSCREEN*/ /*fullscreen is on, so do nothing...*/ <<if Fullscreen.isFullscreen()>> /* fullscreen is OFF... so check if it's meant to be on */ <<else>> /*yep, looks like fullscreen is meant to be on, so re-enable it! */ <<if $fullscreen is 1>> <<script>> Fullscreen.request({ navigationUI : "hide" }); <</script>> <</if>> <</if>> <div id="settings-button"> /* LINK TO REVEAL UI BAR */ <<link [img[assets/ui/settings.png]]>> <<set _settings to true>> <<include "settings toggle">> <</link>> </div> <div id="fullscreen-button"> /* LINK TO toggle fullscreen */ <<link [img[assets/transparent.png]]>> /* fullscreen was on, so now turn it OFF!*/ <<if $fullscreen is 1>> <<set $fullscreen to 0>> <<script>> Fullscreen.exit(); <</script>> <<addclass "#fullscreen-button" "screen-grow">> <<removeclass "#fullscreen-button" "screen-shrink">> /* fullscreen was off, so now turn it ON!*/ <<else>> <<set $fullscreen to 1>> <<script>> Fullscreen.request({ navigationUI : "hide" }); <</script>> <<addclass "#fullscreen-button" "screen-shrink">> <<removeclass "#fullscreen-button" "screen-grow">> <</if>> <</link>> </div> /* default class for the button (toggles background image) */ <<done>> <<if $fullscreen is 0>> <<addclass "#fullscreen-button" "screen-shrink">> <<else>> <<addclass "#fullscreen-button" "screen-grow">> <</if>> <</done>>
<<if _settings is true>> /* REVEAL UI BAR */ <<script>> UIBar.unstow(); UIBar.show(); <</script>> /* LINK TO HIDE UI BAR */ <<replace "#settings-button">> <<link [img[assets/ui/settingson.png]]>> <<set _settings to false>> <<include "settings toggle">> <</link>> <</replace>> <<else>> /* HIDE UI BAR */ <<script>> UIBar.stow(); UIBar.hide(); <</script>> /* LINK TO REVEAL UI BAR */ <<replace "#settings-button">> <<link [img[assets/ui/settings.png]]>> <<set _settings to true>> <<include "settings toggle">> <</link>> <</replace>> <</if>>
<span class="debug"> [[word problems]] [[gate]] [[maze loop]] [[chamber 1]] [[monster fight]] [[scan for items]] [[find items]] [[workshop]] [[backpack contents]] [[camp]] [[test]] [[vault]] [[quests]] [[current quest]] [[gauntlet]] [[quest victory]] [[leaderboard]] <<link "demo mode">> <<if ndef $demo>> <<set $demo to true>> <<else>> <<unset $demo>> <</if>> <</link>> </span> <<if passage() isnot "Start">> <div id="difficulty" style="display:flex; justify-content:center;"> <div id="toggle" class="normal-mode" onclick="flipElement(this.id); toggleHardMode(this.id);"> NORMAL </div> </div> <<if $hardMode is 1>> <<removeclass "#toggle" "normal-mode">> <<addclass "#toggle" "hard-mode">> <<replace "#toggle">>HARD<</replace>> <</if>> <</if>> <br> <<button "mute">> <<masteraudio "mute">> <<masteraudio volume 0>> <</button>> <<button "unmute">> <<masteraudio "unmute">> <</button>> <br> /* --------------------------------------------------------- SETUP ------------------------------------------ */
/* <div id="health-bar" style="width: 10%;"> <div class="sideways"> <<showmeter '$healthBar' `$stats.HP / $stats.MaxHP`>> </div> </div> <<button "lose hp">> <<set $stats.HP-->> <<updatemeter '$healthBar' `$stats.HP / $stats.MaxHP`>> <</button>> */ <<script>> (async function () { console.log("The authenticate function is working"); /*const queryString = window.location.search; console.log(queryString); const urlParams = new URLSearchParams(queryString); const code = urlParams.get('code'); console.log(code);*/ const code = new URLSearchParams(document.location.search.substring(1)).get('code'); /*Check license key codes*/ let studentResult = await authenticate(code,'tzemO'); let teacherResult = await authenticate(code,'OZuFi'); let schoolResult = await authenticate(code,'SQuPc'); if (studentResult||teacherResult||schoolResult === 'ok') { console.log('License Key Valid!'); } else if (result === 'incorrect') { console.log('No valid license key'); } else { console.log('network error'); } }) (); <</script>> <div class="centerh" style="color: white;"> Free to Play </div> <div class="centerh"> <div id="splash-screen" class="animate__animated animate__backInDown"> <<link [img["assets/ui/mathmazesplash.png"]]>> <<audio "powerup" volume 0.2 play>> <<goto "qna setup">> <</link>> </div> </div> <div class="centerh"> <div id="difficulty" > <div id="toggle" class="normal-mode" onclick="flipElement(this.id); toggleHardMode(this.id);"> Difficulty! </div> </div> /* START BUTTON */ <div style="margin-left: 5%; margin-right: 5%"> <<button "Begin!">> <<audio "powerup" volume 0.2 play>> <<goto "qna setup">> <</button>> </div> </div> <div style="position: fixed; bottom: 5px; left: 0; width: 100vw;"> <h1 class="centerh" style="color: grey; font-size: 100%; font-style: italic; "> Math Maze 2 | Game-based Learning </h1> </div>
<div class="centerh"> <div id="grid-container"></div> </div> /*populate the map with divs */ <<done>> <<script>> /*here prop is the object key name essentially, and becomes a different name each step of the loop */ for (const prop in State.variables.mapA) { console.log(`${prop}`); console.log(`${State.variables.mapA[prop].gridPosition}`); let gridContainer = document.getElementById('grid-container'); let el = document.createElement('div'); el.id = prop; /*el.innerHTML = prop;*/ el.classList.add("grid-item","animate__animated", "journeymap-" + State.variables.mapA[prop].challenge); el.style.gridArea = State.variables.mapA[prop].gridPosition; gridContainer.appendChild(el); } <</script>> <</done>> <<done>> <<script>> /*get the grid container element */ let gridContainer = document.getElementById('grid-container'); console.log(gridContainer); /*get the current step element */ let el = document.getElementById(State.variables.step); console.log("current element id: " + el.id); /*THIS IS THE CURRENT STEP OBJECT! */ let curStepOb = State.variables.mapA[State.variables.step]; /*add glow to current position */ el.classList.add("glow"); /*start at BOTTOM of map first, then scrolls up (if you put 'true' instead of false it'll start at the top*/ gridContainer.scrollIntoView(false); /*add pulse and onclick event to available connections */ let connector; for (let i = 0; i < curStepOb.connectsTo.length; i++) { connector = document.getElementById(curStepOb.connectsTo[i]); connector.classList.add("green-border","animate__pulse", "animate__infinite"); connector.onclick = function() { /*grab the map object that matches the clicked on id (ie it's key value)*/ let nextStepOb = State.variables.mapA[this.id]; journeyMap(this.id,nextStepOb.challenge); /*pass the object id (to remember what step you're up to) */ }; } /*scroll to center the current position in the middle of the screen*/ setTimeout(function(){ el.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"}); }, 500); <</script>> <</done>> /* <<set _randomPositions to [ "a1","a2","a3","a4","a5","a6","a7","a8","a9","a10", "b1","b2","b3","b4","b5","b6","b7","b8","b9","b20", "c1","c2","c3","c4","c5","c6","c7","c8","c9","c10", "d1","d2","d3","d4","d5","d6","d7","d8","d9","d10", "e1","e2","e3","e4","e5","e6","e7","e8","e9","e10", "f1","f2","f3","f4","f5","f6","f7","f8","f9","f10", "g1","g2","g3","g4","g5","g6","g7","g8","g9","g10", "h1","h2","h3","h4","h5","h6","h7","h8","h9","h10", "i1","i2","i3","i4","i5","i6","i7","i8","i9","i10", "j1","j2","j3","j4","j5","j6","j7","j8","j9","j10", "k1","k2","k3","k4","k5","k6","k7","k8","k9","k10", "l1","l2","l3","l4","l5","l6","l7","l8","l9","l10", "m1","m2","m3","m4","m5","m6","m7","m8","m9","m10", "n1","n2","n3","n4","n5","n6","n7","n8","n9","n10", "o1","o2","o3","o4","o5","o6","o7","o8","o9","o10", "p1","p2","p3","p4","p5","p6","p7","p8","p9","p10", "q1","q2","q3","q4","q5","q6","q7","q8","q9","q10", "r1","r2","r3","r4","r5","r6","r7","r8","r9","r10", "s1","s2","s3","s4","s5","s6","s7","s8","s9","s10", "t1","t2","t3","t4","t5","t6","t7","t8","t9","t10", "u1","u2","u3","u4","u5","u6","u7","u8","u9","u10", "v1","v2","v3","v4","v5","v6","v7","v8","v9","v10", "w1","w2","w3","w4","w5","w6","w7","w8","w9","w10", "x1","x2","x3","x4","x5","x6","x7","x8","x9","x10", "y1","y2","y3","y4","y5","y6","y7","y8","y9","y10", "z1","z2","z3","z4","z5","z6","z7","z8","z9","z10", "aa1","aa2","aa3","aa4","aa5","aa6","aa7","aa8","aa9","aa10", "bb1","bb2","bb3","bb4","bb5","bb6","bb7","bb8","bb9","bb20", "cc1","cc2","cc3","cc4","cc5","cc6","cc7","cc8","cc9","cc10", "dd1","dd2","dd3","dd4","dd5","dd6","dd7","dd8","dd9","dd10", "ee1","ee2","ee3","ee4","ee5","ee6","ee7","ee8","ee9","ee10", "ff1","ff2","ff3","ff4","ff5","ff6","ff7","ff8","ff9","ff10", "gg1","gg2","gg3","gg4","gg5","gg6","gg7","gg8","gg9","gg10", "hh1","hh2","hh3","hh4","hh5","hh6","hh7","hh8","hh9","hh10", "ii1","ii2","ii3","ii4","ii5","ii6","ii7","ii8","ii9","ii10", "jj1","jj2","jj3","jj4","jj5","jj6","jj7","jj8","jj9","jj10", "kk1","kk2","kk3","kk4","kk5","kk6","kk7","kk8","kk9","kk10", "ll1","ll2","ll3","ll4","ll5","ll6","ll7","ll8","ll9","ll10", "mm1","mm2","mm3","mm4","mm5","mm6","mm7","mm8","mm9","mm10", "nn1","nn2","nn3","nn4","nn5","nn6","nn7","nn8","nn9","nn10", ]>> */
/* Get a different bit of story here */ <<switch visited()>> <<case 1>> <<done>><<replace "#qna">><<include "qna setup">><</replace>><</done>> <<default>> <h2 style="text-align: center;"> <<link "Pick new math questions">> <<replace "#qna">><<include "qna setup">><</replace>> <</link>>, or keep practicing the [[same questions!|where to next?]] </h2> <</switch>> /* questions will get generated here if student wants to pick 'em */ <div id="qna"> </div>
<<set _code to []>> /* HEADING */ <div class="centerh"> <div id="qna-heading"> Choose your math questions! </div> </div><hr> /* MATH CHECKBOXES */ <div class="mathlist-container"> <div class="mathlist"> <div id="add" class="title accordion" onclick="accordion(this.id);">Add</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="a1" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 1 digit (easy)</div> <div class="checkbox-container off" data-state="off" id="a2" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Adding 10s (up to 100)</div> <div class="checkbox-container off" data-state="off" id="a3" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 2 digits (easy)</div> <div class="checkbox-container off" data-state="off" id="a4" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 2 digits (hard)</div> <div class="checkbox-container off" data-state="off" id="a5" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 3 digits (hard)</div> <div class="checkbox-container off" data-state="off" id="a6" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Multi-step (easy)</div> <div class="checkbox-container off" data-state="off" id="a7" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Multi-step (med)</div> <div class="checkbox-container off" data-state="off" id="a8" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Multi-step (hard)</div> </div> </div> <div class="mathlist"> <div class="title accordion" id="subtract" onclick="accordion(this.id);">Subtract</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="b1" onclick="customCheckbox(this.id);"><div class="checkbox"></div>1 digit</div> <div class="checkbox-container off" data-state="off" id="b2" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 2 digits (easy)</div> <div class="checkbox-container off" data-state="off" id="b3" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 2 digits (hard)</div> <div class="checkbox-container off" data-state="off" id="b4" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Multi-step (easy)</div> <div class="checkbox-container off" data-state="off" id="b5" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Multi-step (hard)</div> </div> </div> <div class="mathlist"> <div class="title accordion" id="multiply" onclick="accordion(this.id);">Multiply</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="c1" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 1 x tables</div> <div class="checkbox-container off" data-state="off" id="c2" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 2 x tables</div> <div class="checkbox-container off" data-state="off" id="c3" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 3 x tables</div> <div class="checkbox-container off" data-state="off" id="c4" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 4 x tables</div> <div class="checkbox-container off" data-state="off" id="c5" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 5 x tables</div> <div class="checkbox-container off" data-state="off" id="c6" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 6 x tables</div> <div class="checkbox-container off" data-state="off" id="c7" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 7 x tables</div> <div class="checkbox-container off" data-state="off" id="c8" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 8 x tables</div> <div class="checkbox-container off" data-state="off" id="c9" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 9 x tables</div> <div class="checkbox-container off" data-state="off" id="c10" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 10 x tables</div> <div class="checkbox-container off" data-state="off" id="c11" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 11 x tables</div> <div class="checkbox-container off" data-state="off" id="c12" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 12 x tables</div> <div class="checkbox-container off" data-state="off" id="c13" onclick="customCheckbox(this.id);"><div class="checkbox"></div> 3 step multiplication</div> </div> </div> <div class="mathlist"> <div class="title accordion" id="divide" onclick="accordion(this.id);">Divide</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="d1" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Division (easy)</div> </div> </div> <div class="mathlist"> <div class="title accordion" id="order-of-operations" onclick="accordion(this.id);">Operations</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="e1" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Add & Subtract (easy)</div> <div class="checkbox-container off" data-state="off" id="e2" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Add & Subtract (med)</div> <div class="checkbox-container off" data-state="off" id="e3" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Add & Subtract (hard)</div> <div class="checkbox-container off" data-state="off" id="e4" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Add & Multiply</div> </div> </div> <div class="mathlist"> <div class="title accordion" id="fractions" onclick="accordion(this.id);">Fractions</div> <div class="panel"> <div class="checkbox-container off" data-state="off" id="f1" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Fractions Add (easy)</div> <div class="checkbox-container off" data-state="off" id="f2" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Fractions to Decimals</div> <div class="checkbox-container off" data-state="off" id="f3" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Fractions to Percent</div> <div class="checkbox-container off" data-state="off" id="f4" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Decimals to Fractions</div> <div class="checkbox-container off" data-state="off" id="f5" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Decimals to Percent</div> <div class="checkbox-container off" data-state="off" id="f6" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Percent to Fractions</div> <div class="checkbox-container off" data-state="off" id="f7" onclick="customCheckbox(this.id);"><div class="checkbox"></div> Percent to Decimals</div> </div> </div> </div> /*adding event listeners to checkboxes */ /* <<done>> <<script>> let allCheckboxes = document.getElementsByClassName("custom-checkbox"); for (let i = 0; i < allCheckboxes.length; i++) { allCheckboxes[i].addEventListener('change', customCheckbox, false); } <</script>> <</done>> */ /*LINK or PLAY BUTTON DISPLAY */ <div id="link-or-play"> <div style="text-align: center; color: gray; font-size: 200%;"> /* PLAY BUTTON */ <div class="animate__animated animate__pulse animate__infinite"> <<button "Start Game!">> /*INCLUDE QnA CODE SETUP if the player has selected at least one set of questions, and no more than 3*/ <<if _code.length gt 0>> /* decode the $urlc variable create questions based on selection */ <<include "qna code setup">> /*NO QUESTIONS SELECTED! */ <<else>> <<audio "error" volume 1 play>> <<replace "#qna-heading">>//Choose at least 1 question type to practice :)//<</replace>> <<shaketarget "#qna-heading" .5s>> <</if>> <</button>> </div> </div> <div class="hide"> /* No links in free version!*/ <div id="middle-text" style="color: #268afd;">or</div> <div> /* GAME URL GOES HERE WHEN IT'S MADE */ <span class="tooltip"> <span class="tooltiptext">Share this link with students. They'll play with your chosen questions :)</span> <span id="link" class="animate__animated" style="display: none; user-select: all; text-decoration: underline; margin-right: 1vmin;"></span> </span> /*GET GAME LINK */ <span class="tooltip"> /* Link ToolTip! */ <span class="tooltiptext" id="link-tool-tip">Create a Game Link</span> /*LINK */ <span id="link-button" style="text-decoration: underline;"> <<link "Get a game link for these questions">> /* AT LEAST 1 QUESTION SELECTED */ <<if _code.length gt 0>> /* Replace THIS link with a button that copies the url!*/ <<replace "#link-button">><<include "link button">><</replace>> /* Replace the little "or" text for clarity*/ <<replace "#middle-text">>Game Link: <</replace>> <<script>> /*Update the tooltip on this button*/ document.getElementById('link-tool-tip').innerHTML = "Copy to Clipboard!"; /*make the link visible!*/ document.getElementById('link').style.display = ""; <</script>> /* NO QUESTIONS SELECTED, SO THROW ERROR */ <<else>> <<audio "error" volume 1 play>> <<replace "#qna-heading">>//Choose at least 1 question type to practice :)//<</replace>> <<shaketarget "#qna-heading" .5s>> <<shaketarget ".tooltip" .5s>> <</if>> <</link>> </span> </span> </div> </div> /*free version hide */ </div> <br><br><br><br>
<<button "Copy!">> /* AT LEAST 1 QUESTION SELECTED */ <<if _code.length gt 0>> <<audio "victory" volume 1 play>> /* CURRENT LINK */ /* grab the current url address */ <<script>> getURL(); <</script>> /* DISPLAY LINK (combine current url address with selected pin codes from selected check boxes) */ <<replace "#link">><span style="user-select: all;"><<=_urlAddress + "?urlc=" + $urlc>></span><</replace>> <<removeclass "#link" "animate__swing animate__rubberBand">> <<addclass "#link" "animate__swing">> <<replace "#link-button">><<include "link button">><</replace>> /* Add Game Pin to Clipboard! */ <<script>> copyStringToClipboard(State.temporary.urlAddress + "?urlc=" + State.variables.urlc, "link-tool-tip"); <</script>> /*NO QUESTIONS SELECTED! */ <<else>> <<audio "error" volume 1 play>> <<replace "#qna-heading">>//Choose at least 1 question type to practice :)//<</replace>> <<shaketarget ".tooltip" .5s>> <<shaketarget "#qna-heading" .5s>> <</if>> <</button>>
<<set _total to []>> <<set _urlCodeSplit to []>> TOTAL: _total /* split $urlc variable into 3 separate strings */ <<script>> codeSplit(State.variables.urlc); <</script>> /* debug */ /* Split: _urlCodeSplit ;P */ /* Check each part of the split urlCode & grab the matching question set and load it in to _total */ <<if _urlCodeSplit.length gt 0>> <<audio "powerup" volume 0.2 play>> <<for _i to 0; _i lt _urlCodeSplit.length; _i++>> <<switch _urlCodeSplit[_i]>> /*ADD SELECTED QUESTIONS TO THE _total ARRAY -> these words match passages where the corresponding questions can be found */ /*ADDITION*/ <<case "a1">> <<set _total.push("1 digit addition (no regrouping)")>> <<case "a2">> <<set _total.push("adding 10s (up to 100)")>> <<case "a3">> <<set _total.push("2 digit addition (no regrouping)")>> <<case "a4">> <<set _total.push("2 digit addition (regrouping)")>> <<case "a5">> <<set _total.push("3 digit addition (mixed)")>> <<case "a6">> <<set _total.push("multi-step addition (easy)")>> <<case "a7">> <<set _total.push("multi-step addition (medium)")>> <<case "a8">> <<set _total.push("multi-step addition (hard)")>> /*SUBTRACTION*/ <<case "b1">> <<set _total.push("1 digit subtraction")>> <<case "b2">> <<set _total.push("2 digit subtraction (no regrouping)")>> <<case "b3">> <<set _total.push("2 digit subtraction (regrouping)")>> <<case "b4">> <<set _total.push("multi-step subtraction (easy)")>> <<case "b5">> <<set _total.push("multi-step subtraction (hard)")>> /*TIMES TABLES */ <<case "c1">> <<set _total.push("1x tables")>> <<case "c2">> <<set _total.push("2x tables")>> <<case "c3">> <<set _total.push("3x tables")>> <<case "c4">> <<set _total.push("4x tables")>> <<case "c5">> <<set _total.push("5x tables")>> <<case "c6">> <<set _total.push("6x tables")>> <<case "c7">> <<set _total.push("7x tables")>> <<case "c8">> <<set _total.push("8x tables")>> <<case "c9">> <<set _total.push("9x tables")>> <<case "c10">> <<set _total.push("10x tables")>> <<case "c11">> <<set _total.push("11x tables")>> <<case "c12">> <<set _total.push("12x tables")>> <<case "c13">> <<set _total.push("3 step multiplication")>> /*DIVIDE*/ <<case "d1">> <<set _total.push("division simple")>> /* MIXED */ <<case "e1">> <<set _total.push("multistep addition & subtraction (easy)")>> <<case "e2">> <<set _total.push("multistep addition & subtraction (medium)")>> <<case "e3">> <<set _total.push("multistep addition & subtraction (hard)")>> <<case "e4">> <<set _total.push("Order of Operations (+ & x)")>> /* FRACTIONS */ <<case "f1">> <<set _total.push("fractions addition (like fractions)")>> <<case "f2">> <<set _total.push("fractions to decimals")>> <<case "f3">> <<set _total.push("fractions to percent")>> <<case "f4">> <<set _total.push("decimals to fractions")>> <<case "f5">> <<set _total.push("decimals to percent")>> <<case "f6">> <<set _total.push("percent to fractions")>> <<case "f7">> <<set _total.push("percent to decimals")>> <</switch>> <</for>> /*NEW CODE! */ /*GRAB NEW QUESTIONS and ANSWERS and make an answerbank and questionbank*/ <<for _i to 0; _i lt _total.length; _i++>> /*QUESTIONS */ <<set _questionPassage to _total[_i]>> /*this is the question passage */ <<arraymaker _questionPassage>> /*Running the arraymaker widget for _questionPassage. */ <<set _questions to _array>> /*an array of all the questions from the question passage*/ /*ANSWERS */ <<set _answerPassage to _questionPassage + " ANSWERS">>/*setting answer passage*/ <<arraymaker _answerPassage>> /*Running the arraymaker widget for _questionPassage. */ <<set _answers to _array>> /*an array of all the answers from the answer passage */ /*SETUP */ <<set _setupPassage to _questionPassage + " SETUP">>/*setting setup passage*/ <<include _setupPassage>> /*now the temporary variables for this question set are set and ready to be included in the data sets below! */ /* set an array to fill with index numbers */ <<set _questionsIndex to []>> /*create an index for every member of the questions array */ <<for _r to 0; _r lt _questions.length; _r++>> <<set _questionsIndex.push(_r)>> /*fill questionsIndex with a number for each position of the question array */ <</for>> /* <<append "#index">> _questionsIndex <</append>> */ /* Find out how big the question array is...and set a limit on it */ <<if _questions.length gt 24>> <<set _limit to 24>> <<else>> <<set _limit to _questions.length-1>> /*in this case _limit is LESS than 24 */ <</if>> /*grab UP TO 24 (the upper limit) unique index numbers! */ <<set _random24OrLess to _questionsIndex.randomMany(_limit)>> /* <<append "#random24">> _random24OrLess <</append>> */ /*QNA OBJECT SETUP*/ <<for _n to 0; _n lt _random24OrLess.length; _n++>> /*24 is the upper limit for a question set to keep them all roughly balanced... */ /* Get the next (unique) index number */ <<set _rando to _random24OrLess[_n]>> /* Grab question and matching answer from the arrays^^ */ <<set _q to _questions[_rando]>> <<set _a to _answers[_rando]>> /*check if this qestion set has placeholders */ <<if _placeholder is true>> <<else>> <<set _placeholder to false>> <</if>> /*create qna object and populate it with the data */ <<set _qnaObject to { q: _q, a: _a, instruction: _instruction, example: _example, placeholder: _placeholder, }>> /*Store this qna object! */ <<set $qnaObjects.unshift(_qnaObject)>> /*add this qna dataset to the START of the $qnaObjects array! */ /*Check it! */ /* <<append "#questions">> $qnaObjects[0].q <</append>> <<append "#answers">> $qnaObjects[0].a <</append>> <<append "#instruction">> $qnaObjects[0].instruction <</append>> <<append "#example">> $qnaObjects[0].example <</append>> <<append "#keyboard">> _keyboard <</append>> */ <</for>> /* KEYBOARD CHECK */ /* does this qna set require a special keyboard? */ <<if _keyboard is "symbols">> <<set $keyboard.unshiftUnique("symbols")>> /*adds to the start of the array if it's not there already (it must be unique) */ <</if>> <</for>> /*shuffle all the qna objects */ <<set $qnaObjects.shuffle()>> /*Store the chosen questions, so the game can refresh the questions later if needed */ <<set $qnaObjectsBackup to clone($qnaObjects)>> <<script>> console.log('Keyboard: ' + State.variables.keyboard); console.log('QnA OBJECTS ANSWERS: ' + State.variables.qnaObjects); let i; for (i=0; i < State.variables.qnaObjects.length; i++){ console.log(State.variables.qnaObjects[i].q + " = " + State.variables.qnaObjects[i].a); console.log("instruction: " + State.variables.qnaObjects[i].instruction + "example: " + State.variables.qnaObjects[i].example); } <</script>> /* GO TO CHOOSE QUEST */ <<goto "choose quest" >> /* <div id="questions">Questions: </div> <div id="answers">Answers:</div> <div id="instruction">Instruction:</div> <div id="example">Example:</div> <div id="keyboard">Keyboard:</div> <div id="index">Index:</div> <div id="random24">Random24:</div> <div id="loop-number">Loop number:</div> */ <</if>>
<<set _mazeTime to 60>> /*TIMER */ <<set _seconds to _mazeTime>> <<repeat 1s>> <<set _seconds-->> <<if _seconds gt 0>> /*<<replace "#time">>_seconds remaining!<</replace>>*/ <<else>> /*<<replace "#time">>Too Late!<</replace>>*/ /* do something useful here */ <<stop>> <</if>> <</repeat>>
/* CHOOSE YOUR NAME */ <<if ndef $name>> <div id="full-page-container" class="animate__animated" style="background-color: rgba(0, 0, 0, 0.5);"> <div id="item-message" class="animate__animated animate__backInDown"> <div class="centerv"> <h2>Your Name: </h2> <<set _nameBit1 to [ "Humpty", "Prancy", "Smelly", "Sir", "El", "Lady", "Poopy", "Pumpkin", "El", "Jimmy", "Jane", "Jelly", "Gellert", "Little Red", "Crusty", "Harry", "Wally", "Esmerelda", ]>> <<set _nameBit2 to [ "Pants", "Pranco", "Panda", "Rinsebald", "Dishfingers", "Pots", "Slimo", "Bucket", "Widdershins", "Blurst", "Collywobbles", "Cakes", "the Crust", "Bandicoot", "Elephant", "Mittens", "Snippity", "the Chucklesome", "the Humble", "Pie Face", "Twinkletoes", "Huff n Puff", ]>> <<set _tempName to _nameBit1.random() + " " + _nameBit2.random()>> <div class="large-textbox"><<textbox "$name" _tempName>></div> <div style="margin-top: 30px;"> <<button "Ok!">> <<script>> removeElAnimate("item-message"); removeEl('full-page-container'); <</script>> <<audio "victory" volume 1 play>> <</button>> </div> </div> </div> </div> <</if>> /* QUEST DISPLAY*/ /* NOTE, JAVASCRIPT FUNCTIONS NOW SET THE QUEST VARIABLES */ /* HEADING */ /* <div style="text-align: center"> <h1>Available Quests!</h1> </div> <hr> */ <div id="full-page-quest-container"> /* <div id="npc-quests-container"> */ <div id="quest-container" class="centerh"> </div> /*GAUNTLET QUEST ICON */ <div id="gauntlet-quest-container" class="centerh" onclick="startGauntlet(this.id);"> <div id="gauntlet-frame" class="quest-frame"> <div id="gauntlet-icon" class="quest-character animate__animated animate__pulse animate__slower animate__infinite"> [img[assets/ui/gauntlet.png]] </div> <div class="quest-ring"></div> <span class="quest-title">Begin Hunt!</span> <div class="bigger-emoji"><img src="assets/ui/fight.png"></div> </div> </div> </div> /* 2. Loop that populates emoji quests */ <<done>> /* clear the quest div */ <<replace "#quest-container">><</replace>> /* populate quest div with NPCs and emojis! */ <<for _i to 0; _i lt $dailyNPCs.length; _i++>> /* CHECK IF PLAYER HAS COMPLETED THIS QUEST! -> for displaying emojis properly! */ /* array of the current quests scores */ <<set _scores to $dailyNPCs[_i].currentQuest.quest.score>> /* Loop which compares the quests completedScore to each possible rank in the quest... */ <<for _s to 0; _s lt _scores.length; _s++>> <<if $dailyNPCs[_i].currentQuest.quest.completedScore gte _scores[_s].rank>> /*keep looping! */ <<else>> <<break>> /*terminate the loop here. now _s will be a useful number for the switch below! */ <</if>> <</for>> /* Now use _s (the players rank) to get the appropriate emoji*/ <<if _s gte 3>> <<set _emoji to "veryhappy">> <<elseif _s is 2>> <<set _emoji to "happy">> <<elseif _s is 1>> <<set _emoji to "neutral">> <<else>> <<set _emoji to either("sad","angry","blank")>> <</if>> /* APPEND CLICKABLE QUEST Img and accompanying emoji! */ /*JAVASCRIPT SETS THE QUEST VARIABLES HERE! */ <<append "#quest-container">> <div @id="_i" class="quest-frame" onclick="startQuest(this.id);"> <div class="quest-character">[img[$dailyNPCs[_i].img.random()]]</div> <div class="quest-ring"></div> <span class="quest-title">$dailyNPCs[_i].currentQuest.title</span> <div class="emoji"><img @src="'assets/quests/'+_emoji+'.png'"></div> <div class="glass">[img[assets/transparent.png]]</div> </div> <</append>> <</for>> <</done>>
/*MAZE DIFFICULTY ADJUSTMENTS */ <<set _studentTime to _mazeTime-_seconds>> /*Rolling average of your latest 3 maze times... */ <<set $studentTimes.push(_studentTime)>> /* Add current time to the end of the time array */ /* if there are more than 3 in the array, remove the first one (which is now the oldest) */ <<if $studentTimes.length > 3>> <<set $studentTimes.shift()>> <</if>> <<set _total to 0>> <<for _i to 0; _i lt $studentTimes.length; _i++>> <<set _total +=$studentTimes[_i]>> /*Loop through the time scores in the array and add them together!*/ <</for>> <<set _average to _total/$studentTimes.length>> /* STUDENT WAS QUICK */ <<if _average lt 45>> /*YES! if difficulty isn't as maxed out, raise it!*/ <<if $difficulty lt $maparray.length-1>> /*minus 1 cos the maparray is zero-based */ <<set $difficulty++>> /* <<notify 3s 'notify-difficulty'>>Level up! You are now on level $difficulty<</notify>> */ <<else>> /*difficulty is already maxed out so gain bonus points!*/ /* <<notify 3s 'notify-difficulty'>>Level $difficulty is the highest level!<</notify>> */ /* set random amount of bonus points */ <<set _bonus to random(30,50)>> /* gaining extra points! */ <<if $gauntlet is true>> /*don't get points */ <<else>> <<stats "points" _bonus>> <</if>> <</if>> <</if>> /* STUDENT WAS SLOW */ <<if _studentTime gt _mazeTime>> <<if $difficulty gt 0>> <<set $difficulty-->> <<else>> /* do nothing, you're already on the lowest difficulty: 0 */ <</if>> <</if>>
/*NORMAL QUEST */ <<if $gauntlet is false>> /*get the next challenge from the challenges array and include the matching challenge to the div below*/ <<set $i++>> /*QUEST IS COMPLETE, SO GO TO VICTORY PASSAGE*/ <<if $i gte $quest.challenges.length-1>> <<goto $quest.victorypassage>> /*NOT YET COMPLETE, SO LOAD NEXT CHALLENGE*/ <<else>> /* Challenge types */ <<switch $quest.challenges[$i]>> <<case "maze">> <<include "maze loop">> <<case "checkpoint">> <<include "maze loop">> <<case "fight">> <<goto "monster fight">> <<default>> <<include "maze loop">> <</switch>> <</if>> /*GAUNTLET */ <<else>> /*display the journey map! */ <<goto "journey map">> <</if>> /* debug */ <div class="debug"> ''Challenges:'' $quest.challenges ''current challenge:'' $quest.challenges[$i] ($i) </div>
<<switch $challenge>> <<case "maze">> <<include "maze loop">> <<case "fight">> <<goto "gauntlet monster fight">> <<case "unknown">> <<goto "encounter test">> <<case "rest">> <<goto "rest">> <<case "chest">> <<goto "chest">> <<case "end">> <<goto "gauntlet monster fight">> <<default>> <<include "maze loop">> <</switch>>
<<if $quest.challenges[$i] is "checkpoint">> /* advance checkpoint variable (starts on -1 in "choose quest passage") */ <<set $c++>> /* checkpoint quest message popup */ <div id="quest-message" class="animate__animated animate__backInLeft" onclick="removeElAnimate(this.id, 'animate__backOutLeft'); let input = document.getElementById('0');input.focus();input.select();"> <div class="dialogue-left"> /*image */ <div class="dialogue-character"><img @src="$questNPC.img"></div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText"> $questVars.checkpoints[$c] </div> </div> </div> </div> <<timed 20s>> <<script>> removeElAnimate('quest-message', 'animate__backOutLeft'); <</script>> <</timed>> <</if>> /* -------------------------------------------------- MAIN LOOP ------------------------------------------ */
<<if tags().includes("bbar")>> <div id="bottombar"> <div id="bbblock"> /*REVEAL DEBUG */ /* <<link "debug">> <<if $debug is false>> <<set $debug to true>> <<addclass ".debug" "reveal">> <<else>> <<set $debug to false>> <<removeclass ".debug" "reveal">> <</if>> <</link>> */ <div id="bbtext"> /* FEEDBACK BUTTON */ <<if passage() is "quest victory" or passage() is "Start">> <div class="centerh"> <<button "Give Feedback!">> <<goto "feedback">> <</button>> </div> <</if>> </div> </div> </div> <</if>>
<<set _includePassage to "NPC down">> /*for the onclick event */ <<replace "#maze-NPC-container">> <div id="NPC-up" class="dialogue-right" onclick="$.wiki('<<include _includePassage>>')"> <div id="on-click-background" onclick="$.wiki('<<include _includePassage>>')"></div> /*image */ <div class="dialogue-character"> <<link[img[$questNPC.img[1]]]>> <<include "NPC down">> <</link>> </div> /*text */ <div class="dialogue-box-right"> <div class="dialogue-text" id="NPCText"> /*CHECKPOINT OR JOKE! */ <<if $quest.challenges[$i] is "checkpoint">> $questVars.checkpoints[$c] <<else>> <<=$questNPC.jokes.random()>> <</if>> </div> </div> </div> <</replace>>
<<replace "#maze-NPC-container">> <div id="NPC-down"> <<link[img[$questNPC.img[1]]]>> /* Display NPC up (white background with border) */ <<include "NPC up">> <</link>> </div> <</replace>> /* throw focus to first answerbox */ <<script>> if (State.temporary.challengeType === "maze"){ let input = document.getElementById('0'); /*to fix later - this should really be whatever question the player is up to! */ input.focus(); input.select(); } <</script>>
<<prepend "#NPC-and-points">> <div id = "NPC-alert-container" class="animate__animated animate__bounce animate__slower"> <div id="NPC-alert-icon"> <<link[img[assets/ui/alert_right.png]]>> <<include "NPC up">> <</link>> </div> </div> <</prepend>>
/* <<button "lose hp">> <<set $stats.HP-->> <<updatemeter '$healthBar' `$stats.HP / $stats.MaxHP`>> <</button>> */ /*Maze Moves! */ <div id="maze-moves-container"> <div id="maze-moves"></div> </div> <<include "maze timer">> <<set _challengeType to "maze">> /* <<set $difficulty to 1>> */ /*SOUND */ /* doesn't play the first time so maze loads faster */ /* <<if visited() gt 1>> <<set $playlist to "maze">> <<playlist $playlist loop play>> <</if>> */ /*RANDOM MAP - Grab the next map in Queue (and send it to back)*/ <<set $currentmap to $maparray[$difficulty].shift()>>/*extracts FIRST map from current pool*/ <<set $maparray[$difficulty].push($currentmap)>> /*appends map to END of current pool (back of the queue)*/ /* FOR TESTING SPECIFIC MAPS: */ /* <<if visited() is 1>> <<set $maparray to [ "maps/map217.json", "maps/map410.json", ]>> <</if>> */ /* <<set $currentmap to $maparray.pluck()>> */ /* MAZE CONTAINER */ <div class="centerh" style="width:100%;"> <div id="twine-maze-container"></div> </div> <<done>> /* 1.BUILD MAP AND SET TOTAL NUMBER OF QUESTIONS TO SUGARCUBE VARIABLE */ <<script>> (async function () { console.log(State.variables.currentmap); console.log("difficulty: " + State.variables.difficulty); let maze = document.createElement('game-maze'); maze.setAttribute('src', State.variables.currentmap); /*Disable sound for Safari and IOS (since IOS chrome is actually safari basically) */ /* Get the user-agent string let userAgentString = navigator.userAgent;*/ /* Detect Chrome let chromeAgent = userAgentString.indexOf("Chrome") > -1;*/ /* Detect Safari let safariAgent = userAgentString.indexOf("Safari") > -1;*/ /* Set safariAgent variable to false since it also matches Chrome (Chrome is BOTH, so you've really found a chrome imposter here!) if (chromeAgent && safariAgent) safariAgent = false;*/ /*Check whether this is an IOS device let isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;*/ /*Check if this device is running Safari OR is IOS if (isIOS || safariAgent) { console.log('This is a IOS device'); maze.setAttribute('sound', '0'); } else { console.log('This is Not a IOS device'); } */ let input = document.getElementById('textbox--password'); /*input.setAttribute('type', "number"); makes the textbox only recieve numbers*/ /* the maze */ let container = document.createElement('div'); container.id = 'maze-container'; container.appendChild(maze); console.log('size of maze', maze.clientWidth, maze.clientHeight); /* creating instruction zone */ let instructions = document.createElement('div'); instructions.id = 'instructions'; container.appendChild(instructions); /* creating answerboxes zone */ let answerBoxes = document.createElement('div'); answerBoxes.id = 'answer-boxes'; container.appendChild(answerBoxes); /*putting container (maze and answerboxes below) into twine-maze-container*/ let viewport = document.getElementById('twine-maze-container'); viewport.appendChild(container); try { await maze.ready(); await maze.loaded(); /*ONLY DO THIS FOR SAFARI */ await new Promise((resolve, reject) => setTimeout(resolve, 200)); let mapQTotal = maze.riddleCount(); console.log("there are " ,mapQTotal, " riddles in this maze all up"); let randqna; let mapQnA = []; for (let c = 0; c < mapQTotal; c++) { console.log("there are " + State.variables.qnaObjects.length + " qna objects left in the $qnaObjects array!"); console.log("Backup qnaObjects array length: " +State.variables.qnaObjectsBackup.length); /* MAKE SURE THERE ARE ENOUGH MAP QUESTIONS AND ANSWERS AS MAP REQUIRES ^^ */ if (State.variables.qnaObjects.length < mapQTotal){ State.variables.qnaObjects = State.variables.qnaObjectsBackup.slice(0); /*this is a DEEP (full) clone! */ } /*GET RANDOM qna object*/ randqna = State.variables.qnaObjects.shift(); /*extracts the FIRST value from the $qnaObjects array (it's already shuffled, so random) */ console.log("randqna:" + randqna.q + "=" + randqna.a + "and its intruction is: " + randqna.instruction); /*GET qna object THAT MATCHES c AND ADD IT TO MAP QUESTIONS ARRAY*/ mapQnA.push(randqna); } /*strip out questions and put into an array of questions */ let qs = mapQnA.map(x => x.q); /*strip out answers and put into an array of answers */ let ans = mapQnA.map(x => x.a); /*strip out instructions and put into an array of instructions */ let ins = mapQnA.map(x => x.instruction); /*strip out placeholder and put into an array of placeholder values */ let plc = mapQnA.map(x => x.placeholder); /*3. THE MAP QUESTIONS ARE GENERATED ON TO THE MAP!*/ State.variables.indices = maze.setRiddles(qs); /*Generates all questions on to the map */ /*let's say the path through the maze is 0, 1, 2, 3, 2, 4 (2 appears twice because the path doubles back on itself), and there's two additional foils, 5 and 6. you call maze.setRiddles(...) with say ['0+0', '1+0', '2+0', '3+0', '4+0', '5+0', '6+0'] maze.setRiddles() will return the array indices of the tiles, i.e. [0, 1, 2, 3, 2, 4] notice that this matches the path through the maze exactly. this is what gets assigned to State.variables.indices */ qs = State.variables.indices.map(index => qs[index]); /*This TRANSFORMS $mapquestions to an array (in correct order) of the correct path questions */ ans = State.variables.indices.map(index => ans[index]); /*This TRANSFORMS $mapanswers to an array (in correct order) of the correct path answers */ /*save ans as sugarcube variable for later checking in keyboard.*/ State.variables.mapanswers = ans; console.log(State.variables.indices.length," path answers for dis map!"); State.temporary.instructionArray = ins; console.log(State.temporary.instructionArray); State.temporary.placeholderText = plc; /*Loop that creates answer boxes let smallBoxDiv; let smallBox; for (let i = 0; i < ans.length; i++) { smallBoxDiv = document.createElement('div'); smallBoxDiv.classList.add("small-textboxes"); smallBox = document.createElement('input'); smallBox.type = "text"; smallBox.inputmode = "none"; smallBox.autocomplete = "off"; smallBox.ariaHasPopup = "false"; smallBox.id = i; smallBox.classList.add("triggerbutton"); smallBoxDiv.appendChild(smallBox); answerBoxes.appendChild(smallBoxDiv); }*/ $.wiki('<<for _i to 0; _i lt $mapanswers.length; _i++>><<append "#answer-boxes">><div class="small-textboxes"><input type="text" inputmode="none" autocomplete="off" aria-haspopup="false" @id="_i" class="triggerbutton"></div><</append>><</for>>'); /*adding event listeners to textboxes */ document.querySelectorAll('.triggerbutton').forEach(item => { /*event listener 1: when you hit enter on textbox it simulates clicking the button (to check the answer) */ item.addEventListener("keyup", function(event) { if (event.keyCode === 13) { event.preventDefault(); document.getElementById("enter-element").firstElementChild.id = "enterbutton"; document.getElementById("enterbutton").click(); /*$("#enter-element") .find(".macro-button") .trigger("click");*/ } }); /*event listener 2: when the textbox is focussed on, it shows it's instructions & placeholders, (if any) and resizes the textbox accordingly*/ item.addEventListener("focus", function () { let id = this.id; /*INSTRUCTION? */ let instruction = State.temporary.instructionArray[id]; console.log("textbox id is: " + id + "and it's instruction is " + State.temporary.instructionArray[id]); let instructionContainer = document.getElementById('instructions'); if (instruction !==""){ instructionContainer.innerHTML = instruction; } /*check if this question has placeholder text */ let placeholderBoolean = State.temporary.placeholderText[id]; /*PLACEHOLDER? */ if (placeholderBoolean){ /*grab this question's real answer */ let ans = State.variables.mapanswers[id]; /*obscure the answer by converting characters to underscores with a space in between*/ let placeholder = ans.replace(/[0-9]/g, ' _ '); /*add the placeholder text to the textbox */ this.placeholder = placeholder; /*ADJUST TEXTBOX WIDTH TO FIT CONTENT*/ /*get length of the placeholder string */ let placeholderLength = placeholder.length; /*set width to the same value (in m spaces) as the placeholder string length */ this.style.width = (placeholderLength +2) + "em"; } }); /*event listener 3: on blur event*/ item.addEventListener("blur", function () { this.style.width = ""; this.placeholder = ""; }); }); /*casting focus into first answer box */ let answerboxFocus = document.getElementById('0');answerboxFocus.focus();answerboxFocus.select(); let hint; /*FIRST maze instruction */ if (State.variables.i === 0){ /*need to fix this later...A is the first step in the map after "BEGIN" ->but if i start the guantlet on higher difficulty I won't need this hint at all! */ hint = 'Get to the exclamation point by entering the math answer!'; instructions.innerHTML = hint; /*Maze Moves Popup */ $.wiki("<<include 'maze moves popup 1st'>>"); } else { /*Maze Moves Popup */ $.wiki("<<include 'maze moves popup'>>"); } /*NPC CHECKPOINT POPUP? */ if (State.variables.quest.challenges[State.variables.i] === "checkpoint") { State.variables.c++; $.wiki("<<include 'NPC alert'>>"); } /*$(output).wiki(Story.get('quest item').processText()); THIS VERSION OF INCLUDE DOES WORK*/ } catch (e) { console.log(e); /* window.location = window.location;*/ } }) (); /*this is calling on the anonymous async function^^*/ <</script>> /*add symbols keyboard if needed */ <<if $keyboard.includes("symbols")>> <<prepend "#numberpad">> <<include "symbols">> <</prepend>> <</if>> /*pop up number of moves notification! OI THIS NEEDS TO GO IN JS above AFTER the AWAIT so the map answers number is correct!*/ <</done>> /*UI CONTAINER */ <div id="ui-container"> /* HEALTHBAR */ /* <div id="health-bar"><<showmeter '$healthBar' `$stats.HP / $stats.MaxHP`>></div> */ /*HEALTH */ <div id="hero-stats"> <<if $gauntlet is true>> /*only display hp in gauntlet! */ <div id="health"> <div id="health-text">$stats.HP</div> </div> <<else>> <</if>> <div id="backpack-icon"> /* <span>$stats.points</span> */ </div> </div> /*NUMBERPAD (includes ENTER button now)*/ <<include "numberpad">> /*NPC/points*/ <div id="NPC-and-points"> /* NPC pop up (or not!) */ <div id="maze-NPC-container"> <div id="NPC-down"> <<link[img[$questNPC.img[1]]]>> /* Display NPC up (white background with border) */ <<include "NPC up">> <</link>> </div> </div> /* points display! */ <div id="points" class="animate__animated"> <span>$stats.points</span> </div> </div> </div> /* <div id="health-bar-vert"> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> <div class="health-icon"></div> </div> */
<<append "#passages">> <div id="full-page-container" class="animate__animated" onclick="removeElAnimate('full-page-container'); let input = document.getElementById('0');input.focus();input.select(); "> <div id="small-item-message" class="animate__animated animate__backInDown" style="justify-content: center;" onclick="removeElAnimate('full-page-container'); let input = document.getElementById('0');input.focus();input.select();"> <div style="font-size: larger;"> Get to the <img src="assets/starportal.png" style= "width: 30px; margin-left: 5px; margin-right: 5px; vertical-align: bottom;"> in </div> <div id="maze-moves-popup-container"> $mapanswers.length move! </div> <div style="font-size: larger;"> </div> </div> </div> <</append>> /*updating the top maze moves icon with the correct value! */ <<replace "#maze-moves">>$mapanswers.length<</replace>>
<<append "#passages">> <div id="full-page-container" class="animate__animated animate__flipInY" onclick="removeElAnimate('full-page-container'); let input = document.getElementById('0');input.focus();input.select(); "> <div id="maze-moves-popup-container"> <div>$mapanswers.length</div><div>moves</div> </div> </div> <</append>> /*remove maze move notification automatically after 2 seconds! */ <<timed 1.5s>> <<timed .3s>> <<script>> removeElAnimate('full-page-container','animate__fadeOutUp'); <</script>> <</timed>> <<script>> let mazeMoves = document.getElementById('maze-moves-popup-container'); /*const fxMove = `transform: translate(${mazeMoves.offsetLeft}px, ${mazeMoves.offsetTop}px);`;*/ /*this is it's current position */ const fxAnim = `transition: 1s ease-in-out; transform: translate(-45vw, -45vh); width: 12vmin; height: 12vmin; font-size: 3vmin; `; /*mazeMoves.style.cssText += fxMove;*/ mazeMoves.style.cssText += fxAnim; let input = document.getElementById('0'); input.focus(); input.select(); <</script>> <</timed>> /*updating the top maze moves icon with the correct value! */ <<replace "#maze-moves">>$mapanswers.length<</replace>>
<<if ndef $monsterItem>><<set $monsterItem to $quest.monsterItems.random()>><</if>> /*SOUND */ <<set $playlist to "battle">> <<playlist $playlist play>> /*MONSTER SETUP */ <<set $monster to $quest.monsters.random()>> /*grab a random monster from the array */ <<set _NPCImg to $monster.img.random()>> /*setting the image path*/ <<set _taunts to $monster.taunts.shuffle()>> <<set _itemTaunt to "Hey that's my " + $monsterItem.name + "!">> <<audio $monster.tauntSound.random() volume 1 play>> /*playing initial monster taunt sound */ /* SETUP */ <<set _timerIncludePassage to "monster item defeat">> /*this is the passage that get's included when timer runs out */ /* time */ <<set _timeDifficulty to $difficulty * 5>> <<set _totalTime to 60 - _timeDifficulty>> /* monster HP setup */ <<switch $difficulty>> <<case 0>><<set _monsterHP to 2>> <<case 1>><<set _monsterHP to 2>> <<case 2>><<set _monsterHP to 3>> <<case 3>><<set _monsterHP to 3>> <<case 4>><<set _monsterHP to 4>> <<case 5>><<set _monsterHP to 4>> <<default>><<set _monsterHP to 4>> <</switch>> <<set _monsterMaxHP to _monsterHP>> /*QUESTION n Answer SETUP */ <<timed 1s>> /*delay so we can see the monster's first item-related taunt (it's dynamic, so can't be hard-coded) */ <<include "monster qna">> <<replace "#boss-fight-timer">><<timerbar _totalTime>><</replace>> <</timed>> /* DISPLAYING THE MONSTER! */ <div id="encounter-page-container"> <div id="encounter" style="margin: 0px;"> <div> /*MONSTER IMG */ <img @src="_NPCImg" id="monster-img" style="background: radial-gradient(circle, rgb(250 211 198) 0%, rgb(250 54 108) 75%);"> /* HEALTHBAR */ <div style="position: relative; bottom: 10px; width: 80%; margin-left: 10%;"> <<showmeter '$monsterHealthBar' `_monsterHP / _monsterMaxHP`>> </div> </div> /*MONSTER TEXT */ <div id="encounter-text"> _itemTaunt </div> <div id="encounter-options"></div> </div> </div> /* MONSTER ITEM IMG! */ <div class="centerh"> <div style="height: 12vmin; width: 12vmin"> <img id="monster-item" @src="$monsterItem.img"> </div> </div> /*CHOICES*/ <div id="ui-container"> /* HEALTHBAR */ /* <div id="health-bar"><<showmeter '$healthBar' `$stats.HP / $stats.MaxHP`>></div> */ /*HEALTH */ <div id="hero-stats"> <<if $gauntlet is true>> /*only display hp in gauntlet! */ <div id="health"> <div id="health-text">$stats.HP</div> </div> <</if>> <div id="backpack-icon"> /* <span>$stats.points</span> */ </div> </div> /* TIMER */ <div id="boss-fight-timer" style="grid-area: middle; position: relative; bottom: 2vh;"><br></div> /*ANSWER CHOICES*/ <div id="bossfightchoices"></div> /*NPC/points*/ <div id="NPC-and-points"> /* NPC pop up (or not!) */ <div id="maze-NPC-container"> <<done>><<include "NPC down">><</done>> </div> /* points display! */ <div id="points" class="animate__animated"> <span>$stats.points</span> </div> </div> </div> /* DEBUG */ <div class="debug">$monster</div>
/*QUESTION n Answer SETUP */ <<set _randoReal to $qnaObjects.pluck()>> <<set _question to _randoReal.q>> <<set _answer to _randoReal.a>> <<set _realanswer to _randoReal.a>> /*need an extra answer here to check against later */ /*adding the answer to an array */ <<set _answerarray to []>> <<set _answerarray.push(_answer)>> /* LOOP that gets 3 unique fake answers! */ <<for _i to 0; _i lt 3; _i++>> /* make sure I've got enough qnas to draw from! */ <<if $qnaObjects.length lt 3>> <<set $qnaObjects to clone($qnaObjectsBackup)>> <</if>> /* grab random qna*/ <<set _randoFake to $qnaObjects.pluck()>> /*get the fake answer */ <<set _fake to _randoFake.a>> /* now check it it's unique! It should be unique... */ <<if _answerarray.includes(_fake)>> <<set _i-->> /*redo this loop run because it was a duplicate (failed attempt) */ <<else>> <<set _answerarray.push(_fake)>> /*it's unique, so add it to the answer array! */ <</if>> <</for>> /* Now shuffle up the array so they come out in a random order! */ <<set _answerarray.shuffle()>> /* DEBUG */ /* Array: _answerarray... REAL answer: _realanswer */ /* GENERATE NEW LINKS! */ <<replace "#bossfightchoices">> <</replace>> /*clear the span so I'm ready to add fresh links*/ /* Fresh links loop*/ <<for _i to 0; _i lt _answerarray.length; _i++>> /* Loop through each member of the answer array and add event listeners to divs based if they're correct or wrong */ <<append "#bossfightchoices">> <<if _answerarray[_i] is _realanswer>> <div class="story-choice" onclick="$.wiki('<<monsterDivClick 1>>')"> /*the "@" tells sugarcube to check back after evaluation and change the id to whatever _i is... the onclick adds an eventlistener which triggers monsterDivClick widget*/ <div> _answerarray[_i] </div> </div> <<else>> <div class="story-choice" onclick="$.wiki('<<monsterDivClick 0>>')"> <div> _answerarray[_i] </div> </div> <</if>> <</append>> <</for>> /* TAUNTS & NEW QUESTION*/ /*update monster textbox with a fresh taunt AND question */ <<replace "#encounter-text">>_taunts[0] <br> So what's _question?<</replace>> /*prepare a new taunt */ <<set _curTaunt to _taunts.shift()>> /*extract the first taunt */ <<set _taunts.push(_curTaunt)>> /*appends taunt to END of taunt array (back of the queue)*/
<<widget "monsterDivClick">> /*CORRECT ANSWER DIV! */ <<if $args[0] is 1>> /*Monster health goes down */ <<set _monsterHP-->> <<updatemeter '$monsterHealthBar' `_monsterHP / _monsterMaxHP`>> /*update the healthbar */ /* NEW QUESTION OR FINISH PASSAGE?*/ /*MONSTER DEATH! -> animate death and then go to where to next? passage */ <<if _monsterHP lte 0>> <<playlist $playlist fadeoverto 2 0>> /* defeated monster sound */ <<audio $monster.deathSound.random() volume 0.5 play>> /* add falling animation class to the monster img */ <<addclass "#monster-img" "animate__animated animate__rotateOutDownLeft">> /* remove the monster ITEM, because you'll get it in the popup */ /* <<a "#monster-item" "shakeY">> */ <<timed 1s>> <<addclass "#monster-item" "animate__animated animate__fadeOut">> <<addclass "#encounter" "animate__animated animate__fadeOut">> <</timed>> /* remove monster health bar and title*/ /* <<timed 0.8s>> <<addclass "#monster-message" "animate__flipOutY">> <</timed>> */ /* monster item popup!*/ <<timed 1.5s>> <<include "monster item victory">> <</timed>> /*MONSTER HIT! */ <<else>> /* monster attack/hit sound! */ <<audio $monster.attackSound.random() volume 0.6 play>> /* animate the monster wobbling as he loses hp */ <<set _randomClass to either("jello","wobble")>> <<a "#monster-img" _randomClass>> /* RESET & GENERATE NEW QUESTION */ <<include "monster qna">> <</if>> /*WRONG ANSWER DIV! */ <<else>> <<audio "error" volume 1 play>> <<shaketarget "#bossfightchoices" .5s>> <<if $gauntlet is true>> <<stats "HP" -1>> <</if>> <</if>> <</widget>>
<<set _flag to true>> /* <<for _i to 0; _i lt $quest.monsterItems.length; _i++>> <<set $monsterItem to $quest.monsterItems[_i]>>*/ /*LOOP FOR TESTING ALL ITEMS IN ONE GO */ /* VARIABLES SETUP */ <<set $discover to $quest.discover.random()>> <<set $monsterItem to $quest.monsterItems.shift()>>/*extracts FIRST monsterItem from current pool*/ <<set $quest.monsterItems.push($monsterItem)>> /*appends monsterItem to END of monsterItems array*/ <<set $cond to $monsterItem.cond.random()>> <<append "#passages">> <div id="full-page-container" class="animate__animated"> <div id="item-message" class="animate__animated animate__backInDown"> <div> //$discover $cond $monsterItem.name!// </div> <div> <img @src="$monsterItem.img"> </div> <div> $monsterItem.value points! </div> <div id="enter-button"> <<button "CLAIM!">> <<if _flag is true>> /*Button can only be triggered once now! */ <<set _flag to false>> /*OOPS! A monster is guarding this item! */ /* remove the old maze and full page container*/ <<script>> removeEl('maze-container'); removeElAnimate('full-page-container'); <</script>> /*load the next challenge */ <<goto "where to next?">> <</if>> <</button>> </div> </div> </div> <</append>> /* focus on item CLAIM button */ <<script>> focusOnChild('enter-button'); <</script>>
/*stops the timer! */ <<set _stopTimer to true>> /*hide the timer div from view */ <<replace "#boss-fight-timer">><br><</replace>> <<set _flag to true>> /* MONSTER item popup (defeated monster)*/ <<append "#passages">> <div id="full-page-container" class="animate__animated"> <div id="item-message" class="animate__animated animate__flipInY"> <div> //You defeated the $monster.name! The $monsterItem.name is yours!// </div> <div> <img @src="$monsterItem.img"> </div> <div> $monsterItem.value points! </div> <div id="enter-button"> <<button `"Take " + $monsterItem.name`>> <<if _flag is true>> /*Button can only be triggered once now! */ <<set _flag to false>> /* add points to your score */ <<stats "points" $monsterItem.value>> /* audio */ <<audio "finditem1" volume 1 play>> /* add item to your found items array */ <<set $backpack.push($monsterItem)>> /* remove the item pop up (via full-page-container)*/ <<script>> removeElAnimate('full-page-container'); <</script>> /* unset all monsterItem variables */ <<unset $monsterItem>> <<unset $discover>> <<unset $cond>> /*load the next challenge */ <<timed 1s>><<goto "where to next?">> <</timed>> <</if>> <</button>> </div> </div> </div> <</append>> /* focus on item CLAIM button */ <<script>> focusOnChild('enter-button'); <</script>>
/* This fades the item up so it looks like the monster is taking it */ <<addclass "#monster-item" "animate__animated animate__fadeOutUp">> <<addclass "#ui-container" "animate__animated animate__fadeOutDown">> <<timed 3s>> <<goto "where to next?">> <</timed>>
/* QUEST ITEM! */ /* grab a new random item */ <<set _qItem to $quest.items.random()>> <<set _flag to true>> /*ITEM popup */ /* <<for _i to 0; _i lt $quest.items.length; _i++>> <<set _qItem to $quest.items[_i]>> */ /*loop for testing ALL items in one go*/ <<append "#passages">> <div id="full-page-container" class="animate__animated"> <div id="item-message" class="animate__animated animate__backInDown"> <div> //<<=$quest.discover.random()>> <<=_qItem.cond.random()>> _qItem.name!// </div> <div> <img @src="_qItem.img"> </div> <div> _qItem.value points! </div> <div> <span id="enter-button"> <<button "CLAIM!">> <<if _flag is true>> /*Button can only be hit once now! */ <<set _flag to false>> /* add points to your score */ <<stats "points" _qItem.value>> <<audio "finditem1" volume 1 play>> /* add item to your found items array */ <<set $backpack.push(_qItem)>> /* remove the old maze and full page container*/ <<script>> removeElAnimate('full-page-container'); <</script>> /*load the next challenge */ <<timed 1s>><<goto "where to next?">><</timed>> <</if>> <</button>> </span> </div> </div> </div> <</append>> /* <</for>> */ /* focus on item CLAIM button */ <<script>> focusOnChild('enter-button'); <</script>>
[[Back|choose quest]] <div style="min-height: 100vh;"> <iframe width="95%" height= "883px" src= "https://forms.office.com/Pages/ResponsePage.aspx?id=8KtrY1Ehz0OwwANBCzyvJBqgd-0A8G5OuaoNhs8DPG5UMzNOWTUxV0VQMFBWRTlZWTAzMlVWMFFSTS4u&embed=true" frameborder= "0" marginwidth= "0" marginheight= "0" style= "border: none; max-width:100%; max-height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe> </div> [[Back|choose quest]]
/* HEADING */ <div style="text-align: center"> <h1>Victory!</h1> </div> <hr> <br> You found a way out of the Maze and off the island!<br><br> You had $stats.points points! To be continued... [[Back to Camp|camp]] /* -------------------------------------------------- MAP STUFF ------------------------------------------ */
<<widget "timerbar">> /* resetting variables <<set _totalTime to 0>> <<set _curTime to 0>>*/ /* setting new variables */ <<set _totalTime to $args[0]>> <<set _curTime to _totalTime>> /* the timerbar display zone*/ <span id="timerbar"><<showmeter '$timerbar' `_curTime / _totalTime`>></span> /*This last argument is a fraction/percentage (decimal between 0 and 1 essentially) Also, showmeter just runs the meter, but updatemeter runs it ONCE */ /* TIME LOOP */ <<repeat 1s>> <<set _curTime -->> <<if _curTime gt -1>> <<updatemeter '$timerbar' `_curTime / _totalTime`>> <<else>> <<replace "#timerbar">><span style="color: white; text-align: center;">Too Late!</span><</replace>> <<shaketarget "#ui-container" 1s>> <<playlist "death" shuffle play>> <<timed 1.5s>> /* forward to a passage if it's set */ <<if def _timerIncludePassage>> <<include _timerIncludePassage>> <</if>> <</timed>> <<stop>> <</if>> <<if _stopTimer is true>> /*extra way to stop the timer */ <<stop>> <</if>> <</repeat>> <</widget>>
/*WIDGET CONSTRUCTING Array FROM PASSAGE*/ <<widget "arraymaker">> /*the name of the widget*/ /*Get the contents of a variable passage - that is specified in the twine passage. For example, <<arraymaker "somepassage">> would run this widget and turn the contents of "somepassage" into an Array*/ <<set _passageContents to Story.get($args[0])>> /*full argument string in raw and parsed forms—accessed via the $args.raw and $args.full*/ /*Turn the contents into text*/ <<set _passageText to _passageContents.text>> /*Turn the text into an Array (split here by ENTERS)*/ <<set _array to _passageText.split("\n")>> <</widget>>
<<widget "a">> <<script>> /*usage: <<a "#health" "bounce" "slideInUp">> [widget, "element", "1st animation", "2nd animation"]*/ let el = document.querySelector(State.variables.args[0]); if (el) { let styly = window.getComputedStyle(el, null).display; /*give the element inline-block if it doesn't already have it (or block)*/ if (styly == "block" || styly =="inline-block" || styly =="flex"){ } else { el.style.display="inline-block"; } /*give the element the FIRST animation style, then check for other styles... */ animateCSS(State.variables.args[0], State.variables.args[1]); /*2nd animation?*/ if (State.variables.args[2]){ animateCSS(State.variables.args[0], State.variables.args[2]); } /*3rd animation?*/ if (State.variables.args[3]){ animateCSS(State.variables.args[0], State.variables.args[3]); } /*4th animation?*/ if (State.variables.args[4]){ animateCSS(State.variables.args[0], State.variables.args[4]); } } else { console.log("Animation error: couldn't find the element to add animation to!") } <</script>> <</widget>>
<<widget "stats">> <<switch $args[0]>> <<case "HP">> /*AUDIO */ /* Are you gaining or losing resources here? */ <<if $args[1] gt 0>> /* yay, you're GAINING HP! */ <<audio "victory" volume 0.5 play>> <<a "#health" "bounce">> <<else>> /* Hmmm, you're LOSING HP! */ <<audio "error" volume 0.5 play>> <<a "#health" "heartBeat">> <</if>> /*GAIN OR LOSE HEALTH */ <<set $stats.HP to $stats.HP + $args[1]>> /*Gain or lose as much HP as the widget argument[0] */ /*GAME-BASED STUFF */ /*IF HP loss dropped player below 0 send them to the death passage! */ <<if $stats.HP lte 0>> <<timed 1s>> <<playlist "death" play>> <<goto "death">> <</timed>> <</if>> /*you can't go over Max HP*/ <<if $stats.HP gt $stats.MaxHP>> <<set $stats.HP to $stats.MaxHP>> <</if>> /*display new resources amount somewhere, IF the element exists!*/ <<script>> if (document.getElementById("health-text")){ document.getElementById("health-text").innerHTML = State.variables.stats.HP; } <</script>> <<case "resources">> /* GAIN or LOSE resources (not buying!)*/ /* Are you gaining or losing resources here? */ <<if $args[1] gt 0>> /* yay, you're GAINING resources! */ <<audio "victory" volume 0.5 play>> <<notify 3s 'inventory-resources'>>+$args[1] resources.<</notify>> <<else>> /* Hmmm, you're LOSING resources! */ <<audio "error" volume 0.5 play>> <</if>> /* update resources value */ <<set $stats.resources to $stats.resources + $args[1]>> /*gain or lose as much resources as args[1] */ /*can't go below zero resources!*/ <<if $stats.resources lt 0>> <<set $stats.resources to 0>> <</if>> /*display new resources amount somewhere!*/ <<replace "#resources">>Resources: $stats.resources<</replace>> <<case "points">> /* GAIN or LOSE points (not buying!)*/ /* Are you gaining or losing points here? */ <<if $args[1] gt 0>> /* yay, you're GAINING points! */ <<audio "victory" volume 0.5 play>> /* <<notify 3s 'inventory-points'>>+$args[1] points.<</notify>> */ <<else>> /* Hmmm, you're LOSING points! */ <<audio "error" volume 0.5 play>> <</if>> /* update points value */ <<set $stats.points to $stats.points + $args[1]>> /*gain or lose as much points as args[1] */ /*can't go below zero points!*/ <<if $stats.points lt 0>> <<set $stats.points to 0>> <</if>> /*display new points amount somewhere!*/ /*display new resources amount somewhere, IF the element exists!*/ <<script>> if (document.getElementById("points")){ document.getElementById("points").innerHTML = State.variables.stats.points; animateCSS('#points', 'tada'); } <</script>> <</switch>> <</widget>>
<<widget "choicepassword">> /*The name of the widget */ <<set _password to $args[0]>> /*setting the textbox password */ <<set _forwardingpassage to $args[1]>> /*setting the forwarding passage */ <<if $args[2]>> <<set _buttonlabel to $args[2]>>/*setting the label for the textbox check button. If Designer hasn't included a button label it will default to "Check!" */ <<else>> <<set _buttonlabel to "Go">> <</if>> /*Creating the textbox and button */ <div class="textenter"> <<textbox "_code" "" autofocus>> <<button _buttonlabel>> <<set _code to _code.toLowerCase().toString()>> <<if _code.indexOf(_password) > -1>> /*checks code against the password set by the widget argument. If password is "brain" any instance of it will work, ie "brained" or "the brain" or "xyzsbrain"*/ <<goto _forwardingpassage>> <<audio "victory" volume 1 play>> <<else>> /*something could happen here */ <</if>> <<replace "#poop">>_password. _forwardingpassage. _code<</replace>> <</button>> </div> <span id="poop"></span> <</widget>> /*USAGE: <<password "The Password" "Forwarding Passage" "Button Label">> "The Password", the second is the passage to forward to if the password is correct */
<<widget "password">> /*The name of the widget */ /*setting up the failed password messages array */ <<arraymaker "failed password messages">> <<set _failmessage to _array>> <<set _counter to 0>> <<set _password to $args[0]>> /*setting the textbox password */ <<set _forwardingpassage to $args[1]>> /*setting the forwarding passage */ <<if $args[2]>> <<set _buttonlabel to $args[2]>>/*setting the label for the textbox check button. If Designer hasn't included a button label it will default to "Check!" */ <<else>> <<set _buttonlabel to "Check!">> <</if>> /*Creating the textbox and button */ <div class="textenter"> <<textbox "_code" "" autofocus>> <<button _buttonlabel>> <<set _code to _code.toLowerCase()>> <<if _code.indexOf(_password) > -1>> /*checks code against the password set by the widget argument. If password is "brain" any instance of it will work, ie "brained" or "the brain" or "xyzsbrain"*/ <<goto _forwardingpassage>> <<else>> <<replace "#answerfeedback">>_failmessage[_counter]<</replace>> <<set _counter++>> <<if _counter gte _failmessage.length>> /*if you've seen all the fail messages, reset the counter so you start from the beginning again */ <<set _counter to 0>> <</if>> <</if>> <</button>> </div> <br> <span id="answerfeedback"></span> <</widget>> /*USAGE: <<password "The Password" "Forwarding Passage" "Button Label">> "The Password", the second is the passage to forward to if the password is correct */
Oopsy! That doesn't look right...try again? Hmm...that's not the code I was expecting... Nope, that's not it I'm afraid! :( Are you sure you know what you're doing here? ;) Hmm maybe try asking your teacher? Are you sure the spelling is correct? Hmmm not trying to break in are you? :P If you type that password in wrong again I think I'll cry!
/*---- DEMO MODE FOR SCREEN CAPTURES!------------------------------------------ */ <<if def $demo>> <<set _d to 0>> <<link "Next answer for demo!">> <<addclass `"#"+_d` "right-answer animate__animated animate__heartBeat">> <<script>> async function doStuff() { let x = document.getElementById(State.temporary.d); x.value = State.variables.mapanswers[State.temporary.d]; /*setting the value of the textbox to the correct map answer */ let maze = document.querySelector('game-maze'); await maze.move(); State.temporary.d++; } doStuff(); <</script>> <</link>> <</if>> /*END DEMO MODE-------------------------------------------------------------------- */ /* -------------------------------------------------- RANDOM SHIIIIT ------------------------------------------ */
<span id="test"> TEST: </span> Yay you finished the Food quest! Yummy! /* compare player points to the rank scores of the quest */ /*Loop that checks from the highest rank backwards... */ <<for _i to $quest.score.length-1; _i gte 0; _i-->> <<set _rank to $quest.score[_i].rank>> <<if $stats.points gte _rank>> <<set _achievement to $quest.score[_i].achievement>> <<set _victorymessage to $quest.score[_i].victorymessage>> /* <<prepend "#test">> $stats.points _achievement hi! <</prepend>> */ <<break>> <</if>> <</for>> SILLY ACHIEVEMENT: _achievement <div class="dialogue-left"> /*image */ <div class="dialogue-character"><img @src="$quest.NPCImg"></div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText"> <<type 30ms start 1s>> _victorymessage <</type>> </div> </div> </div> Hello my friend! I'm glad you dropped by... I'm lookin for some _______ for a ________. Can you quickly pop into the terrifying and deadly maze and fetch me some? Look out for those ______! They'll getcha! Maybe take that cool sword of yours?
<<timed 0.5s>><<audio $questNPC.dialogueSound play>><</timed>> /* variables */ <<set _i to 0>> /*CARD DISPLAY VERSION */ <div id="encounter-page-container"> <div id="encounter"> <img @src="$questNPC.img[0]" style="background: radial-gradient(circle, rgb(218 248 254) 0%, rgb(35 161 155) 75%);"> <div id="encounter-text"> $questVars.purpose[_i] </div> <div id="encounter-options"></div> </div> </div> /*Quest Button */ <div id="go-on" class="centerh"> <<include "quest button">> </div>
/*IS INTRO OVER? */ /*NO -> Keep going */ <<if _i lt $questVars.purpose.length-1>> /* Button Labels */ <<set _buttonLabel to either("Go on...","Tell me more.","I'm interested.","Ok, tell me more...","Ok then.","Righto then.","I'm listening...")>> /* TELL ME MORE! */ <<button _buttonLabel>> <<audio $questNPC.dialogueSound play>> /* increment counter */ <<set _i++>> /*Display next big of intro purpose dialogue */ <<replace "#encounter-text" t8n>> $questVars.purpose[_i] <</replace>> <<a "#encounter-text" "flipInY">> /* Replace this button */ <<replace "#go-on" t8n>> <<include "quest button">> <</replace>> <</button>> /* YES -> Replace this button with START QUEST button */ <<else>> /* Button Labels */ <<set _buttonLabel to either("Let's do this!","Righto, I'm in.","If you say so!","Alright then.","Only 'cos you asked nicely...","Let's get this done!","I'll be back before you can say 'Howdy McHowdy-boy'")>> /* BEGIN QUEST */ <<button _buttonLabel>> <<goto "where to next?">> <</button>> <</if>>
<<audio "yeah" volume 0.5 play>> <<timed 2.5s>><<audio $questNPC.dialogueSound play>><</timed>> /* Loop that checks from the highest rank backwards, and sets the right achievement and victory message... */ /* <<set $backpack to $quest.items>> */ <<for _i to $quest.score.length-1; _i gte 0; _i-->> <<set _rank to $quest.score[_i].rank>> <<if $stats.points gte _rank>> <<set _achievement to $quest.score[_i].achievement>> <<set _img to $quest.score[_i].img>> <<break>> <<else>> <<set _achievement to $quest.score[0].achievement>> <<set _img to $quest.score[0].img>> <</if>> <</for>> <<done>> /*Display found items*/ <<for _i to 0; _i lt $backpack.length; _i++>> <<append "#items">> <div @id="_i" class="animate__animated" style="width: 20%; max-width: 100px;"> <img @src="$backpack[_i].img" style="width: 100%; "> </div> <</append>> <</for>> /*Give Items to NPC */ <<timed 2s>> <<set _i to 0>> /* loop that showers NPC with items! */ <<repeat .3s>> <<if _i lt $backpack.length>> <<addclass `"#"+_i` "animate__fadeOutDown">> <<set _i++>> <<else>> <<stop>> /*stop this repeat loop */ <</if>> <</repeat>> <</timed>> <</done>> /* SCORE! */ <div class="centerh"> <div id="qna-heading" class="animate__animated animate__bounceInDown centerh" style="color:white;"> $stats.points points! </div> </div> /* ITEMS */ <div id="items" style="display: flex; justify-content:center; align-items: center;"></div> /*CARD DISPLAY VERSION */ <div id="encounter-page-container"> <div id="encounter"> /* NPC */ <img @src="$questNPC.img[0]" style="background: radial-gradient(circle, rgb(218 248 254) 0%, rgb(35 161 155) 75%);"> /*TEXT */ <div id="encounter-text"> $questVars.victoryMessage </div> <div id="encounter-options"></div> </div> </div> /* BUTTON */ <div class="centerh"> <<button "Victory!">> <<audio "powerup" volume 0.5 play>> <<set _finalSound to "finditem1">> /* saving your score to the currect $quest object */ <<set $quest.completedScore to $stats.points>> /* update the dailyNPCs array with a dweller who's current quest score matches the quest you just finished!*/ <<set $dailyNPCs[$questnumber].currentQuest.quest to clone($quest)>> /* ACHIEVEMENT POPUP! */ <<append "#story">> <div id="full-page-container" class="animate__animated"> <div id="quest-achievement" class="animate__animated animate__bounceInUp" onclick="removeEl('full-page-container'); forward('leaderboard')"> <div id="curvytext"> <svg viewBox="0 0 500 500"> <path id="curve" fill="transparent" d="M73.2,148.6c4-6.1,65.5-96.8,178.6-95.6c111.3,1.2,170.8,90.3,175.1,97" /> <text width="500"> <textPath xlink:href="#curve" startOffset="30%" style="font-size: 35px;"> You did it! </textPath> </text> </svg> </div> <div id="bottom-half"> <div>[img[_img]] </div> /*achievement image */ <div>You unlocked the achievement:</div> <div id="achievement-title"> _achievement /*achievement title */ </div> </div> </div> </div> <</append>> <</button>> </div>
<<set _currentPlayer to { name: $stats.name, points: $stats.points, }>> <<set _randomNPC to { name: either("Haggy Blobber","Dagrid","Jon Beasley","Princess Emerald","Professor Snope","Bumblebeard","Wimpy Skeleton","Helga the Invincible","Lord Prancy Pants","Joan of Aaark!"), points: random(80,200), }>> <div class="centerv"> <h1>High Scores </h1> <div id="leaderboard"></div> <div id="fail-message"></div> <div><br></div> /*BUTTON THAT REFRESHES ALL THE VARIABLES! */ <<button "Go on a new Quest!">> <<goto "choose quest">> <</button>> <<linkreplace "Clear ALL scores">> Are you sure? <br> Your current score (and 1 challenger) will be saved... but all previous scores will be cleared!<br> <<link "I'm sure. Erase the past!">> <<run forget('scoreboard')>> <<goto "leaderboard">> <</link>> <</linkreplace>> </div> <<done>> <<updatescoreboard>> <<scoreboard>> <</done>>
<<widget "updatescoreboard">> /% Create the scoreboard variable if it doesn't exist. %/ <<if ndef $scoreboard>> <<set $scoreboard to []>> <</if>> /% Grab memorized scores from past plays! %/ <<set $scoreboard = recall("scoreboard", [])>> /% Add the current name and score to the end of the array. %/ <<set $scoreboard.push(_currentPlayer)>> /% Add the current name and score to the end of the array. %/ <<set $scoreboard.push(_randomNPC)>> /% Sort the array. Sort Highest to lowest. If I want lowest to highest, switch to "return a - b" %/ <<run $scoreboard.sort(function (a, b) { return b.points - a.points; })>> /% Persist the scoreboard story variable (which now includes the current score!) %/ <<set memorize("scoreboard", $scoreboard)>> <</widget>> <<widget "scoreboard">> <<set _scoreFound to false>> <<if def $scoreboard>> /* LOOP -> Goes through the scores, prints the top 10 and highlights the current score */ <<for _i to 0; _i lt $scoreboard.length and _i lt 10; _i++>> /*Only display the top 10 scores */ <<append "#leaderboard">> <<if $scoreboard[_i].points is $stats.points and $scoreboard[_i].name is $stats.name and _scoreFound is false>> <div class="current-score"> <span style="font-size: 130%;"> <<=_i+1>> </span> - $scoreboard[_i].name ($scoreboard[_i].points) </div> <<set _scoreFound to true>> /*sets this variable once you've found the first score, so if there's multiple scores in the array that are the same they won't all highlight */ <<else>> <div class="score"> <span style="font-size: 130%;"> <<=_i+1>> </span> - $scoreboard[_i].name ($scoreboard[_i].points) </div> <</if>> <</append>> <</for>> /* FAIL TEXT -> displayed if you didn't make the top 10 */ <<if _scoreFound is false>> <br><br> <<set _position to $scoreboard.indexOf(_currentPlayer)+1>> <<append "#fail-message">> //You got rank _position ...not quite enough to make it to the top 10... :( <br> Better luck next time! // <</append>> <</if>> <</if>> <</widget>>
/* HIDE UI BAR (Default) */ <<script>> UIBar.stow(); UIBar.hide(); <</script>> <<set $player to "teacher">> <<set $debug to false>> /* DIFFICULTY */ <<set $hardMode to 0>> <<set $studentTimes to []>> <<set $fullscreen to 1>> /*default ON */ <<set $gauntlet to false>> <<set $step to "BEGIN">> <<set $challenge to "maze">> /* PLAYER STATS */ <<set $stats to { name: "Billy Bob", HP: 10, MaxHP: 10, resources: 0, points: 0, }>> /*QUEST SETUP*/ <<set $difficulty to 0>> <<set $answercounter to 0>> <<set $backpack to []>> <<set $currentmap to "">> /* set counter for "where to next?" challenges! */ <<set $i to -1>> /* set counter for quest checkpoints */ <<set $c to -1>> <<set $keyboard to ["numberpad"]>> /*default keyboard layout */ <<set $qnaObjects to []>> <<set $qnaObjectsBackup to []>> /* MAZE SETUP */ /*Going to passage of maps by difficulty, setting the output array to a variable and then shuffling each one.*/ <<arraymaker "intro">> <<set $intro to _array>> <<set $intro.shuffle()>> <<arraymaker "veryeasy">> <<set $veasy to _array>> <<set $veasy.shuffle()>> <<arraymaker "easy">> <<set $easy to _array>> <<set $easy.shuffle()>> <<arraymaker "medium">> <<set $med to _array>> <<set $med.shuffle()>> <<arraymaker "hard">> <<set $hard to _array>> <<set $hard.shuffle()>> <<arraymaker "veryhard">> <<set $vhard to _array>> <<set $vhard.shuffle()>> /*putting all the map pools inside one big array */ <<set $maparray to [ $intro, $veasy, $easy, $med, $hard, $vhard ]>> /* HP & MONSTER SETUP */ /* setting up a meter for Monster'S health */ <<newmeter '$healthBar'>> /*this is the (variable) name of the element */ <<animation 500ms>> <<colors 'green' 'red' 'black'>> /*full, empty, backing */ <<sizing 100% 3vmin>> /*width, height */ <<label '$stats.HP' 'black' center>> <</newmeter>> <<newmeter '$monsterHealthBar'>> /*this is the (variable) name of the element */ <<animation 500ms>> <<colors 'yellow' 'red' 'black'>> /*full, empty, backing */ <<sizing 100% 1.5em >> /*width, height */ <<label '_monsterHP' 'black' center>> <</newmeter>> /* setting up a timer meter for monster fights */ <<set _curTime to 10>> <<set _totalTime to 30>> /*initial setup */ /* <<label '_curTime'>> */ <<newmeter '$timerbar'>> /*this is the (variable) name of the element */ <<animation 1s>> <<colors 'grey' 'red' 'black'>> /*full, empty, backing */ <<sizing 100% 1.5em >> /*width, height */ <</newmeter>> <<set $mapA to { BEGIN:{ gridPosition: "mm6", challenge: "begin", connectsTo: ["A"], }, A: { gridPosition: "kk5", challenge: "maze", connectsTo: ["B","C"], }, B: { gridPosition: "ii7", challenge: "unknown", connectsTo: ["D"], }, C: { gridPosition: "hh5", challenge: "maze", connectsTo: ["E","F"], }, D: { gridPosition: "ff8", challenge: "fight", connectsTo: ["G"], }, E: { gridPosition: "ee2", challenge: "fight", connectsTo: ["H"], }, F: { gridPosition: "ee5", challenge: "unknown", connectsTo: ["K"], }, G: { gridPosition: "dd7", challenge: "maze", connectsTo: ["I","J"], }, H: { gridPosition: "cc2", challenge: "chest", connectsTo: ["K"], }, I: { gridPosition: "cc9", challenge: "rest", connectsTo: ["L"], }, J: { gridPosition: "bb7", challenge: "chest", connectsTo: ["K"], }, K: { gridPosition: "z6", challenge: "maze", connectsTo: ["M","N"], }, L: { gridPosition: "y9", challenge: "maze", connectsTo: ["O"], }, M: { gridPosition: "x3", challenge: "maze", connectsTo: ["P"], }, N: { gridPosition: "w5", challenge: "fight", connectsTo: ["T"], }, O: { gridPosition: "w8", challenge: "chest", connectsTo: ["Q"], }, P: { gridPosition: "v3", challenge: "maze", connectsTo: ["R","S"], }, Q: { gridPosition: "u9", challenge: "maze", connectsTo: ["T"], }, R: { gridPosition: "t5", challenge: "unknown", connectsTo: ["U"], }, S: { gridPosition: "r3", challenge: "chest", connectsTo: ["SSS"], }, SSS: { gridPosition: "o2", challenge: "fight", connectsTo: ["X","W"], }, T: { gridPosition: "r7", challenge: "rest", connectsTo: ["V"], }, U: { gridPosition: "q5", challenge: "rest", connectsTo: ["Y","SSS"], }, V: { gridPosition: "p8", challenge: "fight", connectsTo: ["Y"], }, W: { gridPosition: "n4", challenge: "maze", connectsTo: ["Z"], }, X: { gridPosition: "m2", challenge: "unknown", connectsTo: ["Z"], }, Y: { gridPosition: "m7", challenge: "maze", connectsTo: ["AA","AB"], }, Z: { gridPosition: "k4", challenge: "maze", connectsTo: ["AB","AC"], }, AA: { gridPosition: "j8", challenge: "chest", connectsTo: ["AE"], }, AB: { gridPosition: "h6", challenge: "fight", connectsTo: ["AD"], }, AC: { gridPosition: "g3", challenge: "chest", connectsTo: ["AD"], }, AD: { gridPosition: "f5", challenge: "fight", connectsTo: ["AF"], }, AE: { gridPosition: "f8", challenge: "unknown", connectsTo: ["AF"], }, AF: { gridPosition: "d5", challenge: "maze", connectsTo: ["END"], }, END: { gridPosition: "b5", challenge: "end", connectsTo: [], }, }>> /*SOUND SETUP*/ /*PATH*/ <<set setup.Path to "assets/sounds/">> /*camp */ /* <<set _bgm = setup.Path + "camp1.mp3">> <<cacheaudio "camp1" _bgm>> <<set _bgm = setup.Path + "camp2.mp3">> <<cacheaudio "camp2" _bgm>> <<createplaylist "camp">> <<track "camp1" volume 1>> <<track "camp2" volume 1>> <</createplaylist>> */ /* Merchant */ /* <<set _bgm = setup.Path + "merchant.mp3">> <<cacheaudio "merchant" _bgm>> <<createplaylist "merchant">> <<track "merchant" volume 1>> <</createplaylist>> */ /* maze */ /* <<set _bgm = setup.Path + "maze1_loop.mp3">> <<cacheaudio "maze1" _bgm>> <<set _bgm = setup.Path + "maze4_loop.mp3">> <<cacheaudio "maze4" _bgm>> */ /* <<set _bgm = setup.Path + "maze2_loop.mp3">> <<cacheaudio "maze2" _bgm>> <<set _bgm = setup.Path + "maze3_loop.mp3">> <<cacheaudio "maze3" _bgm>> */ /* <<createplaylist "maze">> <<track "maze1" volume .3>> <<track "maze4" volume .3>> <</createplaylist>> */ /* monster fight */ <<set _bgm = setup.Path + "battle1.mp3">> /*setting the path*/ <<cacheaudio "battle1" _bgm>> /*caching the track*/ <<createplaylist "battle">> <<track "battle1" volume 0.2>> <</createplaylist>> /* SFX */ /*error sounds*/ <<set _bgm = setup.Path + "error.mp3">> <<cacheaudio "error" _bgm>> /* location sounds */ <<set _bgm = setup.Path + "coins.mp3">> <<cacheaudio "coins" _bgm>> <<set _bgm = setup.Path + "sell.mp3">> <<cacheaudio "sell" _bgm>> <<set _bgm = setup.Path + "itemtransfer.mp3">> <<cacheaudio "itemtransfer" _bgm>> /* item sounds */ <<set _bgm = setup.Path + "finditem1.mp3">> <<cacheaudio "finditem1" _bgm>> /*victory sounds*/ <<set _bgm = setup.Path + "victory.mp3">> <<cacheaudio "victory" _bgm>> <<set _bgm = setup.Path + "yeah.mp3">> <<cacheaudio "yeah" _bgm>> <<set _bgm = setup.Path + "powerup.mp3">> <<cacheaudio "powerup" _bgm>> /* death */ <<set _bgm = setup.Path + "death1.mp3">> <<cacheaudio "death1" _bgm>> <<set _bgm = setup.Path + "death2.mp3">> <<cacheaudio "death2" _bgm>> <<createplaylist "death">> <<track "death1" volume 1>> <<track "death2" volume 1>> <</createplaylist>> /*misc sounds*/ /* <<set _bgm = setup.Path + "achievement.mp3">> <<cacheaudio "achievement" _bgm>> */ /*MONSTER SOUNDS */ /* rat */ <<set setup.Path to "assets/monsters/rat/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "rat_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "rat_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "rat_attack2" _bgm>> <<set _bgm = setup.Path + "attack3.mp3">> <<cacheaudio "rat_attack3" _bgm>> <<set _bgm = setup.Path + "attack4.mp3">> <<cacheaudio "rat_attack4" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "rat_death" _bgm>> /* bee */ <<set setup.Path to "assets/monsters/bee/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "bee_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "bee_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "bee_attack2" _bgm>> <<set _bgm = setup.Path + "attack3.mp3">> <<cacheaudio "bee_attack3" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "bee_death" _bgm>> /* bear */ <<set setup.Path to "assets/monsters/bear/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "bear_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "bear_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "bear_attack2" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "bear_death" _bgm>> /* guard */ <<set setup.Path to "assets/monsters/guard/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "guard_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "guard_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "guard_attack2" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "guard_death" _bgm>> /* flower */ <<set setup.Path to "assets/monsters/flower/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "flower_taunt" _bgm>> <<set _bgm = setup.Path + "taunt2.mp3">> <<cacheaudio "flower_taunt2" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "flower_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "flower_attack2" _bgm>> <<set _bgm = setup.Path + "attack3.mp3">> <<cacheaudio "flower_attack3" _bgm>> <<set _bgm = setup.Path + "attack4.mp3">> <<cacheaudio "flower_attack4" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "flower_death" _bgm>> /* bug/s */ <<set setup.Path to "assets/monsters/bug/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "bug_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "bug_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "bug_attack2" _bgm>> <<set _bgm = setup.Path + "attack3.mp3">> <<cacheaudio "bug_attack3" _bgm>> <<set _bgm = setup.Path + "attack4.mp3">> <<cacheaudio "bug_attack4" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "bug_death" _bgm>> <<set _bgm = setup.Path + "death2.mp3">> <<cacheaudio "bug_death2" _bgm>> /* boss robot */ <<set setup.Path to "assets/monsters/boss-robot/">> <<set _bgm = setup.Path + "taunt.mp3">> <<cacheaudio "boss-robot_taunt" _bgm>> <<set _bgm = setup.Path + "attack.mp3">> <<cacheaudio "boss-robot_attack" _bgm>> <<set _bgm = setup.Path + "attack2.mp3">> <<cacheaudio "boss-robot_attack2" _bgm>> <<set _bgm = setup.Path + "attack3.mp3">> <<cacheaudio "boss-robot_attack3" _bgm>> <<set _bgm = setup.Path + "attack4.mp3">> <<cacheaudio "boss-robot_attack4" _bgm>> <<set _bgm = setup.Path + "death.mp3">> <<cacheaudio "boss-robot_death" _bgm>> /* setting setup.path back to normal */ <<set setup.Path to "assets/">> /* ----------------------------MONSTERS----------------------- */ /* Rat */ <<set _name to "rat">> <<set _path to "assets/monsters/" +_name +"/">> /* 1 is very common, 10 is very rare! */ <<set setup.rat to { name: "Rascally Rat", img: [_path + _name + ".png"], startTaunts: [ "Think you can just run off with that do you!?", "You can't have that, boy!", "Hey! That's mine!", "This rat wants to dance!", ], taunts: [ "Grr! Cheese and biscuits!", "By the kink in my tail!", "See this axe?!", "I've been in more fights than you can imagine!", "Aaaargh!", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", _name + "_attack3", _name + "_attack4", ], deathSound: [_name + "_death"], rarity: 1, }>> /* Bee */ <<set _name to "bee">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.bee to { name: "Bee", img: [_path + "bee.png"], startTaunts: [ "Think you can just run off with that do you!?", "You can't have that, boy!", "Hey! That's mine!", "Buzz off boy!", ], taunts: [ "You'll never defeat me!", "I'll crush you like a bug!", "You will bee defeated!", "You think you're the only one with a sting?!", "BUZZZ!", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", _name + "_attack3", ], deathSound: [_name + "_death"], rarity: 3 }>> /* Bear */ <<set _name to "bear">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.bear to { name: "Bear", img: [_path + _name + ".png"], startTaunts: [ "Give that back!", "Mine. MINE!", "Leave bear alone...", "Bear make fight!", ], taunts: [ "Bear chase boy now...", "I'm beary, beary angry!", "That's not beary nice!", "Grrrrr", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", ], deathSound: [_name + "_death"], rarity: 2, }>> /* Guard */ <<set _name to "guard">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.guard to { name: "Red Guard", img: [_path + _name + ".png"], startTaunts: [ "Give that back!", "Mine. MINE!", "I'm guarding that!", "Hands off! That's mine!", ], taunts: [ "I'll eat you for breakfast!", "En Garde!", "Don't let your guard down!", "You're tougher than you look...", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", ], deathSound: [_name + "_death"], rarity: 2, }>> /* Flower */ <<set _name to "flower">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.flower to { name: "Angry Flower", img: [_path + _name + ".png"], startTaunts: [ "Oi you! That's mine!", "Give that back!", "Leaf that alone!", "This flower's got the power!", ], taunts: [ "Unbe-leaf-able!", "Think you can get away from me!?", "What's up buttercup?", "What in carnation?", "Petal to the metal!", "Oopsie Daisy!", "Oooh... thorny!" ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", ], deathSound: [_name + "_death"], rarity: 2, }>> /* Bug */ <<set _name to "bug">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.bug to { name: "Bug", img: [ _path + _name + "_yellow.png", _path + _name + "_green.png", _path + _name + "_blue.png", _path + _name + "_purple.png", _path + _name + "_red.png", ], startTaunts: [ "Bug! Attack!", "You steal! You steal!", "That's mine!", "Give it back!", ], taunts: [ "Bug not happy!", "Blugger brr!", "Gah!", "Grrrrr", "Bug ANGRY!", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", _name + "_attack3", _name + "_attack4", ], deathSound: [ _name + "_death", _name + "_death2", ], rarity: 2, }>> /* Boss Robot */ <<set _name to "boss-robot">> <<set _path to "assets/monsters/" +_name +"/">> <<set setup.bossRobot to { name: "Big Bad Robo Boy", img: [_path + _name + ".png"], startTaunts: [ "Oi you! That's mine!", "Give that back!", "Leaf that alone!", "This flower's got the power!", ], taunts: [ "Exterminate!", "Come closer, I byte!", "Rust in pieces, human!", "Your moves are rusty...", "Hmmm this one's a resistor!", "I need to reCHarge!", ], tauntSound: [_name + "_taunt"], attackSound: [ _name + "_attack", _name + "_attack2", _name + "_attack3", _name + "_attack4", ], deathSound: [_name + "_death"], rarity: 2, }>> /* ---------------------- QUEST OBJECTS START----------------------------- */ /* COND = opinion(lovely) size(small) shape(round) age(old) LOOK = colour(blue) material(ceramic) purpose(ceremonial) origin(elven) SINGLE ITEM FORMULA: DISCOVER ("You find") COND("an old") NAME("clock") MULTIPLE ITEMS FORMULA: DISCOVER ("You find") COND("a clump of") NAME("parsley") */ /* HERBS */ <<set _path to "assets/quests/herbs/">> <<set setup.herbQuest = { name: "herbs", discover: ["You find ","Viola! Looks like ","You discover ","Look! It's ","Ha! It's ","Oooh! It's ","Perfect... ","Mmmm... "], items: [ { name: "parsley", img: _path + "parsley.png", cond: ["a sprig of withered","a bunch of","a patch of fresh"], desc: ["tasty!","quite condter!"], value: random(5,10), }, { name: "elderberry", img: _path + "elderberry.png", cond: ["a sprig of withered","a bunch of","a branch of wizened","a patch of fresh"], desc: ["tasty!","quite condter!"], value: random(5,10), }, { name: "elf leaf", img: _path + "elfleaf.png", cond: ["a clove of withered","a snip of pungent","a sprout of fresh","a branch of succulent"], desc: ["tasty!","marvellous!"], value: random(5,10), }, { name: "spikenut", img: _path + "spikenut.png", cond: ["a curling vine of unripe","an offshoot of tart","a clump of mild","a thicket of fresh"], desc: ["spicy!","tangy!"], value: random(5,10), }, { name: "purple stools", img: _path + "purpletoadstool.png", cond: ["a bunch of withered","a corner of pungent","a clump of fresh"], desc: ["tasty!","marvellous!"], value: random(5,10), }, { name: "blue mushrooms", img: _path + "bluemushroom.png", cond: ["a bunch of withered","a corner of pungent","a clump of fresh"], desc: ["tasty!","marvellous!"], value: random(5,10), }, { name: "blue leaf", img: _path + "blueleaf.png", cond: ["a sprout of fresh","a shrub of","a patch of fresh"], desc: ["tasty!","marvellous!"], value: random(5,10), }, { name: "goose horn", img: _path + "goosehorn.png", cond: ["a snip of","a sprout of fresh","a patch of"], desc: ["tasty!","marvellous!"], value: random(5,10), }, { name: "tangleweed", img: _path + "tangleweed.png", cond: ["a clove of withered","a sprouting clump of","a ripe thicket of"], desc: ["tasty!","marvellous!"], value: random(5,10), } ], monsterItems: [ { name: "dragon leaf", img: _path + "dragonleaf.png", cond: ["a sprout of old","shards of withered","an offshoot of cracked","a fistfull of fresh"], desc: ["fiery!","potent!"], value: random(30,50), }, { name: "spiked amber", img: _path + "spikedamber.png", cond: ["a sprout of old","blades of unripe","a shrub of fresh"], desc: ["fiery!","potent!"], value: random(30,50), }, { name: "amber root", img: _path + "amberroot.png", cond: ["a patch of old","tubers of ripened","a clump of fresh"], desc: ["fiery!","potent!"], value: random(30,50), }, ], challenges: [ "checkpoint", "maze", either("maze","fight"), "maze", "checkpoint", either("maze","fight"), "maze", "fight", "maze", ], monsters: [ setup.bee, setup.flower, ], score: [ { rank: 30, achievement: "Just in thyme", img: _path + "justinthyme.png", }, { rank: 60, achievement: "Herbivore", img: _path + "herbivore.png", }, { rank: 100, achievement: "Parslayer", img: _path + "parslayer.png", }, ], completedScore: 0, startpassage: "quest start", victorypassage: "quest victory", }>> /* FOOD */ <<set _path to "assets/quests/food/">> <<set setup.foodQuest = { name: "food", discover: ["You find ","Viola! Looks like ","You discover ","Look! It's ","Ha! It's ","Oooh! It's ","Perfect... ","Mmmm... "], items: [ { name: "wild grains", img: _path + "grains.png", cond: ["a handful of withered","a clump of fresh","a patch of golden"], desc: ["tasty!","healthy!"], value: random(5,10), }, { name: "apples", img: _path + "apples.png", cond: ["a handful of unripe","a bunch of juicy","a delicious assortment of","a pile of sweet smelling"], desc: ["so colourfu!","quite scrumptious!"], value: random(5,10), }, { name: "mushrooms", img: _path + "mushroom.png", cond: ["a cluster of smelly","a bunch of pungent","a clump of succulent","a large patch of fresh"], desc: ["not poisonous!","revolting!"], value: random(5,10), }, { name: "carrots", img: _path + "carrot.png", cond: ["a handful of unripe","a bunch of wizened","patch of ripe"], desc: ["so colourfu!","quite scrumptious!"], value: random(5,10), }, { name: "berries", img: _path + "berries.png", cond: ["a handful of unripe","a bunch of juicy","a delicious assortment of","a pile of sweet smelling"], desc: ["so colourfu!","quite scrumptious!"], value: random(5,10), }, { name: "eggs", img: _path + "eggs.png", cond: ["a few","a nest of cool", "a cluster of fresh"], desc: ["so colourfu!","quite scrumptious!"], value: random(5,10), }, { name: "tubers", img: _path + "tuber.png", cond: ["a handful of scummy little","a bunch of mucky","a patch of crunchy"], desc: ["so colourfu!","quite scrumptious!"], value: random(5,10), }, ], monsterItems: [ { name: "pumpkin", img: _path + "pumpkin.png", cond: ["a half-eaten","a wizened old", "a giant, fresh"], desc: ["like they're full of vitamins!","perfect!"], value: random(30,50), }, { name: "bee hive", img: _path + "hive.png", cond: ["an old","a cracked","a sweet smelling"], desc: ["so colourfu!","quite scrumptious!"], value: random(30,50), }, { name: "meat", img: _path + "meat.png", cond: ["a chunk of","a wedge of", "a fresh hunk of"], desc: ["so colourfu!","quite scrumptious!"], value: random(30,50), }, ], challenges: [ "checkpoint", "maze", either("maze","fight"), "maze", "checkpoint", either("maze","fight"), "maze", "fight", "maze", ], monsters: [ setup.rat, setup.bug, ], score: [ { rank: 50, img: _path + "unbeleafable.png", achievement: "Unbe-leaf-able!", }, { rank: 70, img: _path + "highsteaks.png", achievement: "High Steaks!", }, { rank: 90, img: _path + "stewperb.png", achievement: "Stewperb!", }, { rank: 120, img: _path + "tentacool.png", achievement: "Tentacool!", }, { rank: 150, img: _path + "fishingforcondiments.png", achievement: "Fishing for Condiments!", }, ], completedScore: 0, startpassage: "quest start", victorypassage: "quest victory", }>> /* MATERIALS */ <<set _path to "assets/quests/materials/">> <<set setup.materialsQuest = { name: "materials", discover: ["You find ","Viola! Looks like ","You discover ","Look! It's ","Ha! It's ","Oooh! It's ","Perfect... ","Mmmm... "], items: [ { name: "wood", img: _path + "wood.png", cond: ["some rotting","some sturdy","some strong"], desc: ["Looks strong!","This should work well."], value: random(5,10) }, { name: "stone", img: _path + "stone.png", cond: ["a pile of weathered","a clump of mossy","a chunk of smooth"], desc: ["It's pretty heavy!","Kinda hard to pick up!"], value: random(5,10) }, { name: "leather", img: _path + "leather.png", cond: ["a strong smelling skin of","a rigid hide of","a pelt of"], desc: ["It smells nice,","It looks strong."], value: random(5,10) }, { name: "fur", img: _path + "fur.png", cond: ["a smelly scrap of","a old patch of","a supple strip of"], desc: ["It smells nice,","It conds strong."], value: random(5,10) }, { name: "iron bar", img: _path + "ironbar.png", cond: ["a broken","a rusty","a strong"], desc: ["It smells nice,","It conds strong."], value: random(5,10) }, { name: "rune stone", img: _path + "runestone.png", cond: ["a broken","a weathered","an untouched"], desc: ["It smells nice,","It conds strong."], value: random(5,10) }, { name: "planks", img: _path + "planks.png", cond: ["some weathered","a pile of cracked","some sturdy"], desc: ["They look useless","Aren't these broken?"], value: random(5,10) } ], monsterItems: [ { name: "bundle of cloth", img: _path + "cloth.png", cond: ["a torn","a weathered","a strong"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "emerald shard", img: _path + "emeraldshard.png", cond: ["an unstable","a cracked","a pristine"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "crystal", img: _path + "crystalshards.png", cond: ["a shattered handful of","an cracked clump of","a stash of glowing"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "crystal cube", img: _path + "crystalcube.png", cond: ["a broken","an old","a cracked","a pristine"], desc: ["fiery!","potent!"], value: random(30,50) } ], challenges: [ "checkpoint", "maze", "fight", "maze", "checkpoint", "maze", "maze", "fight", "maze" ], monsters: [ setup.guard, setup.bear ], score: [ { rank: 50, achievement: "Close Shave!", img: _path + "closeshave.png", }, { rank: 70, achievement: "Sharp Shooter!", img: _path + "sharpshooter.png", }, { rank: 90, achievement: "Wood Fairy!", img: _path + "woodfairy.png", }, { rank: 120, achievement: "Nerves of Steel!", img: _path + "nervesofsteel.png", }, { rank: 150, achievement: "Goldilocks!", img: _path + "goldilocks.png", } ], completedScore: 0, startpassage: "quest start", victorypassage: "quest victory", }>> /* TECH */ <<set _path to "assets/quests/tech/">> <<set setup.techQuest = { name: "tech", discover: ["You find ","Viola! Looks like ","You discover ","Look! It's ","Ha! It's ","Oooh! It's ","Perfect... ","Mmmm... "], items: [ { name: "bolts", img: _path + "bolts.png", cond: ["a rusty bunch of","a handful of","some good quality"], desc: ["Looks strong!","This should work well."], value: random(5,10) }, { name: "chain", img: _path + "chain.png", cond: ["a shattered","a rusty","a strong"], desc: ["It's pretty heavy!","Kinda hard to pick up!"], value: random(5,10) }, { name: "metal tube", img: _path + "metaltube.png", cond: ["a broken","a rusty","a working"], desc: ["It smells nice,","It looks strong."], value: random(5,10) }, { name: "nails", img: _path + "nails.png", cond: ["a rusty bunch of","a handful of","some good quality"], desc: ["They look useless","Aren't these broken?"], value: random(5,10) }, { name: "pipe", img: _path + "pipe.png", cond: ["a shattered","an old","a functioning"], desc: ["They look useless","Aren't these broken?"], value: random(5,10) }, { name: "screw", img: _path + "screw.png", cond: ["a rusty","an old","a strong"], desc: ["They look useless","Aren't these broken?"], value: random(5,10) }, { name: "spring", img: _path + "spring.png", cond: ["a broken","an old","a functioning"], desc: ["They look useless","Aren't these broken?"], value: random(5,10) } ], monsterItems: [ { name: "clock", img: _path + "clock.png", cond: ["a shattered","an old","a functioning"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "relic artifact", img: _path + "relic_artifact.png", cond: ["a broken","an aged","a working","a pristine"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "elven artifact", img: _path + "elven_artifact.png", cond: ["a broken","an aged","a working","a pristine"], desc: ["fiery!","potent!"], value: random(30,50) }, { name: "springdongler", img: _path + "springdongler.png", cond: ["a broken","an aged","a working","a pristine"], desc: ["fiery!","potent!"], value: random(30,50) } ], challenges: [ "checkpoint", "maze", "fight", "maze", "checkpoint", either("maze","fight"), "maze", "fight", "maze" ], monsters: [ setup.rat, setup.guard, ], score: [ { rank: 50, achievement: "Just in Time!", img: _path + "justintime.png", }, { rank: 70, achievement: "Joke Horn!", img: _path + "jokehorn.png", }, { rank: 90, achievement: "Iron Will!", img: _path + "ironwill.png", }, { rank: 120, achievement: "Grate Job!", img: _path + "gratejob.png", }, { rank: 150, achievement: "Springdongler!", img: _path + "springdongler.png", }, { rank: 170, achievement: "Technological Marvel!", img: _path + "techmarvel.png", }, ], completedScore: 0, startpassage: "quest start", victorypassage: "quest victory" }>> /* ---------------------- END NORMAL QUEST OBJECTS----------------------------- */ /* GAUNTLET QUEST OBJECT */ <<set _path to "assets/quests/herbs/">> <<set setup.gauntletQuest = { name: "herbs", discover: ["You find ","Viola! Looks like ","You discover ","Look! It's ","Ha! It's ","Oooh! It's ","Perfect... ","Mmmm... "], items: [ { name: "parsley", img: _path + "parsley.png", cond: ["a sprig of withered","a bunch of","a patch of fresh"], desc: ["tasty!","quite condter!"], value: random(5,10), }, ], monsterItems: [ { name: "dragon leaf", img: _path + "dragonleaf.png", cond: ["a sprout of old","shards of withered","an offshoot of cracked","a fistfull of fresh"], desc: ["fiery!","potent!"], value: random(30,50), }, ], challenges: [], monsters: [ setup.bee, setup.flower, setup.guard, setup.rat, setup.flower, setup.bear, ], score: [], completedScore: 0, startpassage: "", victorypassage: "", }>> /* ------------------------- CHARACTERS ---------------------- */ /* GUANTLET NPC (MAYOR)*/ <<set _name to "mayor">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching -ALREADY DONE ABOVE*/ /* <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio "mayor_dialogue" _bgm>> */ /* character object */ <<set setup.mayorGauntlet = { name: "Malcolm the Mayor", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.gauntletQuest, purpose: ["So you want to find a maze BEAST?", "This is no ordinary quest. Sure you're ready for this?", "It's not too late to chicken out. You can click the 'back' button to choose an easier quest.", "Alright. Well don't say I didn't warn you!", "Here, you'll need this map. *gives you map*", "Follow the map and it will lead you to the BEAST. Be careful out there!", ], checkpoints:["You're doing well out there!","Keep going, the monster is at the end of the map I gave you", "You're getting close to the monster now... Be careful!"], victoryMessage: "I don't believe it! You defeated that MONSTER and made the maze a safer place.", title: "Big Bad Robot", titleImg: setup.Path + "mayor.png", }, ], currentQuest: setup.gauntletQuest, encouragement: ["Fantastic!","Very good!","Good good!!"], dialogueSound: [_name + "_dialogue"], jokes: ["Make me look good out there son!", "I hope I'm a better mayor than the horse that was elected before me.. Nothing ever got done! He kept voting Neigh."], }>> /* TURTLE */ <<set _name to "turtle">> <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> <<set setup.turtle = { name: "Kenny the Old Turtle", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.herbQuest, purpose: ["I need herbs to heal my aching flippers.","Do you think you could find some for me?"], checkpoints:["Look around and try to find some herbs. My flippers are aching!","Oooh excellent. Looks like you've got about half the herbs! Hurry!", "Almost done! Acchh my flippers!"], victoryMessage: "Thank goodness! My flippers are KILLING me! These herbs will help a lot!", title: "Golden Flippers!", titleImg: setup.Path + "goldenflippers.png", }, { quest: setup.foodQuest, purpose: ["I need you to go find me some treats for my grandchildren.","I heard you are good at finding things in the maze. Can you help?"], checkpoints:["Look for some tasty treats for my sweet little grandchildren! I need bribes - er- I mean rewards for good behavior!","This food looks tasty! You need just a bit more...", "This is nearly enough!"], victoryMessage: "Oooh! This food should keep the kids happy for a while. Thank you so much!", title: "Little Sweeties!", titleImg: setup.Path + "littlesweeties.png", }, ], currentQuest: false, encouragement: ["Very nice!","Ex-shell-ent work!","Let's shellebrate!"], dialogueSound: [_name + "_dialogue"], jokes: [ "That's turt-ally shell-arious!", "What did the snail say when riding on the turtles back? Weeeeee!", "Did you hear about the guy caught in a stampede of turtles? It was a very slow death...", "My friend and I went to a turtle pun class yesterday. It tortoise nothing.", "How does a turtle feel after being electrocuted? Shell-shocked.", "What do you call a turtle porcupine? A slowpoke.", "What do you call a turtle chef? A slow cooker.", "What do turtles on their birthdays? They have a shell-ebration", ], }>> /* SNAIL */ <<set _name to "snail">> <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> <<set setup.snail = { name: "Slimy Snail", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.foodQuest, purpose: ["I need ingredients for a special celebration.", "Think you could find some for me?"], checkpoints:["See what ingredients you can find in the maze - I want to make something special!","Halfway done! More veggies would be great!", "I'm getting excited! What else can you find?"], victoryMessage: "Yes! I am going to make the BEST FEAST EVER with what you've found. Great job!", title: "More Peas!", titleImg: setup.Path + "morepeas.png", }, { quest: setup.techQuest, purpose: ["I need to rig up some lighting for my kitchen...", "Maybe you could find me some bits of tech in the maze that I could use?"], checkpoints:["Look for any bits and pieces of old maze tech - I might be able to use it!","Oooh great job so far. What else can you find?", "Just a few more pieces and I should have enough!"], victoryMessage: "Awesome! I can use these parts to rig up some lights for my kitchen. Way to go champ!", title: "Little Light!", titleImg: setup.Path + "littlelight.png", }, ], currentQuest: false, encouragement: ["Very nice!","These look great!","Good job!"], dialogueSound: [_name + "_dialogue"], jokes: ["You're a cut above the rest!", "My son told me the other day, 'I love you from my head tomatoes!'"], }>> /* CROC */ <<set _name to "croc">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.croc = { name: "Contemplative Crocodile", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.techQuest, purpose: ["I've been studying the maze technology, but I need more samples.", "Can you find me some more from the maze?"], checkpoints:["Explore and see what you can find. Let me know if you find anything interesting...","Hmmm that technology looks excellent! Keep up the good work.", "Yes, yes. These samples are good quality! We're nearly finished..."], victoryMessage: "I'm so pleased with what you've found! Thank you for your contribution to science!", title: "Researcher", titleImg: setup.Path + "researcher.png", }, { quest: setup.materialsQuest, purpose: ["I hate to do this to you... but I need materials for my lab.", "Can you go into the maze and find some for me?"], checkpoints:["Look for stone, wood, or scraps of cloth. I need plenty of materials to keep the lab in working order.","Those materials look good, I just need a few more...", "Excellent, I shouldn't need too many more materials."], victoryMessage: "Splendid! Thank you for collecting so much! I'll be able to fix a few things and keep the bunson burners...er...burning!", title: "Lab Technician", titleImg: setup.Path + "labtechnician.png", }, ], currentQuest: false, encouragement: ["Splendid!","Very good!","Superb!"], dialogueSound: [_name + "_dialogue"], jokes: ["Well that's a snap!", "Why did the chicken cross the road? The answer is simple. Chickens, over great periods of time, have evolved in such a way that they are now genetically dispositioned to cross roads."], }>> /* BLACKSMITH (BERNITA) */ <<set _name to "blacksmith">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.blacksmith = { name: "Bernita the Blacksmith", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.materialsQuest, purpose: ["I'm going to need more materials to keep fixing peoples tools.", "Can you find me some more from the maze?"], checkpoints:["Anything you can find should be useful!","That's looking pretty good so far! Keep up the good work.", "You're doing well, a bit more should do it."], victoryMessage: "This is great, I should be able to keep up with demands with all these materials.", title: "Tough as Iron", titleImg: setup.Path + "blacksmith.png", }, { quest: setup.materialsQuest, purpose: ["Heyyy if it isn't my favorite person...","I hate to tell you this but...I need more materials for the forge!", "Can you go into the maze and find some for me?"], checkpoints:["Look for stone, wood, or scraps of cloth. I need plenty of materials to keep the forge shipshape.","Looking good, I just need a few more materials please!", "Excellent, I shouldn't need too many more materials."], victoryMessage: "Thank you! If you ever need a new plow, come and see me!", title: "Temper, temper!", titleImg: setup.Path + "blacksmith.png", }, ], currentQuest: false, encouragement: ["Splendid!","Very good!","Superb!"], dialogueSound: [_name + "_dialogue"], jokes: ["What do you say to a beaten up sword? You look hammered!", "What's the hardest part about blacksmithing? The anvil. Get it? The anvil... hahaha."], }>> /* BUILDER (Harry) */ <<set _name to "builder">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.builder = { name: "Harry the builder", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.materialsQuest, purpose: ["The mayor wants me to build his daughter a pen for her horses...","Can you find some materials for me in the maze?"], checkpoints:["I'm looking for wood mostly, but anything is helpful!","Awesome, This is going to be a GREAT bed.", "A few more things and we'll have enough."], victoryMessage: "You've done a great job, the mayor's daughter is going to love her new bed.", title: "Sleeping Beauty", titleImg: setup.Path + "builder.png", }, { quest: setup.foodQuest, purpose: ["Hi friend! A rat got into my pantry and made a mess of my supplies.", "Can you go into the maze and find some fresh food for me?"], checkpoints:["Thanks for helping me out.. Any thing edible would be great","Looking good, I just need a bit more to get me through the week...", "Great, a few more things and I won't go hungry!"], victoryMessage: "Wow! You've really helped me out, thanks for that!", title: "Soup-er Star", titleImg: setup.Path + "builder.png", }, ], currentQuest: false, encouragement: ["Wow!","Very good!","Fantastic!"], dialogueSound: [_name + "_dialogue"], jokes: ["Nailed it!", "I have an good joke about construction... but I still need to work on it."], }>> /* LUMBERJACK (Hans) */ <<set _name to "lumberjack">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.lumberjack = { name: "Hans the Lumberjack", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.materialsQuest, purpose: ["Bernita the Blacksmith says she can't fix my axe without more materials", "Can you find me some some materials to help her out?"], checkpoints:["Look around and grab whatever materials you can find!","Good job so far! Hopefully this stuff will be helpful for Bernita", "I think that's probably enough materials for now, good job!"], victoryMessage: "Thanks so much for finding those materials... I'm looking forward to having my axe repaired!", title: "Decent feller", titleImg: setup.Path + "lumberjack.png", }, { quest: setup.techQuest, purpose: ["Well, well, well.. Look who it is!", "I'm after some maze tech to make a mechanised saw", "Can you look in the maze for me? My eyes aren't quite what they used to be..."], checkpoints:["So keep an eye out for any bits of maze tech!","Great, you've found some useful things so far", "One or two more things and I should have enough, thank you!"], victoryMessage: "Yahoo! Once I build a mechanised saw I'll have more time to pursue my TRUE passion - knitting!", title: "Choppin'", titleImg: setup.Path + "lumberjack.png", }, ], currentQuest: false, encouragement: ["Fantastic!","Very good!","Good good!!"], dialogueSound: [_name + "_dialogue"], jokes: ["Branches and brambles!", "I once knew a lumberjack with a Ph.D. He was a smart feller."], }>> /* MAYOR (Malcolm) */ <<set _name to "mayor">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio "mayor_dialogue" _bgm>> /* character object */ <<set setup.mayor = { name: "Malcolm the Mayor", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.techQuest, purpose: ["The town barometer seems to be broken..","I need some bits of tech to repair it.","Could you go into the maze and find some for me?"], checkpoints:["Grab whatever materials you can find!","Splendid, looking good so far", "I think we have enough for now, good job!"], victoryMessage: "We should be able to get the Barometer fixed with what you've found today. Job well done citizen!", title: "Calm Under Pressure", titleImg: setup.Path + "mayor.png", }, { quest: setup.foodQuest, purpose: ["The anniversary of our island settlement is coming up.", "Could you find some tasty morsels for the celebration feast?"], checkpoints:["Bring back any food you can find.","Hmmm they said you were good. Looks like some tasty food so far!", "Wonderful, a few more morsels and we'll be set for the feast."], victoryMessage: "Wonderful! This years celebration will be VERY special thanks to you! Thank you!", title: "Delicioso", titleImg: setup.Path + "mayor.png", }, ], currentQuest: false, encouragement: ["Fantastic!","Very good!","Good good!!"], dialogueSound: [_name + "_dialogue"], jokes: ["Make me look good out there son!", "I hope I'm a better mayor than the horse that was elected before me.. Nothing ever got done! He kept voting Neigh."], }>> /* SCIENTIST (Kathryn) */ <<set _name to "scientist">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.scientist = { name: "Kathryn the Scientist", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.techQuest, purpose: ["That storm the other day broke some of my instruments!","Be a dear and go into the maze to find tech to repair them?", "There seems to be endless junk lying around in there!"], checkpoints:["Please, only bring back tech of the highest quality!","Yes, excellent, this tech looks useful! You're halfway done!", "That's quite enough, thank you dear."], victoryMessage: "I'll be able to repair ALL my instruments with these bits of tech! THANK YOU!", title: "Intrumental", titleImg: setup.Path + "scientist.png", }, { quest: setup.foodQuest, purpose: ["My lab animals need a greater variety of nutrients.", "Could you find some food in the maze for my animals?"], checkpoints:["Please look for different kinds of food for my animals!","Ooh yes, you've got some good bits of food here already. Keep up the good work!", "Very good! You've got sharp eyes. A little more food is all I need!"], victoryMessage: "Excellent! My animals deserve the best and YOU have provided! Thank you!", title: "Lab Rat", titleImg: setup.Path + "scientist.png", }, ], currentQuest: false, encouragement: ["Fantastic!","Very good!","Good good!!"], dialogueSound: [_name + "_dialogue"], jokes: ["Sniffle", "All mushrooms are edible. But some are only edible once!"], }>> /* SENTRY (Lim) */ <<set _name to "sentry">> /* path */ <<set setup.Path to "assets/characters/"+ _name + "/">> /* sound caching */ <<set _bgm = setup.Path + _name + "_dialogue.mp3">> <<cacheaudio `_name + "_dialogue"` _bgm>> /* character object */ <<set setup.sentry = { name: "Lim the Sentry", img: [setup.Path + _name + "_left.png",setup.Path + _name + "_right.png",], gif: setup.Path + _name + ".gif", quests: [ { quest: setup.techQuest, purpose: ["I've been working on a motion detector..","Could you bring me back some tech from the maze to finish constructing it?"], checkpoints:["Look for any bits and pieces of tech you can find.","Great, looks like you've found some good bits and pieces so far!", "That's nearly enough, a few more bits and you're done!"], victoryMessage: "Great! I'll be able to finish off the motion detector with these parts. Thanks a lot!", title: "Detect-ive", titleImg: setup.Path + "sentry.png", }, { quest: setup.foodQuest, purpose: ["Don't tell anyone, but I fell asleep on duty last night. A wild animal broke into the food stores and ate a bunch of supplies.","Could you help me out by finding some more food?","I need more supplies before anyone notices!"], checkpoints:["That animal ate half our stores! Let's see what you can find to restock them.","Oooh yes you're doing great! If you keep this up, we'll end up with more food than before!", "Great, thats nearly enough to replace what was eaten. A little bit extra wouldn't hurt right? :P"], victoryMessage: "You really saved my bacon today! Thanks for you help, and please don't tell anybody I fell asleep!", title: "Hamper Hero", titleImg: setup.Path + "sentry.png", }, ], currentQuest: false, encouragement: ["Fantastic!","Very good!","Good good!!"], dialogueSound: [_name + "_dialogue"], jokes: ["When I was a boy, I was told to guard dog poo. Now that was a guard doody I remember! ;P", "Did you hear the joke about the robot attack?"], }>> /* Array that contains ALL NPC characters */ <<set setup.NPCs to [ setup.turtle, setup.snail, setup.croc, setup.sentry, setup.scientist, setup.mayor, setup.lumberjack, setup.builder, setup.blacksmith, ]>> /* 4 Random NPCs from the NPCs array*/ <<set $dailyNPCs to setup.NPCs.randomMany(4)>> /* <<set $dailyNPCs to [setup.sentry, setup.scientist, setup.mayor, setup.lumberjack, setup.builder, setup.blacksmith,]>> */ /* Loop that goes to each random NPC and randomly gives them ONE current quest (from their quest pools) */ <<for _i to 0; _i lt $dailyNPCs.length; _i++>> <<set $dailyNPCs[_i].currentQuest to clone($dailyNPCs[_i].quests.random())>> <</for>> /*forward a student with urlc code? */ <<script>> checkURLForCode(); <</script>>
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 1+2 = 3">>
1+1 1+2 1+3 1+4 1+5 1+6 1+7 1+8 2+1 2+2 2+3 2+4 2+5 2+6 2+7 3+1 3+2 3+3 3+4 3+5 3+6 4+1 4+2 4+3 4+4 4+5 5+1 5+2 5+3 5+4 6+1 6+2 6+3 7+1 7+2 8+1
2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 10+20 = 30">>
10+10 10+20 10+30 10+40 10+50 10+60 10+70 10+80 10+90 20+10 20+20 20+30 20+40 20+50 20+60 20+70 20+80 30+10 30+20 30+30 30+40 30+50 30+60 30+70 40+10 40+20 40+30 40+40 40+50 40+60 50+10 50+20 50+30 50+40 50+50 60+10 60+20 60+30 60+40 70+10 70+20 70+30 80+10 80+20 90+10
20 30 40 50 60 70 80 90 100 30 40 50 60 70 80 90 100 40 50 60 70 80 90 100 50 60 70 80 90 100 60 70 80 90 100 70 80 90 100 80 90 100 90 100 100
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 32+14 = 46">>
32+14 17+30 32+15 46+52 32+35 45+20 38+20 31+35 35+44 44+23 14+42 39+50 19+40 17+21 16+23 44+42 15+24 32+35 23+26 26+22 14+41 16+23 27+42 25+23 24+53 46+33 22+52 41+55 28+50 47+30 33+36 27+12 19+30 48+30 33+25 44+12 33+40 17+42 32+35 21+55 49+50 34+15 26+20 14+32 29+20 13+40 41+11 12+16 35+42 44+55 25+54 29+10 38+21 34+34 42+20 26+33 14+53 46+41 23+56 46+13 38+51 46+51 42+21 32+35 33+41 39+40 35+14 31+54 15+50 16+43 42+14 32+50 29+30 42+15 43+42 26+10 11+37 25+43 21+52 23+24 26+12 47+11 43+46 26+41 45+42 47+50 15+40 26+52 29+10 17+40 43+30 18+10 15+14 46+23 18+11 19+50 43+11 41+12 35+53 36+51 41+31 31+34 17+50 49+20 34+32 25+40 15+42 13+22 29+40 29+10 49+30 25+51 26+11 14+15 26+20 14+14 48+50 22+17 11+31 11+23 32+54 27+51 34+50 49+30 44+41 15+53 44+25 39+40 35+54 22+22 24+50 15+10 21+48 45+52 43+13 11+26 11+43 46+33 11+54 26+22 38+21 31+38 33+25 13+10 49+30 27+32 42+34 44+22 14+41 41+52 13+50 13+43 33+14 24+25 49+30 38+30 48+10 23+44 16+51 45+20 47+41 38+21 27+21 46+33 12+11 21+44 24+25 49+50 39+40 29+30 15+50 41+54 14+20 28+20 47+21 23+11 22+41 16+20 18+20 35+31 35+31 18+40 39+20 39+40 18+20 37+40 18+31 45+12 45+12 13+31 22+11 37+51 18+31 44+55 47+50 19+20 11+25 18+50 21+23 11+42 12+55 14+23 11+33 47+20 27+11 27+40 13+32 27+42
46 47 47 98 67 65 58 66 79 67 56 89 59 38 39 86 39 67 49 48 55 39 69 48 77 79 74 96 78 77 69 39 49 78 58 56 73 59 67 76 99 49 46 46 49 53 52 28 77 99 79 39 59 68 62 59 67 87 79 59 89 97 63 67 74 79 49 85 65 59 56 82 59 57 85 36 48 68 73 47 38 58 89 67 87 97 55 78 39 57 73 28 29 69 29 69 54 53 88 87 72 65 67 69 66 65 57 35 69 39 79 76 37 29 46 28 98 39 42 34 86 78 84 79 85 68 69 79 89 44 74 25 69 97 56 37 54 79 65 48 59 69 58 23 79 59 76 66 55 93 63 56 47 49 79 68 58 67 67 65 88 59 48 79 23 65 49 99 79 59 65 95 34 48 68 34 63 36 38 66 66 58 59 79 38 77 49 57 57 44 33 88 49 99 97 39 36 68 44 53 67 37 44 67 38 67 45 69
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 49+25 = 74">>
49+25 26+47 33+29 21+49 18+45 45+58 42+59 48+36 42+59 11+19 13+47 35+29 24+56 28+56 28+45 16+56 21+19 45+17 37+44 25+18 33+37 26+14 25+18 29+44 22+18 38+44 13+18 23+38 17+25 39+43 18+28 28+58 46+39 44+17 15+59 27+53 29+14 26+38 15+59 11+29 38+36 39+38 16+49 33+48 25+37 14+59 14+39 43+19 29+49 48+38 41+19 43+59 13+39 24+37 41+19 19+11 25+48 41+49 42+28 13+17 12+48 31+19 16+38 47+15 23+48 38+39 14+19 23+37 14+47 34+49 22+59 38+12 39+29 24+27 41+19 22+49 36+14 46+25 37+18 38+56 31+29 42+39 14+38 15+55 11+19 25+56 24+17 21+59 39+18 24+19 15+35 11+59 21+49 46+25 25+15 41+39 18+16 48+18 11+59 49+23 24+27 48+59 36+34 33+57 18+24 23+18 24+48 38+33 21+59 18+26 42+19 36+28 31+19 21+19 48+12 45+19 25+49 49+18 37+24 45+29 37+49 34+37 14+19 34+36 17+45 17+54 25+16 42+49 19+43 48+36 32+19 47+24 37+14 25+58 39+43 47+54 31+59 37+27 22+29 15+37 26+35 29+39 39+27 38+48 38+56 49+12 43+18 47+15 34+38 36+35 33+19 24+29 22+58 31+29 38+32 46+15 39+16 44+17 47+24 42+59 13+27 19+17 35+27 45+36 12+48 22+58 48+49 38+29 25+17 15+55 37+15 29+41 45+48 16+25 19+23 33+48 32+59 22+29 49+27 44+28 49+57 47+38 18+13 42+38 37+34 11+29 49+37 37+38 11+59 34+57 27+46 42+19 12+49 28+15 36+17 26+35 48+13 26+46 35+55 16+15 47+45 41+39 32+38 19+31 29+56 32+19 12+39 46+17
74 73 62 70 63 103 101 84 101 30 60 64 80 84 73 72 40 62 81 43 70 40 43 73 40 82 31 61 42 82 46 86 85 61 74 80 43 64 74 40 74 77 65 81 62 73 53 62 78 86 60 102 52 61 60 30 73 90 70 30 60 50 54 62 71 77 33 60 61 83 81 50 68 51 60 71 50 71 55 94 60 81 52 70 30 81 41 80 57 43 50 70 70 71 40 80 34 66 70 72 51 107 70 90 42 41 72 71 80 44 61 64 50 40 60 64 74 67 61 74 86 71 33 70 62 71 41 91 62 84 51 71 51 83 82 101 90 64 51 52 61 68 66 86 94 61 61 62 72 71 52 53 80 60 70 61 55 61 71 101 40 36 62 81 60 80 97 67 42 70 52 70 93 41 42 81 91 51 76 72 106 85 31 80 71 40 86 75 70 91 73 61 61 43 53 61 61 72 90 31 92 80 70 50 85 51 51 63
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 898+899 = 1797">>
623+496 228+640 702+842 945+774 898+899 466+732 985+777 516+105 992+225 162+139 695+717 628+289 909+484 206+338 351+405 222+442 860+401 160+167 847+674 758+440 797+375 413+936 700+600 757+428 859+650 942+120 486+203 458+776 615+188 952+302 868+346 215+372 835+282 878+144 942+922 806+306 503+592 931+610 445+270 813+791 712+952 276+814 634+490 850+438 765+641 654+977 957+704 509+308 715+709 713+567 322+536 601+912 427+958 291+349 726+652 770+937 165+762 421+956 355+701 542+660 532+477 729+680 302+347 682+163 929+236 706+360 288+679 689+612 263+127 491+490 363+209 502+640 109+812 122+662 274+494 134+458 879+609 782+418 534+928 905+977 288+496 163+470 857+857 637+139 161+423 795+981 313+479 699+657 110+541 781+748 737+423 356+766 798+877 224+856 308+663 913+797 935+381 805+956 830+623 607+690 164+547 739+512 865+324 118+472 742+128 637+805 558+665 327+280 158+749 412+340 290+354 722+776 982+682 144+262 699+992 908+457 207+401 588+955 191+790 653+113 526+503 159+389 918+623 137+811 447+263 471+889 976+695 176+963 388+114 335+833 144+437 847+241 875+379 994+676 270+515 315+533 633+709 844+809 653+367 486+225 583+789 527+919 682+449 343+161 856+945 218+860 627+298 250+389 163+196 838+626 668+377 688+364 118+402 500+329 708+176 831+927 188+667 919+598 673+102 604+982 435+655 519+832 256+708 320+109 908+817 401+810 964+929 195+701 467+986 720+636 429+683 501+810 388+354 567+363 963+167 173+256 447+156 686+734 922+635 418+795 833+270 207+804 461+965 192+266 677+254 620+201 779+793 830+518 375+109 210+912 794+256 759+354 313+247 861+594 341+722 820+754 776+519 833+599 394+552 344+761 720+620 292+338 123+607 735+109 607+775 619+309 576+160 295+325
1119 868 1544 1719 1797 1198 1762 621 1217 301 1412 917 1393 544 756 664 1261 327 1521 1198 1172 1349 1300 1185 1509 1062 689 1234 803 1254 1214 587 1117 1022 1864 1112 1095 1541 715 1604 1664 1090 1124 1288 1406 1631 1661 817 1424 1280 858 1513 1385 640 1378 1707 927 1377 1056 1202 1009 1409 649 845 1165 1066 967 1301 390 981 572 1142 921 784 768 592 1488 1200 1462 1882 784 633 1714 776 584 1776 792 1356 651 1529 1160 1122 1675 1080 971 1710 1316 1761 1453 1297 711 1251 1189 590 870 1442 1223 607 907 752 644 1498 1664 406 1691 1365 608 1543 981 766 1029 548 1541 948 710 1360 1671 1139 502 1168 581 1088 1254 1670 785 848 1342 1653 1020 711 1372 1446 1131 504 1801 1078 925 639 359 1464 1045 1052 520 829 884 1758 855 1517 775 1586 1090 1351 964 429 1725 1211 1893 896 1453 1356 1112 1311 742 930 1130 429 603 1420 1557 1213 1103 1011 1426 458 931 821 1572 1348 484 1122 1050 1113 560 1455 1063 1574 1295 1432 946 1105 1340 630 730 844 1382 928 736 620
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 9+6+2 = 17">>
2+1+7 3+2+6 2+6+5 1+1+9 1+1+9 5+8+3 6+1+5 3+8+2 9+7+2 8+5+6 3+3+9 7+6+3 9+4+2 5+7+3 3+1+7 6+5+7 4+3+7 6+3+9 1+6+4 5+2+1 4+7+1 6+1+6 1+3+1 8+7+7 9+7+4 1+5+1 1+7+7 7+6+5 4+6+9 7+9+5 9+6+2 7+8+6 3+6+7 4+8+5 5+9+7 4+8+7 4+9+5 4+7+9 6+8+2 9+4+7 5+9+8 1+3+8 5+4+1 5+7+3 6+3+8 8+5+6 5+3+7 9+7+4 6+7+4 6+4+4 9+5+3 4+6+5 2+4+5 1+7+4 6+9+5 8+4+5 7+8+7 5+8+1 3+3+2 9+4+1 7+5+2 2+6+2 1+2+3 3+6+6 4+1+1 2+6+9 8+8+4 7+8+8 6+7+1 1+1+2 3+1+8 2+9+2 4+2+1 4+1+7 2+3+6 7+9+9 6+9+7 4+6+3 8+6+9 5+5+4 6+7+8 5+7+7 5+2+1 8+7+8 5+9+3 2+3+3 7+2+1 1+8+7 1+3+1 3+4+2 5+7+7 2+5+2 8+8+2 8+6+8 5+4+8 9+5+9 2+4+6 2+7+4 9+1+8 3+5+9 6+4+5 2+5+8 1+8+1 6+8+7 3+9+8 6+3+9 7+3+4 1+8+8 8+5+3 7+7+3 2+3+2 7+6+1 7+1+4 9+8+7 5+7+7 4+8+1 5+9+4 6+2+9 2+9+8 3+4+9 8+5+8 4+9+6 1+3+7 7+7+5 2+5+4 5+9+3 6+9+6 6+8+6 9+4+7 6+8+4 8+9+1 7+5+1 4+8+3 2+5+7 5+9+2 7+1+1 7+7+3 2+5+4 8+2+1 1+3+7 7+4+2 3+6+4 2+1+7 5+8+6 2+3+5 3+5+8 8+3+5 3+6+6 5+4+5 8+3+4 1+9+1 8+4+8 2+9+7 1+2+2 1+9+8 3+3+2 4+1+3 6+7+2 4+1+1 8+4+3 6+5+6 2+4+4 6+2+5 1+4+5 4+3+2 7+1+2 2+5+1 2+8+7 6+9+7 7+5+6 1+2+3 7+7+3 8+6+6 7+7+3 5+2+2 6+8+1 3+6+4 9+8+6 4+9+1 1+6+3 2+5+9 1+5+6 4+4+5 2+3+5 1+2+9 8+9+5 5+7+5 8+2+3 2+7+2 6+4+9 7+6+1 3+7+6 3+9+3 1+7+7 5+4+8 7+5+9 8+4+8 3+3+7 3+1+8 6+4+4 4+5+5 8+5+9 3+5+7 2+7+5 7+6+8 9+7+5 4+2+3 2+1+6
10 11 13 11 11 16 12 13 18 19 15 16 15 15 11 18 14 18 11 8 12 13 5 22 20 7 15 18 19 21 17 21 16 17 21 19 18 20 16 20 22 12 10 15 17 19 15 20 17 14 17 15 11 12 20 17 22 14 8 14 14 10 6 15 6 17 20 23 14 4 12 13 7 12 11 25 22 13 23 14 21 19 8 23 17 8 10 16 5 9 19 9 18 22 17 23 12 13 18 17 15 15 10 21 20 18 14 17 16 17 7 14 12 24 19 13 18 17 19 16 21 19 11 19 11 17 21 20 20 18 18 13 15 14 16 9 17 11 11 11 13 13 10 19 10 16 16 15 14 15 11 20 18 5 18 8 8 15 6 15 17 10 13 10 9 10 8 17 22 18 6 17 20 17 9 15 13 23 14 10 16 12 13 10 12 22 17 13 11 19 14 16 15 15 17 21 20 13 12 14 14 22 15 14 21 21 9 9
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 7+19+3 = 29">>
2+13+7 3+14+6 2+15+5 1+14+9 1+20+9 5+19+3 6+14+5 3+18+2 9+10+2 8+17+6 3+19+9 7+19+3 9+10+2 5+13+3 3+16+7 6+11+7 4+13+7 6+10+9 1+11+4 5+20+1 4+14+1 6+17+6 1+19+1 8+20+7 9+13+4 1+17+1 1+15+7 7+18+5 4+14+9 7+20+5 9+11+2 7+10+6 3+13+7 4+18+5 5+15+7 4+18+7 4+18+5 4+11+9 6+11+2 9+20+7 5+10+8 1+20+8 5+18+1 5+12+3 6+13+8 8+14+6 5+14+7 9+15+4 6+11+4 6+11+4 9+11+3 4+12+5 2+14+5 1+16+4 6+14+5 8+15+5 7+10+7 5+14+1 3+17+2 9+19+1 7+16+2 2+20+2 1+16+3 3+19+6 4+18+1 2+11+9 8+11+4 7+17+8 6+18+1 1+14+2 3+10+8 2+16+2 4+14+1 4+17+7 2+16+6 7+20+9 6+17+7 4+19+3 8+11+9 5+20+4 6+12+8 5+20+7 5+10+1 8+16+8 5+11+3 2+10+3 7+13+1 1+18+7 1+16+1 3+10+2 5+13+7 2+12+2 8+16+2 8+11+8 5+10+8 9+16+9 2+16+6 2+18+4 9+16+8 3+20+9 6+18+5 2+20+8 1+11+1 6+20+7 3+17+8 6+12+9 7+17+4 1+20+8 8+17+3 7+14+3 2+12+2 7+13+1 7+18+4 9+15+7 5+13+7 4+11+1 5+18+4 6+18+9 2+17+8 3+11+9 8+11+8 4+18+6 1+12+7 7+17+5 2+17+4 5+15+3 6+17+6 6+18+6 9+20+7 6+17+4 8+16+1 7+14+1 4+11+3 2+11+7 5+14+2 7+19+1 7+17+3 2+14+4 8+12+1 1+17+7 7+15+2 3+11+4 2+13+7 5+16+6 2+15+5 3+11+8 8+13+5 3+20+6 5+18+5 8+16+4 1+11+1 8+20+8 2+17+7 1+16+2 1+12+8 3+10+2 4+14+3 6+12+2 4+17+1 8+11+3 6+17+6 2+20+4 6+15+5 1+20+5 4+14+2 7+16+2 2+18+1 2+10+7 6+14+7 7+17+6 1+20+3 7+15+3 8+15+6 7+18+3 5+20+2 6+17+1 3+20+4 9+13+6 4+10+1 1+20+3 2+18+9 1+13+6 4+11+5 2+16+5 1+14+9 8+13+5 5+12+5 8+13+3 2+13+2 6+16+9 7+19+1 3+20+6 3+19+3 1+20+7 5+14+8 7+11+9 8+18+8 3+15+7 3+16+8 6+11+4 4+20+5 8+14+9 3+17+7 2+16+5 7+12+8 9+17+5 4+19+3 2+16+6
22 23 22 24 30 27 25 23 21 31 31 29 21 21 26 24 24 25 16 26 19 29 21 35 26 19 23 30 27 32 22 23 23 27 27 29 27 24 19 36 23 29 24 20 27 28 26 28 21 21 23 21 21 21 25 28 24 20 22 29 25 24 20 28 23 22 23 32 25 17 21 20 19 28 24 36 30 26 28 29 26 32 16 32 19 15 21 26 18 15 25 16 26 27 23 34 24 24 33 32 29 30 13 33 28 27 28 29 28 24 16 21 29 31 25 16 27 33 27 23 27 28 20 29 23 23 29 30 36 27 25 22 18 20 21 27 27 20 21 25 24 18 22 27 22 22 26 29 28 28 13 36 26 19 21 15 21 20 22 22 29 26 26 26 20 25 21 19 27 30 24 25 29 28 27 24 27 28 15 24 29 20 20 23 24 26 22 24 17 31 27 29 25 28 27 27 34 25 27 21 29 31 27 23 27 31 26 24
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 3+16+89 = 108">>
2+13+47 3+14+93 2+15+71 1+14+63 1+20+28 5+19+41 6+14+49 3+18+53 9+10+78 8+17+77 3+19+90 7+19+61 9+10+75 5+13+57 3+16+89 6+11+96 4+13+46 6+10+96 1+11+53 5+20+44 4+14+66 6+17+49 1+19+51 8+20+99 9+13+21 1+17+35 1+15+96 7+18+43 4+14+64 7+20+84 9+11+76 7+10+59 3+13+51 4+18+73 5+15+57 4+18+51 4+18+29 4+11+70 6+11+88 9+20+52 5+10+86 1+20+49 5+18+80 5+12+89 6+13+31 8+14+24 5+14+66 9+15+72 6+11+76 6+11+78 9+11+95 4+12+70 2+14+24 1+16+90 6+14+42 8+15+51 7+10+86 5+14+88 3+17+32 9+19+28 7+16+56 2+20+66 1+16+35 3+19+65 4+18+30 2+11+21 8+11+92 7+17+84 6+18+62 1+14+84 3+10+64 2+16+71 4+14+41 4+17+22 2+16+96 7+20+73 6+17+29 4+19+77 8+11+52 5+20+45 6+12+83 5+20+80 5+10+76 8+16+31 5+11+64 2+10+28 7+13+41 1+18+30 1+16+52 3+10+83 5+13+57 2+12+67 8+16+49 8+11+97 5+10+98 9+16+36 2+16+26 2+18+66 9+16+90 3+20+26 6+18+52 2+20+84 1+11+83 6+20+75 3+17+73 6+12+41 7+17+24 1+20+78 8+17+36 7+14+90 2+12+22 7+13+81 7+18+55 9+15+58 5+13+27 4+11+60 5+18+48 6+18+84 2+17+92 3+11+77 8+11+48 4+18+96 1+12+77 7+17+91 2+17+78 5+15+74 6+17+83 6+18+71 9+20+53 6+17+95 8+16+77 7+14+63 4+11+80 2+11+40 5+14+49 7+19+79 7+17+97 2+14+55 8+12+43 1+17+86 7+15+87 3+11+59 2+13+60 5+16+42 2+15+44 3+11+61 8+13+98 3+20+26 5+18+91 8+16+35 1+11+64 8+20+92 2+17+66 1+16+31 1+12+95 3+10+89 4+14+58 6+12+56 4+17+91 8+11+64 6+17+38 2+20+87 6+15+45 1+20+56 4+14+74 7+16+58 2+18+68 2+10+57 6+14+92 7+17+69 1+20+78 7+15+34 8+15+96 7+18+90 5+20+52 6+17+63 3+20+74 9+13+52 4+10+54 1+20+35 2+18+39 1+13+25 4+11+61 2+16+91 1+14+50 8+13+43 5+12+88 8+13+83 2+13+68 6+16+79 7+19+27 3+20+40 3+19+20 1+20+28 5+14+81 7+11+44 8+18+41 3+15+69 3+16+97 6+11+93 4+20+58 8+14+24 3+17+36 2+16+76 7+12+71 9+17+96 4+19+76 2+16+63
62 110 88 78 49 65 69 74 97 102 112 87 94 75 108 113 63 112 65 69 84 72 71 127 43 53 112 68 82 111 96 76 67 95 77 73 51 85 105 81 101 70 103 106 50 46 85 96 93 95 115 86 40 107 62 74 103 107 52 56 79 88 52 87 52 34 111 108 86 99 77 89 59 43 114 100 52 100 71 70 101 105 91 55 80 40 61 49 69 96 75 81 73 116 113 61 44 86 115 49 76 106 95 101 93 59 48 99 61 111 36 101 80 82 45 75 71 108 111 91 67 118 90 115 97 94 106 95 82 118 101 84 95 53 68 105 121 71 63 104 109 73 75 63 61 75 119 49 114 59 76 120 85 48 108 102 76 74 112 83 61 109 66 77 92 81 88 69 112 93 99 56 119 115 77 86 97 74 68 56 59 39 76 109 65 64 105 104 83 101 53 63 42 49 100 62 67 87 116 110 82 46 56 94 90 122 99 81
<<if ndef $currentQuest>> /*SOUND */ <<set $playlist to "camp">> <<playlist $playlist volume 0.6 shuffle play>> <div id="dwellerdisplay"> /* HEADING */ <div style="text-align: center"> <h1>Available Quests!</h1> </div> <hr> <<set _i to 0>> /* TITLE */ <div class="centerh"><div id="quest-title">Save the $quests[_i].name!</div></div> /* QUEST DISPLAY */ <div class="centerh"> /* button 1 */ <div style="align-self:center"> <<button "<">> /* SET NEXT QUEST */ <<if _i gt 0>> <<set _i-->> <<else>> <<set _i to $quests.length-1>> <</if>> /* NEW QUEST IMAGE LINK */ <<replace "#choose-quest">> <div> [img[$quests[_i].img]] </div> <</replace>> /* NEW QUEST TITLE */ <<replace "#quest-title" t8n>>Save the $quests[_i].name!<</replace>> <</button>> </div> /* QUEST IMAGE LINK */ <div id="choose-quest"> <div> [img[$quests[_i].img]] </div> </div> /* button 2 */ <div style="align-self:center"> <<button ">">> /* SET NEXT QUEST */ <<if _i lt $quests.length-1>> <<set _i++>> <<else>> <<set _i to 0>> <</if>> /* NEW QUEST IMAGE LINK */ <<replace "#choose-quest">> <div> [img[$quests[_i].img]] </div> <</replace>> /* NEW QUEST TITLE */ <<replace "#quest-title" t8n>>Save the $quests[_i].name!<</replace>> <</button>> </div> </div> /* BEGIN BUTTON */ <div class="centerh"> <<button "Begin!">> /* set currentQuest */ <<set $currentQuest to $quests[_i]>> /* Set _curItem (needed for generating parts below) */ <<set _curItem to $currentQuest>> /* remove this dweller from the array of quests */ <<set $quests.deleteAt[_i]>> /* include meet dweller passage which creates the parts for the dweller etc. */ <<replace "#dwellerdisplay">><<include "meet dweller">><</replace>> <</button>> </div> </div> <<else>> /* HEADING */ <div style="text-align: center"> <h1>Quest in progress...</h1> </div> <hr> You are already working on a quest! Finish your [[current quest]] by [[exploring the maze|gate]]before starting a new one. <br><br> <</if>> You can also check out your [[completed quests]]. <br><br> [[Back to Camp.|camp]]
/* Add this dweller to the current (incomplete) DWELLERS array so the vault knows it needs parts */ <<set $dwellers.push(_curItem)>> /*Add this dweller's parts to $items you can discover later in the maze... */ <<include "part maker">> /* now remove this dweller from items so you can't get it again??*/ <<set $items.delete(_curItem)>> /*DWELLER DIALOGUE*/ /* variables */ <<set _NPCImg to _curItem.img>> <<set _i to 0>> /* HEADING */ <div style="text-align: center"> <h1>Quest Start</h1> </div> <hr> /* dialogue container */ <div class="dialogue-left"> /*image */ <div class="dialogue-character"> <img @src="_NPCImg"> </div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText"> <<type 20ms>> _curItem.meeting[_i] <</type>> </div> </div> </div> /* button */ <div id="go-on" class="centerh"> <<button "go on...">> <<set _i++>> /* Display next bit of text OR */ <<if _i lt _curItem.meeting.length>> <<replace "#NPCText">> <<type 20ms>> _curItem.meeting[_i] <</type>> <</replace>> /* Replace this button with START QUEST button */ <<else>> <<replace "#go-on">> <<button "Start Quest!">> <<goto "maze loop">> <</button>> <</replace>> <</if>> <</button>> <br><br> </div>
<<set _partsnumber to Object.keys(_curItem["parts"])>> /* Loop that creates many parts as the dweller's number of parts */ <<for _p to 1; _p lt _partsnumber.length+1; _p++>> /* empty part object */ <<set _part to {}>> /* adding properties to the part object */ <<set _part["itemtype"] to "part">> <<set _part["name"] to _curItem.name>> <<set _part["part"] to "p" + _p>> <<set _part["value"] to "???">> <<set _part["img"] to "assets/dwellers/" + _curItem.name + "_part" + _p + ".png">> /* adding the part object to the $items array KEEP THIS */ <<set $items.push(_part)>> <</for>>
/* HEADING */ <div style="text-align: center"> <h1>Current Quest</h1> </div> <hr> /* Run if there's a dweller that needs completing! */ <<if $dwellers.length gt 0>> <div style="text-align:center"> Find the $currentQuest.name dweller's parts in [[the maze|gate]] to complete this quest... </div> <br> <<set _complete to 0>> /*IF all parts are found it gets changed to true (complete) */ /* VAULT CONTAINER */ <div id = "vault"> <div id="dwellercontainer" class="dwellercontainer"> <div id="dwellericon" class="backpackitem dwellericon"> <<link [img[$dwellers[0].img]]>> <</link>> </div> </div> </div> <div class="debug"></div> /*Loop to separate parts from items in your backpack*/ <<set _partsArray to []>> <<for _i to 0; _i lt $backpack.length; _i++>> <<if $backpack[_i].itemtype is "part">> /* PART! -> add it to _partsArray */ <<set _partsArray.push($backpack[_i])>> <<set $backpack.delete($backpack[_i])>> <<if $backpack.length gt 0>> <<set _i-->> <</if>> <</if>> <</for>> /* NOW ADD NEW PARTS*/ <<timed 0.2s>> /* 1. SET VARIABLES */ /* Loop through each PART in backpack */ <<for _i to 0; _i lt _partsArray.length; _i++>> /* get array of keys for dweller parts */ <<set _partkeys to Object.keys($dwellers[0].parts)>> /* Loop through the parts of this Dweller*/ <<for _t to 0; _t lt _partkeys.length; _t++>> /* COMPARE EACH PART SLOT TO THE CURRENT BACKPACK PART*/ /*CORRECT PART! */ <<if _partkeys[_t] is _partsArray[_i].part>> /* STORE THE Part's IMAGE in the dweller object instead of the "false" value that was there */ <<set $dwellers[0].parts[_partkeys[_t]] to _partsArray[_i].img>> /* INCORRECT PART */ <<else>> <</if>> <</for>> <</for>> /* 2. CREATE DIVS FOR DWELLER PARTS */ <<set _partkeys to Object.keys($dwellers[0].parts)>> <<for _i to 0; _i lt _partkeys.length; _i++>> <<if $dwellers[0].parts[_partkeys[_i]] is false>> /* flag set flag that dweller is incomplete */ /* create empty slot for part*/ <<append "#dwellercontainer">> <div @id="_i" class="backpackitem"> </div> <</append>> <<else>> /* display part!*/ <<append "#dwellercontainer">> <div @id="_i" class="backpackitem"> <<link [img[$dwellers[0].parts[_partkeys[_i]]]]>> <</link>> </div> <</append>> <<set _complete ++>> /*found 1 completed part! */ <</if>> <</for>> /* 3. CHECK IF DWELLER IS COMPLETE! */ <<if _complete gte _partkeys.length>> /* SOUND*/ <<audio "powerup" play>> /*changing the default (head) img to the complete img */ <<set $dwellers[0].img to $dwellers[0].complete>> /* grab name of this dweller to store it properly in dwellers_complete */ <<set _name to $dwellers[0].name>> /* adding the dweller to the COMPLETED DWELLERS object */ <<set $dwellers_complete[_name] to $dwellers[0]>> <<append ".debug">>dwellers_complete DWELLER img: <<print $dwellers_complete[_name].img>><</append>> /* DISPLAY GIF! */ <<timed 2s>> <<replace "#vault">><</replace>> <<include "dweller reward">> <</timed>> /* remove the dweller from the dwellers object (since it's complete!) */ <<set $dwellers to []>> /* add this dweller to completed quests array */ <<set $completedQuests.push($currentQuest)>> /* unset quest variable so you can get a new quest! */ <<unset $currentQuest>> <</if>> <</timed>> <<else>> <div class="story"> You are not currently working on any quests. [[Find a new quest|quests]] to get the ball rolling. </div> <</if>> <br><br> <div class="centerh"> <<link "Back">> <<set _return to previous()>> <<goto _return>> <</link>> </div>
<div style="text-align: center"> <h1>Completed Quests</h1> </div> <hr> /* Div for completed */ <div id="completed" class="centerh"></div> /* Create clickable gifs of completed creatures! */ <<if $completedQuests.length gt 0>> <<for _i to 0; _i lt $completedQuests.length; _i++>> <<capture _i>> <<link [img[$completedQuests[_i].gif]]>> <<replace "#secret">>Don't forget, my secret word is: <<print $completedQuests[_i].secret>><</replace>> <</link>> <</capture>> <</for>> <<else>> You have not completed any quests yet. Get a [[new quest|quests]] to begin! <</if>> /* Div for secret words */ <div id="secret"></div>
/*DWELLER DIALOGUE*/ /* dweller display */ /* <<set _NPCImg to >><img @src="_NPCImg"> */ <<set _i to 0>> /* container */ <div class="dialogue-left"> /*image */ <div class="dialogue-character"> <img @src="$dwellers_complete[_name].gif"> </div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText"> <<type 20ms>> <<print $dwellers_complete[_name]["reward"][_i]>> <</type>> </div> </div> </div> /* button */ <div style="text-align:center"> <<button "go on...">> <<set _i++>> <<if _i lt $dwellers_complete[_name]["reward"].length>> <<replace "#NPCText">> <<type 20ms>> <<print $dwellers_complete[_name]["reward"][_i]>> <</type>> <</replace>> <<else>> /*reveal choices div below */ <<timed 0.2s>><<removeclass "#choices" "hide">><</timed>> <</if>> <</button>> <br><br> </div> <div id="choices" class="hide"> [[Back to Camp|camp]]</div> <div class="debug"> name: _name "dwellersComplete": <<print $dwellers_complete[_name].name>> </div>
/*SOUND */ <<set $playlist to "maze">> <<playlist $playlist volume 1 shuffle play>> /* HEADING */ <div style="text-align: center"> <h1>The Portal Stone</h1> </div> <hr> /* GATE IMG */ <div class="centerh"> <div class="location"> [img["assets/locations/gauntlet-gate.png"]] </div> </div> /* GAUNTLET RUNES DISPLAY */ <div id="rune-container" class="centerh"> <div> /* Top */ <div id="rune-top"> </div> /*runes */ <div id="rune-middle"> </div> /*Bottom */ <div id="rune-bottom"> </div> </div> <div> /* CODE */ /* Setting Rune secrets and accompanying images*/ <<set _secretsArray to []>> <<set _dwellerImgArray to []>> <<set _dwellerkeys to Object.keys($dwellers_all)>> <<for _i to 0; _i lt _dwellerkeys.length; _i++>> <<set _secretsArray.push($dwellers_all[_dwellerkeys[_i]].secret)>> <<set _dwellerImgArray.push($dwellers_all[_dwellerkeys[_i]].img)>> <</for>> <<set _codesArray to []>> <<set _answerCount to 0>> /* creating textboxes */ <<timed 0.2s>> <<for _i to 0; _i lt _secretsArray.length; _i++>> <<append "#rune-middle">> <div class="rune-item"> [img[_dwellerImgArray[_i]]] <<textbox `"_code" + _i` "">> </div> <</append>> <</for>> <</timed>> /* CHECKING CODES! */ <br> <div id="button" class="centerh"> <<button "Activate Runes">> /* Push all codes into an array */ <<if def _code0>> <<if _code0 is _secretsArray[0]>><<set _answerCount ++>><</if>> <</if>> <<if def _code1>> <<if _code1 is _secretsArray[1]>><<set _answerCount ++>><</if>> <</if>> <<if def _code2>> <<if _code2 is _secretsArray[2]>><<set _answerCount ++>><</if>> <</if>> <<if def _code3>> <<if _code3 is _secretsArray[3]>><<set _answerCount ++>><</if>> <</if>> <<if def _code4>> <<if _code4 is _secretsArray[4]>><<set _answerCount ++>><</if>> <</if>> <<if def _code5>> <<if _code5 is _secretsArray[5]>><<set _answerCount ++>><</if>> <</if>> <<if def _code6>> <<if _code6 is _secretsArray[6]>><<set _answerCount ++>><</if>> <</if>> /* Check the first code against the first secret */ <<if _answerCount is _secretsArray.length>> <<audio "powerup" play>> <<replace ".story" t8n>> The Portal Activates!! <</replace>> <<timed 2s>> <<goto "victory">> <</timed>> <<else>> <<audio "error" play>> <<shaketarget ".rune-item" 0.5s>> <</if>> /* Clear the codes array and answercount */ <<set _codesArray to []>> <<set _answerCount to 0>> <</button>> </div> /* STORY */ <div class="story"> The portal stone. The one way out of the maze.<br> There are rune markings here. If only you knew the secret words to activate each one...<br> <br> <<link "Back">> <<set _return to previous()>> <<goto _return>> <</link>> </div>
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 8÷4 means 8 DIVIDED into 4 parts. If you cut 8 into 4 parts, how many would be in each part?">>
2÷2 4÷2 6÷2 6÷3 8÷2 8÷4 9÷3 10÷2 12÷2 12÷3 12÷4 12÷6 14÷2 14÷7 15÷3 15÷5 16÷2 16÷4 16÷8 18÷2 18÷3 18÷6 18÷9 20÷2 20÷4 20÷5 20÷10
1 2 3 2 4 2 3 5 6 4 3 2 7 2 5 3 8 4 2 9 6 3 2 10 5 4 2
<<set _keyboard to "symbols">> <<set _instruction to "Add these fractions together!">> <<set _example to "Example: 1/6 + 1/6 = 2/6 (not 1/3).">>
1/2 + 1/2 1/3 + 1/3 1/3 + 2/3 2/3 + 1/3 1/4 + 1/4 1/4 + 2/4 1/4 + 3/4 2/4 + 1/4 2/4 + 2/4 3/4 + 1/4 1/6 + 1/6 1/6 + 2/6 1/6 + 3/6 1/6 + 4/6 1/6 + 5/6 2/6 + 1/6 2/6 + 2/6 2/6 + 3/6 2/6 + 4/6 3/6 + 1/6 3/6 + 2/6 3/6 + 3/6 4/6 + 1/6 4/6 + 2/6 5/6 + 1/6 1/8 + 1/8 1/8 + 2/8 1/8 + 3/8 1/8 + 4/8 1/8 + 5/8 1/8 + 6/8 1/8 + 7/8 2/8 + 1/8 2/8 + 2/8 2/8 + 3/8 2/8 + 4/8 2/8 + 5/8 2/8 + 6/8 3/8 + 1/8 3/8 + 2/8 3/8 + 3/8 3/8 + 4/8 3/8 + 5/8 4/8 + 1/8 4/8 + 2/8 4/8 + 3/8 4/8 + 4/8 5/8 + 1/8 5/8 + 2/8 5/8 + 3/8 6/8 + 1/8 6/8 + 2/8 7/8 + 1/8
2/2 2/3 3/3 3/3 2/4 3/4 4/4 3/4 4/4 4/4 2/6 3/6 4/6 5/6 6/6 3/6 4/6 5/6 6/6 4/6 5/6 6/6 5/6 6/6 6/6 2/8 3/8 4/8 5/8 6/8 7/8 8/8 3/8 4/8 5/8 6/8 7/8 8/8 4/8 5/8 6/8 7/8 8/8 5/8 6/8 7/8 8/8 6/8 7/8 8/8 7/8 8/8 8/8
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a decimal (round to 3 decimal places)">> <<set _example to "Example: 1/3 = 0.333 and 2/3 = 0.667 (correct to 3 decimal places, rounded up).">> <<set _placeholder to true>>
1/10 1/8 1/5 1/4 3/10 1/3 2/5 1/2 3/5 2/3 7/10 3/4 4/5 9/10
0.1 0.125 0.2 0.25 0.3 0.333 0.4 0.5 0.6 0.667 0.7 0.75 0.8 0.9
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a percentage (round to 1 decimal place)">> <<set _example to "Example: 2/3 = 66.7% (1 decimal place, rounded up).">> <<set _placeholder to true>>
1/10 1/8 1/5 1/4 3/10 1/3 2/5 1/2 3/5 2/3 7/10 3/4 4/5 9/10
10% 12.5% 20% 25% 30% 33.3% 40% 50% 60% 66.7% 70% 75% 80% 90%
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a fraction & simplify">> <<set _example to "Example: 0.667 = 2/3">> <<set _placeholder to true>>
0.1 0.125 0.2 0.25 0.3 0.3<span class='overline'>_</span> 0.4 0.5 0.6 0.6<span class='overline'>_</span> 0.7 0.75 0.8 0.9
1/10 1/8 1/5 1/4 3/10 1/3 2/5 1/2 3/5 2/3 7/10 3/4 4/5 9/10
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a percentage (round to 1 decimal place)">> <<set _example to "Example: 0.6<span class='overline'>_</span> = 66.7%">> <<set _placeholder to true>>
0.1 0.125 0.2 0.25 0.3 0.3<span class='overline'>_</span> 0.4 0.5 0.6 0.6<span class='overline'>_</span> 0.7 0.75 0.8 0.9 0.05
10% 12.5% 20% 25% 30% 33.3% 40% 50% 60% 66.7% 70% 75% 80% 90% 5%
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a fraction & simplify">> <<set _example to "Example: 66.6<span class='overline'>_</span>% = 2/3">> <<set _placeholder to true>>
10% 12.5% 20% 25% 30% 33.3<span class='overline'>_</span>% 40% 50% 60% 66.6<span class='overline'>_</span>% 70% 75% 80% 90%
1/10 1/8 1/5 1/4 3/10 1/3 2/5 1/2 3/5 2/3 7/10 3/4 4/5 9/10
<<set _keyboard to "symbols">> <<set _instruction to "Convert to a decimal (round to 3 decimal places)">> <<set _example to "Example: 66.6<span class='overline'>_</span>% = 0.667">> <<set _placeholder to true>>
10% 12.5% 20% 25% 30% 33.3<span class='overline'>_</span>% 40% 50% 60% 66.6<span class='overline'>_</span>% 70% 75% 80% 90% 5%
0.1 0.125 0.2 0.25 0.3 0.333 0.4 0.5 0.6 0.667 0.7 0.75 0.8 0.9 0.05
<<stats "HP" 3>>\ <div id="encounter">\ <img src="assets/encounters/well.jpg">\ <div id="encounter-text" style="text-align: center; ">\ <<en "YOU REST!" "slideInDown" "animate__repeat-1" "green">> //Nothing quite like a quiet meadow to regain your strength!// You gain 3 Health and then [[continue your journey|where to next?]] </div>\ </div>\
<div id="encounter">\ <img src="assets/encounters/chest.jpg">\ <div id="encounter-text" style="text-align: center;">\ <<en "TREASURE!" "bounceInDown" "animate__repeat-1" "yellow" "animate__fast">> //Aha! Some more goodies from the maze!// [[Open Chest|chest open]] </div>\ </div>\
<div id="encounter">\ <img src="assets/encounters/chest.jpg">\ <div id="encounter-text" style="text-align: center;">\ <<en "Ooooh!" "bounceInDown" "animate__repeat-1" "yellow" "animate__fast">> //This could come in handy!// [[carry on|where to next?]] </div>\ </div>\
<div id="encounter">\ <img src="assets/encounters/defeat.jpg">\ <div id="encounter-text" style="text-align: center; ">\ <<en "YOU HAVE BEEN DEFEATED!" "flipInX" "animate__repeat-2" "red">> You run back to [[the village|choose quest]]. <<stats "HP" 10>> </div>\ </div>\
<<timed 0.5s>><<audio $questNPC.dialogueSound play>><</timed>> /* variables */ <<set _i to 0>> /*CARD DISPLAY VERSION */ <div id="encounter-page-container"> <div id="encounter"> <img @src="$questNPC.img[0]" style="background: radial-gradient(circle, rgb(218 248 254) 0%, rgb(35 161 155) 75%);"> <div id="encounter-text"> $questVars.purpose[_i] </div> <div id="encounter-options"></div> </div> </div> /*gauntlet quest button */ <div id="go-on" class="centerh"> <<include "gauntlet quest button">> </div> <div id="go-on" class="centerh" style="position: fixed; bottom: 10px; width: 100%"> <<button "Back" "choose quest">><</button>> </div>
/*IS INTRO OVER? */ /*NO -> Keep going */ <<if _i lt $questVars.purpose.length-1>> /* Button Labels */ <<set _buttonLabel to either("Go on...","Tell me more.","I'm interested.","Ok, tell me more...","Ok then.","Righto then.","I'm listening...")>> /* TELL ME MORE! */ <<button _buttonLabel>> <<audio $questNPC.dialogueSound play>> /* increment counter */ <<set _i++>> /*Display next big of intro purpose dialogue */ <<replace "#encounter-text" t8n>> $questVars.purpose[_i] <</replace>> <<a "#encounter-text" "flipInY">> /* Replace this button */ <<replace "#go-on" t8n>> <<include "gauntlet quest button">> <</replace>> <</button>> /* YES -> Replace this button with START gauntlet quest button */ <<else>> /* Button Labels */ <<set _buttonLabel to either("Let's do this!","Righto, I'm in.","If you say so!","Alright then.","Only 'cos you asked nicely...","Let's get this done!","I'll be back before you can say 'Howdy McHowdy-boy'")>> /* BEGIN QUEST */ <<button _buttonLabel "where to next?">> <</button>> <</if>>
/*THIS PASSAGE IS CURRENTLY UNUSED BECAUSE THE STAR PORTAL FORWARDS YOU STRAIGHT TO THE JOURNEYMAP */ <<set _flag to true>> /*MONSTER SETUP */ <<append "#passages">> <div id="full-page-container" class="animate__animated"> <div id="item-message" class="animate__animated animate__backInDown"> <div> //$monster.name wants to fight you!// </div> <div> <img @src="$monster.img.random()"> </div> <div> /* $monsterItem.value points! */ </div> <div id="enter-button"> <<button "Fight!">> <<if _flag is true>> /*Button can only be triggered once now! */ <<set _flag to false>> /*OOPS! A monster is guarding this item! */ /* remove the old maze and full page container*/ <<script>> removeEl('maze-container'); removeElAnimate('full-page-container'); <</script>> /*load the next challenge */ <<goto "gauntlet where to next?">> <</if>> <</button>> </div> </div> </div> <</append>> /* focus on item CLAIM button */ <<script>> focusOnChild('enter-button'); <</script>>
/*CHECK -> this a BOSS monster? (ie for end of gauntlet?) */ <<if $challenge is "end">> <<set $monster to setup.bossRobot>> /* to fix later --add more types of boss monsters! */ <<set _boss to true>> <<else>> <<set $monster to $quest.monsters.random()>> /*grab a random monster from the array */ <<script>> console.log("the monster is " + State.variables.monster.name); <</script>> <</if>> <<set _taunts to $monster.taunts.shuffle()>> <<audio $monster.tauntSound.random() volume 1 play>> /*playing initial monster taunt sound */ /*SOUND */ <<set $playlist to "battle">> <<playlist $playlist play>> /* SETUP */ <<set _timerIncludePassage to "gauntlet monster defeat">> /*this is the passage that gets included when timer runs out */ /* time */ <<set _timeDifficulty to $difficulty * 5>> <<set _totalTime to 60 - _timeDifficulty>> <<if _boss>> _totalTime to 120 - _timeDifficulty <</if>> /* monster HP setup */ <<switch $difficulty>> <<case 0>><<set _monsterHP to 3>> <<case 1>><<set _monsterHP to 3>> <<case 2>><<set _monsterHP to 4>> <<case 3>><<set _monsterHP to 5>> <<case 4>><<set _monsterHP to 5>> <<case 5>><<set _monsterHP to 6>> <<default>><<set _monsterHP to 4>> <</switch>> /*BOSS? */ <<if _boss>> <<set _monsterHP to 5 + $difficulty>> <</if>> <<set _monsterMaxHP to _monsterHP>> /*QUESTION n Answer SETUP */ <<timed 1s>> /*delay so we can see the monster's first item-related taunt (it's dynamic, so can't be hard-coded) */ <<include "gauntlet monster qna">> <<replace "#boss-fight-timer">><<timerbar _totalTime>><</replace>> <</timed>> /* DISPLAYING THE MONSTER! */ <div id="encounter-page-container"> <div id="encounter" style="margin: 0px;"> <div> /*MONSTER IMG */ <img @src="$monster.img.random()" id="monster-img" style="background: radial-gradient(circle, rgb(250 211 198) 0%, rgb(250 54 108) 75%);"> /* HEALTHBAR */ <div style="position: relative; bottom: 10px; width: 80%; margin-left: 10%;"> <<showmeter '$monsterHealthBar' `_monsterHP / _monsterMaxHP`>> </div> </div> /*MONSTER TEXT */ <div id="encounter-text"> DO YOU THINK YOU CAN DEFEAT ME? </div> <div id="encounter-options"></div> </div> </div> /*CHOICES*/ <div id="ui-container"> /* HEALTHBAR */ /* <div id="health-bar"><<showmeter '$healthBar' `$stats.HP / $stats.MaxHP`>></div> */ /*HEALTH */ <div id="hero-stats"> <div id="health"> <div id="health-text">$stats.HP</div> </div> <div id="backpack-icon"> /* <span>$stats.points</span> */ </div> </div> /* TIMER */ <div id="boss-fight-timer" style="grid-area: middle; position: relative; bottom: 2vh;"><br></div> /*ANSWER CHOICES*/ <div id="bossfightchoices"></div> /*NPC/points*/ <div id="NPC-and-points"> /* NPC pop up (or not!) */ <div id="maze-NPC-container"> <<done>><<include "NPC down">><</done>> </div> /* points display! */ <div id="points" class="animate__animated"> <span>$stats.points</span> </div> </div> </div> /* DEBUG */ <div class="debug">$monster</div>
/*QUESTION n Answer SETUP */ <<set _randoReal to $qnaObjects.pluck()>> <<set _question to _randoReal.q>> <<set _answer to _randoReal.a>> <<set _realanswer to _randoReal.a>> /*need an extra answer here to check against later */ /*adding the answer to an array */ <<set _answerarray to []>> <<set _answerarray.push(_answer)>> /* LOOP that gets 3 unique fake answers! */ <<for _i to 0; _i lt 3; _i++>> /* make sure I've got enough qnas to draw from! */ <<if $qnaObjects.length lt 3>> <<set $qnaObjects to clone($qnaObjectsBackup)>> <</if>> /* grab random qna*/ <<set _randoFake to $qnaObjects.pluck()>> /*get the fake answer */ <<set _fake to _randoFake.a>> /* now check it it's unique! It should be unique... */ <<if _answerarray.includes(_fake)>> <<set _i-->> /*redo this loop run because it was a duplicate (failed attempt) */ <<else>> <<set _answerarray.push(_fake)>> /*it's unique, so add it to the answer array! */ <</if>> <</for>> /* Now shuffle up the array so they come out in a random order! */ <<set _answerarray.shuffle()>> /* DEBUG */ /* Array: _answerarray... REAL answer: _realanswer */ /* GENERATE NEW LINKS! */ <<replace "#bossfightchoices">> <</replace>> /*clear the span so I'm ready to add fresh links*/ /* Fresh links loop*/ <<for _i to 0; _i lt _answerarray.length; _i++>> /* Loop through each member of the answer array and add event listeners to divs based if they're correct or wrong */ <<append "#bossfightchoices">> <<if _answerarray[_i] is _realanswer>> <div class="story-choice" onclick="$.wiki('<<GauntletMonsterDivClick 1>>')"> /*the "@" tells sugarcube to check back after evaluation and change the id to whatever _i is... the onclick adds an eventlistener which triggers GauntletMonsterDivClick widget*/ <div> _answerarray[_i] </div> </div> <<else>> <div class="story-choice" onclick="$.wiki('<<GauntletMonsterDivClick 0>>')"> <div> _answerarray[_i] </div> </div> <</if>> <</append>> <</for>> /* TAUNTS & NEW QUESTION*/ /*update monster textbox with a fresh taunt AND question */ <<replace "#encounter-text">><<type 20ms>>_taunts[0] <br> So what's _question?<</type>><</replace>> /*prepare a new taunt */ <<set _curTaunt to _taunts.shift()>> /*extract the first taunt */ <<set _taunts.push(_curTaunt)>> /*appends taunt to END of taunt array (back of the queue)*/
<<widget "GauntletMonsterDivClick">> /*CORRECT ANSWER DIV! */ <<if $args[0] is 1>> /*Monster health goes down */ <<set _monsterHP-->> <<updatemeter '$monsterHealthBar' `_monsterHP / _monsterMaxHP`>> /*update the healthbar */ /* NEW QUESTION OR FINISH PASSAGE?*/ /*MONSTER DEATH! -> animate death and then go to where to next? passage */ <<if _monsterHP lte 0>> <<playlist $playlist fadeoverto 2 0>> /* defeated monster sound */ <<audio $monster.deathSound.random() volume 0.5 play>> /* add falling animation class to the monster img */ <<addclass "#monster-img" "animate__animated animate__rotateOutDownLeft">> /* fade out the monster and textbox */ <<timed 1s>> <<addclass "#encounter" "animate__animated animate__fadeOut">> <</timed>> /* monster item popup!*/ <<timed 1.5s>> <<include "gauntlet monster victory">> <</timed>> /*MONSTER HIT! */ <<else>> /* monster attack/hit sound! */ <<audio $monster.attackSound.random() volume 0.6 play>> /* animate the monster wobbling as he loses hp */ <<set _randomClass to either("jello","wobble")>> <<a "#monster-img" _randomClass>> /* RESET & GENERATE NEW QUESTION */ <<include "gauntlet monster qna">> <</if>> /*WRONG ANSWER DIV! */ <<else>> <<audio "error" volume 1 play>> <<shaketarget "#bossfightchoices" .5s>> <<if $gauntlet is true>> <<stats "HP" -1>> <</if>> <</if>> <</widget>>
/*stops the timer! */ <<set _stopTimer to true>> /*hide the timer div from view */ <<replace "#boss-fight-timer">><br><</replace>> <<set _flag to true>> /* Button Label */ <<if _boss>> <<set _buttonLabel to "VICTORY!">> <<else>> <<set _buttonLabel to "Keep Hunting!">> <</if>> /* MONSTER item popup (defeated monster)*/ <<append "#passages">> <div id="full-page-container" class="animate__animated"> <div id="item-message" class="animate__animated animate__flipInY"> <div> //You defeated the $monster.name!// </div> <div> <img @src="$monster.img"> </div> <div> /* $monsterItem.value points! */ </div> <div id="enter-button"> <<button _buttonLabel>> /*`"Take " + $monsterItem.name` */ <<if _flag is true>> /*Button can only be triggered once now! */ <<set _flag to false>> /* add points to your score */ /* <<stats "points" $monsterItem.value>> */ /* audio */ <<audio "finditem1" volume 1 play>> /* add item to your found items array */ /* <<set $backpack.push($monsterItem)>> */ /* remove the item pop up (via full-page-container)*/ <<script>> removeElAnimate('full-page-container'); <</script>> /*load the next challenge */ <<timed 1s>> <<if _boss>> <<goto "gauntlet boss monster victory">> <<else>> <<goto "journey map">> <</if>> <</timed>> <</if>> <</button>> </div> </div> </div> <</append>> /* focus on item CLAIM button */ <<script>> focusOnChild('enter-button'); <</script>>
/* This fades the item up so it looks like the monster is taking it */ <<addclass "#ui-container" "animate__animated animate__fadeOutDown">> <<timed 3s>> <<goto "death">> <</timed>>
<<audio "yeah" volume 0.5 play>> /*CARD DISPLAY VERSION */ <div id="encounter-page-container"> <div id="encounter"> /* NPC */ <img @src="$questNPC.img[0]" style="background: radial-gradient(circle, rgb(218 248 254) 0%, rgb(35 161 155) 75%);"> /*TEXT */ <div id="encounter-text"> I don't believe it! You defeated one of the 7 boss monsters. The maze is a safer place because of you. </div> <div id="encounter-options"></div> </div> </div> /* BUTTON */ <div class="centerh"> <<button "Victory!">> <<audio "powerup" volume 0.5 play>> <<set _finalSound to "finditem1">> /* ACHIEVEMENT POPUP! */ <<append "#story">> <div id="full-page-container" class="animate__animated"> <div id="quest-achievement" class="animate__animated animate__bounceInUp" onclick="removeEl('full-page-container'); forward('choose quest')"> <div id="curvytext"> <svg viewBox="0 0 500 500"> <path id="curve" fill="transparent" d="M73.2,148.6c4-6.1,65.5-96.8,178.6-95.6c111.3,1.2,170.8,90.3,175.1,97" /> <text width="500"> <textPath xlink:href="#curve" startOffset="30%" style="font-size: 35px;"> You did it! </textPath> </text> </svg> </div> <div id="bottom-half"> <div>[img[assets/ui/battle.png]] </div> /*achievement image */ <div>You unlocked the achievement:</div> <div id="achievement-title"> MONSTER SLAYER! /*achievement title */ </div> </div> </div> </div> <</append>> <</button>> </div>
<div id="symbols-keyboard"> <div style="grid-area: backslash;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('/')" onmousedown="event.preventDefault();">/</button></div> <div style="grid-area: percent;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('%')" onmousedown="event.preventDefault();">%</button></div> <div style="grid-area: power2;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('²')" onmousedown="event.preventDefault();">²</button></div> <div style="grid-area: power3;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('³')" onmousedown="event.preventDefault();">³</button></div> <div style="grid-area: plus;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('+')" onmousedown="event.preventDefault();">+</button></div> <div style="grid-area: minus;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('-')" onmousedown="event.preventDefault();">-</button></div> <div style="grid-area: leftbracket;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType('(')" onmousedown="event.preventDefault();">(</button></div> <div style="grid-area: rightbracket;" class="keyboard-keys symbols"><button type="button" onmouseup="keyboardType(')')" onmousedown="event.preventDefault();">)</button></div> </div>
/* variables */ <<set $answercounter to 0>> <<set _errorCount to 0>> <<set _mazeStillGoing to true>> <<set _error to false>> /*starts false by default so you can click the first time! */ <div id="numberpad"> <div style="grid-area: one;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('1')" onmousedown="event.preventDefault();">1</button></div> <div style="grid-area: two;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('2')" onmousedown="event.preventDefault();">2</button></div> <div style="grid-area: three;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('3')" onmousedown="event.preventDefault();">3</button></div> <div style="grid-area: four;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('4')" onmousedown="event.preventDefault();">4</button></div> <div style="grid-area: five;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('5')" onmousedown="event.preventDefault();">5</button></div> <div style="grid-area: six;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('6')" onmousedown="event.preventDefault();">6</button></div> <div style="grid-area: seven;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('7')" onmousedown="event.preventDefault();">7</button></div> <div style="grid-area: eight;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('8')" onmousedown="event.preventDefault();">8</button></div> <div style="grid-area: nine;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('9')" onmousedown="event.preventDefault();">9</button></div> <div style="grid-area: fullstop;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('.')" onmousedown="event.preventDefault();">.</button></div> <div style="grid-area: zero;" class="keyboard-keys"><button type="button" onmouseup="keyboardType('0')" onmousedown="event.preventDefault();">0</button></div> <div style="grid-area: backspace;" class="backspace"><button type="button" onmouseup="keyboardBackspace('<');" onmousedown="event.preventDefault();">< </button></div> /* ENTER BUTTON */ <div id="enter-element" class="enter-button"> <<button "ENTER">> <<script>> console.log("Hardmode is " + State.variables.hardMode); <</script>> /* fixing Doug's ENTER smash bug */ <<if _error is false>> /*this gets reset to false after half a sec (right at the end) */ /* set _guess variable for jscript to reference below*/ <<set _guess to "">> <<if _mazeStillGoing is true>> <<script>> let allCorrect; let easyMove = false; let hardMove = false; State.temporary.mazeStillGoing = false; /*by default you CAN'T just hit this button again until it gets set to true later */ /*EASY */ if (State.variables.hardMode === 0){ allCorrect = false; /* Check the current textbox only*/ let curTextbox = document.getElementById(State.variables.answercounter); /*get the textbox's value and assign it to _guess */ State.temporary.guess = curTextbox.value; /*CHECK ANSWER - > if guess is correct, move one! */ if (State.temporary.guess === State.variables.mapanswers[State.variables.answercounter]) { console.log("guess is answer"); easyMove = true; } else { console.log("guess is NOT answer"); /*select the contents for easy typing over */ let input = document.getElementById(State.variables.answercounter); input.focus(); input.select(); /*record error so twine knows to give player feedback below! */ State.temporary.error = true; /*GAUNTLET -> LOSE HP! */ if (State.variables.gauntlet){ /*State.variables.stats.HP--; Subtract 1 from HP console.log("Your health is :" + State.variables.stats.HP); document.getElementById("health-text").innerHTML=State.variables.stats.HP; */ $.wiki('<<stats "HP" -1>>'); } } /*HARD */ } else { /* set flag here (true by default) */ allCorrect = true; /* LOOP THAT CHECKS ANSWER OF EACH TEXTBOX */ for (let i = 0; i < State.variables.mapanswers.length; i++) { /* Get the textbox values (by their ids) */ let x = document.getElementById(i); /*getting each textbox by it's ID*/ State.temporary.guess = x.value; /*setting _guess to the value of the textbox */ /* check EACH guess against the answer array */ if (State.temporary.guess === State.variables.mapanswers[i]) { console.log("at least one answer CORRECT!"); /* Establish textbox to focus on... if (i < State.variables.mapanswers.length-1){ focusOnElement(i+1); console.log("throwing focus one forward: " + i); } else { focusOnElement(i); console.log("Keeping focus at last textbox: " + i); }*/ /*FEEDBACK cos you've made 3 mistakes! */ if (State.temporary.errorCount > 3) { /*remove green CORRECT background color (if it's there!) */ x.classList.remove("wrong-answer"); /* add red INCORRECT background color so player knows which answers are wrong*/ x.classList.add("right-answer"); } } else { /*At least ONE answer is wrong --> */ allCorrect = false; console.log("at least one answer is wrong"); /*record error so twine knows to give player feedback below! */ State.temporary.error = true; /*FEEDBACK cos you've made 3 mistakes! */ if (State.temporary.errorCount > 2) { /*remove green CORRECT background color (if it's there!) */ x.classList.remove("right-answer"); /* add red INCORRECT background color so player knows which answers are wrong*/ x.classList.add("wrong-answer"); } /*GAUNTLET -> LOSE HP! */ if (State.variables.gauntlet){ State.variables.stats.HP--; /*Subtract 1 from HP */ document.getElementById("health-text").innerHTML=State.variables.stats.HP; } } } /*Are ALL answer correct? Get ready to moveAll below! */ if (allCorrect === true) { hardMove = true; console.log("allCorrect is still true -> ALL ANSWERS MUST BE CORRECT!!"); document.querySelectorAll('.triggerbutton').forEach(item => { item.classList.remove('wrong-answer'); item.classList.add('right-answer'); }) } } console.log("easyMove is " + easyMove); console.log("hardMove is " + hardMove); async function easyHardMovesThenFinish() { let maze = document.querySelector('game-maze'); if (easyMove === true) { /*while animating the easy move, don't touch this textbox! */ let input = document.getElementById(State.variables.answercounter); input.disabled = true; input.classList.remove("wrong-answer"); /* remove red INCORRECT background color (if it's there!)*/ input.classList.add("right-answer"); /*add green CORRECT background color */ await maze.move(); /*move has finished, so DON'T enable input this textbox anymore... input.disabled = false;*/ /*increment answercounter if needed */ if (State.variables.answercounter < State.variables.indices.length) { State.variables.answercounter++; console.log("The new textbox id now selected is: " + State.variables.answercounter); let newSelector = State.variables.answercounter; /*increment input and select NEXT textbox */ if (newSelector === State.variables.indices.length){ /*it's beyond the textbox array so bring the selector back by 1 */ newSelector--; } input = document.getElementById(newSelector); input.focus(); input.select(); } /*Check variables!*/ console.log("Is " + State.variables.answercounter + " equivalent to " + State.variables.indices.length + "?"); /*Reset easymove to false (ready for next move)*/ easyMove = false; } if (hardMove === true) { await maze.moveAll(); console.log("allCorrect is: " + allCorrect); } /*FINISHED? (Check for both normal mode and Hard mode) */ if (State.variables.answercounter === State.variables.indices.length || allCorrect === true) { /*This maze is solved so STOP the maze!*/ State.temporary.mazeStillGoing = false; console.log("finished the maze!"); /* include maze complete passage that makes difficulty adjustments */ $(output).wiki(Story.get('maze complete').processText()); /*This is the javascript version of <<include>> */ /*GAUNTLET -> Go to journey map OR pop up a SOMETHING (not an item!)*/ if (State.variables.gauntlet){ Engine.play("journey map"); /*go to the where to next passage*/ /*NORMAL QUEST -> get a normal quest item or a MONSTER ITEM if there's a monster guard ahead */ } else { if (State.variables.quest.challenges[State.variables.i+1] === "fight") { console.log(State.variables.quest.challenges[State.variables.i+1]); $(output).wiki(Story.get('monster item maze').processText()); /*This is the javascript version of <<include>> */ } else { console.log(State.variables.quest.challenges[State.variables.i+1]); $(output).wiki(Story.get('quest item').processText()); /*This is the javascript version of <<include>> */ } } /*let questItem = document.getElementById("item-message"); questItem.classList.remove("hide"); questItem.classList.add("animate__backInUp");*/ /*Engine.play("quest item");*/ /*go to the where to next passage*/ } else { /*The level isn't over, so allow user to check more answers... */ State.temporary.mazeStillGoing = true; } } easyHardMovesThenFinish(); <</script>> <</if>> /*Error Feedback! */ <<if _error is true>> /* EASY error feedback */ <<if $hardMode is 0>> /* sound */ <<audio "error" volume 1 play>> /* shake! */ <<shaketarget `"#"+$answercounter` .5s>> /* HARD error feedback */ <<else>> /* no feedback by default, but increment _errorCount!*/ <<set _errorCount++>> <<if _errorCount gt 3>> <<audio "error" volume 1 play>> <<shaketarget ".wrong-answer" .5s>> <</if>> <</if>> /*Wait half a sec, then make the button clickable again! This is so you can't get a double error on double click! */ <<timed 0.5s>> <<set _error to false>> <</timed>> <</if>> <</if>> <</button>> </div> </div>
Maze is an outpost - you're trying to recover it. The first mission was a failure. The forest has overgrown the old camp. You've been sent to discover what happened to the first settlers. You discover the scanner and it helps you find relics. You give the relics to the scientists / market to fund the expedition but also to research what happened. Other races are fighting over the maze too - kind of like a goldrush You are trying to restore the outpost / research base to discover what happened. Maybe you lost your older brother/sister in the first expedition? What if you have a magic power that others don't have? ie that's why you're here on this expedition... You have an affinity for the old magic
Your mother gets sick. Now she can't go to work and your father has to work harder than ever. You can hear her coughing in her room when you try and do your school work. You try to take her some hot tea but she pushes the cup away with a tight smile.
You come back to the camp and find the village doctor bending over your mother. He says she is very sick. There's not much he can do. He needs herbs of healing from the North.
The doctor says he heard of a merchant who can bring medicine from the North - but it's very expensive. $1000 gold per leaf! He says if you sell half the house you might be able to get half that, and then you could beg and borrow the rest.
The doctor can't believe you've got 1000 gold. He double checks with the Merchant but then agrees to pay the Merchant the money. The herbs should be back in town in a few weeks. You'll have to sit tight 'til then.
Your mother gets sicker every day. She can't walk at all now. Her face is thin and she can barely speak. The doctor says she should rest. Now she lies in her bed and looks at the sky through the window. You can't help but wonder what will happen if the medicine doesn't arrive in time.
When you get to the camp the doctor is back in your house. 'Do you have the herbs?' you ask, stepping quickly to your mother's side. 'A few leaves, yes.' The doctor says hurriedly. 'I'll need hot water.'
You pay the carpenter 100 gold to fix your door. There it is, as strong and sturdy as ever!
You pay the carpenter another 75 gold to fix your window. Your mother says it keeps the night flies out.
You pay the Thatcher to put some ceramic tiles on your roof. Now the rain doesn't come in so much and house is cozy!
maps/map000.json maps/map001.json maps/map002.json maps/map003.json maps/map004.json maps/map005.json
maps/map100.json maps/map101.json maps/map102.json maps/map103.json maps/map104.json maps/map105.json maps/map106.json maps/map107.json maps/map108.json maps/map109.json maps/map110.json maps/map111.json maps/map112.json maps/map113.json maps/map114.json maps/map115.json maps/map116.json
maps/map200.json maps/map201.json maps/map202.json maps/map203.json maps/map204.json maps/map205.json maps/map206.json maps/map207.json maps/map208.json maps/map209.json maps/map210.json maps/map211.json maps/map212.json maps/map213.json maps/map214.json maps/map215.json maps/map216.json maps/map217.json
maps/map300.json maps/map301.json maps/map302.json maps/map303.json maps/map304.json maps/map305.json maps/map306.json maps/map307.json maps/map308.json maps/map309.json maps/map310.json maps/map311.json maps/map312.json maps/map313.json maps/map314.json maps/map315.json maps/map316.json maps/map317.json maps/map318.json maps/map319.json maps/map320.json maps/map321.json maps/map322.json maps/map323.json maps/map324.json
maps/map400.json maps/map401.json maps/map402.json maps/map403.json maps/map404.json maps/map405.json maps/map406.json maps/map407.json maps/map408.json maps/map409.json maps/map410.json
maps/map500.json maps/map501.json maps/map502.json maps/map503.json maps/map504.json
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 1x2 = 2">>
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
1x1 1x2 1x3 1x4 1x5 1x6 1x7 1x8 1x9 1x10 1x11 1x12 1x1 2x1 3x1 4x1 5x1 6x1 7x1 8x1 9x1 10x1 11x1 12x1
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 2x2 = 4">>
1x2 2x2 3x2 4x2 5x2 6x2 7x2 8x2 9x2 10x2 11x2 12x2 2x1 2x2 2x3 2x4 2x5 2x6 2x7 2x8 2x9 2x10 2x11 2x12
2 4 6 8 10 12 14 16 18 20 22 24 2 4 6 8 10 12 14 16 18 20 22 24
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 3x2 = 6">>
1x3 2x3 3x3 4x3 5x3 6x3 7x3 8x3 9x3 10x3 11x3 12x3 3x1 3x2 3x3 3x4 3x5 3x6 3x7 3x8 3x9 3x10 3x11 3x12
3 6 9 12 15 18 21 24 27 30 33 36 3 6 9 12 15 18 21 24 27 30 33 36
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 4x2 = 8">>
4x1 4x2 4x3 4x4 4x5 4x6 4x7 4x8 4x9 4x10 4x11 4x12 1x4 2x4 3x4 4x4 5x4 6x4 7x4 8x4 9x4 10x4 11x4 12x4
4 8 12 16 20 24 28 32 36 40 44 48 4 8 12 16 20 24 28 32 36 40 44 48
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 5x2 = 10">>
5x1 5x2 5x3 5x4 5x5 5x6 5x7 5x8 5x9 5x10 5x11 5x12 1x5 2x5 3x5 4x5 5x5 6x5 7x5 8x5 9x5 10x5 11x5 12x5
5 10 15 20 25 30 35 40 45 50 55 60 5 10 15 20 25 30 35 40 45 50 55 60
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 6x2 = 12">>
6x1 6x2 6x3 6x4 6x5 6x6 6x7 6x8 6x9 6x10 6x11 6x12 1x6 2x6 3x6 4x6 5x6 6x6 7x6 8x6 9x6 10x6 11x6 12x6
6 12 18 24 30 36 42 48 54 60 66 72 6 12 18 24 30 36 42 48 54 60 66 72
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 7x2 = 14">>
7x1 7x2 7x3 7x4 7x5 7x6 7x7 7x8 7x9 7x10 7x11 7x12 1x7 2x7 3x7 4x7 5x7 6x7 7x7 8x7 9x7 10x7 11x7 12x7
7 14 21 28 35 42 49 56 63 70 77 84 7 14 21 28 35 42 49 56 63 70 77 84
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 8x2 = 16">>
8x1 8x2 8x3 8x4 8x5 8x6 8x7 8x8 8x9 8x10 8x11 8x12 1x8 2x8 3x8 4x8 5x8 6x8 7x8 8x8 9x8 10x8 11x8 12x8
8 16 24 32 40 48 56 64 72 80 88 96 8 16 24 32 40 48 56 64 72 80 88 96
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 9x2 = 18">>
9x1 9x2 9x3 9x4 9x5 9x6 9x7 9x8 9x9 9x10 9x11 9x12 1x9 2x9 3x9 4x9 5x9 6x9 7x9 8x9 9x9 10x9 11x9 12x9
9 18 27 36 45 54 63 72 81 90 99 108 9 18 27 36 45 54 63 72 81 90 99 108
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 10x2 = 20">>
10x1 10x2 10x3 10x4 10x5 10x6 10x7 10x8 10x9 10x10 10x11 10x12 1x10 2x10 3x10 4x10 5x10 6x10 7x10 8x10 9x10 10x10 11x10 12x10
10 20 30 40 50 60 70 80 90 100 110 120 10 20 30 40 50 60 70 80 90 100 110 120
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 11x2 = 22">>
11x1 11x2 11x3 11x4 11x5 11x6 11x7 11x8 11x9 11x10 11x11 11x12 1x11 2x11 3x11 4x11 5x11 6x11 7x11 8x11 9x11 10x11 11x11 12x11
11 22 33 44 55 66 77 88 99 110 121 132 11 22 33 44 55 66 77 88 99 110 121 132
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 12x2 = 24">>
12x1 12x2 12x3 12x4 12x5 12x6 12x7 12x8 12x9 12x10 12x11 12x12 1x12 2x12 3x12 4x12 5x12 6x12 7x12 8x12 9x12 10x12 11x12 12x12
12 24 36 48 60 72 84 96 108 120 132 144 12 24 36 48 60 72 84 96 108 120 132 144
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 5x2x12 = 120">>
1x5x9 6x1x8 6x4x2 2x2x4 6x5x16 8x1x13 8x3x13 10x5x1 8x4x16 10x5x16 1x2x3 6x2x18 5x2x12 4x4x9 7x1x18 10x5x20 10x1x16 2x5x1 9x3x12 2x4x10 6x5x9 4x2x5 1x1x15 2x1x19 6x1x16 5x5x9 4x1x4 10x1x5 4x5x13 1x4x13 5x5x19 4x2x8 3x4x8 2x2x11 3x3x19 10x1x4 2x4x8 2x1x17 5x1x8 2x4x19 2x4x14 8x1x17 1x5x12 7x4x11 5x5x5 9x3x15 4x5x18 3x4x7 4x4x17 6x5x12 5x2x9 10x5x4 5x2x11 10x5x6 9x4x11 4x5x13 1x2x3 9x5x17 1x3x5 3x1x16 4x1x10 10x1x7 7x3x20 10x3x3 7x1x15 7x2x13 10x3x8 9x5x2 8x1x8 4x5x4 8x1x11 8x1x7 5x4x11 5x1x8 9x5x11 7x3x16 6x3x6 6x4x9 1x2x4 7x1x20 10x4x8 5x1x9 10x2x1 7x3x5 1x4x17 2x4x3 2x5x5 9x5x2 8x5x13 4x4x15 10x3x13 8x5x5 7x3x8 1x3x16 8x2x5 8x3x4 10x2x6 10x5x4 1x1x14 6x1x15 1x5x2 1x1x3 8x5x16 2x4x1 3x5x19 9x4x6 5x5x19 6x5x4 7x5x6 10x5x14 8x2x2 10x5x12 9x1x20 8x3x15 1x5x8 9x2x11 1x4x1 5x1x4 3x5x1 6x1x3 4x1x18 3x5x17 6x3x1 1x3x19 4x2x14 3x1x9 1x4x19 3x5x4 4x5x20 4x3x12 10x3x4 8x3x1 3x1x1 10x1x12 8x2x10 5x1x14 1x1x15 10x1x18 4x4x14 6x2x5 1x2x8 4x2x10 5x4x4 6x4x17 6x3x11 9x4x13 1x3x11 6x3x16 1x4x18 10x1x4 4x3x1 4x3x3 1x2x20 9x3x1 9x1x8 1x2x11 1x1x16 1x2x18 1x3x1 10x5x15 4x3x16 8x1x16 9x1x11 6x5x5 7x4x18 1x4x5 10x1x1 8x1x17 10x3x20 5x2x8 9x3x8 5x5x3 5x3x9 3x2x10 6x1x20 2x1x10 5x3x15 8x1x11 8x5x8 8x1x13 2x5x14 6x4x1 9x4x17 2x2x4 1x4x4 10x2x19 1x4x3 4x5x11 9x4x1 8x4x5 7x3x12 8x4x7 6x4x5 5x3x6 3x4x19 8x4x8 4x4x19 5x5x8 4x1x17 10x4x20 5x2x1 1x4x18 4x2x19 6x3x9 7x3x20 6x3x10 6x4x19 7x3x13 1x4x11 10x3x2 2x2x20 3x1x13 10x1x19 8x3x2 8x1x4 2x3x12 1x3x7 5x3x4 6x4x3 8x4x1 1x5x19 4x1x8 3x1x15 10x5x12 6x2x18 1x1x3 1x5x12 5x3x5 3x5x9 3x3x2 9x5x2 2x2x9 5x1x4 7x3x12 10x1x6 4x4x16 8x5x10 4x4x12 1x2x11 2x1x5 1x2x1 2x3x6 2x3x17 7x4x10 8x3x3 4x1x9 2x2x6 1x3x7 5x3x20 9x2x20 10x4x9 9x3x17 8x3x14 10x2x3 4x1x5 1x5x15 2x1x17 2x4x7 4x2x15 5x1x4 5x1x11 9x1x5 6x1x9 3x4x15 5x3x5 1x2x20 4x3x13 4x3x11 7x1x17 10x4x15 9x1x15 2x3x13 1x2x1 8x4x13 5x3x15 10x4x10 5x1x14 3x4x17 7x2x9 8x5x1 3x1x16 3x3x6 2x5x17 1x2x4 4x4x10 1x5x11 8x5x4 9x3x11 5x4x14 9x4x4 7x1x20 2x4x7 2x1x13 4x3x2 2x2x12 1x4x1 3x4x2 9x3x5 3x4x13 4x5x12 10x4x10 9x2x20 8x3x7 3x1x15 6x1x6 3x3x18 2x2x18 9x2x20 10x3x2 2x1x1 9x5x5 3x5x15 3x4x20 7x1x12 3x3x18 1x1x15 6x5x16 8x4x14 4x5x1 1x1x8 2x4x19 7x2x2 2x3x14 2x4x4 7x3x12 9x2x6 10x5x13 2x3x10 10x2x18 7x2x13 10x5x7 6x1x14 1x4x20 8x4x17 5x1x1 1x2x11 5x2x13 3x1x2 9x4x1 8x3x12 1x3x3 5x3x7 7x5x10 2x4x18 8x2x14 10x5x2 7x5x19 4x3x12 2x5x4 4x1x20 10x1x4 8x5x5 10x5x6 1x4x19 7x2x19 1x3x4 2x3x5 7x5x9 4x2x12 10x4x19 8x3x4 6x4x2 8x2x2 7x2x3 8x2x2 3x4x9 5x3x15 7x5x17 6x2x5 1x1x19 1x4x20 3x4x1 7x2x4 9x2x8 2x4x11 4x5x16 6x4x10 3x2x18 5x3x16 3x5x15 3x1x10 7x2x10 10x4x11 4x3x12 7x2x10 1x5x3 1x1x15 1x4x11 7x1x19 8x3x4 4x1x20 10x4x13 3x1x5 6x3x1 3x3x20 1x4x7 10x4x6 2x1x19 1x3x2 5x4x20 9x3x8 1x5x19 7x2x18 3x1x1 4x4x6 4x2x13 7x2x15 5x2x15 1x3x10 8x2x13 10x4x7 9x1x6 2x2x12 9x3x12 7x5x13 5x4x17 8x5x7 2x2x2 10x5x10 10x4x6 2x3x15 9x3x14 7x1x7 4x5x1 4x5x3 8x1x20 6x2x9 4x3x5 5x3x9 10x4x11 1x2x19 9x1x12 1x2x19 4x4x11 3x5x14 8x4x5 1x3x10 5x3x8 1x1x20 10x5x19 1x1x18 5x5x18 9x4x17 8x4x2 4x3x12 8x5x17 4x3x1 1x5x1 6x4x6 9x4x20 5x3x18 4x4x11 1x1x3 5x4x3 5x4x9 2x3x16 8x3x6 6x4x2 4x4x6 3x5x19 9x1x19 9x1x15 7x4x1 8x2x14 9x3x10 9x4x9 5x4x9 9x3x1 7x3x3 5x4x6 6x5x2 7x1x15 5x3x3 6x2x16 6x1x9 5x1x17 4x3x2 4x5x4 10x2x16 7x4x5 3x3x3 1x5x7 10x5x18 6x2x13 8x4x18 8x5x15 8x1x15 7x3x9 6x1x6 4x4x1 10x1x6 9x2x9 5x4x3 10x4x2 3x3x11 5x3x2 9x5x9 10x5x9 4x1x20 5x3x19 3x1x1 4x2x18 6x3x18 10x4x3 9x4x9 10x3x4 9x4x12 9x5x10 5x1x15 2x2x20 10x3x1 4x2x12 6x2x13 7x2x3 6x2x11 5x3x8 3x1x7 7x3x19 4x2x2 6x4x13 2x3x6 4x3x5 7x3x17 3x3x12 9x3x1 7x3x9 1x1x2 8x3x17 10x2x18 10x1x5 3x5x10 3x3x10 10x1x8 1x4x17 6x2x12 3x3x2 2x5x1 7x4x16 9x3x15 4x1x6 5x4x14 7x1x10 4x3x20 2x4x12 10x2x7 9x4x16 1x4x20 8x3x17 8x4x15 9x4x12 8x5x15 1x3x18 1x2x14 4x5x2 8x1x10 8x5x6 3x1x20 1x5x17 6x4x9 9x4x9 3x1x3 10x5x13 4x3x18 4x3x4 5x4x2 4x5x16 9x2x14 7x3x18
45 48 48 16 480 104 312 50 512 800 6 216 120 144 126 1000 160 10 324 80 270 40 15 38 96 225 16 50 260 52 475 64 96 44 171 40 64 34 40 152 112 136 60 308 125 405 360 84 272 360 90 200 110 300 396 260 6 765 15 48 40 70 420 90 105 182 240 90 64 80 88 56 220 40 495 336 108 216 8 140 320 45 20 105 68 24 50 90 520 240 390 200 168 48 80 96 120 200 14 90 10 3 640 8 285 216 475 120 210 700 32 600 180 360 40 198 4 20 15 18 72 255 18 57 112 27 76 60 400 144 120 24 3 120 160 70 15 180 224 60 16 80 80 408 198 468 33 288 72 40 12 36 40 27 72 22 16 36 3 750 192 128 99 150 504 20 10 136 600 80 216 75 135 60 120 20 225 88 320 104 140 24 612 16 16 380 12 220 36 160 252 224 120 90 228 256 304 200 68 800 10 72 152 162 420 180 456 273 44 60 80 39 190 48 32 72 21 60 72 32 95 32 45 600 216 3 60 75 135 18 90 36 20 252 60 256 400 192 22 10 2 36 102 280 72 36 24 21 300 360 360 459 336 60 20 75 34 56 120 20 55 45 54 180 75 40 156 132 119 600 135 78 2 416 225 400 70 204 126 40 48 54 170 8 160 55 160 297 280 144 140 56 26 24 48 4 24 135 156 240 400 360 168 45 36 162 72 360 60 2 225 225 240 84 162 15 480 448 20 8 152 28 84 32 252 108 650 60 360 182 350 84 80 544 5 22 130 6 36 288 9 105 350 144 224 100 665 144 40 80 40 200 300 76 266 12 30 315 96 760 96 48 32 42 32 108 225 595 60 19 80 12 56 144 88 320 240 108 240 225 30 140 440 144 140 15 15 44 133 96 80 520 15 18 180 28 240 38 6 400 216 95 252 3 96 104 210 150 30 208 280 54 48 324 455 340 280 8 500 240 90 378 49 20 60 160 108 60 135 440 38 108 38 176 210 160 30 120 20 950 18 450 612 64 144 680 12 5 144 720 270 176 3 60 180 96 144 48 96 285 171 135 28 224 270 324 180 27 63 120 60 105 45 192 54 85 24 80 320 140 27 35 900 156 576 600 120 189 36 16 60 162 60 80 99 30 405 450 80 285 3 144 324 120 324 120 432 450 75 80 30 96 156 42 132 120 21 399 16 312 36 60 357 108 27 189 2 408 360 50 150 90 80 68 144 18 10 448 405 24 280 70 240 96 140 576 80 408 480 432 600 54 28 40 80 240 60 85 216 324 9 650 216 48 40 320 252 378
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 10+5x7 = 45 (don't forget that x comes before +)">>
5+8x4 9+5x6 10+5x7 2+10x5 2+2x5 3+2x2 5+2x7 3+10x8 12+3x2 11+10x3 5+2x3 11+7x4 6+10x5 4+5x8 7+9x5 11+5x6 7+3x4 10+3x8 10+4x8 8+4x5 2+6x5 12+4x7 8+6x2 10+9x5 12+7x5 3+8x8 8+5x3 10+10x3 3+9x2 3+10x4 2+2x2 11+8x7 10+4x2 7+8x7 11+4x3 11+4x8 7+9x7 6+8x6 5x10+5 5x4+6 12x7+2 10x7+6 11x8+5 7x9+6 5x9+6 10x4+2 3x2+3 7x2+6 3x9+2 12x7+3 8x8+4 9x2+2 12x2+2 5x7+3 10x10+7 10x3+7 10x9+8 12x8+2 5x4+6 5x7+6 10x7+5 10x5+4 9x5+3 12x9+6 6x5+2 6x3+4 12x3+6 11x2+5 5x5+5 8x2+2 3x3+5 2x9+5 8x3+3 5x4+2 8x10+3 10x8+8
37 39 45 52 12 7 19 83 18 41 11 39 56 44 52 41 19 34 42 28 32 40 20 55 47 67 23 40 21 43 6 67 18 63 23 43 70 54 55 26 86 76 93 69 51 42 9 20 29 87 68 20 26 38 107 37 98 98 26 41 75 54 48 114 32 22 42 27 30 18 14 23 27 22 83 88
You come to an open space in the maze. A white-walled chamber with a humming noise echoing faintly from the walls. You step into the space. In the middle of the chamber is a strange looking rock. In the far right corner you can see head-high grass. The stalks are as thick as your body. To the left you can see a blackened hole in the wall. What do you do? /*VARIABLES */ <div id="story-choice-box"> </div> <<set _choices to ["Look at the rock","Check out the grass","See what you can find at the blackened hole","fish in the pond"]>> <<set _forwardingPassages to ["strange looking rock","long grasses 1","hole in the wall","fish in the pond"]>> <<set _challengeType to "story">>
You step closer. The humming noise seems to be coming from the rock itself. In the center of the rock is a metal circle. Some kind of... You pick it up. The humming immediately stops but the metal disc in your hands shimmers with an electric blue light. This might come in handy, you think, stowing it in your backpack. [[Explore|where to next?]] <<set $backpack.push("electric disk")>> Backpack: $backpack
You edge past the rock and head for the giant grass. You hear a little chirping noise and push through the grass. On the ground in the grasses is a nest made from twigs and lying in the nest is a fluffy little... "OUCH!" you yelp as a baby birdling nips your hand. You back away slowly, but the birdling starts to waddle after you, flapping it's dark wings. "Nice birdy," you say, but before you know it, the little creature flaps onto your shoulder. You don't move. The baby bird is glaring at you. But...it doesn't look angry anymore. Just curious. [[Explore|where to next?]] <<set $backpack.push("birdling")>> Backpack: $backpack
You head for the hole. As you get closer you can see the scorch marks clearly. The hole has been melted into the wall by...something. What could cause this much heat? You put your hand gently on the charred lip of the hole. It's cool now but... Something catches your eye. Up there, towards the back. Something is glowing faint red. You climb into the hole and grab it quickly. It looks like an egg of some kind. Your clothes are blackened as you back out of the cavern, putting the egg carefully in your backpack. Who knows. Maybe this egg could be worth something? [[Explore|where to next?]] <<set $backpack.push("thunder egg")>> Backpack: $backpack
Yeeeep. There's a fish down there! /*-------------------------------------------------------STORY SCENES --------------------------------------------------------- */
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 9-2 = 7">>
9-1 9-2 9-3 9-4 9-5 9-6 9-7 9-8 8-1 8-2 8-3 8-4 8-5 8-6 8-7 7-1 7-2 7-3 7-4 7-5 7-6 6-1 6-2 6-3 6-4 6-5 5-1 5-2 5-3 5-4 4-1 4-2 4-3 3-1 3-2 2-1
8 7 6 5 4 3 2 1 7 6 5 4 3 2 1 6 5 4 3 2 1 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 69-54 = 15">>
69-54 22-11 65-51 48-37 82-51 57-35 35-21 44-21 65-52 42-31 93-11 92-31 63-52 59-32 97-51 96-53 66-51 56-32 48-11 87-41 57-44 82-21 74-13 26-15 46-31 82-21 48-35 39-22 28-14 28-11 83-71 82-71 95-11 72-51 98-66 37-11 95-53 82-21 23-11 62-11 63-42 74-53 78-26 26-11 95-12 86-53 63-31 23-11 85-53 35-12 58-27 83-41 75-31 35-14 68-17 78-15 54-42 23-11 95-54 96-25 42-11 57-36 97-45 75-24 35-12 22-11 94-31 77-53 76-21 73-12 55-42 44-32 77-46 63-31 54-31 52-31 76-23 72-41 66-32 48-34 84-41 44-23 56-13 86-11 78-43 34-12 33-22 89-13 65-43 75-53 26-11 27-14 34-13 77-42 27-11 75-23 46-31 73-21 87-35 45-23 56-43 73-61 99-21 46-12 57-35 76-13 64-13 67-41 78-66 85-23 99-57 78-14 96-84 27-11 89-21 85-33 22-11 68-55 39-21 89-51 98-15 88-17 82-61 25-13 32-11 96-11 89-37 49-31 52-31 97-83 72-11 49-28 27-11 28-13 55-32 92-11 93-32 26-12 83-11 64-23 46-12 33-22 83-21 69-35 76-31 94-82 69-47 33-11 27-12 29-17 95-63 47-33 89-33 25-13 63-22 98-57 84-31 96-32 46-35 55-34 47-24 53-12 82-61 68-41 89-35 83-21 55-14 24-13 57-42 33-11 44-11 73-11 56-11 69-57 77-15 82-51 49-25 28-14 27-13 42-31 42-21 77-34 26-12 22-11 37-11 55-41 26-13 38-26 35-21 24-13 74-51 88-54 86-15 37-22 47-31 65-12 69-35 67-43 55-14 86-24 48-27 82-51 92-41 52-31 89-21 68-55 45-11 68-25
15 11 14 11 31 22 14 23 13 11 82 61 11 27 46 43 15 24 37 46 13 61 61 11 15 61 13 17 14 17 12 11 84 21 32 26 42 61 12 51 21 21 52 15 83 33 32 12 32 23 31 42 44 21 51 63 12 12 41 71 31 21 52 51 23 11 63 24 55 61 13 12 31 32 23 21 53 31 34 14 43 21 43 75 35 22 11 76 22 22 15 13 21 35 16 52 15 52 52 22 13 12 78 34 22 63 51 26 12 62 42 64 12 16 68 52 11 13 18 38 83 71 21 12 21 85 52 18 21 14 61 21 16 15 23 81 61 14 72 41 34 11 62 34 45 12 22 22 15 12 32 14 56 12 41 41 53 64 11 21 23 41 21 27 54 62 41 11 15 22 33 62 45 12 62 31 24 14 14 11 21 43 14 11 26 14 13 12 14 11 23 34 71 15 16 53 34 24 41 62 21 31 51 21 68 13 34 43
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 81-52 = 29">>
64-59 21-12 61-55 47-38 81-52 55-37 31-25 41-24 62-55 41-32 91-13 91-32 62-53 52-39 91-57 93-56 61-56 52-36 41-18 81-47 54-47 81-22 73-14 25-16 41-36 81-22 45-38 32-29 24-18 21-18 81-73 81-72 91-15 71-52 96-68 31-17 93-55 81-22 21-13 61-12 62-43 73-54 76-28 21-16 92-15 83-56 61-33 21-13 83-55 32-15 57-28 81-43 71-35 34-15 67-18 75-18 52-44 21-13 94-55 95-26 41-12 56-37 95-47 74-25 32-15 21-12 91-34 73-57 71-26 72-13 52-45 42-34 76-47 61-33 51-34 51-32 73-26 71-42 62-36 44-38 81-44 43-24 53-16 81-16 73-48 32-14 32-23 83-19 63-45 73-55 21-16 24-17 33-14 72-47 21-17 73-25 41-36 71-23 85-37 43-25 53-46 71-63 91-29 42-16 55-37 73-16 63-14 61-47 76-68 83-25 97-59 74-18 94-86 21-17 81-29 83-35 21-12 65-58 31-29 81-59 95-18 87-18 81-62 23-15 31-12 91-16 87-39 41-39 51-32 93-87 71-12 48-29 21-17 23-18 52-35 91-12 92-33 22-16 81-13 63-24 42-16 32-23 81-23 65-39 71-36 92-84 67-49 31-13 22-17 27-19 93-65 43-37 83-39 23-15 62-23 97-58 81-34 92-36 45-36 54-35 44-27 52-13 81-62 61-48 85-39 81-23 54-15 23-14 52-47 31-13 41-14 71-13 51-16 67-59 75-17 81-52 45-29 24-18 23-17 41-32 41-22 74-37 22-16 21-12 31-17 51-45 23-16 36-28 31-25 23-14 71-54 84-58 85-16 32-27 41-37 62-15 65-39 63-47 54-15 84-26 47-28 81-52 91-42 51-32 81-29 65-58 41-15 65-28
5 9 6 9 29 18 6 17 7 9 78 59 9 13 34 37 5 16 23 34 7 59 59 9 5 59 7 3 6 3 8 9 76 19 28 14 38 59 8 49 19 19 48 5 77 27 28 8 28 17 29 38 36 19 49 57 8 8 39 69 29 19 48 49 17 9 57 16 45 59 7 8 29 28 17 19 47 29 26 6 37 19 37 65 25 18 9 64 18 18 5 7 19 25 4 48 5 48 48 18 7 8 62 26 18 57 49 14 8 58 38 56 8 4 52 48 9 7 2 22 77 69 19 8 19 75 48 2 19 6 59 19 4 5 17 79 59 6 68 39 26 9 58 26 35 8 18 18 5 8 28 6 44 8 39 39 47 56 9 19 17 39 19 13 46 58 39 9 5 18 27 58 35 8 58 29 16 6 6 9 19 37 6 9 14 6 7 8 6 9 17 26 69 5 4 47 26 16 39 58 19 29 49 19 52 7 26 37
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 42-11-6 = 25">>
74-23-1 42-11-6 59-26-10 62-21-6 96-31-2 83-51-8 86-43-2 58-47-3 98-43-8 87-51-9 54-22-6 65-44-10 45-31-5 29-12-11 24-12-8 96-75-1 82-51-8 37-13-2 52-31-11 99-57-2 45-31-8 28-16-8 69-54-7 89-32-4 47-21-7 79-38-9 54-31-11 85-42-5 62-41-10 85-53-11 64-31-8 98-14-11 73-12-7 24-12-5 27-13-10 69-47-4 74-43-9 93-81-2 37-11-10 62-21-4 57-12-6 97-63-2 54-32-1 86-62-11 92-51-4 92-21-1 69-22-10 66-44-7 24-11-11 55-43-7 99-24-11 95-24-6 66-42-4 35-23-2 37-22-6 38-13-6 62-21-5 63-22-9 96-21-1 58-32-4 85-11-4 33-21-1 64-12-7 24-13-9 64-31-6 58-44-3 43-21-8 84-22-3 39-11-5 73-41-9 42-31-4 28-15-9 77-13-8 84-22-1 55-31-1 77-44-10 43-11-4 79-55-7 58-37-9 52-41-8 69-43-2 95-73-8 53-42-7 37-13-5 77-51-7 48-11-4 53-21-4 22-11-7 95-71-8 78-17-2 49-23-5 23-12-4 69-28-8 25-12-8 23-12-8 72-41-3 75-24-11 63-22-5 24-13-11 93-41-4 25-14-4 64-11-9 74-11-2 97-23-7 88-65-4 22-11-8 74-61-10 44-11-2 68-45-4 34-21-5 53-21-10 54-43-9 77-51-5 52-31-6 66-32-2 79-45-7 82-61-3 85-41-9 28-12-2 47-21-3 79-52-10 39-23-4 94-82-6 76-24-1 67-12-3 68-12-6 53-42-3 52-21-4 92-71-7 64-23-9 38-17-4 86-74-10 55-14-5 73-12-4 59-28-1 76-24-11 34-22-1 88-56-9 84-12-10 22-11-5 28-12-11 75-14-1 22-11-8 38-21-8 39-24-6 23-11-3 36-21-9 35-14-4 88-77-3 82-61-2 64-21-10 37-22-10 87-72-4 47-36-11 99-31-9 26-11-7 34-23-3 63-32-6 62-21-1 74-63-9 72-31-4 63-12-11 68-32-8 89-58-6 78-54-10 29-17-2 94-82-6 42-31-5 45-14-9 53-21-8 75-32-6 68-51-10 94-13-3 78-42-10 27-14-10 35-11-2 79-38-2 93-12-5 59-21-6 55-32-10 43-31-6 43-11-10 74-51-6 32-11-3 78-41-4 32-11-3 73-12-5 33-12-5 36-21-8 57-44-2 25-14-6 54-42-5 29-17-3 53-31-9 82-71-10 35-21-4 88-27-1 49-26-6 44-31-7 89-63-1 33-11-8 54-41-8 88-37-7 83-62-4 79-18-1 47-24-5 98-63-7 28-17-9
50 25 23 35 63 24 41 8 47 27 26 11 9 6 4 20 23 22 10 40 6 4 8 53 19 32 12 38 11 21 25 73 54 7 4 18 22 10 16 37 39 32 21 13 37 70 37 15 2 5 64 65 20 10 9 19 36 32 74 22 70 11 45 2 27 11 14 59 23 23 7 4 56 61 23 23 28 17 12 3 24 14 4 19 19 33 28 4 16 59 21 7 33 5 3 28 40 36 0 48 7 44 61 67 19 3 3 31 19 8 22 2 21 15 32 27 18 35 14 23 17 12 6 51 52 50 8 27 14 32 17 2 36 57 30 41 11 23 62 6 5 60 3 9 9 9 6 17 8 19 33 5 11 0 59 8 8 25 40 2 37 40 28 25 14 10 6 6 22 24 37 7 78 26 3 22 39 76 32 13 6 22 17 18 33 18 56 16 7 11 5 7 9 13 1 10 60 17 6 25 14 5 44 17 60 18 28 2
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 73-24-28 = 21">>
73-24-28 41-12-21 56-29-27 61-22-2 91-36-3 81-53-25 83-46-12 57-48-6 93-48-11 81-57-5 52-24-25 64-45-3 41-35-1 22-19-1 22-14-4 95-76-5 81-52-18 33-17-9 51-32-19 97-59-12 41-35-1 26-18-2 64-59-1 82-39-12 41-27-13 78-39-19 51-34-1 82-45-5 61-42-12 83-55-20 61-34-6 94-18-49 72-13-14 22-14-3 23-17-5 67-49-5 73-44-11 91-83-7 31-17-9 61-22-32 52-17-13 93-67-7 52-34-11 82-66-2 91-52-35 91-22-51 62-29-26 64-46-4 21-14-7 53-45-5 94-29-46 94-25-45 62-46-13 33-25-3 32-27-4 33-18-4 61-22-10 62-23-12 91-26-14 52-38-7 81-15-57 31-23-5 62-14-33 23-14-1 61-34-2 54-48-6 41-23-16 82-24-21 31-19-8 71-43-22 41-32-7 25-18-7 73-17-1 82-24-27 51-35-13 74-47-21 41-13-24 75-59-2 57-38-5 51-42-1 63-49-6 93-75-14 52-43-3 33-17-7 71-57-7 41-18-1 51-23-22 21-12-6 91-75-5 77-18-32 43-29-13 22-13-2 68-29-23 22-15-5 22-13-4 71-42-14 74-25-40 62-23-20 23-14-2 91-43-37 24-15-7 61-14-23 71-14-22 93-27-4 85-68-15 21-12-3 71-64-3 41-14-24 65-48-3 31-24-3 51-23-25 53-44-1 71-57-10 51-32-12 62-36-3 75-49-6 81-62-13 81-45-22 22-18-4 41-27-13 72-59-13 33-29-3 92-84-6 74-26-17 62-17-35 62-18-30 52-43-5 51-22-3 91-72-13 63-24-9 37-18-4 84-76-5 54-15-33 72-13-36 58-29-10 74-26-21 32-24-8 86-58-15 82-14-5 21-12-3 22-18-3 74-15-43 21-12-2 31-28-3 34-29-5 21-13-7 31-26-1 34-15-19 87-78-4 81-62-17 61-24-15 32-27-4 82-77-1 46-37-3 91-39-18 21-16-1 33-24-3 62-33-20 61-22-20 73-64-9 71-32-37 62-13-5 62-38-2 88-59-20 74-58-1 27-19-6 92-84-7 41-32-8 44-15-19 51-23-17 72-35-6 61-58-1 93-14-41 72-48-3 24-17-3 31-15-7 78-39-28 92-13-10 51-29-15 52-35-17 41-33-1 41-13-14 71-54-6 31-12-12 71-48-8 31-12-1 72-13-34 32-13-17 31-26-4 54-47-7 24-15-6 52-44-4 27-19-2 51-33-2 81-72-8 31-25-1 87-28-17 46-29-13 41-34-4 83-69-9 31-13-18 51-44-2 87-38-9 82-63-8 78-19-28 44-27-5 93-68-25 27-18-8
21 8 0 37 52 3 25 3 34 19 3 16 5 2 4 14 11 7 0 26 5 6 4 31 1 20 16 32 7 8 21 27 45 5 1 13 18 1 5 7 22 19 7 14 4 18 7 14 0 3 19 24 3 5 1 11 29 27 51 7 9 3 15 8 25 0 2 37 4 6 2 0 55 31 3 6 4 14 14 8 8 4 6 9 7 22 6 3 11 27 1 7 16 2 5 15 9 19 7 11 2 24 35 62 2 6 4 3 14 4 3 8 4 7 23 20 6 14 0 1 0 1 2 31 10 14 4 26 6 30 15 3 6 23 19 27 0 13 63 6 1 16 7 0 0 1 4 0 5 2 22 1 4 6 34 4 6 9 19 0 2 44 22 9 15 2 1 1 10 11 31 2 38 21 4 9 11 69 7 0 7 14 11 7 15 18 25 2 1 0 3 4 6 16 1 5 42 4 3 5 0 5 40 11 31 12 0 1
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 12-2+8 = 18">>
15-12+4 6+1-1 12+3-5 12-2+8 18-3+8 16-15+10 20+8-8 11-5+7 6+9-5 15+9-2 11+3-6 18+10-12 17+1-16 16-4+8 16+10-8 20-11+7 19+5-13 16-8+8 12+10-5 8+10-5 7+6-5 8+10-7 9-7+1 6-2+2 20+8-17 16-7+1 16-12+7 20+9-16 6+10-2 13+7-9 12+6-7 8+2-2 14-13+1 11-10+7 9-5+5 9+7-5 10-10+5 6+10-4 8-6+2 9-2+2 20-14+6 17+10-2 8+1-5 11+4-8 16+10-15 12+9-11 14+9-6 7+9-6 19-7+10 15+5-2 20-5+8 14+4-2 18-7+8 8-2+5 19-19+8 14+7-7 10+3-8 12+7-7 10+6-5 12+8-11 8-4+5 17+3-11 11+10-3 6+8-3 10+6-9 20-6+4 14-14+2 6+5-1 6-2+9 13-3+9 17-1+5 11+6-10 8-2+1 17+5-10 9-5+9 7+10-6 9+5-3 18-2+3 14-13+4 18-9+1 14-4+5 7+4-1 14-7+3 19-4+4 8-1+7 20-3+1 11-7+5 16+9-9 11+1-11 20-14+9 6-2+9 7-5+8 17-9+10 20-18+4 14-7+2 20-17+1 6+2-3 12+4-4 11+4-4 15+7-8 16+1-12 17+3-8 19+10-9 17+6-15 10+6-8 17-15+4 9-6+10 9-5+10 20-18+3 13+10-9 9-1+6 17+1-3 13+5-13 18-16+8 10-9+3 9+4-3 11-11+4 13-3+10 13+8-10 19+3-10 9-9+1 12+6-11 16+8-3 10-3+7 16-9+4 7-7+9 19-8+7 6+8-6 13-8+7 14+3-8 9-6+8 10-5+9 11+5-5 12+6-6 9+8-3 18+6-4 20-13+3 11+8-3 8+3-5 18-9+6 18-1+7 10-2+9 8-5+5 14-6+5 16-12+4 16-11+7 16+1-12 20-17+1 15-12+9 6+2-5 6+7-3 20+9-9 7+6-5 9-5+3 15-14+5 11+1-3 10-1+10 15+4-5 18-12+3 7-3+7 16+3-5 8+7-8 7-2+7 15+2-15 6+10-2 15+6-5 7-5+6 13+1-4 14+5-9 13-6+7 8-5+8 7-1+9 17-8+8 17+2-3 7+5-5 6+4-3 7-7+9 13-8+3 10-9+2 6-2+7 14-12+1 12-7+7 13+7-8 12+5-2 14-8+6 14-13+2 14+3-8 16+6-2 10-2+3 9-3+2 17+4-11 6+4-1 16+3-14 9-9+2 20-11+6 13-3+3 8-3+6 15+10-12 19-2+10 18-13+7 16+5-7 14+4-7 14-7+1 12-3+5 20+2-17 16+1-6 20-6+2 13+1-4
7 6 10 18 23 11 20 13 10 22 8 16 2 20 18 16 11 16 17 13 8 11 3 6 11 10 11 13 14 11 11 8 2 8 9 11 5 12 4 9 12 25 4 7 11 10 17 10 22 18 23 16 19 11 8 14 5 12 11 9 9 9 18 11 7 18 2 10 13 19 21 7 7 12 13 11 11 19 5 10 15 10 10 19 14 18 9 16 1 15 13 10 18 6 9 4 5 12 11 14 5 12 20 8 8 6 13 14 5 14 14 15 5 10 4 10 4 20 11 12 1 7 21 14 11 9 18 8 12 9 11 14 11 12 14 20 10 16 6 15 24 17 8 13 8 12 5 4 12 3 10 20 8 7 6 9 19 14 9 11 14 7 12 2 14 16 8 10 10 14 11 15 17 16 7 7 9 8 3 11 3 12 12 15 12 3 9 20 11 8 10 9 5 2 15 13 11 13 27 12 14 11 8 14 5 11 16 10
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 39-28+6 = 17">>
7+94-21 38-12+2 85-23+8 55-21+5 1+76-62 39-28+6 9+97-62 44-22+7 32-21+3 96-85+9 4+99-38 9+52-31 95-81+2 6+65-11 85-42+8 34-21+6 7+48-25 8+63-32 28-15+1 1+24-11 49-32+7 5+34-22 47-16+5 87-46+3 3+52-41 2+25-13 77-46+10 97-81+2 8+45-12 38-25+5 65-12+7 10+69-53 6+97-85 36-21+6 7+42-31 45-13+10 62-21+10 8+63-51 7+77-11 47-23+7 77-43+1 4+55-11 78-53+5 35-12+9 4+56-12 9+54-21 92-61+1 42-21+2 10+74-42 38-25+8 87-61+5 5+23-12 58-42+3 9+28-14 5+29-16 68-34+9 58-14+3 58-42+5 92-61+9 39-17+3 33-11+6 1+94-33 3+57-14 4+66-55 66-55+3 55-33+2 1+25-14 1+67-25 4+44-12 10+54-43 45-12+4 8+85-24 4+83-21 5+83-72 88-76+7 4+24-11 6+27-11 2+58-26 94-22+4 9+73-21 56-15+5 57-41+6 1+92-31 4+96-62 8+46-25 67-26+5 28-13+1 88-63+5 10+38-26 62-51+2 99-66+5 2+46-35 5+39-23 54-23+3 72-31+4 9+73-42 3+54-42 9+27-14 5+37-13 35-23+8 53-11+1 47-24+9 38-12+9 86-33+7 56-11+1 10+63-21 7+72-61 10+66-42 9+77-23 1+79-65 87-72+9 7+94-52 43-12+4 84-22+10 57-13+8 4+48-31 2+86-43 5+97-21 7+56-43 63-31+6 37-25+10 37-24+7 45-23+1 8+36-24 63-21+4 8+54-22 8+83-61 85-52+9 96-82+1 69-16+10 73-12+9 7+74-53 67-52+1 8+35-23 1+88-63 82-71+2 78-63+2 2+26-12 7+28-11 48-22+4 53-42+6 9+86-65 76-11+8 85-22+3 37-23+10 44-12+8 1+34-21 5+69-41 64-22+3 39-23+8 54-31+7 83-21+8 5+28-16 84-11+4 10+53-21 2+23-12 33-12+6 55-42+4 57-36+2 3+33-11 1+83-71 1+83-11 5+23-12 10+37-25 62-31+9 9+57-14 95-62+7 26-12+7 5+84-22 83-41+4 6+69-55 4+59-31 7+96-21 32-21+9 68-44+3 4+33-12 1+72-51 8+59-37 7+37-24 6+76-55 36-24+6 4+97-62 72-21+8 79-42+5 75-42+1 96-45+10 2+94-62 10+26-11 6+63-31 7+33-22 1+93-12 3+88-61 8+99-85 2+62-51 6+85-22 3+45-31 5+74-22 1+53-32 29-17+1 26-11+10 38-12+10 2+49-12 4+36-12 98-44+6 7+63-52 75-21+10 42-31+2 9+48-13
80 28 70 39 15 17 44 29 14 20 65 30 16 60 51 19 30 39 14 14 24 17 36 44 14 14 41 18 41 18 60 26 18 21 18 42 51 20 73 31 35 48 30 32 48 42 32 23 42 21 31 16 19 23 18 43 47 21 40 25 28 62 46 15 14 24 12 43 36 21 37 69 66 16 19 17 22 34 76 61 46 22 62 38 29 46 16 30 22 13 38 13 21 34 45 40 15 22 29 20 43 32 35 60 46 52 18 34 63 15 24 49 35 72 52 21 45 81 20 38 22 20 23 20 46 40 30 42 15 63 70 28 16 20 26 13 17 16 24 30 17 30 73 66 24 40 14 33 45 24 30 70 17 77 42 13 27 17 23 25 13 73 16 22 40 52 40 21 67 46 20 32 82 20 27 25 22 30 20 27 18 39 59 42 34 61 34 25 38 18 82 30 22 13 69 17 57 22 13 25 36 39 28 60 18 64 13 44
<<set _keyboard to "">> <<set _instruction to "">> <<set _example to "Example: 82+83-25 = 140">>
91-24+56 32-18+31 82+83-25 35+51-25 56+72-66 38-29+87 92-67+58 42-24+49 31-22+93 95-86+41 98-39+64 51-32+16 91-85+38 61-15+95 82-45+80 53+31-24 45-28+29 44+62-33 25-18+89 21-14+38 56+42-39 49+32-24 46-17+94 86-47+13 51-42+36 40+23-15 92+76-47 91-87+53 76+42-15 35-28+65 96+62-15 63-59+98 95-87+28 31-26+85 62+41-32 45+43-15 61-22+19 18+61-53 65+71-17 43-27+59 73-47+23 28+51-15 73-58+87 22+32-15 52-16+51 51-24+94 84+91-62 50+41-22 14+72-44 98+35-28 81-67+60 22-13+62 52-48+96 24-18+70 43+26-19 44+64-38 54-18+56 52-48+97 48+91-62 37-19+73 88+31-13 93-34+94 54-17+80 65-56+15 65-56+23 66+53-35 24-15+48 45+65-27 42-14+42 91+53-44 34+42-15 38+84-25 81-23+88 70+82-73 86-78+26 21-14+93 96+21-17 56-28+61 85+92-24 71-23+68 16+55-16 95+51-47 91-32+21 17+92-66 45-26+24 66-27+81 23-18+76 42+83-68 36-28+32 61-52+37 68+96-69 45-36+47 17+33-29 53-24+67 58+71-32 72-43+35 52-44+37 24-17+58 33-17+79 33-25+53 13+51-13 82+44-27 32-18+46 71+83-36 23+51-16 80+61-23 71-62+40 80+62-46 73-27+84 49+75-69 82-77+57 92-54+59 42-13+14 91+82-24 53-17+21 91+41-38 83-46+78 91-27+92 53-46+42 61-33+74 16+35-27 92+34-27 43-25+60 34-26+43 61-23+13 52-24+76 81-63+31 22+82-55 25+92-86 66-19+95 72-13+78 73-54+66 64+62-57 81+33-25 83-68+43 50+81-72 73-68+17 22-16+88 21-18+67 42-28+57 52-43+16 85-66+16 71-16+25 82-25+72 33-27+97 78+42-14 31-24+96 61-49+66 62-24+14 64+33-29 51-34+42 81-23+13 26-18+14 81-14+44 51-23+77 81+22-13 32-13+87 52-45+57 56-37+47 31-13+96 81-73+49 81-13+77 22-13+92 35-27+60 61-32+43 54-17+62 82+92-65 22-16+62 75+82-24 81-43+33 65-59+25 51-39+81 91-26+24 71+31-22 64-48+88 11+32-13 94+71-52 57-39+68 91+34-27 75-56+90 73+34-26 92-67+33 71-22+89 72-49+22 47+72-45 38+95-46 92-64+81 21-16+51 90+61-33 32-23+15 92-13+48 78+81-68 95-89+11 61-52+96 94+82-25 18+41-35 72-24+45 52-33+81 32+27-19 74+21-16 50+32-18 42-19+63 86+32-16 94-48+22 62-53+96 71-25+61 88+41-32 33+43-18
123 45 140 61 62 96 83 67 102 50 123 35 44 141 117 60 46 73 96 45 59 57 123 52 45 48 121 57 103 72 143 102 36 90 71 73 58 26 119 75 49 64 102 39 87 121 113 69 42 105 74 71 100 76 50 70 92 101 77 91 106 153 117 24 32 84 57 83 70 100 61 97 146 79 34 100 100 89 153 116 55 99 80 43 43 120 81 57 40 46 95 56 21 96 97 64 45 65 95 61 51 99 60 118 58 118 49 96 130 55 62 97 43 149 57 94 115 156 49 102 24 99 78 51 51 104 49 49 31 142 137 85 69 89 58 59 22 94 70 71 25 35 80 129 103 106 103 78 52 68 59 71 22 111 105 90 106 64 66 114 57 145 101 68 72 99 109 68 133 71 31 93 89 80 104 30 113 86 98 109 81 58 138 45 74 87 109 56 118 24 127 91 17 105 151 24 93 100 40 79 64 86 102 68 105 107 97 58
/* INITIAL VARIABLES */ <<set $monster to $quest.monsters.random()>> /*grab a random monster from the array */ <<set _NPCImg to $monster.img.random()>> /*setting the image path*/ <<set _taunts to $monster.taunts.shuffle()>> <<set _itemTaunt to "Hey that's my " + $monsterItem.name + "!">> /* DISPLAYING THE MONSTER! */ <div class="centerh"> <div> <div id="monster-message" class="animate__animated animate__zoomInDown"> /* TITLE */ <div class="centerh"> <h2>A Monster Attacks!</h2> </div> /*MONSTER */ <div class="dialogue-left"> /*image */ <div class="dialogue-character"><img @src="_NPCImg" class="animate__animated"></div> /*text */ <div class="dialogue-box-left"> <div class="dialogue-text" id="NPCText"><<type 20ms>>_itemTaunt<</type>></div> </div> </div> /* HEALTHBAR */ /* <div style="align-self: flex-start"> <<showmeter '$healthBar' `_monsterHP / _monsterMaxHP`>> </div> */ </div> </div> </div> <<set setup.characters to [ "Bob", "Mary", "Jane", "Susan", "Harry", "Ronald", "Hermione", ]>> <<set setup.things to [ { one: "apple", multiple: "apples", }, { one: "orange", multiple: "oranges", }, { one: "pear", multiple: "pears", }, { one: "sock", multiple: "socks", }, { one: "cup", multiple: "cups", }, ]>> <<set setup.containers to [ { one: "box", multiple: "boxes", }, { one: "truck", multiple: "trucks", }, { one: "bag", multiple: "bags", }, { one: "shelf", multiple: "shelves", }, { one: "container", multiple: "containers", }, ]>> <<set setup.tables = { numbers: [1,2,3,4,5,6,7,8,9,10,11,12], multiplier: [], Qs: [], QsBackwards: [], As: [], AsStrings: [], }>> <<button "random multiplier!">> <<replace "#multiplier">>Multiplier: <</replace>> <<replace "#Qs">>Qs: <</replace>> <<replace "#QsBackwards">>QsBackwards: <</replace>> <<replace "#As">>As: <</replace>> <<replace "#AsStrings">>AsStrings: <</replace>> <<set _multiplier to random(1,12)>> <<timesTables _multiplier>> /*Calling on the times tables widget */ <<replace "#word-problem">><<include "word problem sentences">><</replace>> /*Calling on the word problem sentence maker */ <</button>> <div id="word-problem"></div> <div id="multiplier">Multiplier: </div> <div id="Qs">Qs: </div> <div id="QsBackwards">QsBackwards: </div> <div id="As">As: </div> <div id="AsStrings">AsStrings: </div>
<<widget "timesTables">> /* Cloning the base tables object to populate it*/ <<set _tablesObject to clone(setup.tables)>> /* setting the multiplier */ <<set _multiplier to $args[0]>> <<set _tablesObject.multiplier to $args[0]>> <<append "#multiplier">><br>_tablesObject.multiplier<</append>> /* Loop that goes through and populates this tables object with questions and answers */ <<for _i to 0; _i lt _tablesObject.numbers.length; _i++>> <<set _number to _i+1>> /* Questions as strings */ <<set _question to _number + "x" + _multiplier>> <<set _tablesObject.Qs.push(_question)>> <<append "#Qs">><br>_tablesObject.Qs[_i]<</append>> /* Qs Backwards as strings*/ <<set _question to _multiplier + "x" + _number>> <<set _tablesObject.QsBackwards.push(_question)>> <<append "#QsBackwards">><br>_tablesObject.QsBackwards[_i]<</append>> /* Answers as values*/ <<set _answer to _number*_multiplier>> <<set _tablesObject.As.push(_answer)>> <<if Number.isInteger(_answer)>> /*VERIFYING these answers ARE integers!! */ <<append "#As">><br>_tablesObject.As[_i]<</append>> <<else>> <<append "#As">><br>NOT an integer<</append>> <</if>> /* Answers as strings*/ <<set _answer to ""+_number*_multiplier>> <<set _tablesObject.AsStrings.push(_answer)>> <<if not Number.isInteger(_answer)>> /*VERIFYING these answers are NOT integers!! */ <<append "#AsStrings">><br>_tablesObject.AsStrings[_i]<</append>> <<else>> <<append "#AsStrings">><br>NOT an integer<</append>> <</if>> <</for>> <</widget>>
<<widget "wordProblem">> /* multiplier*/ <<set _multiplier to _tablesObject.multiplier>> /* random number*/ <<set _number to _tablesObject.numbers.random()>> /* totalThings */ <<set _totalThings to _multiplier*_number>> /* random name */ <<set _name to setup.characters.random()>> /* random thing object (both singular and plural) */ <<set _thingsObject to setup.things.random()>> /* singular thing*/ <<set _thing to _thingsObject.one>> /* plural thing*/ <<set _things to _thingsObject.multiple>> <<set _thingsT to _things>> <<set _thingsM to _things>> /* if _multiplier or _totalThings is low enough, change plural to singular so it shows up properly in the sentences below... */ <<if _multiplier is 1>> <<set _thingsM to _thing>> <</if>> <<if _totalThings is 1>> <<set _thingsT to _thing>> <</if>> /* random container object (both singular and plural) */ <<set _containerObject to setup.containers.random()>> /* singular */ <<set _container to _containerObject.one>> /* plural */ <<set _containers to _containerObject.multiple>> /* if number is low enough, change plural to singular so it shows up properly in the sentences below... */ <<if _number is 1>> <<set _containers to _container>> <</if>> <</widget>>
<h3> <<wordProblem>> _name had _number _containers and put _multiplier _thingsM in each one. How many _thingsObject.multiple were there in total? <br> Answer: _totalThings<br> <<wordProblem>> _name split _totalThings _thingsT evenly between _number _containers. How many _thingsObject.multiple were in each _container?<br> Answer: _multiplier<br> <<wordProblem>> _name has _totalThings _thingsT, and needs to put them in _containers. Each _container can hold _multiplier _thingsM. How many _containers does _name need?<br> Answer: _number </h3>