Added hasAtLeast function to increase
rule flexibility on test functions. added an extra1 passthrough to describe function to increase rule flexibility on test functions
Added pickString, a function that returns a random array element for text variation.
@@ -71,6 +71,13 @@ function hasLessThan(container, thing, amount) {
return false;
}
function hasAtleast(container, thing, amount) { //this function does not trigger in situations where you have a single object(..., 1 [thing], ...) nested inside of a larger group. If you have a case where that can feasibly happen it is reccomended to put a parent ofject of the one you want as an and condition.
if (container.contents.hasOwnProperty(thing))
if (container.contents[thing].count >= amount)
return true;
return false;
}
function hasExactly(container, thing, amount) {
if (!container.contents.hasOwnProperty(thing) && amount == 0)
return true;
@@ -110,11 +117,11 @@ function nothingLarger(container, thing) {
return true;
}
function describe(action, container, macro, verbose=true, flat=false) {
function describe(action, container, macro, verbose=true, flat=false, extra1=0) {