浏览代码

Added a vending machine, an empty corner mart, and ECONOMICS

tags/v0.2.8
Fen Dweller 7 年前
父节点
当前提交
102c80c533
共有 8 个文件被更改,包括 136 次插入12 次删除
  1. +4
    -2
      combat.js
  2. +1
    -1
      customs.js
  3. +67
    -2
      dialog.js
  4. +1
    -0
      feast.html
  5. +3
    -0
      feast.js
  6. +11
    -0
      objects.js
  7. +9
    -2
      vore.js
  8. +40
    -5
      world.js

+ 4
- 2
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 <i>shlk</i>, 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 <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!";
} else {
return "Your grasp and shove " + defender.description("the") + ", but they manage to avoid becoming " + attacker.species + " chow.";
}


+ 1
- 1
customs.js 查看文件

@@ -1,4 +1,4 @@
/* AEZNON COMMISSION */
/* AEZNON GETA COMMISSION */

function Geta() {
Creature.call(this, "Geta", 5, 15, 10);


+ 67
- 2
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&trade;";

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.";
}
}

+ 1
- 0
feast.html 查看文件

@@ -30,6 +30,7 @@
<div id="stats">
<div class="stat-line" id="time">Time: to file a bug report, because you shouldn't see this!</div>
<div class="stat-line" id="stat-name">Vim: 15</div>
<div class="stat-line" id="stat-cash">Spondulicks: 150000</div>
<div class="stat-line" id="stat-health">Pulchritude: 44</div>
<div class="stat-line" id="stat-stamina">Imagination: 97</div>
<div class="stat-line" id="stat-fullness">Candy Corn: 3</div>


+ 3
- 0
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) {


+ 11
- 0
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());
}
});
}

+ 9
- 2
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;
};
}



+ 40
- 5
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."
}
]
}
];



正在加载...
取消
保存