Browse Source

Added names and one non-fatal stomp

tags/v0.7.0
Fen Dweller 7 years ago
parent
commit
d765aaad67
3 changed files with 32 additions and 6 deletions
  1. +2
    -1
      game.js
  2. +26
    -5
      recursive-desc.js
  3. +4
    -0
      stroll.html

+ 2
- 1
game.js View File

@@ -18,6 +18,7 @@ victims = {};
var macro =
{
"scaling": function(value, scale, factor) { return value * Math.pow(scale,factor); },
"name": "",
"species": "crux",
"color" : "blue",
"baseHeight": 2.26,
@@ -382,7 +383,7 @@ var macro =

get description() {
result = [];
line = "You are a " + length(macro.height, unit, true) + " tall " + macro.species + ". You weigh " + mass(macro.mass, unit) + ".";
line = "You are " + (macro.name == "" ? "" : macro.name + ", ") + "a " + length(macro.height, unit, true) + " tall " + macro.species + ". You weigh " + mass(macro.mass, unit) + ".";
result.push(line);

if (this.arousalEnabled) {


+ 26
- 5
recursive-desc.js View File

@@ -19,6 +19,10 @@ rules["balls"] = [];
rules["womb"] = [];
rules["bowels"] = [];

function isNonFatal(macro) {
return macro.brutality == 0;
}

function isFatal(macro) {
return macro.brutality >= 1;
}
@@ -52,11 +56,8 @@ function hasExactly(container, thing, amount) {
}

function hasOnly(container, things) {
for (var key in container.contents) {
if (container.contents.hasOwnProperty(key))
if (!things.includes(key))
return false;
}
if (!hasNothingElse(container, things))
return false;

for (var i=0; i<things.length; i++) {
if (!container.contents.hasOwnProperty(things[i]))
@@ -66,6 +67,16 @@ function hasOnly(container, things) {
return true;
}

function hasNothingElse(container, things) {
for (var key in container.contents) {
if (container.contents.hasOwnProperty(key))
if (!things.includes(key))
return false;
}

return true;
}

function nothingLarger(container, thing) {
for (var key in container.contents)
if (container.contents.hasOwnProperty(key))
@@ -331,3 +342,13 @@ rules["stomp"].push({
return "Your shadow falls over " + container.describe(verbose) + ", and your paw follows, crushing their soft body and reducing them to a heap of broken gore.";
}
});

rules["stomp"].push({
"test": function(container, macro) {
return hasNothingElse(container, ["Person","Cow","Car"])
&& isNonFatal(macro);
}, "desc": function(container, macro, verbose) {
return "Your soft paws smoosh over " + container.describe(verbose) + ". They stick to your toes, carried along for the ride as you take another few steps before finally\
falling off.";
}
});

+ 4
- 0
stroll.html View File

@@ -97,6 +97,10 @@
<p>Build your Character (leave blank for defaults)</p>
<form id=custom-species-form name="custom-species-form">
<ul class="flex-outer">
<li>
<label for="species">Name</label>
<input type="text" name="name" />
</li>
<li>
<label for="species">Species</label>
<input type="text" name="species" placeholder="crux"/>


Loading…
Cancel
Save