Browse Source

Merge pull request #9 from jsb5468/Text-Addition

Better Walking and Text Additions
tags/v1.0.1
Fen Dweller GitHub 5 years ago
parent
commit
4743257f59
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2041 additions and 351 deletions
  1. +1
    -1
      README.md
  2. +17
    -3
      features.js
  3. +226
    -49
      game.js
  4. +1712
    -260
      recursive-desc.js
  5. +58
    -27
      recursive-macro.js
  6. +27
    -11
      units.js

+ 1
- 1
README.md View File

@@ -2,4 +2,4 @@


Stroll is an 18+ macro/vore text game. Smash things, eat things, and do lewd things to things - then grow and do it all over again. Stroll is an 18+ macro/vore text game. Smash things, eat things, and do lewd things to things - then grow and do it all over again.


https://chemicalcrux.org/stroll/
https://stroll.crux.sexy/

+ 17
- 3
features.js View File

@@ -514,6 +514,13 @@ options = [
"default": "1", "default": "1",
"tooltip": "You start out this many times larger than normal. A good way to build a macro character is to design them at normal size, then adjust the scale to get them to the right height." "tooltip": "You start out this many times larger than normal. A good way to build a macro character is to design them at normal size, then adjust the scale to get them to the right height."
}, },
{
"name": "Walk Speed",
"id": "walkSpeed",
"type": "float",
"default": "1",
"tooltip": "How quickly you move while walking, jogging, or running."
},
{ {
"name": "Height", "name": "Height",
"id": "baseHeight", "id": "baseHeight",
@@ -626,14 +633,15 @@ options = [
] ]
}, },
{ {
"name": "Difficulty",
"name": "Gameplay",
"optional": false, "optional": false,
"entries": "entries":
[ [
{
{
"type": "radio", "type": "radio",
"id": "difficulty", "id": "difficulty",
"default": "0", "default": "0",
"tooltip": "Grow how you want, when you want.",
"choices": "choices":
[ [
{ {
@@ -676,7 +684,13 @@ options = [
"tooltip": "If you're ten times bigger than normal, you gain ten times as much mass when digesting prey" "tooltip": "If you're ten times bigger than normal, you gain ten times as much mass when digesting prey"
} }
] ]
}
},
{
"name": "Walk to other locations",
"id": "changingBiomes",
"type": "checkbox",
"tooltip": "When checked, walking will sometimes change your location."
},
] ]
}, },
{ {


+ 226
- 49
game.js View File

@@ -19,7 +19,13 @@ window.onerror = function(msg, source, lineno, colno, error) {


let started = false; let started = false;


let strolling = false;
const strollingEnum = {
Standing: 0,
Strolling: 1,
Jogging: 2,
Running: 4};

let strolling = strollingEnum.Standing;


let unit = "metric"; let unit = "metric";


@@ -34,6 +40,10 @@ let autoVerbose = true;


let biome = "city"; let biome = "city";


let biomeSize = 3000;

let position = 0;

let newline = " "; let newline = " ";


let victims = {}; let victims = {};
@@ -43,6 +53,7 @@ let macro =
"shrunkPrey": null, "shrunkPrey": null,
"fastDigestFactor": 1, "fastDigestFactor": 1,
"fastDigestTimer": null, "fastDigestTimer": null,
"walkSpeed": 1,


"growthPoints": 0, "growthPoints": 0,


@@ -234,6 +245,86 @@ let macro =
return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result; return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
}, },


"soleNoShoeDesc": function(plural=false,capital=false) {
let result = "";

if (!this.footSockWorn) {
return this.soleOnlyDesc(plural,capital);
} else if (this.footSockWorn) {
switch(this.footSock) {
case "sock":
result = "socked " + this.soleOnlyDesc(plural,false);
}
}

return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
},

"soleOnlyDesc": function(plural=false,capital=false) {
let result = "";

switch(this.footType) {
case "paw":
result = plural ? "pads" : "pads";
break;
case "hoof":
result = plural ? pickString("frogs","soles"):pickString("frog","sole");
break;
case "foot":
result = plural ? "soles" : "sole";
break;
case "avian":
result = plural ? "pads" : "pads";
break;
}
return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
},

"soleDesc": function(plural=false,capital=false,possessive=false) {
let result = "";
if (!this.footWear) {
return this.soleOnlyDesc(plural,capital);
}
if (!this.footSockWorn && !this.footShoeWorn) {
return this.soleOnlyDesc(plural,capital);
} else if (this.footShoeWorn) {
switch(this.footShoe) {
case "shoe":
result = plural ? "heels" : "heel";
break;
case "boot":
result = plural ? "heels" : "heel";
break;
case "trainer":
result = plural ? "heels" : "heel";
break;
case "sandal":
result = plural ? "heels" : "heel";
break;
case "heel":
return plural ? "soles" : "sole";
break;
case "croc":
return plural ? "heels" : "heel";
break;
}
} else if (this.footSockWorn) {
switch(this.footSock) {
case "sock":
result = "socked " + this.soleOnlyDesc(plural,false);
break;
case "stocking":
result = "stocking-wrapped " + this.soleOnlyDesc(plural, false);
break;
}
}

if(possessive) {
result = "your " + result;
}
return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
},

"shoeDesc": function(plural,capital) { "shoeDesc": function(plural,capital) {
let result = ""; let result = "";
switch(this.footShoe) { switch(this.footShoe) {
@@ -351,7 +442,7 @@ let macro =
return (this.tailCount > 1 ? "tails" : "tail"); return (this.tailCount > 1 ? "tails" : "tail");
}, },
get arousalDickFactor() { get arousalDickFactor() {
//this scales the size of the dick based on arousal, and is not directly related to arousalFactor(muiltiplier on arousal you gain from actions)
//this scales the size of the dick based on arousal, and is not directly related to arousalFactor(multiplier on arousal you gain from actions)
let factor = 1; let factor = 1;
if (!this.arousalEnabled || this.arousal < 25) { if (!this.arousalEnabled || this.arousal < 25) {
factor = 0.5; factor = 0.5;
@@ -1558,9 +1649,9 @@ let macro =
} }
if (this.maleParts) { if (this.maleParts) {
if (this.hasSheath && this.arousal < 75) { if (this.hasSheath && this.arousal < 75) {
line = "Your " + this.describeDick + " cock is hidden away in your bulging sheath, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
line = "Your " + this.describeDick + " is hidden away in your bulging sheath, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
} else { } else {
line = "Your " + this.describeDick + " cock hangs from your hips, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
line = "Your " + this.describeDick + " hangs from your hips, with two " + mass(macro.ballMass, unit, true) + ", " + length(macro.ballDiameter, unit, true) + "-wide balls hanging beneath.";
} }
result.push(line); result.push(line);
result.push(macro.balls.description); result.push(macro.balls.description);
@@ -1599,7 +1690,7 @@ let macro =
result.push(this.pouch.description); result.push(this.pouch.description);
} }


line = "Your two " + this.footDesc(true) + " shake the earth.";
line = "Your two " + length(macro.pawLength, unit, true) + " by " + length(macro.pawWidth, unit, true) + " " + this.footDesc(true) + " shake the earth.";


if (this.footShoeWorn && this.shoe.container.count > 0) { if (this.footShoeWorn && this.shoe.container.count > 0) {
line += " Within " + (this.shoe.container.count > 1 ? "are" : "is") + " " + this.shoe.container.describeSimple(verbose || flat); line += " Within " + (this.shoe.container.count > 1 ? "are" : "is") + " " + this.shoe.container.describeSimple(verbose || flat);
@@ -1651,10 +1742,7 @@ let macro =
} }
} }


let descDickArray = ["cock", "shaft", "rod"];
let randomDescDick = descDickArray[(Math.random() * descDickArray.length) | 0];

return length(this.dickLength, unit, true) + " long " + state + " " + this.dickType + " " + randomDescDick;
return length(this.dickLength, unit, true) + " long " + state + " " + this.dickType + " " + pickString("cock", "shaft", "rod", "member", "dick");
}, },


get describeVagina() { get describeVagina() {
@@ -1681,36 +1769,98 @@ let macro =
}, },
}; };


