Преглед на файлове

Added a system for controlling brutality. Added some stomps

tags/v0.7.0
Fen Dweller преди 7 години
родител
ревизия
cb05251219
променени са 3 файла, в които са добавени 82 реда и са изтрити 6 реда
  1. +14
    -0
      game.js
  2. +49
    -6
      recursive-desc.js
  3. +19
    -0
      stroll.html

+ 14
- 0
game.js Целия файл

@@ -467,6 +467,12 @@ var macro =
this.growthPoints += Math.round(50 * mass / (this.scale*this.scale));
},

// 0 = entirely non-fatal
// 1 = fatal, but not specific
// 2 = gory

"brutality": 1,

"scale": 1,
}

@@ -1423,6 +1429,14 @@ function startGame(e) {
macro[form[i].name] = parseFloat(form[i].value);
else if (form[i].type == "checkbox") {
macro[form[i].name] = form[i].checked;
} else if (form[i].type == "radio") {
if (form[i].checked) {
switch(form[i].id) {
case "brutality-0": macro.brutality = 0; break;
case "brutality-1": macro.brutality = 1; break;
case "brutality-2": macro.brutality = 2; break;
}
}
}
}
}


+ 49
- 6
recursive-desc.js Целия файл

@@ -14,6 +14,14 @@ rules["male-orgasm"] = [];
rules["female-orgasm"] = [];
rules["grind"] = [];

function isFatal(macro) {
return macro.brutality >= 1;
}

function isGory(macro) {
return macro.brutality >= 2;
}

function hasNothing(container, thing, amount) {
for (var key in container.contents) {
if (container.contents.hasOwnProperty(key))
@@ -61,6 +69,7 @@ function nothingLarger(container, thing) {

return true;
}

function describe(action, container, macro, verbose=true) {
options = [];

@@ -70,8 +79,10 @@ function describe(action, container, macro, verbose=true) {
}
}

if (options.length > 0)
return options[0](container, macro, verbose);
if (options.length > 0) {
let choice = Math.floor(Math.random() * options.length);
return options[choice](container, macro, verbose);
}
else {
return describeDefault(action, container, macro, verbose);
}
@@ -136,7 +147,7 @@ rules["eat"].push({
"desc": function(container, macro, verbose) {
return "You grasp " + container.describe() + " and greedily wolf them down, swallowing forcefully to cram them into your bulging stomach. A crass belch escapes your lips as they curl up in your slimy gut.";
}
})
});

rules["eat"].push({
"test": function(container, macro) {
@@ -147,7 +158,7 @@ rules["eat"].push({
"desc": function(container, macro, verbose) {
return "You crush the " + container.contents["Car"].describe() + " with your tight throat, washing it down with " + container.contents["Person"].describe();
}
})
});

rules["eat"].push({
"test": function(container, macro) {
@@ -160,7 +171,7 @@ rules["eat"].push({
and you suckle on it for a long moment before twisting your head to snap it loose. The entire building and the " + describe_all(container.contents["Small Skyscraper"].contents, verbose) + "\
within plunge into your roiling guts, along with some delicious treats you slurped up along with it - " + describe_all(container.contents, verbose, ["Small Skyscraper"]) + ".";
}
})
});

rules["eat"].push({
"test": function(container, macro) {
@@ -175,4 +186,36 @@ rules["eat"].push({
down your sultry throat. Your gut bubbles as " + describe_all(container.contents["Small Skyscraper"].contents, verbose) + " are crunched and crushed within, along with the \
" + describe_all(container.contents, verbose, ["Small Skyscraper"]) + " that were unfortunate enough to be caught up by your slimy tongue.";
}
})
});

// STOMPING

rules["stomp"].push({
"test": function(container, macro) {
return hasOnly(container, ["Person"])
&& hasExactly(container, "Person", 1)
&& isFatal(macro);
}, "desc": function(container, macro, verbose) {
return "Your heavy paw slams down on " + container.describe(verbose) + ", smashing the poor thing like an insect.";
}
});

rules["stomp"].push({
"test": function(container, macro) {
return hasOnly(container, ["Person"])
&& hasExactly(container, "Person", 1)
&& isGory(macro);
}, "desc": function(container, macro, verbose) {
return "Your paw thumps " + container.describe(verbose) + ", shoving your victim to the ground and cracking them open like an egg.";
}
});

rules["stomp"].push({
"test": function(container, macro) {
return hasOnly(container, ["Person"])
&& hasExactly(container, "Person", 1)
&& isGory(macro);
}, "desc": function(container, macro, verbose) {
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.";
}
});

+ 19
- 0
stroll.html Целия файл

@@ -131,6 +131,25 @@
<input type="number" name="baseAssArea" placeholder="0.4"><br>
</li>
<br>
Brutality:<br>
<ul>
<li>
<input type="radio" name="brutality" id="brutality-0" disabled="disabled">
<label for="brutality-0">No brutality (not implemented)</label>
</li>
<li>
<input type="radio" name="brutality" checked=true id="brutality-1">
<label for="brutality-1">Fatal, no gore</label>
</li>
<li>
<input type="radio" name="brutality" id="brutality-2">
<label for="brutality-2">Gory</label>
</li>
<li>
<input type="radio" name="brutality" id="brutality-2" disabled="disableD">
<label for="brutality-3">Sadistic (not implemented)</label>
</li>
</ul>
<div>
Arousal:<br>
<input type="checkbox" checked=true name="arousalEnabled"/><br>


Loading…
Отказ
Запис