| @@ -0,0 +1,20 @@ | |||
| { | |||
| "esversion": 6, | |||
| "node": true, | |||
| "sub": true, | |||
| "globals": { | |||
| "Container": true, | |||
| "Person": true, | |||
| "things": true, | |||
| "areas": true, | |||
| "fill_area": true, | |||
| "length": true, | |||
| "mass": true, | |||
| "volume": true, | |||
| "round": true, | |||
| "number": true, | |||
| "describe": true, | |||
| "humanMode": true, | |||
| "describe_all": true | |||
| } | |||
| } | |||
| @@ -2,42 +2,15 @@ | |||
| var rules = {}; | |||
| rules["eat"] = []; | |||
| rules["chew"] = []; | |||
| rules["stomp"] = []; | |||
| rules["kick"] = []; | |||
| rules["anal-vore"] = []; | |||
| rules["tail-slap"] = []; | |||
| rules["tail-vore"] = []; | |||
| rules["ass-crush"] = []; | |||
| rules["cleavage-stuff"] = []; | |||
| rules["cleavage-crush"] = []; | |||
| rules["cleavage-drop"] = []; | |||
| rules["cleavage-absorb"] = []; | |||
| rules["breast-crush"] = []; | |||
| rules["breast-vore"] = []; | |||
| rules["breast-milk"] = []; | |||
| rules["unbirth"] = []; | |||
| rules["sheath-stuff"] = []; | |||
| rules["sheath-squeeze"] = []; | |||
| rules["sheath-crush"] = []; | |||
| rules["sheath-absorb"] = []; | |||
| rules["cock-vore"] = []; | |||
| rules["cockslap"] = []; | |||
| rules["ball-smother"] = []; | |||
| rules["male-spurt"] = []; | |||
| rules["male-orgasm"] = []; | |||
| rules["female-spurt"] = []; | |||
| rules["female-orgasm"] = []; | |||
| rules["grind"] = []; | |||
| rules["pouch-stuff"] = []; | |||
| rules["pouch-eat"] = []; | |||
| rules["stomach"] = []; | |||
| rules["balls"] = []; | |||
| rules["womb"] = []; | |||
| rules["bowels"] = []; | |||
| rules["breasts"] = []; | |||
| var actions = ["eat","chew","stomp","kick","anal-vore","tail-slap","tail-vore","ass-crush", | |||
| "cleavage-stuff","cleavage-crush","cleavage-drop","cleavage-absorb","breast-crush", | |||
| "breast-vore","breast-milk","unbirth","sheath-stuff","sheath-squeeze","sheath-crush", | |||
| "sheath-absorb","cock-vore","cockslap","ball-smother","male-spurt","male-orgasm","female-spurt", | |||
| "female-orgasm","grind","pouch-stuff","pouch-eat","stomach","womb","balls","bowels","breasts"]; | |||
| for (let i=0; i<actions.length; i++) { | |||
| rules[actions[i]] = []; | |||
| } | |||
| function isNonFatal(macro) { | |||
| return macro.brutality == 0; | |||
| @@ -200,19 +173,19 @@ function defaultAssCrush(container, macro, verbose) { | |||
| function defaultTailSlap(container, macro, verbose) { | |||
| if (isFatal(macro)) | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails swing" : " tail swings") + " into " + container.describe(verbose) + ", smashing everything in " | |||
| + (macro.tailCount > 1 ? "their" : "its") + " path."; | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails swing" : " tail swings") + " into " + container.describe(verbose) + ", smashing everything in " + | |||
| (macro.tailCount > 1 ? "their" : "its") + " path."; | |||
| else | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails slap" : " tail slaps") + " against " + container.describe(verbose) + ", bowling them over."; | |||
| } | |||
| function defaultTailVore(container, macro, verbose) { | |||
| if (isFatal(macro)) | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails lunge, maws agape, " : " tail lunges, maw agape, ") + "at " + container.describe(verbose) | |||
| + ". " + (macro.tailCount > 1 ? "They" : "It") + " scarf down everything in a second, gulping forcefully to drag your prey into your sloppy guts."; | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails lunge, maws agape, " : " tail lunges, maw agape, ") + "at " + container.describe(verbose) + | |||
| ". " + (macro.tailCount > 1 ? "They" : "It") + " scarf down everything in a second, gulping forcefully to drag your prey into your sloppy guts."; | |||
| else | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails lunge, maws agape, " : " tail lunges, maw agape, ") + "at " + container.describe(verbose) | |||
| + ". " + (macro.tailCount > 1 ? "They" : "It") + " scarf down everything in a second, gulping forcefully and pulling everything into your belly."; | |||
| return "Your " + macro.describeTail + (macro.tailCount > 1 ? " tails lunge, maws agape, " : " tail lunges, maw agape, ") + "at " + container.describe(verbose) + | |||
| ". " + (macro.tailCount > 1 ? "They" : "It") + " scarf down everything in a second, gulping forcefully and pulling everything into your belly."; | |||
| } | |||
| function defaultCleavageStuff(container, macro, verbose) { | |||
| @@ -433,9 +406,9 @@ rules["eat"].push({ | |||
| rules["eat"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasLessThan(container, "Person", 6) | |||
| && macro.height >= 10; | |||
| return hasOnly(container, ["Person"]) && | |||
| hasLessThan(container, "Person", 6) && | |||
| macro.height >= 10; | |||
| }, | |||
| "desc": function(container, macro, verbose) { | |||
| return "You pluck up the " + container.describe() + " and stuff them into your mouth, swallowing lightly to drag them down to your bubbling guts."; | |||
| @@ -444,9 +417,9 @@ rules["eat"].push({ | |||
| rules["eat"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && macro.height < 10; | |||
| return hasOnly(container, ["Person"]) && | |||
| hasExactly(container, "Person", 1) && | |||
| macro.height < 10; | |||
| }, | |||
| "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."; | |||
| @@ -455,9 +428,9 @@ rules["eat"].push({ | |||
| rules["eat"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person","Car"]) | |||
| && hasExactly(container, "Car", 1) | |||
| && hasLessThan(container, "Person", 5); | |||
| return hasOnly(container, ["Person","Car"]) && | |||
| hasExactly(container, "Car", 1) && | |||
| hasLessThan(container, "Person", 5); | |||
| }, | |||
| "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(); | |||
| @@ -466,9 +439,9 @@ rules["eat"].push({ | |||
| rules["eat"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Small Skyscraper", 1) | |||
| && nothingLarger(container, "Small Skyscraper") | |||
| && macro.height < 500; | |||
| return hasExactly(container, "Small Skyscraper", 1) && | |||
| nothingLarger(container, "Small Skyscraper") && | |||
| macro.height < 500; | |||
| }, | |||
| "desc": function(container, macro, verbose) { | |||
| return "You drop onto your hands and knees, jaws opening wide to envelop the skyscraper. It glides into your throat as your snout touches the ground,\ | |||
| @@ -479,9 +452,9 @@ rules["eat"].push({ | |||
| rules["eat"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Small Skyscraper", 2) | |||
| && nothingLarger(container, "Small Skyscraper") | |||
| && macro.height < 750; | |||
| return hasExactly(container, "Small Skyscraper", 2) && | |||
| nothingLarger(container, "Small Skyscraper") && | |||
| macro.height < 750; | |||
| }, | |||
| "desc": function(container, macro, verbose) { | |||
| return "You drop onto your hands and knees, jaws opening wide to envelop the skyscraper. It glides into your throat as your snout touches the ground,\ | |||
| @@ -496,34 +469,34 @@ rules["eat"].push({ | |||
| rules["chew"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && isGory(macro) | |||
| && macro.height < 5; | |||
| return hasOnly(container, ["Person"]) && | |||
| hasExactly(container, "Person", 1) && | |||
| isGory(macro) && | |||
| macro.height < 5; | |||
| }, "desc": function(container, macro, verbose) { | |||
| return "You tackle a " + container.describe(verbose) + " and dig into your meal, powerful jaws ripping them to shreds in seconds. You wolf down great mouthfuls \ | |||
| of meat, consuming them in a terrifying frenzy that ends with naught but bones lying on the ground."; | |||
| } | |||
| }) | |||
| }); | |||
| rules["chew"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && isGory(macro) | |||
| && macro.height >= 5; | |||
| return hasOnly(container, ["Person"]) && | |||
| hasExactly(container, "Person", 1) && | |||
| isGory(macro) && | |||
| macro.height >= 5; | |||
| }, "desc": function(container, macro, verbose) { | |||
| return "You snatch up a " + container.describe(verbose) + ", then stuff their lower body into the guillotine that is your ravenous maw - slicing off their legs with \ | |||
| a single disgusting <i>crunch</i>, then finishing them off with another ravenous bite that obliterates their torso. Their bleeding head falls from your lips, only to be \ | |||
| caught between two fingers and popped back in to be crunched between molars and swallowed."; | |||
| } | |||
| }) | |||
| }); | |||
| rules["chew"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 2) | |||
| && isGory(macro) | |||
| return hasOnly(container, ["Person"]) && | |||
| hasExactly(container, "Person", 2) && | |||
| isGory(macro); | |||
| }, "desc": function(container, macro, verbose) { | |||
| var prey1 = new Person(1).describe(verbose); | |||
| var prey2 = new Person(1).describe(verbose); | |||
| @@ -531,15 +504,15 @@ rules["chew"].push({ | |||
| in a vice. A heartbeat later, their face is jammed into your bloody throat. A squeeze of your jaws snaps their spine with ease, and their limp body plunges down into \ | |||
| your churning depths to be destroyed."; | |||
| } | |||
| }) | |||
| }); | |||
| // STOMPING | |||
| rules["stomp"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && isFatal(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."; | |||
| } | |||
| @@ -547,9 +520,9 @@ rules["stomp"].push({ | |||
| rules["stomp"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && isGory(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."; | |||
| } | |||
| @@ -557,9 +530,9 @@ rules["stomp"].push({ | |||
| rules["stomp"].push({ | |||
| "test": function(container, macro) { | |||
| return hasOnly(container, ["Person"]) | |||
| && hasExactly(container, "Person", 1) | |||
| && isGory(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."; | |||
| } | |||
| @@ -567,8 +540,8 @@ rules["stomp"].push({ | |||
| rules["stomp"].push({ | |||
| "test": function(container, macro) { | |||
| return hasNothingElse(container, ["Person","Cow","Car"]) | |||
| && isNonFatal(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."; | |||
| @@ -579,19 +552,19 @@ rules["stomp"].push({ | |||
| rules["anal-vore"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Person", 1) | |||
| && hasOnly(container, ["Person"]); | |||
| return hasExactly(container, "Person", 1) && | |||
| hasOnly(container, ["Person"]); | |||
| }, "desc": function(container, macro, verbose) { | |||
| let adjective = ["musky","winding","churning"][Math.floor(Math.random()*3)]; | |||
| return "Your weighty rump slams against the ground. A shock of pleasure runs up your spine as a " + container.describe(verbose) + " slides up your ass," | |||
| + (macro.maleParts ? " grinding against your prostate" : "") + ". A powerful clench drags them deeper into your bowels, sealing them away in your " + adjective + " depths."; | |||
| return "Your weighty rump slams against the ground. A shock of pleasure runs up your spine as a " + container.describe(verbose) + " slides up your ass," + | |||
| (macro.maleParts ? " grinding against your prostate" : "") + ". A powerful clench drags them deeper into your bowels, sealing them away in your " + adjective + " depths."; | |||
| } | |||
| }); | |||
| rules["anal-vore"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Car", 1) | |||
| && hasOnly(container, ["Car"]); | |||
| return hasExactly(container, "Car", 1) && | |||
| hasOnly(container, ["Car"]); | |||
| }, "desc": function(container, macro, verbose) { | |||
| return "You ram " + container.describe(verbose) + " up your ass, biting your lip as it" + (macro.maleParts ? " rubs along your prostate" : " slides into velvety depths") + ".\ | |||
| You moan and clench hard, yanking it in with a wet <i>shlrrp</i> and abruplty silencing its blaring horn."; | |||
| @@ -600,8 +573,8 @@ rules["anal-vore"].push({ | |||
| rules["anal-vore"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Bus", 1) | |||
| && hasOnly(container, ["Bus"]); | |||
| return hasExactly(container, "Bus", 1) && | |||
| hasOnly(container, ["Bus"]); | |||
| }, "desc": function(container, macro, verbose) { | |||
| return "A speeding bus slams on its brakes as you abruptly sit - but it's too late to stop. A gasp flies from your lips as it penetrates your greedy ass, sinking halfway in and coming to a halt. \ | |||
| You grunt and squeeze, causing its frame to creak and groan. Two fingers to the back are enough to get it moving again, and it slowly works inside. You shiver and moan, taking it in all the way. \ | |||
| @@ -611,8 +584,8 @@ rules["anal-vore"].push({ | |||
| rules["anal-vore"].push({ | |||
| "test": function(container, macro) { | |||
| return hasExactly(container, "Train", 1) | |||
| && hasOnly(container, ["Train"]); | |||
| return hasExactly(container, "Train", 1) && | |||
| hasOnly(container, ["Train"]); | |||
| }, "desc": function(container, macro, verbose) { | |||
| var cars = container.contents["Train"].contents["Train Car"].count; | |||
| return "Your massive fingers wrap around a train, yanking it from the rails with a tremendous screech of metal-on-metal. You squat down low, eyes rolling back in anticipation as you thrust the locomotive towards your massive ass - and then it hits home. A moan of pleasure shakes the earth, your ravenous pucker spread around the engine and sucking it in with a <i>squelch</i>. Powerful muscles squeeze and grab...and " + container.describe(verbose) + " swiftly vanishes into your bowels, every one of the " + cars + " cars a fresh shock of pleasure as they glide into your musky depths."; | |||
| @@ -109,7 +109,7 @@ var clusters = | |||
| function fill_area(area, weights, variance=0.15) | |||
| { | |||
| var area = area + Math.random() * variance * 2 - variance; | |||
| area = area + Math.random() * variance * 2 - variance; | |||
| var result = []; | |||
| var candidates = []; | |||
| for (var key in weights) { | |||
| @@ -193,9 +193,9 @@ function merge_things(list,semicolons=false) { | |||
| list.slice(0,list.length-1).forEach(function(term) { | |||
| result += term + ", "; | |||
| }) | |||
| }); | |||
| result += "and " + list[list.length-1] | |||
| result += "and " + list[list.length-1]; | |||
| return result; | |||
| } | |||
| @@ -204,7 +204,7 @@ function merge_things(list,semicolons=false) { | |||
| // combine the adjectives for something into a single string | |||
| function merge_desc(list) { | |||
| var result = "" | |||
| var result = ""; | |||
| list.forEach(function(term) { | |||
| if (term != "") | |||
| @@ -228,17 +228,17 @@ function merge_desc(list) { | |||
| function distribution(min, max, samples) { | |||
| var result = 0; | |||
| var limit = Math.min(100,samples) | |||
| var limit = Math.min(100,samples); | |||
| if (limit < samples) { | |||
| for (var i = 0; i < limit; i++) { | |||
| for (let i = 0; i < limit; i++) { | |||
| result += (i/10 + 1) * Math.floor(Math.random() * (max - min + 1) + min); | |||
| } | |||
| result = Math.round((result / 595) * samples * (max - min) + min); | |||
| } else { | |||
| for (var i = 0; i < limit; i++) { | |||
| for (let i = 0; i < limit; i++) { | |||
| result += Math.floor(Math.random() * (max - min + 1) + min); | |||
| } | |||
| } | |||
| @@ -268,7 +268,7 @@ function defaultMerge(thing) { | |||
| } | |||
| } | |||
| for (var key in container.contents) { | |||
| for (key in container.contents) { | |||
| if (container.contents.hasOwnProperty(key)) { | |||
| if (this.contents.hasOwnProperty(key)) { | |||
| newThing.contents[key] = this.contents[key].merge(container.contents[key]); | |||
| @@ -279,12 +279,12 @@ function defaultMerge(thing) { | |||
| } | |||
| return newThing; | |||
| } | |||
| }; | |||
| } | |||
| function defaultSum(thing) { | |||
| return function() { | |||
| var counts = {} | |||
| var counts = {}; | |||
| if (thing.name != "Container") | |||
| counts[thing.name] = thing.count; | |||
| @@ -302,7 +302,7 @@ function defaultSum(thing) { | |||
| } | |||
| return counts; | |||
| } | |||
| }; | |||
| } | |||
| function defaultSumProperty(thing) { | |||
| @@ -318,19 +318,19 @@ function defaultSumProperty(thing) { | |||
| } | |||
| return total; | |||
| } | |||
| }; | |||
| } | |||
| function defaultAddContent(thing) { | |||
| return function(name, min, max, count) { | |||
| if (min == max) { | |||
| var object = new things[name](min*count); | |||
| let object = new things[name](min*count); | |||
| thing.contents[object.name] = object; | |||
| } else { | |||
| var object = new things[name](distribution(min, max, count)); | |||
| let object = new things[name](distribution(min, max, count)); | |||
| thing.contents[object.name] = object; | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function DefaultEntity() { | |||
| @@ -348,7 +348,7 @@ function DefaultEntity() { | |||
| function copy_defaults(self,proto) { | |||
| for (var key in proto) { | |||
| if (proto.hasOwnProperty(key)) { | |||
| self[key] = proto[key](self) | |||
| self[key] = proto[key](self); | |||
| } | |||
| } | |||
| } | |||
| @@ -363,7 +363,7 @@ function Container(contents = []) { | |||
| else | |||
| this.count = 0; | |||
| this.contents = {} | |||
| this.contents = {}; | |||
| for (var i=0; i < contents.length; i++) { | |||
| this.contents[contents[i].name] = contents[i]; | |||
| @@ -376,8 +376,8 @@ function Container(contents = []) { | |||
| } | |||
| this.describe = function(verbose = true) { | |||
| return describe_all(this.contents,verbose) | |||
| } | |||
| return describe_all(this.contents,verbose); | |||
| }; | |||
| return this; | |||
| } | |||
| @@ -394,12 +394,13 @@ function Person(count = 1) { | |||
| this.describeOne = function (verbose=true) { | |||
| var body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0)); | |||
| var sex = random_desc(["male", "female"], (verbose ? 1 : 0)); | |||
| var species = ""; | |||
| if (!humanMode) | |||
| var species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]); | |||
| species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]); | |||
| else | |||
| var species = random_desc(["jogger","police officer","road worker","pastor","dog-walker","clerk","accountant","CEO","millionaire","mailman"]); | |||
| species = random_desc(["jogger","police officer","road worker","pastor","dog-walker","clerk","accountant","CEO","millionaire","mailman"]); | |||
| return "a " + merge_desc([body,sex,species]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose=true) { | |||
| if (verbose) { | |||
| @@ -410,12 +411,12 @@ function Person(count = 1) { | |||
| } | |||
| return merge_things(list); | |||
| } else { | |||
| return this.count + " people" | |||
| return this.count + " people"; | |||
| } | |||
| } else { | |||
| return (this.count > 1 ? this.count + " people" : "a person"); | |||
| } | |||
| } | |||
| }; | |||
| return this; | |||
| } | |||
| @@ -433,7 +434,7 @@ function Cow(count = 1) { | |||
| var body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0)); | |||
| var sex = random_desc(["male", "female"], (verbose ? 1 : 0)); | |||
| return "a " + merge_desc([body,sex,"cow"]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose=true) { | |||
| if (verbose) { | |||
| @@ -444,12 +445,12 @@ function Cow(count = 1) { | |||
| } | |||
| return merge_things(list); | |||
| } else { | |||
| return this.count + " cattle" | |||
| return this.count + " cattle"; | |||
| } | |||
| } else { | |||
| return (this.count > 1 ? this.count + " cattle" : "a cow"); | |||
| } | |||
| } | |||
| }; | |||
| return this; | |||
| } | |||
| @@ -469,7 +470,7 @@ function EmptyCar(count = 1) { | |||
| var adjective = random_desc(["rusty","brand-new"],0.3); | |||
| var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]); | |||
| return "a parked " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -486,7 +487,7 @@ function EmptyCar(count = 1) { | |||
| return (this.count > 1 ? this.count + " parked cars" : "a parked car"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Car(count = 1) { | |||
| @@ -503,7 +504,7 @@ function Car(count = 1) { | |||
| var adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0)); | |||
| var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]); | |||
| return "a " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -520,7 +521,7 @@ function Car(count = 1) { | |||
| return (this.count > 1 ? this.count + " cars" : "a car"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Bus(count = 1) { | |||
| @@ -537,7 +538,7 @@ function Bus(count = 1) { | |||
| var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0)); | |||
| var type = random_desc(["bus","double-decker bus","articulating bus"]); | |||
| return "a " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -554,7 +555,7 @@ function Bus(count = 1) { | |||
| return (this.count > 1 ? this.count + " buses" : "a bus"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Tram(count = 1) { | |||
| @@ -571,7 +572,7 @@ function Tram(count = 1) { | |||
| var color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0)); | |||
| var type = random_desc(["tram"]); | |||
| return "a " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -587,12 +588,12 @@ function Tram(count = 1) { | |||
| } else { | |||
| return (this.count > 1 ? this.count + " trams" : "a tram"); | |||
| } | |||
| } | |||
| }; | |||
| this.anal_vore = function() { | |||
| return "You slide " + this.describe() + " up your tight ass"; | |||
| } | |||
| }; | |||
| } | |||
| function Motorcycle(count = 1) { | |||
| @@ -621,7 +622,7 @@ function Train(count = 1) { | |||
| var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0)); | |||
| var type = random_desc(["train","passenger train","freight train"]); | |||
| return "a " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -638,12 +639,12 @@ function Train(count = 1) { | |||
| return (this.count > 1 ? this.count + " trains" : "a train"); | |||
| } | |||
| } | |||
| }; | |||
| this.anal_vore = function() { | |||
| var cars = (this.contents["Train Car"].count == 1 ? this.contents["Train Car"].describe() + " follows it inside" : this.contents["Train Car"].describe() + " are pulled slowly inside"); | |||
| return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars; | |||
| } | |||
| }; | |||
| } | |||
| function TrainCar(count = 1) { | |||
| @@ -660,7 +661,7 @@ function TrainCar(count = 1) { | |||
| var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0)); | |||
| var type = random_desc(["train car","passenger train car","freight train car"]); | |||
| return "a " + merge_desc([adjective,color,type]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -668,7 +669,7 @@ function TrainCar(count = 1) { | |||
| } else { | |||
| return (this.count > 1 ? this.count + " train cars" : "a train car"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function House(count = 1) { | |||
| @@ -685,7 +686,7 @@ function House(count = 1) { | |||
| var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0)); | |||
| var name = random_desc(["house","house","house","house","house","trailer"], 1); | |||
| return "a " + merge_desc([size,color,name]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -701,7 +702,7 @@ function House(count = 1) { | |||
| } else { | |||
| return (this.count > 1 ? this.count + " houses" : "a house"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Barn(count = 1) { | |||
| @@ -719,7 +720,7 @@ function Barn(count = 1) { | |||
| var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0)); | |||
| var name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1); | |||
| return "a " + merge_desc([size,color,name]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -735,7 +736,7 @@ function Barn(count = 1) { | |||
| } else { | |||
| return (this.count > 1 ? this.count + " barns" : "a barn"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function SmallSkyscraper(count = 1) { | |||
| @@ -752,7 +753,7 @@ function SmallSkyscraper(count = 1) { | |||
| var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0)); | |||
| var name = random_desc(["skyscraper","office tower","office building"], 1); | |||
| return "a " + merge_desc([color,name]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -769,14 +770,6 @@ function SmallSkyscraper(count = 1) { | |||
| return (this.count > 1 ? this.count + " small skyscrapers" : "a small skyscraper"); | |||
| } | |||
| } | |||
| this.anal_vore = function(verbose=true,height=10) { | |||
| var line = skyscraperAnalVore(this,verbose,height); | |||
| if (line == "") | |||
| return defaultAnalVore(this)(verbose); | |||
| else | |||
| return line; | |||
| }; | |||
| } | |||
| @@ -794,7 +787,7 @@ function LargeSkyscraper(count = 1) { | |||
| var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0)); | |||
| var name = random_desc(["skyscraper","office tower","office building"], 1); | |||
| return "a " + merge_desc(["towering",color,name]); | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -810,7 +803,7 @@ function LargeSkyscraper(count = 1) { | |||
| } else { | |||
| return (this.count > 1 ? this.count + " large skyscrapers" : "a large skyscraper"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function ParkingGarage(count = 1) { | |||
| @@ -828,7 +821,7 @@ function ParkingGarage(count = 1) { | |||
| this.describeOne = function(verbose=true) { | |||
| return "a parking garage"; | |||
| } | |||
| }; | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| @@ -836,7 +829,7 @@ function ParkingGarage(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a parking garage" : this.count + " parking garages"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Overpass(count = 1) { | |||
| @@ -879,7 +872,7 @@ function Town(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a town" : this.count + " towns"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function City(count = 1) { | |||
| @@ -915,7 +908,7 @@ function City(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a city" : this.count + " cities"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Continent(count = 1) { | |||
| @@ -943,7 +936,7 @@ function Continent(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a continent" : this.count + " continents"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Planet(count = 1) { | |||
| @@ -961,7 +954,7 @@ function Planet(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a planet" : this.count + " planets"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Star(count = 1) { | |||
| @@ -973,7 +966,7 @@ function Star(count = 1) { | |||
| this.describe = function(verbose = true) { | |||
| return (this.count == 1 ? "a star" : this.count + " stars"); | |||
| } | |||
| }; | |||
| } | |||
| function SolarSystem(count = 1) { | |||
| @@ -993,7 +986,7 @@ function SolarSystem(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a solar system" : this.count + " solar systems"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| function Galaxy(count = 1) { | |||
| @@ -1013,5 +1006,5 @@ function Galaxy(count = 1) { | |||
| } else { | |||
| return (this.count == 1 ? "a galaxy" : this.count + " galaxies"); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| @@ -72,7 +72,7 @@ | |||
| </div> | |||
| <div id=log-area> | |||
| <div id=log> | |||
| <div>Welcome to Stroll 0.5.0</div> | |||
| <div>Welcome to Stroll 0.5.1</div> | |||
| <div><b>This game features 18+ content</b></div> | |||
| <div><a href="https://chemicalcrux.org/stroll">Changelog</a></div> | |||
| <div>It's a nice day for a walk</div> | |||
| @@ -128,7 +128,7 @@ | |||
| <div class=option-container id=option-panel> | |||
| <p>Welcome to Stroll 0.5.0</p> | |||
| <p>Welcome to Stroll 0.5.1</p> | |||
| <p><b>This game features 18+ content</b></p> | |||
| <a href="https://chemicalcrux.org/stroll">Changelog</a> | |||
| <br> | |||
| @@ -82,201 +82,201 @@ function number_prefix(value) { | |||
| function mass(kg, type="metric", singular=false) { | |||
| switch(type) { | |||
| case "metric": return metricMass(kg, singular); break; | |||
| case "customary": return customaryMass(kg, singular); break; | |||
| case "approx": return approxMass(kg, singular); break; | |||
| case "metric": return metricMass(kg, singular); | |||
| case "customary": return customaryMass(kg, singular); | |||
| case "approx": return approxMass(kg, singular); | |||
| } | |||
| } | |||
| function length(m, type="metric", singular=false) { | |||
| switch(type) { | |||
| case "metric": return metricLength(m, singular); break; | |||
| case "customary": return customaryLength(m, singular); break; | |||
| case "approx": return approxLength(m, singular); break; | |||
| case "metric": return metricLength(m, singular); | |||
| case "customary": return customaryLength(m, singular); | |||
| case "approx": return approxLength(m, singular); | |||
| } | |||
| } | |||
| function volume(m3, type="metric", singular=false) { | |||
| switch(type) { | |||
| case "metric": return metricVolume(m3, singular); break; | |||
| case "customary": return customaryVolume(m3, singular); break; | |||
| case "approx": return approxVolume(m3, singular); break; | |||
| case "metric": return metricVolume(m3, singular); | |||
| case "customary": return customaryVolume(m3, singular); | |||
| case "approx": return approxVolume(m3, singular); | |||
| } | |||
| } | |||
| function metricMass(kg, singular=false) { | |||
| if (kg < 1/1000) { | |||
| var mass = round(kg * 1e6,0); | |||
| let mass = round(kg * 1e6,0); | |||
| return mass + (singular || mass == 1 ? " milligram" : " milligrams"); | |||
| } else if (kg < 1) { | |||
| var mass = round(kg * 1000,0); | |||
| let mass = round(kg * 1000,0); | |||
| return mass + (singular || mass == 1 ? " gram" : " grams"); | |||
| } else if (kg < 5000) { | |||
| var mass = round(kg,0); | |||
| let mass = round(kg,0); | |||
| return mass + (singular || mass == 1 ? " kilogram" : " kilograms"); | |||
| } else if (kg < 5000000) { | |||
| var mass = round(kg / 1000,1); | |||
| let mass = round(kg / 1000,1); | |||
| return mass + (singular || mass == 1 ? " metric ton" : " metric tons"); | |||
| } else if (kg < 5000000000) { | |||
| var mass = round(kg / 1000000,1); | |||
| let mass = round(kg / 1000000,1); | |||
| return mass + (singular || mass == 1 ? " kiloton" : " kilotons"); | |||
| } else if (kg < 5000000000000) { | |||
| var mass = round(kg / 1000000000,1); | |||
| let mass = round(kg / 1000000000,1); | |||
| return mass + (singular || mass == 1 ? " megaton" : " megatons"); | |||
| } else { | |||
| var mass = round(kg / 1000000000000,1); | |||
| let mass = round(kg / 1000000000000,1); | |||
| return mass + (singular || mass == 1 ? " gigaton" : " gigatons"); | |||
| } | |||
| } | |||
| function customaryMass(kg, singular=false) { | |||
| var lbs = kg * 2.2; | |||
| let lbs = kg * 2.2; | |||
| if (lbs < 1) { | |||
| var mass = round(lbs * 16,0); | |||
| let mass = round(lbs * 16,0); | |||
| return mass + (singular || mass == 1 ? " ounce" : " ounces"); | |||
| } else if (lbs < 2000) { | |||
| var mass = round(lbs,0); | |||
| let mass = round(lbs,0); | |||
| return mass + (singular || mass == 1 ? " pound" : " pounds"); | |||
| } else { | |||
| var mass = round(lbs / 2000,1); | |||
| let mass = round(lbs / 2000,1); | |||
| return mass + (singular || mass == 1 ? "ton" : " tons"); | |||
| } | |||
| } | |||
| function approxMass(kg, singular=false) { | |||
| if (kg < 10000) { | |||
| var mass = round(kg/1000,2); | |||
| let mass = round(kg/1000,2); | |||
| return (singular || mass == 1 ? "a car" : mass + " cars"); | |||
| } else if (kg < 100000) { | |||
| var mass = round(kg/6000,2); | |||
| let mass = round(kg/6000,2); | |||
| return (singular || mass == 1 ? "an elephant" : mass + " elephants"); | |||
| } else if (kg < 1000000000) { | |||
| var mass = round(kg/54431.1,2); | |||
| let mass = round(kg/54431.1,2); | |||
| return (singular || mass == 1 ? "a tank" : mass + " tanks"); | |||
| } else if (kg < 1e21) { | |||
| var mass = round(kg/1.01605e8,2); | |||
| let mass = round(kg/1.01605e8,2); | |||
| return (singular || mass == 1 ? "an aircraft carrier" : mass + " aircraft carriers"); | |||
| } else { | |||
| var mass = round(kg/5.972e24,4); | |||
| let mass = round(kg/5.972e24,4); | |||
| return (singular || mass == 1 ? "the Earth" : mass + " Earths"); | |||
| } | |||
| } | |||
| function metricLength(m, singular=false) { | |||
| if (m < 1/100) { | |||
| var length = round(m * 1000,2); | |||
| let length = round(m * 1000,2); | |||
| return length + (singular || length == 1 ? " millimeter" : " millimeters"); | |||
| } else if (m < 1) { | |||
| var length = round(m * 100,0); | |||
| let length = round(m * 100,0); | |||
| return length + (singular || length == 1 ? " centimeter" : " centimeters"); | |||
| } else if (m < 500) { | |||
| var length = round(m,2); | |||
| let length = round(m,2); | |||
| return length + (singular || length == 1 ? " meter" : " meters"); | |||
| } else { | |||
| var length = round(m / 1000,1); | |||
| let length = round(m / 1000,1); | |||
| return length + (singular || length == 1 ? " kilometer" : " kilometers"); | |||
| } | |||
| } | |||
| function customaryLength(m, singular=false) { | |||
| var ft = m * 3.28084; | |||
| let ft = m * 3.28084; | |||
| if (ft < 1) { | |||
| var length = round(ft * 12,0); | |||
| let length = round(ft * 12,0); | |||
| return length + (singular || length == 1 ? " inch" : " inches"); | |||
| } else if (ft < 5280) { | |||
| var end = customaryLength((ft - Math.floor(ft))/3.28084, singular); | |||
| var length = Math.floor(ft); | |||
| let end = customaryLength((ft - Math.floor(ft))/3.28084, singular); | |||
| let length = Math.floor(ft); | |||
| return length + (singular || length == 1 ? " foot" : " feet") + " " + end; | |||
| } else { | |||
| var length = round(ft/5280,1); | |||
| let length = round(ft/5280,1); | |||
| return length + (singular || length == 1 ? " mile" : " miles"); | |||
| } | |||
| } | |||
| function approxLength(m, singular=false) { | |||
| if (m < 1000) { | |||
| var length = round(m/49,1); | |||
| let length = round(m/49,1); | |||
| return length + (singular || length == 1 ? " football field" : " football fields"); | |||
| } else if (m < 5000000) { | |||
| var length = round(m/449,1); | |||
| let length = round(m/449,1); | |||
| return length + (singular || length == 1 ? " Empire State Building" : " Empire State Buildings"); | |||
| } else if (m < 3474574*2) { | |||
| var length = round(m/3474574,1); | |||
| let length = round(m/3474574,1); | |||
| return length + (singular || length == 1 ? " moon" : " moons"); | |||
| } else if (m < 12.742e6*100) { | |||
| var length = round(m/12.742e6,1); | |||
| let length = round(m/12.742e6,1); | |||
| return length + (singular || length == 1 ? " earth" : " earths"); | |||
| } else if (m < 149.6e12) { | |||
| var length = round(m/149.6e9,1); | |||
| let length = round(m/149.6e9,1); | |||
| return length + (singular || length == 1 ? " AU" : " AUs"); | |||
| } else { | |||
| var length = round(m/9.4607e15,4); | |||
| let length = round(m/9.4607e15,4); | |||
| return length + (singular || length == 1 ? " light year" : " light years"); | |||
| } | |||
| } | |||
| function metricVolume(m3, singular=false) { | |||
| if (m3 < 1/1000) { | |||
| var volume = round(m3*1e6, 0); | |||
| let volume = round(m3*1e6, 0); | |||
| return volume + (singular || volume == 1 ? " milliliter" : " milliliters"); | |||
| } else if (m3 < 1) { | |||
| var volume = round(m3*1000, 1); | |||
| let volume = round(m3*1000, 1); | |||
| return volume + (singular || volume == 1 ? " liter" : " liters"); | |||
| } else if (m3 < 1000000) { | |||
| var volume = round(m3, 0); | |||
| let volume = round(m3, 0); | |||
| return volume + (singular || volume == 1 ? " cubic meter" : " cubic meters"); | |||
| } else if (m3 < 1e12){ | |||
| var volume = round(m3/1e9, 6); | |||
| let volume = round(m3/1e9, 6); | |||
| return volume + (singular || volume == 1 ? " cubic kilometer" : " cubic kilometers"); | |||
| } else { | |||
| var volume = round(m3/1e9, 0); | |||
| let volume = round(m3/1e9, 0); | |||
| return volume + (singular || volume == 1 ? " cubic kilometer" : " cubic kilometers"); | |||
| } | |||
| } | |||
| function customaryVolume(m3, singular=false) { | |||
| var gallons = m3 * 264.172; | |||
| let gallons = m3 * 264.172; | |||
| if (gallons < 1/16) { | |||
| var volume = round(gallons*128,0); | |||
| let volume = round(gallons*128,0); | |||
| return volume + (singular || volume == 1 ? " fluid ounce" : " fluid ounces"); | |||
| } else if (gallons < 1/4) { | |||
| var volume = round(gallons*16,1); | |||
| let volume = round(gallons*16,1); | |||
| return volume + (singular || volume == 1 ? " cup" : " cups"); | |||
| } else if (gallons < 1/2) { | |||
| var volume = round(gallons*8,1); | |||
| let volume = round(gallons*8,1); | |||
| return volume + (singular || volume == 1 ? " pint" : " pints"); | |||
| } else if (gallons < 1) { | |||
| var volume = round(gallons*4,1); | |||
| let volume = round(gallons*4,1); | |||
| return volume + (singular || volume == 1 ? " quart" : " quarts"); | |||
| } else if (gallons < 100) { | |||
| var volume = round(gallons,1); | |||
| let volume = round(gallons,1); | |||
| return volume + (singular || volume == 1 ? " gallon" : " gallons"); | |||
| } else { | |||
| var volume = round(gallons,0); | |||
| let volume = round(gallons,0); | |||
| return volume + (singular || volume == 1 ? " gallon" : " gallons"); | |||
| } | |||
| } | |||
| function approxVolume(m3, singular=false) { | |||
| if (m3 < 1/10000) { | |||
| var volume = round(m3*1e6,0); | |||
| let volume = round(m3*1e6,0); | |||
| return (singular || volume == 1 ? "a shot" : volume + " shots"); | |||
| } else if (m3 < 1) { | |||
| var volume = round(m3*2000,0); | |||
| let volume = round(m3*2000,0); | |||
| return (singular || volume == 1 ? "a glass" : volume + " glasses"); | |||
| } else if (m3 < 10) { | |||
| var volume = round(m3*2.64,1); | |||
| let volume = round(m3*2.64,1); | |||
| return(singular || volume == 1 ? "a bathtub" : volume + " bathtubs"); | |||
| } else if (m3 < 1e9) { | |||
| var volume = round(m3/1000,2); | |||
| let volume = round(m3/1000,2); | |||
| return (singular || volume == 1 ? "an Olympic swimming pool" : volume + " Olympic swimming pools"); | |||
| } else if (m3 < 1e15) { | |||
| var volume = round(m3/1.8919e10,3); | |||
| let volume = round(m3/1.8919e10,3); | |||
| return (singular || volume == 1 ? "a Great Salt Lake" : volume + " Great Salt Lakes"); | |||
| } else { | |||
| var volume = round(m3/3.547e17, 3); | |||
| let volume = round(m3/3.547e17, 3); | |||
| return (singular || volume == 1 ? "an ocean" : volume + " oceans"); | |||
| } | |||
| } | |||