function look()
function updateBiome()
{
if(macro.height > 1e12){ //stops function from running once it stops being relevant
return
}
let strideSize = macro.height*.4;
position += strideSize;

if (position > biomeSize){
position=0;
biomeSize = ((Math.random()*4000)+1000);
let oldBiome = biome;
biome = pickString("rural","suburb","city","downtown");
if (oldBiome == biome){}
else {
look(true);
}
}
//update(["Your position is " + position + ".",newline]);
}

function look(onlyBiome=false)
{ {
let desc = macro.description;


let desc = macro.description;
let line2 = ""; let line2 = "";


if (macro.height > 1e12) if (macro.height > 1e12)
line2 = "You're pretty much everywhere at once."; line2 = "You're pretty much everywhere at once.";
else if (macro.height > 1e6) else if (macro.height > 1e6)
line2 = "You're standing...on pretty much everything at once.";
line2 = "You're " + (strolling ? "strolling" : "standing") + "...on pretty much everything at once.";
else else
switch(biome) { switch(biome) {
case "rural": line2 = "You're standing amongst rural farmhouses and expansive ranches. Cattle are milling about at your feet."; break;
case "suburb": line2 = "You're striding through the winding roads of a suburb."; break;
case "city": line2 = "You're terrorizing the streets of a city. Heavy traffic, worsened by your rampage, is everywhere."; break;
case "downtown": line2 = "You're lurking amongst the skyscrapers of downtown. The streets are packed, and the buildings are practically begging you to knock them over.";
case "rural": line2 = "You're " + (strolling ? "strolling" : "standing") + " amongst rural farmhouses and expansive ranches. Cattle are milling about at your feet."; break;
case "suburb": line2 = "You're " + (strolling ? "striding" : "standing") + " through the winding roads of a suburb."; break;
case "city":
if (macro.height < 6) {
line2 = "You are " + (strolling ? "strolling" : "standing") + " in the street of a city. Several " + (macro.victimsHuman ? "humans" : "people") + " have noticed your intimidating presence and are beginning to run."; break;
} else if (macro.height < 24) {
line2 = "Your broad frame fills the street of the city you are terrorizing. Your presence has caused a pileup of vehicles trying to escape."; break;
} else if (macro.height < 100){
line2 = "You are too large for the city streets you are " + (strolling ? "strolling through." : "standing in.") + " Your hulking frame scrapes against building after building, leaving a clear indicator of your path. Gridlock is starting to set in, with people honking and trying to drive away on the sidewalks."; break;
} else if (macro.height < 500){
line2 = "You are " + (strolling ? "strolling through" : "looming over") + " a bustling city. Your mammoth frame is on par with the few nearby skyscrapers, You forge your own path, leaving a swath of demolished buildings. Panic has fully gripped the city; the streets are filled with vehicles, all immobile."; break;
} else if (macro.height < 2500){
line2 = "You are " + (strolling ? "strolling over" : "looming over") + " a city in the midst of chaos. Your colossal bulk blots out the sky, and makes the couple of remaining skyscrapers look small in comparison. You can clearly see the imprints of your " + macro.footDesc(true) + ". Traffic is gridlocked as far as you can see, and farther." ; break;
} else {
line2 = "You're terrorizing the streets of a city. Heavy traffic, worsened by your rampage, is everywhere."; break;
}
case "downtown": line2 = "You're lurking amongst the skyscrapers of downtown. The streets are packed, and the buildings are practically begging you to knock them over."; break;
} }


desc = desc.concat([newline,line2,newline]);
update(desc);

if (onlyBiome == true){
update([line2]);
} else {
desc = desc.concat([newline,line2,newline]);
update(desc);
}
} }


