| @@ -38,10 +38,10 @@ function punchAttack(attacker) { | |||
| name: "Punch", | |||
| desc: "Punch a nerd", | |||
| attack: function(defender) { | |||
| return "You punch " + defender.description("the") + " for " + attack(attacker, defender, attacker.str) + " damage"; | |||
| return ["You punch " + defender.description("the") + " for " + attack(attacker, defender, attacker.str) + " damage"]; | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| return attacker.description("The") + " punches you for " + attack(attacker, defender, attacker.str) + " damage"; | |||
| return [attacker.description("The") + " punches you for " + attack(attacker, defender, attacker.str) + " damage"]; | |||
| }, requirements: [ | |||
| function(attacker, defender) { return isNormal(attacker) && isNormal(defender); } | |||
| ], | |||
| @@ -55,10 +55,10 @@ function flankAttack(attacker) { | |||
| name: "Flank", | |||
| desc: "Be sneaky", | |||
| attack: function(defender) { | |||
| return "You run around " + defender.description("the") + " and attack for " + attack(attacker, defender, attacker.dex) + " damage"; | |||
| return ["You run around " + defender.description("the") + " and attack for " + attack(attacker, defender, attacker.dex) + " damage"]; | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| return attacker.description("The") + " runs past you, then turns and hits you for " + attack(attacker, defender, attacker.str) + " damage"; | |||
| return [attacker.description("The") + " runs past you, then turns and hits you for " + attack(attacker, defender, attacker.str) + " damage"]; | |||
| }, requirements: [ | |||
| function(attacker, defender) { return isNormal(attacker) && isNormal(defender); } | |||
| ], | |||
| @@ -75,18 +75,18 @@ function grapple(attacker) { | |||
| let success = statHealthCheck(attacker, defender, "str"); | |||
| if (success) { | |||
| defender.flags.grappled = true; | |||
| return "You charge at " + defender.description("the") + ", tackling them and knocking them to the ground."; | |||
| return ["You charge at " + defender.description("the") + ", tackling them and knocking them to the ground."]; | |||
| } else { | |||
| return "You charge at " + defender.description("the") + ", but they dodge out of the way!"; | |||
| return ["You charge at " + defender.description("the") + ", but they dodge out of the way!"]; | |||
| } | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| let success = Math.random() < 0.5; | |||
| if (success) { | |||
| defender.flags.grappled = true; | |||
| return attacker.description("The") + " lunges at you, pinning you to the floor!"; | |||
| return [attacker.description("The") + " lunges at you, pinning you to the floor!"]; | |||
| } else { | |||
| return attacker.description("The") + " tries to tackle you, but you deftly avoid them."; | |||
| return [attacker.description("The") + " tries to tackle you, but you deftly avoid them."]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -108,9 +108,9 @@ function grappleDevour(attacker) { | |||
| defender.flags.grappled = false; | |||
| changeMode("explore"); | |||
| attacker.cash += defender.cash; | |||
| return "You open your jaws wide, stuffing " + defender.description("the") + "'s head into your gullet and greedily wolfing them down. Delicious. You hack up their wallet with $" + defender.cash + " inside a moment later. Nice!"; | |||
| return ["You open your jaws wide, stuffing " + defender.description("the") + "'s head into your gullet and greedily wolfing them down. Delicious.", newline, "You hack up their wallet with $" + defender.cash + " inside a moment later. Nice!"]; | |||
| } else { | |||
| return "Your jaws open wide, but " + defender.description("the") + " manages to avoid becoming " + attacker.species + " chow."; | |||
| return ["Your jaws open wide, but " + defender.description("the") + " manages to avoid becoming " + attacker.species + " chow."]; | |||
| } | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| @@ -118,9 +118,9 @@ function grappleDevour(attacker) { | |||
| if(success) { | |||
| defender.flags.grappled = false; | |||
| changeMode("eaten"); | |||
| return attacker.description("The") + " forces your head into their sloppy jaws, devouring you despite your frantic struggles. Glp."; | |||
| return [attacker.description("The") + " forces your head into their sloppy jaws, devouring you despite your frantic struggles. Glp."]; | |||
| } else { | |||
| return attacker.description("The") + " tries to swallow you down, but you manage to resist their hunger."; | |||
| return [attacker.description("The") + " tries to swallow you down, but you manage to resist their hunger."]; | |||
| } | |||
| }, requirements: [ | |||
| function(attacker, defender) { return isNormal(attacker) && isGrappled(defender) && defender.flags.shrunk != true; } | |||
| @@ -142,9 +142,9 @@ function grappleAnalVore(attacker) { | |||
| defender.flags.grappled = false; | |||
| attacker.cash += defender.cash; | |||
| changeMode("explore"); | |||
| return "You shove " + defender.description("the") + " between your cheeks. Their head slips into your ass with a wet <i>shlk</i>, and the rest of their body follows suit. You moan and gasp, working them deeper and deeper...and noticing their wallet with $" + defender.cash + " on the ground. Score!"; | |||
| return ["You shove " + defender.description("the") + " between your cheeks. Their head slips into your ass with a wet <i>shlk</i>, and the rest of their body follows suit. You moan and gasp, working them deeper and deeper.", newline, "You notice their wallet with $" + defender.cash + " lying on the ground. Score!"]; | |||
| } else { | |||
| return "Your grasp and shove " + defender.description("the") + ", but they manage to avoid becoming " + attacker.species + " chow."; | |||
| return ["Your grasp and shove " + defender.description("the") + ", but they manage to avoid becoming " + attacker.species + " chow."]; | |||
| } | |||
| }, requirements: [ | |||
| function(attacker, defender) { return isNormal(attacker) && isGrappled(defender) && defender.flags.shrunk != true ; } | |||
| @@ -161,7 +161,7 @@ function grappleRelease(attacker) { | |||
| desc: "Release your opponent", | |||
| attack: function(defender) { | |||
| defender.flags.grappled = false; | |||
| return "You throw " + defender.description("the") + " back, dealing " + attack(attacker, defender, attacker.str*1.5) + " damage"; | |||
| return ["You throw " + defender.description("the") + " back, dealing " + attack(attacker, defender, attacker.str*1.5) + " damage"]; | |||
| }, requirements: [ | |||
| function(attacker, defender) { return isNormal(attacker) && isGrappled(defender); } | |||
| ], | |||
| @@ -177,18 +177,18 @@ function grappledStruggle(attacker) { | |||
| let success = statHealthCheck(attacker, defender, "str"); | |||
| if (success) { | |||
| attacker.flags.grappled = false; | |||
| return "You struggle and shove " + defender.description("the") + " off of you."; | |||
| return ["You struggle and shove " + defender.description("the") + " off of you."]; | |||
| } else { | |||
| return "You struggle, but to no avail."; | |||
| return ["You struggle, but to no avail."]; | |||
| } | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| let success = statHealthCheck(attacker, defender, "str"); | |||
| if (success) { | |||
| attacker.flags.grappled = false; | |||
| return "Your prey shoves you back, breaking your grapple!"; | |||
| return ["Your prey shoves you back, breaking your grapple!"]; | |||
| } else { | |||
| return "Your prey squirms, but remains pinned."; | |||
| return ["Your prey squirms, but remains pinned."]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -207,9 +207,9 @@ function grappledReverse(attacker) { | |||
| if (success) { | |||
| attacker.flags.grappled = false; | |||
| defender.flags.grappled = true; | |||
| return "You surprise " + defender.description("the") + " with a burst of strength, flipping them over and pinning them."; | |||
| return ["You surprise " + defender.description("the") + " with a burst of strength, flipping them over and pinning them."]; | |||
| } else { | |||
| return "You try to throw your opponent off of you, but fail."; | |||
| return ["You try to throw your opponent off of you, but fail."]; | |||
| } | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| @@ -217,9 +217,9 @@ function grappledReverse(attacker) { | |||
| if (success) { | |||
| attacker.flags.grappled = false; | |||
| defender.flags.grappled = true; | |||
| return "Your prey suddenly grabs hold and flips you over, pinning you!"; | |||
| return ["Your prey suddenly grabs hold and flips you over, pinning you!"]; | |||
| } else { | |||
| return "Your prey tries to grab at you, but you keep them under control."; | |||
| return ["Your prey tries to grab at you, but you keep them under control."]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -237,9 +237,9 @@ function shrunkGrapple(attacker) { | |||
| let success = statCheck(attacker, defender, "dex") || statCheck(attacker, defender, "dex"); | |||
| if (success) { | |||
| defender.flags.grappled = true; | |||
| return "You snatch up " + defender.description("the"); | |||
| return ["You snatch up " + defender.description("the")]; | |||
| } else { | |||
| return "You try to grab " + defender.description("the") + ", but they elude your grasp."; | |||
| return ["You try to grab " + defender.description("the") + ", but they elude your grasp."]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -258,7 +258,7 @@ function shrunkSwallow(attacker) { | |||
| attack: function(defender) { | |||
| changeMode("explore"); | |||
| attacker.stomach.feed(defender); | |||
| return "With a light swallow, " + defender.description("the") + " is dragged down to your sloppy guts."; | |||
| return ["With a light swallow, " + defender.description("the") + " is dragged down to your sloppy guts."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -277,7 +277,7 @@ function shrunkStomp(attacker) { | |||
| let success = statCheck(attacker, defender, "dex") || statCheck(attacker, defender, "dex") || defender.stamina == 0; | |||
| defender.stamina = 0; | |||
| defender.health = Math.max(0, defender.health - 50); | |||
| return "Your paw comes crashing down on " + defender.description("the") + ", burying them under your heavy toes and pinning them down hard."; | |||
| return ["Your paw comes crashing down on " + defender.description("the") + ", burying them under your heavy toes and pinning them down hard."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -296,9 +296,9 @@ function flee(attacker) { | |||
| if (success) { | |||
| attacker.clear(); | |||
| changeMode("explore"); | |||
| return "You successfully run away."; | |||
| return ["You successfully run away."]; | |||
| } else { | |||
| return "You can't escape!"; | |||
| return ["You can't escape!"]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -311,10 +311,10 @@ function pass(attacker) { | |||
| name: "Pass", | |||
| desc: "You can't do anything!", | |||
| attack: function(defender) { | |||
| return "You do nothing."; | |||
| return ["You do nothing."]; | |||
| }, | |||
| attackPlayer: function(defender) { | |||
| return attacker.description("The") + " does nothing."; | |||
| return [attacker.description("The") + " does nothing."]; | |||
| }, | |||
| priority: 0, | |||
| }; | |||
| @@ -332,7 +332,7 @@ function devourPlayer(attacker) { | |||
| ], | |||
| attackPlayer: function(defender) { | |||
| changeMode("eaten"); | |||
| return "The voracious " + attacker.description() + " pins you down and devours you in seconds."; | |||
| return ["The voracious " + attacker.description() + " pins you down and devours you in seconds."]; | |||
| }, | |||
| priority: 1, | |||
| }; | |||
| @@ -358,7 +358,7 @@ function poke(attacker) { | |||
| name: "Poke", | |||
| desc: "Poke a nerd", | |||
| attackPlayer: function(defender) { | |||
| return attacker.description("The") + " pokes you on the snout for " + attack(attacker, defender, 1e12) + " damage"; | |||
| return [attacker.description("The") + " pokes you on the snout for " + attack(attacker, defender, 1e12) + " damage"]; | |||
| }, | |||
| priority: 1, | |||
| }; | |||
| @@ -368,7 +368,7 @@ function digestPlayerStomach(predator,damage=20) { | |||
| return { | |||
| digest: function(player) { | |||
| attack(predator, player, damage); | |||
| return predator.description("The") + "'s stomach grinds over your body, swiftly digesting you."; | |||
| return [predator.description("The") + "'s stomach grinds over your body, swiftly digesting you."]; | |||
| }, | |||
| priority: 1, | |||
| }; | |||
| @@ -378,7 +378,7 @@ function instakillPlayerStomach(pedator) { | |||
| return { | |||
| digest: function(player) { | |||
| player.health = -100; | |||
| return "The stomach walls churn, clench, and swiftly crush you into nothingnes."; | |||
| return ["The stomach walls churn, clench, and swiftly crush you into nothingnes."]; | |||
| }, | |||
| priority: 1, | |||
| weight: function(attacker, defender) { return 1/3; }, | |||
| @@ -38,10 +38,10 @@ function getaShrink(attacker) { | |||
| if (success) { | |||
| defender.flags.shrunk = true; | |||
| return attacker.description() + " pulls a strange device from his pocket and points it at you. A blinding flash envelops your vision...and as your sight returns, you find yourself shrunken down to no more than two inches tall."; | |||
| return [attacker.description() + " pulls a strange device from his pocket and points it at you. A blinding flash envelops your vision...and as your sight returns, you find yourself shrunken down to no more than two inches tall."]; | |||
| } else { | |||
| attacker.flags.shrunk = true; | |||
| return attacker.description() + " pulls a strange device from his pocket and points it at you. A blinding flash envelops your vision...and as your sight returns, you see that he's shrunk himself!"; | |||
| return [attacker.description() + " pulls a strange device from his pocket and points it at you. A blinding flash envelops your vision...and as your sight returns, you see that he's shrunk himself!"]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -57,7 +57,7 @@ function getaGrab(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| defender.flags.grappled = true; | |||
| return attacker.description() + " leans down and snatches you up, stuffing you into his maw."; | |||
| return [attacker.description() + " leans down and snatches you up, stuffing you into his maw."]; | |||
| }, | |||
| conditions: [ | |||
| function(attacker, defender) { | |||
| @@ -77,7 +77,7 @@ function getaTease(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| defender.stamina = Math.max(defender.stamina - 25, 0); | |||
| return attacker.description() + " grinds you against the roof of his maw with his tongue."; | |||
| return [attacker.description() + " grinds you against the roof of his maw with his tongue."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -92,7 +92,7 @@ function getaSuckle(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| defender.stamina = Math.max(defender.stamina - 45, 0); | |||
| return attacker.description() + " shuts his jaws and suckles on you."; | |||
| return [attacker.description() + " shuts his jaws and suckles on you."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -107,7 +107,7 @@ function getaSalivaSwallow(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| defender.stamina = Math.max(defender.stamina - 15, 0); | |||
| return attacker.description() + " swallows, draining the drool from his jaws - leaving you on the precipice of his gullet."; | |||
| return [attacker.description() + " swallows, draining the drool from his jaws - leaving you on the precipice of his gullet."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -122,7 +122,7 @@ function getaSwallow(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| changeMode("eaten"); | |||
| return attacker.description() + " shuts his jaws and swallows, dragging you down into his tight throat and dumping you into a caustic stomach."; | |||
| return [attacker.description() + " shuts his jaws and swallows, dragging you down into his tight throat and dumping you into a caustic stomach."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -140,9 +140,9 @@ function getaStomp(attacker) { | |||
| if (success) { | |||
| defender.health = Math.max(-100, defender.health - 50 - Math.round(Math.random() * 25)); | |||
| defender.stamina = 0; | |||
| return attacker.description() + "'s paw comes crashing down on your little body, smashing you into the dirt."; | |||
| return [attacker.description() + "'s paw comes crashing down on your little body, smashing you into the dirt."]; | |||
| } else { | |||
| return "You dive away as " + attacker.description() + "'s paw slams down, narrowly missing your little body."; | |||
| return ["You dive away as " + attacker.description() + "'s paw slams down, narrowly missing your little body."]; | |||
| } | |||
| }, | |||
| requirements: [ | |||
| @@ -158,7 +158,7 @@ function getaStompFinish(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| defender.health = -100; | |||
| return attacker.description() + " looms over your stunned body. You can only watch as his toes flex, squeeze...and come down hard. The fox's paw crushes you like an insect, tearing you open and spilling your guts across the dusty trail. He grinds you a few times more for good measure, leaving a disfigured, broken mess in your place."; | |||
| return [attacker.description() + " looms over your stunned body. You can only watch as his toes flex, squeeze...and come down hard. The fox's paw crushes you like an insect, tearing you open and spilling your guts across the dusty trail. He grinds you a few times more for good measure, leaving a disfigured, broken mess in your place."]; | |||
| }, | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| @@ -190,13 +190,13 @@ function GetaObj() { | |||
| function GetaDialog() { | |||
| DialogNode.call(this); | |||
| this.text = "You approach the sandy-furred fox."; | |||
| this.text = ["You approach the sandy-furred fox."]; | |||
| { | |||
| let nodeFight = new DialogNode(); | |||
| this.addChoice("He certainly looks tasty...", nodeFight); | |||
| nodeFight.text = "You stalk up to your prey, but he sees you coming. You're going to have to fight!"; | |||
| nodeFight.text = ["You stalk up to your prey, but he sees you coming. You're going to have to fight!"]; | |||
| nodeFight.hooks.push( function(){ | |||
| currentFoe = new Geta(); | |||
| changeMode("combat"); | |||
| @@ -1,7 +1,7 @@ | |||
| "use strict"; | |||
| function DialogNode() { | |||
| this.text = "Foo bar baz."; | |||
| this.text = []; | |||
| this.hooks = []; | |||
| this.requirements = []; | |||
| @@ -23,15 +23,15 @@ function EatDude() { | |||
| let nerd = new Anthro(); | |||
| this.text = "You approach " + nerd.description("the"); | |||
| this.text = ["You approach " + nerd.description("the")]; | |||
| let eatHim = new DialogNode(); | |||
| eatHim.text = "You eat the nerd. Burp."; | |||
| eatHim.text = ["You eat the nerd. Burp."]; | |||
| eatHim.hooks.push(function() { player.stomach.feed(nerd); }); | |||
| let dontEatHim = new DialogNode(); | |||
| dontEatHim.text = "You don't eat the nerd."; | |||
| dontEatHim.text = ["You don't eat the nerd."]; | |||
| this.addChoice("Eat him lol",eatHim); | |||
| this.addChoice("Actually don't",dontEatHim); | |||
| @@ -40,25 +40,25 @@ function EatDude() { | |||
| function PhoneCall() { | |||
| DialogNode.call(this); | |||
| this.text = "You pick up the phone. Who do you want to call?"; | |||
| this.text = ["You pick up the phone. Who do you want to call?"]; | |||
| { | |||
| let nodeFen = new DialogNode(); | |||
| this.addChoice("Fen",nodeFen); | |||
| nodeFen.text = "You dial Fen's number. Milliseconds later, he kicks open your front door and dabs on you, then runs away."; | |||
| nodeFen.text = ["You dial Fen's number. Milliseconds later, he kicks open your front door and dabs on you, then runs away."]; | |||
| } | |||
| { | |||
| let nodeNerd = new DialogNode(); | |||
| this.addChoice("Some nerd",nodeNerd); | |||
| nodeNerd.text = "You dial some nerd. He shows up at your front door."; | |||
| nodeNerd.text = ["You dial some nerd. He shows up at your front door."]; | |||
| nodeNerd.hooks.push(function() { startDialog(new EatDude()); }); | |||
| } | |||
| { | |||
| let nodeCrash = new DialogNode(); | |||
| this.addChoice("Crash the game",nodeCrash); | |||
| nodeCrash.text = "Oh no oops"; | |||
| nodeCrash.text = ["Oh no oops"]; | |||
| nodeCrash.hooks.push(function() { potato() }); | |||
| } | |||
| } | |||
| @@ -66,12 +66,12 @@ function PhoneCall() { | |||
| function FallenFoe(foe) { | |||
| DialogNode.call(this); | |||
| this.text = "What do you want to do with your enemy?"; | |||
| this.text = ["What do you want to do with your enemy?"]; | |||
| { | |||
| let nodeEat = new DialogNode(); | |||
| this.addChoice("Devour!",nodeEat); | |||
| nodeEat.text = "You grab your helpless prey and force them down your gullet. You hack up their wallet a minute later, finding $" + foe.cash + " inside."; | |||
| nodeEat.text = ["You grab your helpless prey and force them down your gullet. You hack up their wallet a minute later, finding $" + foe.cash + " inside."]; | |||
| nodeEat.hooks.push(function() { | |||
| player.cash += foe.cash; | |||
| @@ -85,7 +85,7 @@ function FallenFoe(foe) { | |||
| { | |||
| let nodeSpare = new DialogNode(); | |||
| this.addChoice("Spare",nodeSpare); | |||
| nodeSpare.text = "You decide to leave your foe uneaten. You do help yourself to the $" + foe.cash + " in their pockets, though."; | |||
| nodeSpare.text = ["You decide to leave your foe uneaten.", newline, "You do help yourself to the $" + foe.cash + " in their pockets, though."]; | |||
| nodeSpare.hooks.push(function() { | |||
| player.cash += foe.cash; | |||
| @@ -95,7 +95,7 @@ function FallenFoe(foe) { | |||
| { | |||
| let nodeCrush = new DialogNode(); | |||
| this.addChoice("Crush",nodeCrush); | |||
| nodeCrush.text = "You slam your paw down hard, crushing " + foe.description("the") + " like a bug"; | |||
| nodeCrush.text = ["You slam your paw down hard, crushing " + foe.description("the") + " like a bug"]; | |||
| nodeCrush.requirements.push( function(attacker, defender) { | |||
| return defender.flags.shrunk == true; | |||
| }); | |||
| @@ -105,12 +105,12 @@ function FallenFoe(foe) { | |||
| function NatureExercise() { | |||
| DialogNode.call(this); | |||
| this.text = "What do you want to do?"; | |||
| this.text = ["What do you want to do?"]; | |||
| { | |||
| let nodeStrength = new DialogNode(); | |||
| this.addChoice("Rock Climbing (+STR)", nodeStrength); | |||
| nodeStrength.text = "You clamber up walls for a while. You feel a little stronger."; | |||
| nodeStrength.text = ["You clamber up walls for a while. You feel a little stronger."]; | |||
| nodeStrength.hooks.push(function() { | |||
| player.str += 1; | |||
| advanceTime(60*30); | |||
| @@ -120,7 +120,7 @@ function NatureExercise() { | |||
| { | |||
| let nodeDexterity = new DialogNode(); | |||
| this.addChoice("Jogging (+DEX)", nodeDexterity); | |||
| nodeDexterity.text = "You go run for a run around the three-mile-long trail. You feel a little more agile."; | |||
| nodeDexterity.text = ["You go run for a run around the three-mile-long trail. You feel a little more agile."]; | |||
| nodeDexterity.hooks.push(function() { | |||
| player.dex += 1; | |||
| advanceTime(60*30); | |||
| @@ -130,7 +130,7 @@ function NatureExercise() { | |||
| { | |||
| let nodeConstitution = new DialogNode(); | |||
| this.addChoice("Bang your head on a tree (+CON)", nodeConstitution); | |||
| nodeConstitution.text = "You bash your face on a tree for half an hour. I guess that helps."; | |||
| nodeConstitution.text = ["You bash your face on a tree for half an hour. I guess that helps."]; | |||
| nodeConstitution.hooks.push(function() { | |||
| player.con += 1; | |||
| advanceTime(60*30); | |||
| @@ -141,12 +141,12 @@ function NatureExercise() { | |||
| function VendingMachinePurchase() { | |||
| DialogNode.call(this); | |||
| this.text = "You walk up to the vending machine. A variety of foodstuffs and drinks are on display...along with some more unconventional items."; | |||
| this.text = ["You walk up to the vending machine. A variety of foodstuffs and drinks are on display...along with some more unconventional items."]; | |||
| { | |||
| let nodeCandy = new DialogNode(); | |||
| this.addChoice("Buy a candy bar ($2)", nodeCandy); | |||
| nodeCandy.text = "You insert two dollar bills into the machine and select the candy bar. Chocolate and nougat, mmm."; | |||
| nodeCandy.text = ["You insert two dollar bills into the machine and select the candy bar. Chocolate and nougat, mmm."]; | |||
| nodeCandy.hooks.push(function() { | |||
| player.cash -= 2; | |||
| @@ -160,7 +160,7 @@ function VendingMachinePurchase() { | |||
| { | |||
| let nodeSoda = new DialogNode(); | |||
| this.addChoice("Buy a soda ($2)", nodeSoda); | |||
| nodeSoda.text = "You insert a dollar and coins, then select a soda. You're pretty you saw something on the news about it turning people purple, but you can't resist that delicious Citrus Substitute Flavor™"; | |||
| nodeSoda.text = ["You insert a dollar and coins, then select a soda. You're pretty you saw something on the news about it turning people purple, but you can't resist that delicious Citrus Substitute Flavor™"]; | |||
| nodeSoda.hooks.push(function() { | |||
| player.cash -= 2; | |||
| @@ -175,7 +175,7 @@ function VendingMachinePurchase() { | |||
| let prey = new Micro(); | |||
| let nodeMicro = new DialogNode(); | |||
| this.addChoice("Buy a micro ($10)", nodeMicro); | |||
| nodeMicro.text = "You stuff a wad of bills into the machine. " + prey.description("A") + " tumbles into the vending slot; you scoop them up and stuff them into your jaws without a second thought. Tasty."; | |||
| nodeMicro.text = ["You stuff a wad of bills into the machine. " + prey.description("A") + " tumbles into the vending slot; you scoop them up and stuff them into your jaws without a second thought. Tasty."]; | |||
| nodeMicro.hooks.push(function() { | |||
| player.stomach.feed(prey); | |||
| @@ -190,6 +190,6 @@ function VendingMachinePurchase() { | |||
| { | |||
| let nodeCancel = new DialogNode(); | |||
| this.addChoice("Nevermind", nodeCancel); | |||
| nodeCancel.text = "You decide to not purchase anything."; | |||
| nodeCancel.text = ["You decide to not purchase anything."]; | |||
| } | |||
| } | |||
| @@ -332,6 +332,7 @@ function saveSettings() { | |||
| function retrieveSettings() { | |||
| return JSON.parse(window.localStorage.getItem("settings")); | |||
| } | |||
| function update(lines=[]) { | |||
| let log = document.getElementById("log"); | |||
| for (let i=0; i<lines.length; i++) { | |||
| @@ -382,7 +383,7 @@ function startCombat(opponent) { | |||
| } | |||
| function attackClicked(index) { | |||
| update([playerAttacks[index].attack(currentFoe)]); | |||
| update(playerAttacks[index].attack(currentFoe)); | |||
| if (currentFoe.health <= 0) { | |||
| update([currentFoe.description("The") + " falls to the ground!"]); | |||
| @@ -394,7 +395,7 @@ function attackClicked(index) { | |||
| attack = currentFoe.backupAttack; | |||
| } | |||
| update([attack.attackPlayer(player)]); | |||
| update(attack.attackPlayer(player)); | |||
| if (player.health <= -100) { | |||
| update(["You die..."]); | |||
| @@ -446,14 +447,14 @@ function struggleHovered(index) { | |||
| function startDialog(dialog) { | |||
| currentDialog = dialog; | |||
| changeMode("dialog"); | |||
| update([currentDialog.text]); | |||
| update(currentDialog.text); | |||
| currentDialog.visit(); | |||
| updateDisplay(); | |||
| } | |||
| function dialogClicked(index) { | |||
| currentDialog = currentDialog.choices[index].node; | |||
| update([currentDialog.text]); | |||
| update(currentDialog.text); | |||
| currentDialog.visit(); | |||
| if (currentDialog.choices.length == 0 && mode == "dialog") { | |||
| changeMode("explore"); | |||