diff --git a/combat.js b/combat.js index 2b622bc..54a9030 100644 --- a/combat.js +++ b/combat.js @@ -107,7 +107,8 @@ function grappleDevour(attacker) { attacker.stomach.feed(defender); defender.flags.grappled = false; changeMode("explore"); - return "You open your jaws wide, stuffing " + defender.description("the") + "'s head into your gullet and greedily wolfing them down. Delicious."; + 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!"; } else { return "Your jaws open wide, but " + defender.description("the") + " manages to avoid becoming " + attacker.species + " chow."; } @@ -139,8 +140,9 @@ function grappleAnalVore(attacker) { if (success) { attacker.butt.feed(defender); 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 shlk, and the rest of their body follows suit. You moan and gasp, working them deeper and deeper..."; + return "You shove " + defender.description("the") + " between your cheeks. Their head slips into your ass with a wet shlk, 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!"; } else { return "Your grasp and shove " + defender.description("the") + ", but they manage to avoid becoming " + attacker.species + " chow."; } diff --git a/customs.js b/customs.js index eee6e37..d4ff1af 100644 --- a/customs.js +++ b/customs.js @@ -1,4 +1,4 @@ -/* AEZNON COMMISSION */ +/* AEZNON GETA COMMISSION */ function Geta() { Creature.call(this, "Geta", 5, 15, 10); diff --git a/dialog.js b/dialog.js index 4a77b45..dc80fdc 100644 --- a/dialog.js +++ b/dialog.js @@ -71,7 +71,12 @@ function FallenFoe(foe) { { let nodeEat = new DialogNode(); this.addChoice("Devour!",nodeEat); - nodeEat.text = "You grab your helpless prey and force them down your gullet."; + 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; + }); + nodeEat.hooks.push(function() { player.stomach.feed(foe); }) @@ -80,7 +85,11 @@ function FallenFoe(foe) { { let nodeSpare = new DialogNode(); this.addChoice("Spare",nodeSpare); - nodeSpare.text = "You decide to leave your foe uneaten."; + nodeSpare.text = "You decide to leave your foe uneaten. You do help yourself to the $" + foe.cash + " in their pockets, though."; + + nodeSpare.hooks.push(function() { + player.cash += foe.cash; + }); } { @@ -128,3 +137,59 @@ 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."; + + { + 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.hooks.push(function() { + player.cash -= 2; + }); + + nodeCandy.requirements.push(function(player) { + return player.cash > 2; + }); + } + + { + 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.hooks.push(function() { + player.cash -= 2; + }); + + nodeSoda.requirements.push(function(player) { + return player.cash > 2; + }); + } + + { + 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.hooks.push(function() { + player.stomach.feed(prey); + player.cash -= 10; + }); + + nodeMicro.requirements.push(function(player) { + return player.cash > 10; + }); + } + + { + let nodeCancel = new DialogNode(); + this.addChoice("Nevermind", nodeCancel); + nodeCancel.text = "You decide to not purchase anything."; + } +} diff --git a/feast.html b/feast.html index 278697b..329c92b 100644 --- a/feast.html +++ b/feast.html @@ -30,6 +30,7 @@
Time: to file a bug report, because you shouldn't see this!
Vim: 15
+
Spondulicks: 150000
Pulchritude: 44
Imagination: 97
Candy Corn: 3
diff --git a/feast.js b/feast.js index 002e9db..58b44a2 100644 --- a/feast.js +++ b/feast.js @@ -2,6 +2,8 @@ let currentRoom = null; let currentDialog = null; +let currentFoe = null; + let dirButtons = []; let actionButtons = []; @@ -205,6 +207,7 @@ function updateDisplay() { document.getElementById("time").innerHTML = "Time: " + renderTime(time); document.getElementById("stat-name").innerHTML = "Name: " + player.name; document.getElementById("stat-health").innerHTML = "Health: " + round(player.health,0) + "/" + round(player.maxHealth,0); + document.getElementById("stat-cash").innerHTML = "Cash: $" + round(player.cash,0); document.getElementById("stat-stamina").innerHTML = "Stamina: " + round(player.stamina,0) + "/" + round(player.maxStamina,0); document.getElementById("stat-fullness").innerHTML = "Fullness: " + round(player.fullness(),0); if (player.prefs.scat) { diff --git a/objects.js b/objects.js index b7d1125..18e6274 100644 --- a/objects.js +++ b/objects.js @@ -114,3 +114,14 @@ function NatureTrailExercise() { } }); } + +function VendingMachine() { + GameObject.call(this, "Vending Machine"); + + this.actions.push({ + "name": "Use the vending machine", + "action": function() { + startDialog(new VendingMachinePurchase()); + } + }); +} diff --git a/vore.js b/vore.js index 94ac97a..f4c6ba5 100644 --- a/vore.js +++ b/vore.js @@ -44,6 +44,8 @@ function Creature(name = "Creature", str=10, dex=10, con=10) { analVore: true, gore: true }; + + this.cash = Math.floor(Math.random() * 10 + 5); } function Player(name = "Player") { @@ -71,6 +73,8 @@ function Player(name = "Player") { this.attacks.push(new flee(this)); this.backupAttack = new pass(this); + + this.cash = 100; } function Anthro(name="Anthro") { @@ -172,8 +176,11 @@ function Micro() { this.mass = 0.1 * (Math.random()/2 - 0.25 + 1); this.species = pick(["dog","cat","lizard","deer","wolf","fox"]); - this.description = function() { - return "micro " + this.species; + this.description = function(prefix = "") { + if (prefix == "") + return "micro " + this.species; + else + return prefix + " micro " + this.species; }; } diff --git a/world.js b/world.js index 3d4ed90..41f5c44 100644 --- a/world.js +++ b/world.js @@ -55,9 +55,9 @@ let locationsSrc = [ "desc": "A bare living room", "conn": [ { - "name": "North Street", - "dir": WEST, - "desc": "You step outside." + "name": "Lobby", + "dir": NORTH, + "desc": "You leave your apartment and head to the lobby." }, { "name": "Bedroom", @@ -80,9 +80,9 @@ let locationsSrc = [ "desc": "You wander into the dark alley" }, { - "name": "Living Room", + "name": "Lobby", "dir": EAST, - "desc": "You step back into your apartment" + "desc": "You step into your apartment's lobby" }, { "name": "Crossroads", @@ -99,6 +99,25 @@ let locationsSrc = [ Nerd ] }, + { + "name": "Lobby", + "desc": "The modest lobby of your modest apartment complex", + "conn": [ + { + "name": "North Street", + "dir": WEST, + "desc": "You walk out into the street" + }, + { + "name": "Living Room", + "dir": SOUTH, + "desc": "You walk back into your apartment" + } + ], + "objs": [ + VendingMachine + ] + }, { "name": "Alley", "desc": "A suspicious alley", @@ -139,6 +158,11 @@ let locationsSrc = [ "name": "South Street", "dir": SOUTH, "desc": "You walk south" + }, + { + "name": "Corner Mart", + "dir": SOUTH_EAST, + "desc": "You walk into the convenience store" } ] }, @@ -209,6 +233,17 @@ let locationsSrc = [ startCombat(new Fen()); } ] + }, + { + "name": "Corner Mart", + "desc": "A convenience store with a variety of snacks and supplies", + "conn": [ + { + "name": "Crossroads", + "dir": NORTH_WEST, + "desc": "You leave the store." + } + ] } ];