function toggle_auto(e) function toggle_auto(e)
{ {
strolling = !strolling;
e.target.innerText = "Status: " + (strolling ? "Strolling" : "Standing");
if (strolling)
update(["You start walking.",newline]);
else
update(["You stop walking.",newline]);
switch(strolling) { //Changes how fast player is moving, if player is running, sets player back to standing
case strollingEnum.Standing:
strolling = strollingEnum.Strolling;
e.target.innerText = "Status: Strolling";
update(["You start walking.",newline]);
break;
case strollingEnum.Strolling:
strolling = strollingEnum.Jogging;
e.target.innerText = "Status: Jogging";
update(["You start jogging.",newline]);
break;
case strollingEnum.Jogging:
strolling = strollingEnum.Running;
e.target.innerText = "Status: Running";
update(["You start running.",newline]);
break;
case strollingEnum.Running:
strolling = strollingEnum.Standing;
e.target.innerText = "Status: Standing";
update(["You stop running..",newline]);
break;
}
// strolling = !strolling;
// e.target.innerText = "Status: " + (strolling ? "Strolling" : "Standing");
//if (strolling)
// update(["You start walking.",newline]);
//else
// update(["You stop walking.",newline]);
//this is the old code where strolling is defined as true and false(strolling is now referencing an Enum) should probably be ripped out if this ever makes it onto the main Repo
} }


function toggle_units(e) function toggle_units(e)
@@ -1905,21 +2055,21 @@ function getWeights(region, area) {
weights["Artillery"] = 0.06; weights["Artillery"] = 0.06;
weights["Helicopter"] = 0.05, weights["Helicopter"] = 0.05,
weights["Squad"]= .04; weights["Squad"]= .04;
weights["Platoon"]= .4,
weights["Company"]= .5,
weights["Battalion"]= .6,
weights["Brigade"]= .7;
weights["Platoon"]= .2,
weights["Company"]= .3,
weights["Battalion"]= .4,
weights["Brigade"]= .5;
} else if (macro.height < 5000){ } else if (macro.height < 5000){
weights["Tank"] = 0.0002; weights["Tank"] = 0.0002;
weights["Artillery"] = 0.001; weights["Artillery"] = 0.001;
weights["Squad"]= .0001; weights["Squad"]= .0001;
weights["Platoon"]= .005,
weights["Company"]= .01,
weights["Battalion"]= .02,
weights["Brigade"]= .03;
weights["Division"]= .02,
weights["Tank Division"]= .01,
weights["Army"]= .01;
weights["Platoon"]= .0005,
weights["Company"]= .001,
weights["Battalion"]= .002,
weights["Brigade"]= .003;
weights["Division"]= .002,
weights["Tank Division"]= .001,
weights["Army"]= .001;
} else { } else {
weights["Division"]= .02, weights["Division"]= .02,
weights["Tank Division"]= .01, weights["Tank Division"]= .01,
@@ -2008,6 +2158,7 @@ function do_digestion(owner, organ, container, active=false) {
} }
} }



function digest_stomach() { function digest_stomach() {
digest_all(macro.stomach, true); digest_all(macro.stomach, true);
} }
@@ -2164,6 +2315,8 @@ function stomp()


update([sound,line,linesummary,newline]); update([sound,line,linesummary,newline]);


updateBiome(false);

macro.arouse(5); macro.arouse(5);


stomp_wedge(); stomp_wedge();
@@ -2903,7 +3056,7 @@ function male_spurt(vol, active=true)
let area = Math.pow(vol, 2/3); let area = Math.pow(vol, 2/3);


let prey = getPrey(biome, area); let prey = getPrey(biome, area);
let line = describe("male-spurt", prey, macro, verbose, flat).replace("$VOLUME",volume(vol,unit,false));
let line = describe("male-spurt", prey, macro, verbose, flat, vol).replace("$VOLUME",volume(vol,unit,true));
let linesummary = summarize(prey.sum(), true); let linesummary = summarize(prey.sum(), true);


let people = get_living_prey(prey.sum()); let people = get_living_prey(prey.sum());
@@ -2945,7 +3098,7 @@ function male_orgasm(vol, active=true)
let area = Math.pow(vol, 2/3); let area = Math.pow(vol, 2/3);


let prey = getPrey(biome, area); let prey = getPrey(biome, area);
let line = describe("male-orgasm", prey, macro, verbose, flat).replace("$VOLUME",volume(vol,unit,true));
let line = describe("male-orgasm", prey, macro, verbose, flat, vol).replace("$VOLUME",volume(vol,unit,true));
let linesummary = summarize(prey.sum(), true); let linesummary = summarize(prey.sum(), true);


