@@ -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.";
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\