let people = get_living_prey(prey.sum()); let people = get_living_prey(prey.sum());
@@ -4161,8 +4314,28 @@ function stylePercentage(name, storage) {


function pick_move() function pick_move()
{ {
setTimeout(pick_move, 1500 * (1 + Math.log10(macro.scale)));
if (!strolling) {
let moving = false;
let walkSpeed = macro.walkSpeed;
let stepTime = 0;
switch(strolling){
case strollingEnum.Standing:
moving = false;
break;
case strollingEnum.Strolling:
stepTime = (1* (1/walkSpeed) * 2000 * (1 + Math.log10(macro.scale)))
moving = true;
break;
case strollingEnum.Jogging:
stepTime = (1/2* (1/walkSpeed) * 2000 * (1 + Math.log10(macro.scale)))
moving = true;
break;
case strollingEnum.Running:
stepTime = (1/3* (1/walkSpeed) * 2000 * (1 + Math.log10(macro.scale)))
moving = true;
break;
};
setTimeout(pick_move, stepTime);
if (!moving) {
return; return;
} }


@@ -4271,7 +4444,8 @@ function grow(factor=1, simpleCalc=true){
let heightDelta = macro.height - oldHeight; let heightDelta = macro.height - oldHeight;
let massDelta = macro.mass - oldMass; let massDelta = macro.mass - oldMass;


update(["Power surges through you as you grow " + length(heightDelta, unit) + " taller and gain " + mass(massDelta, unit) + " of mass.",newline]);
update([pickString("Power surges through you","Your body surges upward","Your muscles fight for space","Energy flows into you","You feel your body expand","Your surroundings appear to shink","Your muscles tense","You almost lose your balance","A warm sensation fills you","You feel \
a buzz of power") + " as you grow " + length(heightDelta, unit) + " taller and gain " + mass(massDelta, unit) + " of mass.",newline]);
} }


function grow_paws(factor, simpleCalc=true){ function grow_paws(factor, simpleCalc=true){
@@ -4290,7 +4464,8 @@ function grow_paws(factor, simpleCalc=true){


let areaDelta = macro.pawArea - oldArea; let areaDelta = macro.pawArea - oldArea;


update(["Power surges through you as your " + macro.footDesc(true) + " grow, gaining " + area(areaDelta, unit, false) + " of area.",newline]);
update([(pickString("Power surges through you","Energy flows into you","You feel your " + macro.footDesc(true) + " expand","Your muscles tense","A warm sensation fills you","You feel a buzz of power")) + " as your \
" + macro.footOnlyDesc(true) + pickString(" grow,"," push the ground apart,"," sink deeper into the soil,") + " gaining " + area(areaDelta, unit, false) + " of area.",newline]);
} }


function grow_tail(factor, simpleCalc=true) { function grow_tail(factor, simpleCalc=true) {
@@ -4310,7 +4485,7 @@ function grow_tail(factor, simpleCalc=true) {
let lengthDelta = macro.tailLength - oldLength; let lengthDelta = macro.tailLength - oldLength;
let massDelta = macro.tailMass - oldMass; let massDelta = macro.tailMass - oldMass;


update(["Power surges through you as your " + macro.tailType + " tail grows " + length(lengthDelta, unit, false) + " longer and gains " + mass(massDelta, unit, false) + " of mass.",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel your tail twitch","Your muscles tense","Your balance shifts","A warm sensation fills you","You feel a buzz of power") + " as your " + macro.tailType + " tail grows " + length(lengthDelta, unit, false) + " longer and gains " + mass(massDelta, unit, false) + " of mass.",newline]);
} }


function grow_dick(factor, simpleCalc=true) { function grow_dick(factor, simpleCalc=true) {
@@ -4330,7 +4505,7 @@ function grow_dick(factor, simpleCalc=true) {
let lengthDelta = macro.dickLength - oldLength; let lengthDelta = macro.dickLength - oldLength;
let massDelta = macro.dickMass - oldMass; let massDelta = macro.dickMass - oldMass;


update(["Power surges through you as your " + macro.dickType + " cock grows " + length(lengthDelta, unit, false) + " longer and gains " + mass(massDelta, unit, false) + " of mass.",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel your cock throb","Your muscles tense","You feel your loins buzz with energy","A warm sensation fills you","You feel a buzz of power") + " as your " + macro.dickType + " cock grows " + length(lengthDelta, unit, false) + " longer and gains " + mass(massDelta, unit, false) + " of mass.",newline]);
} }


function grow_balls(factor, simpleCalc=true) { function grow_balls(factor, simpleCalc=true) {
@@ -4350,7 +4525,7 @@ function grow_balls(factor, simpleCalc=true) {
let diameterDelta = macro.ballDiameter - oldDiameter; let diameterDelta = macro.ballDiameter - oldDiameter;
let massDelta = macro.ballMass - oldMass; let massDelta = macro.ballMass - oldMass;


update(["Power surges through you as your balls swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece.",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel an unfamiliar weight in your sack","You sack pushes your thighs further apart","Your muscles tense","You feel your loins buzz with energy","You feel a buzz of power","A warm sensation fills you") + " as your balls swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece.",newline]);
} }


function grow_breasts(factor, simpleCalc=true) { function grow_breasts(factor, simpleCalc=true) {
@@ -4370,7 +4545,7 @@ function grow_breasts(factor, simpleCalc=true) {
let diameterDelta = macro.breastDiameter - oldDiameter; let diameterDelta = macro.breastDiameter - oldDiameter;
let massDelta = macro.breastMass - oldMass; let massDelta = macro.breastMass - oldMass;


update(["Power surges through you as your breasts swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece.",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel an unfamilliar weight on your chest","Your balance shifts","Your muscles tense","You feel a buzz of power","A warm sensation fills you") + " as your breasts swell by " + length(diameterDelta, unit, false) + ", gaining " + mass(massDelta, unit, false) + " of mass apiece.",newline]);
} }


function grow_vagina(factor, simpleCalc=true) { function grow_vagina(factor, simpleCalc=true) {
@@ -4388,7 +4563,7 @@ function grow_vagina(factor, simpleCalc=true) {


let lengthDelta = macro.vaginaLength - oldLength; let lengthDelta = macro.vaginaLength - oldLength;


update(["Power surges through you as your moist slit expands by by " + length(lengthDelta, unit, false) + ".",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel your loins buzz with energy","Your muscles tense","You feel a buzz of power","A warm sensation fills you") + " as your moist slit expands by " + length(lengthDelta, unit, false) + ".",newline]);
} }


function grow_womb(factor, simpleCalc=true) { function grow_womb(factor, simpleCalc=true) {
@@ -4406,7 +4581,7 @@ function grow_womb(factor, simpleCalc=true) {


let volumeDelta = macro.wombVolume - oldVolume; let volumeDelta = macro.wombVolume - oldVolume;


update(["Power surges through you as your womb grows larger, gaining " + volume(volumeDelta, unit, false) + " of capacity.",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel your loins buzz with energy","You feel your muscles tense","You feel a buzz of power","A warm sensation fills you") + " as your womb grows larger, gaining " + volume(volumeDelta, unit, false) + " of capacity.",newline]);
} }


function grow_ass(factor, simpleCalc=true) { function grow_ass(factor, simpleCalc=true) {
@@ -4429,7 +4604,7 @@ function grow_ass(factor, simpleCalc=true) {


let diameterDelta = Math.pow(macro.assArea,1/2) - oldDiameter; let diameterDelta = Math.pow(macro.assArea,1/2) - oldDiameter;


update(["Power surges through you as your ass swells by " + length(diameterDelta, unit, false) + ".",newline]);
update([pickString("Power surges through you","Energy flows into you","You feel your rear fill with power","You feel your rear plump out","You feel your rear expand","Your muscles tense","Your balance shifts","You feel a buzz of power","A warm sensation fills you") + " as your ass swells by " + length(diameterDelta, unit, false) + ".",newline]);
} }


function grow_wings(factor, simpleCalc=true){ function grow_wings(factor, simpleCalc=true){
@@ -4444,7 +4619,7 @@ function grow_wings(factor, simpleCalc=true){


let lengthDelta = macro.wingLength - oldLength; let lengthDelta = macro.wingLength - oldLength;


update(["Power surges through you as your " + macro.wingDesc(true) + " grow, gaining " + length(2 * lengthDelta, unit, false) + " of wingspan.",newline]);
update([pickString("Power surges through you","Energy flows into you","Your back muscles fight for space","Your muscles tense","A crackeling fills the air","Your balance shifts","You feel a buzz of power","A warm sensation fills you") + " as your " + macro.wingDesc(true) + " grow, gaining " + length(2 * lengthDelta, unit, false) + " of wingspan.",newline]);
} }


function resetSettings() { function resetSettings() {
@@ -5233,6 +5408,7 @@ function render_int_option(li, option) {
render_number_option(li, option, "int"); render_number_option(li, option, "int");
} }


//sets up style for "radio" in features.js
function render_radio_option(options_div, option) { function render_radio_option(options_div, option) {
option.choices.forEach(function(choice) { option.choices.forEach(function(choice) {
let li = document.createElement("li"); let li = document.createElement("li");
@@ -5261,6 +5437,7 @@ function render_radio_option(options_div, option) {
}); });
} }


//sets up style for "checkbox" in features.js
function render_checkbox_option(li, option) { function render_checkbox_option(li, option) {


let input = document.createElement("input"); let input = document.createElement("input");


+ 1712
- 260
recursive-desc.js
File diff suppressed because it is too large
View File


+ 58
- 27
recursive-macro.js View File

@@ -3,21 +3,28 @@
var things = var things =
{ {
"Container": Container, "Container": Container,

//Creatures
"Person": Person, "Person": Person,
"Human": Human, "Human": Human,
"Cow": Cow, "Cow": Cow,
"Micro": Micro,
"Macro": Macro,
//Vehicles
"Empty Car": EmptyCar, "Empty Car": EmptyCar,
"Car": Car, "Car": Car,
"Bus": Bus, "Bus": Bus,
"Tram": Tram, "Tram": Tram,
"Train": Train,
"Train Car": TrainCar,
//Buildings
"House": House, "House": House,
"Business": Business, "Business": Business,
"Barn": Barn, "Barn": Barn,
"Small Skyscraper": SmallSkyscraper, "Small Skyscraper": SmallSkyscraper,
"Large Skyscraper": LargeSkyscraper, "Large Skyscraper": LargeSkyscraper,
"Train": Train,
"Train Car": TrainCar,
"Parking Garage": ParkingGarage, "Parking Garage": ParkingGarage,
//Places
"Town": Town, "Town": Town,
"City": City, "City": City,
"Continent": Continent, "Continent": Continent,
@@ -28,12 +35,11 @@ var things =
"Cluster": Cluster, "Cluster": Cluster,
"Universe": Universe, "Universe": Universe,
"Multiverse": Multiverse, "Multiverse": Multiverse,
//Military
"Soldier": Soldier, "Soldier": Soldier,
"Tank": Tank, "Tank": Tank,
"Artillery": Artillery, "Artillery": Artillery,
"Helicopter": Helicopter, "Helicopter": Helicopter,
"Micro": Micro,
"Macro": Macro,
"Squad": Squad, "Squad": Squad,
"Platoon": Platoon, "Platoon": Platoon,
"Company": Company, "Company": Company,
@@ -47,20 +53,26 @@ var things =
var areas = var areas =
{ {
"Container": 0, "Container": 0,
//Creatures
"Person": 0.33, "Person": 0.33,
"Human": 0.33, "Human": 0.33,
"Cow": 2, "Cow": 2,
"Micro": 0.05,
"Macro": 100,
//Vehicles
"Car": 4, "Car": 4,
"Bus": 12, "Bus": 12,
"Tram": 20, "Tram": 20,
"Train": 40,
"Train Car": 20,
//Buildings
"House": 150, "House": 150,
"Business": 400, "Business": 400,
"Barn": 300, "Barn": 300,
"Small Skyscraper": 1000, "Small Skyscraper": 1000,
"Large Skyscraper": 2000, "Large Skyscraper": 2000,
"Train": 40,
"Train Car": 20,
"Parking Garage": 750, "Parking Garage": 750,
//Places
"Town": 1e7, "Town": 1e7,
"City": 1e9, "City": 1e9,
"Continent": 1.5e13, "Continent": 1.5e13,
@@ -71,12 +83,11 @@ var areas =
"Cluster": 2e49, "Cluster": 2e49,
"Universe": 7e53, "Universe": 7e53,
"Multiverse": 5e56, "Multiverse": 5e56,
//Military
"Soldier": 1, "Soldier": 1,
"Tank": 10, "Tank": 10,
"Artillery": 12, "Artillery": 12,
"Helicopter": 8, "Helicopter": 8,
"Micro": 0.05,
"Macro": 100,
"Squad": 20, "Squad": 20,
"Platoon": 100, "Platoon": 100,
"Company": 500, "Company": 500,
@@ -90,20 +101,26 @@ var areas =
var masses = var masses =
{ {
"Container": 0, "Container": 0,
//Creatures
"Person": 80, "Person": 80,
"Human": 80, "Human": 80,
"Cow": 300, "Cow": 300,
"Micro": 0.01,
"Macro": 80000,
//Vehicles
"Car": 1000, "Car": 1000,
"Bus": 5000, "Bus": 5000,
"Tram": 10000, "Tram": 10000,
"Train": 50000,
"Train Car": 7500,
//Buildings
"House": 10000, "House": 10000,
"Business": 50000, "Business": 50000,
"Barn": 5000, "Barn": 5000,
"Small Skyscraper": 10000000, "Small Skyscraper": 10000000,
"Large Skyscraper": 80000000, "Large Skyscraper": 80000000,
"Train": 50000,
"Train Car": 7500,
"Parking Garage": 10000000, "Parking Garage": 10000000,
//Places
"Town": 1, "Town": 1,
"City": 1, "City": 1,
"Continent": 1e21, "Continent": 1e21,
@@ -114,12 +131,11 @@ var masses =
"Cluster": 1, "Cluster": 1,
"Universe": 1, "Universe": 1,
"Multiverse": 1, "Multiverse": 1,
//Military
"Soldier": 80, "Soldier": 80,
"Tank": 5000, "Tank": 5000,
"Artillery": 7000, "Artillery": 7000,
"Helicopter": 1500, "Helicopter": 1500,
"Micro": 0.01,
"Macro": 80000,
"Squad": 1, "Squad": 1,
"Platoon": 100, "Platoon": 100,
"Company": 500, "Company": 500,
@@ -133,20 +149,26 @@ var masses =
var clusters = var clusters =
{ {
"Container": 0, "Container": 0,
//Creatures
"Person": 5, "Person": 5,
"Human": 5, "Human": 5,
"Cow": 15, "Cow": 15,
"Micro": 10,
"Macro": 0,
//Vehicles
"Car": 3, "Car": 3,
"Bus": 1, "Bus": 1,
"Tram": 1, "Tram": 1,
"Train": 2,
"Train Car": 1,
//Buildings
"House": 5, "House": 5,
"Business": 5, "Business": 5,
"Barn": 1, "Barn": 1,
"Small Skyscraper": 2, "Small Skyscraper": 2,
"Large Skyscraper": 1, "Large Skyscraper": 1,
"Train": 2,
"Train Car": 1,
"Parking Garage": 1, "Parking Garage": 1,
//Places
"Town": 5, "Town": 5,
"City": 1, "City": 1,
"Continent": 5, "Continent": 5,
@@ -157,12 +179,11 @@ var clusters =
"Cluster": 1, "Cluster": 1,
"Universe": 1, "Universe": 1,
"Multiverse": 1, "Multiverse": 1,
//Military
"Soldier": 0, "Soldier": 0,
"Tank": 0, "Tank": 0,
"Artillery": 0, "Artillery": 0,
"Helicopter": 0, "Helicopter": 0,
"Micro": 10,
"Macro": 0,
"Squad": 20, "Squad": 20,
"Platoon": 2, "Platoon": 2,
"Company": 2, "Company": 2,
@@ -176,20 +197,26 @@ var clusters =
var cluster_chances = var cluster_chances =
{ {
"Container": 0, "Container": 0,
//Creatures
"Person": 0.8, "Person": 0.8,
"Human": 0.8, "Human": 0.8,
"Cow": 0.5, "Cow": 0.5,
"Micro": 10,
"Macro": 0,
//Vehicles
"Car": 0.5, "Car": 0.5,
"Bus": 0.25, "Bus": 0.25,
"Tram": 0.2, "Tram": 0.2,
"Train": 0.1,
"Train Car": 0.05,
//Buildings
"House": 0.5, "House": 0.5,
"Business": .05, "Business": .05,
"Barn": 0.1, "Barn": 0.1,
"Small Skyscraper": 0.25, "Small Skyscraper": 0.25,
"Large Skyscraper": 0.25, "Large Skyscraper": 0.25,
"Train": 0.1,
"Train Car": 0.05,
"Parking Garage": 0.1, "Parking Garage": 0.1,
//Places
"Town": 0.1, "Town": 0.1,
"City": 0.2, "City": 0.2,
"Continent": 0.5, "Continent": 0.5,
@@ -200,12 +227,11 @@ var cluster_chances =
"Cluster": 1, "Cluster": 1,
"Universe": 1, "Universe": 1,
"Multiverse": 1, "Multiverse": 1,
//Military
"Soldier": 0, "Soldier": 0,
"Tank": 0, "Tank": 0,
"Artillery": 0, "Artillery": 0,
"Helicopter": 0, "Helicopter": 0,
"Micro": 10,
"Macro": 0,
"Squad": .05, "Squad": .05,
"Platoon": .05, "Platoon": .05,
"Company": .1, "Company": .1,
@@ -219,20 +245,26 @@ var cluster_chances =
var contents = var contents =
{ {
"Container": [], "Container": [],
//Creatures
"Person": [], "Person": [],
"Human": [], "Human": [],
"Cow": [], "Cow": [],
"Micro": [[]],
"Macro": [[]],
//Vehicles
"Car": [["Person",1,4]], "Car": [["Person",1,4]],
"Bus": [["Person",2,30]], "Bus": [["Person",2,30]],
"Tram": [["Person",10,50]], "Tram": [["Person",10,50]],
"Train": [["Person",1,4,"engine"],["Train Car",2,10]], "Train": [["Person",1,4,"engine"],["Train Car",2,10]],
"Train Car": [["Person",10,40]], "Train Car": [["Person",10,40]],
//Buildings
"House": [["Person",0,8],["Empty Car",0,2]], "House": [["Person",0,8],["Empty Car",0,2]],
"Business": [["Person",0,30],["Car",0,20]], "Business": [["Person",0,30],["Car",0,20]],
"Barn": [["Person",0,2],["Cow",30,70]], "Barn": [["Person",0,2],["Cow",30,70]],
"Small Skyscraper": [["Person",150,750],["Empty Car",10,50]], "Small Skyscraper": [["Person",150,750],["Empty Car",10,50]],
"Large Skyscraper": [["Person",500,1500],["Empty Car",20,100]], "Large Skyscraper": [["Person",500,1500],["Empty Car",20,100]],
"Parking Garage": [["Person",10,200],["Empty Car",100,300],["Car",5,30]], "Parking Garage": [["Person",10,200],["Empty Car",100,300],["Car",5,30]],
//Places
"Town": [["Person",10000,100000],["House",5000,50000],["Empty Car",200,800],["Car",500,80000],["Bus",5,25],["Train",5,25],["Business",500,5000]], "Town": [["Person",10000,100000],["House",5000,50000],["Empty Car",200,800],["Car",500,80000],["Bus",5,25],["Train",5,25],["Business",500,5000]],
"City": [["Person",100000,1500000],["House",20000,200000],["Empty Car",10000,100000],["Car",7500,125000],["Bus",200,400],["Train",10,50],["Tram",25,100],["Small Skyscraper",50,300],["Large Skyscraper",10,75],["Parking Garage",5,10],["Business",2000,10000]], "City": [["Person",100000,1500000],["House",20000,200000],["Empty Car",10000,100000],["Car",7500,125000],["Bus",200,400],["Train",10,50],["Tram",25,100],["Small Skyscraper",50,300],["Large Skyscraper",10,75],["Parking Garage",5,10],["Business",2000,10000]],
"Continent": [["Person",1000000,15000000],["House",2500,10000],["Car",25000,375000],["Train",50,500],["Town",500,1000],["City",50,250],["Business",250,1000]], "Continent": [["Person",1000000,15000000],["House",2500,10000],["Car",25000,375000],["Train",50,500],["Town",500,1000],["City",50,250],["Business",250,1000]],
@@ -243,12 +275,11 @@ var contents =
"Cluster": [["Galaxy",200,5000]], "Cluster": [["Galaxy",200,5000]],
"Universe": [["Cluster",1.5e9,2.5e9]], "Universe": [["Cluster",1.5e9,2.5e9]],
"Multiverse": [["Universe",100,1000]], "Multiverse": [["Universe",100,1000]],
//Military
"Soldier": [], "Soldier": [],
"Tank": [["Soldier",3,5]], "Tank": [["Soldier",3,5]],
"Artillery": [["Soldier",4,6]], "Artillery": [["Soldier",4,6]],
"Helicopter": [["Soldier",4,16]], "Helicopter": [["Soldier",4,16]],
"Micro": [[]],
"Macro": [[]],
//Alterante Army Structuring, may be used later //Alterante Army Structuring, may be used later
//"Squad": [["Soldier",6,9]], //"Squad": [["Soldier",6,9]],
// "Platoon": [["Squad",3,4]], // "Platoon": [["Squad",3,4]],
@@ -861,7 +892,7 @@ function Bus(count = 1) {
this.describeOne = function(verbose=true) { this.describeOne = function(verbose=true) {
var adjective = random_desc(["rusty","brand-new","aging","modern"], (verbose ? 0.3 : 0)); var adjective = random_desc(["rusty","brand-new","aging","modern"], (verbose ? 0.3 : 0));
var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0)); var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
var type = random_desc(["bus","school bus","double-decker bus","articulating bus","open-top bus","sleeper bus","intercity bus"]);
var type = random_desc(["bus","double-decker bus","articulating bus","open-top bus","sleeper bus","intercity bus"]);
return "a " + merge_desc([adjective,color,type]); return "a " + merge_desc([adjective,color,type]);
}; };


@@ -1139,7 +1170,7 @@ function ParkingGarage(count = 1) {


this.describe = function(verbose = true) { this.describe = function(verbose = true) {
if (verbose) { if (verbose) {
return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose) + " inside";
return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose);
} else { } else {
return (this.count == 1 ? "a parking garage" : this.count + " parking garages"); return (this.count == 1 ? "a parking garage" : this.count + " parking garages");
} }
@@ -1322,7 +1353,7 @@ function Tank(count = 1) {


this.describe = function(verbose = true) { this.describe = function(verbose = true) {
if (verbose) { if (verbose) {
return (this.count == 1 ? "a tank" : this.count + " tanks") + " with " + describe_all(this.contents, verbose) + " trapped inside.";
return (this.count == 1 ? "a tank" : this.count + " tanks") + " with " + describe_all(this.contents, verbose) + " trapped inside";
} else { } else {
return (this.count == 1 ? "a tank" : this.count + " tanks"); return (this.count == 1 ? "a tank" : this.count + " tanks");
} }
@@ -1338,7 +1369,7 @@ function Artillery(count = 1) {


this.describe = function(verbose = true) { this.describe = function(verbose = true) {
if (verbose) { if (verbose) {
return (this.count == 1 ? "an artillery unit" : this.count + " artillery units") + " with " + describe_all(this.contents, verbose) + " trapped inside.";
return (this.count == 1 ? "an artillery unit" : this.count + " artillery units") + " with " + describe_all(this.contents, verbose) + " trapped inside";
} else { } else {
return (this.count == 1 ? "an artillery unit" : this.count + " artillery units"); return (this.count == 1 ? "an artillery unit" : this.count + " artillery units");
} }
@@ -1354,7 +1385,7 @@ function Helicopter(count = 1) {


this.describe = function(verbose = true) { this.describe = function(verbose = true) {
if (verbose) { if (verbose) {
return (this.count == 1 ? "a helicopter" : this.count + " helicopters") + " with " + describe_all(this.contents, verbose) + " riding inside.";
return (this.count == 1 ? "a helicopter" : this.count + " helicopters") + " with " + describe_all(this.contents, verbose) + " riding inside";
} else { } else {
return (this.count == 1 ? "a helicopter" : this.count + " helicopters"); return (this.count == 1 ? "a helicopter" : this.count + " helicopters");
} }


+ 27
- 11
units.js View File

@@ -215,22 +215,22 @@ function approxMass(kg, singular=false) {
let mass = round(kg/5.2e10,2); let mass = round(kg/5.2e10,2);
return mass + (singular || mass == 1 ? " Great Wall of China" : " Great Wall Of Chinas"); return mass + (singular || mass == 1 ? " Great Wall of China" : " Great Wall Of Chinas");
} else if (kg < 5e21) { } else if (kg < 5e21) {
let mass = round(kg/1.5373768e15,3);
return mass + (singular || mass == 1 ? " New York City" : mass + " New York Cities");
let mass = round(kg/1.5e15,2);
return mass + (singular || mass == 1 ? " New York City" : " New York Cities");
//this figure includes a lot of underlying bedrock, just the city itself is 1.13587210581190e11 but I needed a good figure to fit in this spot //this figure includes a lot of underlying bedrock, just the city itself is 1.13587210581190e11 but I needed a good figure to fit in this spot
} else if (kg < 6e23) { } else if (kg < 6e23) {
let mass = round(kg/4.6121304e20,3);
return mass +(singular || mass == 1 ? " Australia" : mass + " Australias");
//this is a napkin math number based on the land area of Australia, 25km of height and rough density of rock
let mass = round(kg/4.6e20,2);
return mass + (singular || mass == 1 ? " Australia" : " Australias");
//this is a napkin math number based on the land area of Australia, 25km of height, and rough density of rock
} else if (kg < 2e27) { } else if (kg < 2e27) {
let mass = round(kg/5.972e24,4);
return mass + (singular || mass == 1 ? " Earth" : mass + " Earths");
let mass = round(kg/6e24,2);
return mass + (singular || mass == 1 ? " Earth" :" Earths");
} else if (kg < 1.4e39) { } else if (kg < 1.4e39) {
let mass = round(kg/1.989e30,4);
return mass + (singular || mass == 1 ? " Sun" : mass + " Suns");
let mass = round(kg/2e30,2);
return mass + (singular || mass == 1 ? " Sun" :" Suns");
} else { } else {
let mass = round(kg/1.3923e42,4);
return mass + (singular || mass == 1 ? " Milky Way" : mass + " Milky Ways");
let mass = round(kg/1.4e42,2);
return mass + (singular || mass == 1 ? " Milky Way" :" Milky Ways");
} }
} }


@@ -400,3 +400,19 @@ function approxVolume(m3, singular=false) {
return volume + (singular || volume == 1 ? " Sun" : " Suns"); return volume + (singular || volume == 1 ? " Sun" : " Suns");
} }
} }


function makeSphere(input=0, diameter=false) {
if (diameter = true) {
input = input/2;
}
return (4/3)*Math.PI*(Math.pow(input, 3));
}

function breakSphere(input=0, diameter=false) {
let output = math.pow((3*input)/(4*Math.PI), 1/3)
if (diameter=true) {
output = output*2;
}
return output;
}

Loading…
Cancel
Save