| @@ -324,7 +324,7 @@ var macro = | |||
| return result; | |||
| }, | |||
| "scale": 3, | |||
| "scale": 1, | |||
| "scaleWithMass": function(mass) { | |||
| var startMass = this.mass; | |||
| @@ -339,12 +339,15 @@ function look() | |||
| var line2 = "" | |||
| 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."; | |||
| } | |||
| if (macro.height > 1e6) | |||
| line2 = "You're standing...on pretty much everything at once."; | |||
| else | |||
| 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."; | |||
| } | |||
| desc = desc.concat([newline,line2,newline]); | |||
| update(desc); | |||
| @@ -420,6 +423,10 @@ function initVictims() | |||
| "Train Car": 0, | |||
| "Parking Garage": 0, | |||
| "Overpass": 0, | |||
| "Town": 0, | |||
| "City": 0, | |||
| "Continent": 0, | |||
| "Planet": 0 | |||
| }; | |||
| }; | |||
| @@ -434,12 +441,15 @@ function getOnePrey(biome,area) | |||
| { | |||
| var potential = ["Person"]; | |||
| switch(biome) { | |||
| case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break; | |||
| case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break; | |||
| case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Parking Garage"]; break; | |||
| case "rural": potential = ["Person", "Barn", "House", "Cow"]; break; | |||
| } | |||
| if(macro.height > 1e6) | |||
| potential = ["Town","City","Continent","Planet"]; | |||
| else | |||
| switch(biome) { | |||
| case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break; | |||
| case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break; | |||
| case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Parking Garage"]; break; | |||
| case "rural": potential = ["Person", "Barn", "House", "Cow"]; break; | |||
| } | |||
| var potAreas = [] | |||
| @@ -464,38 +474,48 @@ function getPrey(region, area) | |||
| { | |||
| var weights = {"Person": 1}; | |||
| switch(region) | |||
| { | |||
| case "rural": weights = { | |||
| "Person": 0.05, | |||
| "House": 0.01, | |||
| "Barn": 0.01, | |||
| "Cow": 0.2 | |||
| }; break; | |||
| case "suburb": weights = { | |||
| "Person": 0.5, | |||
| "House": 0.5, | |||
| "Car": 0.2, | |||
| "Train": 0.1, | |||
| "Bus": 0.1 | |||
| }; break; | |||
| case "city": weights = { | |||
| "Person": 0.5, | |||
| "House": 0.2, | |||
| "Car": 0.2, | |||
| "Train": 0.1, | |||
| "Bus": 0.1, | |||
| "Tram": 0.1, | |||
| "Parking Garage": 0.02 | |||
| }; break; | |||
| case "downtown": weights = { | |||
| "Person": 0.5, | |||
| "Car": 0.3, | |||
| "Bus": 0.15, | |||
| "Tram": 0.1, | |||
| "Parking Garage": 0.02, | |||
| "Small Skyscraper": 0.4 | |||
| }; break; | |||
| if (macro.height > 1e6) { | |||
| weights = { | |||
| "Town": 0.1, | |||
| "City": 0.05, | |||
| "Continent": 0.5, | |||
| "Planet": 1 | |||
| } | |||
| } | |||
| else { | |||
| switch(region) | |||
| { | |||
| case "rural": weights = { | |||
| "Person": 0.05, | |||
| "House": 0.01, | |||
| "Barn": 0.01, | |||
| "Cow": 0.2 | |||
| }; break; | |||
| case "suburb": weights = { | |||
| "Person": 0.5, | |||
| "House": 0.5, | |||
| "Car": 0.2, | |||
| "Train": 0.1, | |||
| "Bus": 0.1 | |||
| }; break; | |||
| case "city": weights = { | |||
| "Person": 0.5, | |||
| "House": 0.2, | |||
| "Car": 0.2, | |||
| "Train": 0.1, | |||
| "Bus": 0.1, | |||
| "Tram": 0.1, | |||
| "Parking Garage": 0.02 | |||
| }; break; | |||
| case "downtown": weights = { | |||
| "Person": 0.5, | |||
| "Car": 0.3, | |||
| "Bus": 0.15, | |||
| "Tram": 0.1, | |||
| "Parking Garage": 0.02, | |||
| "Small Skyscraper": 0.4 | |||
| }; break; | |||
| } | |||
| } | |||
| return fill_area2(area,weights); | |||
| } | |||
| @@ -823,9 +843,7 @@ function ball_smother() | |||
| function male_orgasm(vol) | |||
| { | |||
| // let's make it 10cm thick | |||
| var area = vol * 10; | |||
| var area = Math.pow(vol, 2/3); | |||
| var prey = getPrey(biome, area); | |||
| var line = prey.male_orgasm(verbose).replace("$VOLUME",volume(vol,unit,false)) | |||
| @@ -858,9 +876,7 @@ function male_orgasm(vol) | |||
| function female_orgasm(vol) | |||
| { | |||
| // let's make it 10cm thick | |||
| var area = vol * 10; | |||
| var area = Math.pow(vol, 2/3); | |||
| var prey = getPrey(biome, area); | |||
| var line = prey.female_orgasm(verbose).replace("$VOLUME",volume(vol,unit,false)); | |||
| @@ -901,7 +917,8 @@ function update(lines = []) | |||
| log.appendChild(line); | |||
| }); | |||
| log.scrollTop = log.scrollHeight; | |||
| if (lines.length > 0) | |||
| log.scrollTop = log.scrollHeight; | |||
| document.getElementById("height").innerHTML = "Height: " + length(macro.height, unit); | |||
| document.getElementById("mass").innerHTML = "Mass: " + mass(macro.mass, unit); | |||
| @@ -970,6 +987,23 @@ function option_female() { | |||
| document.getElementById("button-female-genitals").innerHTML = (macro.femaleParts ? "Female genitals on" : "Female genitals off"); | |||
| } | |||
| function preset(name) { | |||
| switch(name){ | |||
| case "Fen": | |||
| macro.species = "crux"; | |||
| macro.baseHeight = 2.2606; | |||
| macro.baseMass = 124.738; | |||
| break; | |||
| case "Renard": | |||
| macro.species = "fox"; | |||
| macro.baseHeight = 1.549; | |||
| macro.baseMass = 83.9; | |||
| case "Vulpes": | |||
| macro.species = "fox"; | |||
| macro.baseHeight = 20000; | |||
| macro.baseMass = 180591661866272; | |||
| } | |||
| } | |||
| function startGame() { | |||
| document.getElementById("option-panel").style.display = 'none'; | |||
| document.getElementById("action-panel").style.display = 'flex'; | |||
| @@ -1033,13 +1067,13 @@ function startGame() { | |||
| } | |||
| var species = document.getElementById("option-species").value; | |||
| var re = /^[a-zA-Z\- ]+$/; | |||
| //var species = document.getElementById("option-species").value; | |||
| //var re = /^[a-zA-Z\- ]+$/; | |||
| // tricksy tricksy players | |||
| if (re.test(species)) { | |||
| macro.species = species; | |||
| } | |||
| //if (re.test(species)) { | |||
| // macro.species = species; | |||
| //} | |||
| macro.init(); | |||
| @@ -15,6 +15,10 @@ var things = | |||
| "Train Car": TrainCar, | |||
| "Parking Garage": ParkingGarage, | |||
| "Overpass": Overpass, | |||
| "Town": Town, | |||
| "City": City, | |||
| "Continent": Continent, | |||
| "Planet": Planet | |||
| }; | |||
| var areas = | |||
| @@ -33,6 +37,10 @@ var areas = | |||
| "TrainCar": 500, | |||
| "Parking Garage": 5000, | |||
| "Overpass": 10000, | |||
| "Town": 1e7, | |||
| "City": 1e9, | |||
| "Continent": 1.5e13, | |||
| "Planet": 5e14 | |||
| }; | |||
| var masses = | |||
| @@ -51,6 +59,10 @@ var masses = | |||
| "Train Car": 5000, | |||
| "Parking Garage": 100000, | |||
| "Overpass": 100000, | |||
| "Town": 0, | |||
| "City": 0, | |||
| "Continent": 1e12, | |||
| "Planet": 5.972e24 | |||
| }; | |||
| // general logic: each step fills in a fraction of the remaining space | |||
| @@ -842,3 +854,133 @@ function Overpass(count = 1) { | |||
| amount = distribution(25,100,count); | |||
| this.contents.car = new Car(amount); | |||
| } | |||
| function Town(count = 1) { | |||
| this.name = "Town"; | |||
| copy_defaults(this,new DefaultEntity()); | |||
| this.count = count; | |||
| this.contents = {}; | |||
| var amount = distribution(1000,15000,count); | |||
| this.contents.person = new Person(amount); | |||
| var amount = distribution(500,10000,count); | |||
| this.contents.house = new House(amount); | |||
| var amount = distribution(250,3750,count); | |||
| this.contents.emptycar = new EmptyCar(amount); | |||
| var amount = distribution(250,3750,count); | |||
| this.contents.car = new Car(amount); | |||
| var amount = distribution(5,10,count); | |||
| this.contents.train = new Train(amount); | |||
| var amount = distribution(2,10,count); | |||
| this.contents.smallskyscraper = new SmallSkyscraper(amount); | |||
| var amount = distribution(1,5,count); | |||
| this.contents.parkinggarage = new ParkingGarage(amount); | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| return (this.count == 1 ? "a town" : this.count + " towns") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them"); | |||
| } else { | |||
| return (this.count == 1 ? "a town" : this.count + " towns"); | |||
| } | |||
| } | |||
| } | |||
| function City(count = 1) { | |||
| this.name = "City"; | |||
| copy_defaults(this,new DefaultEntity()); | |||
| this.count = count; | |||
| this.contents = {}; | |||
| var amount = distribution(10000,150000,count); | |||
| this.contents.person = new Person(amount); | |||
| var amount = distribution(5000,100000,count); | |||
| this.contents.house = new House(amount); | |||
| var amount = distribution(2500,37500,count); | |||
| this.contents.emptycar = new EmptyCar(amount); | |||
| var amount = distribution(2500,37500,count); | |||
| this.contents.car = new Car(amount); | |||
| var amount = distribution(50,100,count); | |||
| this.contents.train = new Train(amount); | |||
| var amount = distribution(100,300,count); | |||
| this.contents.tram = new Tram(amount); | |||
| var amount = distribution(20,100,count); | |||
| this.contents.smallskyscraper = new SmallSkyscraper(amount); | |||
| var amount = distribution(10,50,count); | |||
| this.contents.parkinggarage = new ParkingGarage(amount); | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| return (this.count == 1 ? "a city" : this.count + " cities") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them"); | |||
| } else { | |||
| return (this.count == 1 ? "a city" : this.count + " cities"); | |||
| } | |||
| } | |||
| } | |||
| function Continent(count = 1) { | |||
| this.name = "Continent"; | |||
| copy_defaults(this,new DefaultEntity()); | |||
| this.count = count; | |||
| this.contents = {}; | |||
| var amount = distribution(100000,1500000,count); | |||
| this.contents.person = new Person(amount); | |||
| var amount = distribution(5000,100000,count); | |||
| this.contents.house = new House(amount); | |||
| var amount = distribution(25000,375000,count); | |||
| this.contents.car = new Car(amount); | |||
| var amount = distribution(500,1000,count); | |||
| this.contents.train = new Train(amount); | |||
| var amount = distribution(2000,5000,count); | |||
| this.contents.town = new Town(amount); | |||
| var amount = distribution(200,500,count); | |||
| this.contents.city = new City(amount); | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| return (this.count == 1 ? "a continent" : this.count + " continents") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them"); | |||
| } else { | |||
| return (this.count == 1 ? "a continent" : this.count + " continents"); | |||
| } | |||
| } | |||
| } | |||
| function Planet(count = 1) { | |||
| this.name = "Planet"; | |||
| copy_defaults(this,new DefaultEntity()); | |||
| this.count = count; | |||
| this.contents = {}; | |||
| var amount = distribution(4,9,count); | |||
| this.contents.continent = new Continent(amount); | |||
| this.describe = function(verbose = true) { | |||
| if (verbose) { | |||
| return (this.count == 1 ? "a planet" : this.count + " planets") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them"); | |||
| } else { | |||
| return (this.count == 1 ? "a planet" : this.count + " planets"); | |||
| } | |||
| } | |||
| } | |||
| @@ -47,10 +47,25 @@ | |||
| <button class=action-button class=action-button id=button-units>Units: Metric</button> | |||
| <button class=action-button id=button-verbose>Descriptions: Verbose</button> | |||
| </div> | |||
| <div class=button-container id=option-panel> | |||
| <div class=option-container id=option-panel> | |||
| <button class=option-button id=button-male-genitals>Male genitals on</button> | |||
| <button class=option-button id=button-female-genitals>Female genitals on</button> | |||
| <form class=option-form>Species:<br><input type="text" name="species" id="option-species"></input></form> | |||
| <!--<label for="preset">Preset Character:</label> | |||
| <select name="preset" class="preset-selector"> | |||
| <option value="Fen">Fen</option> | |||
| <option value="Renard">Renard</option> | |||
| <option value="Vulpes">Vulpes</option> | |||
| <option value="Custom">Custom</option> | |||
| </select> | |||
| <div id=custom-species | |||
| <form class=option-form>Species:<br><input type="text" name="species" id="option-species"></input></form> | |||
| <form class=option-form>Height:<br><input type="text" name="species" id="option-species"></input></form> | |||
| <form class=option-form>Weight:<br><input type="text" name="species" id="option-species"></input></form> | |||
| <form class=option-form>Weight:<br><input type="text" name="species" id="option-species"></input></form> | |||
| </div>--> | |||
| <button class=option-button id=button-start>Start game</button> | |||
| </div> | |||
| </div> | |||
| @@ -56,6 +56,16 @@ body { | |||
| flex: 1; | |||
| } | |||
| .preset-selector { | |||
| height: 25px; | |||
| } | |||
| .option-container { | |||
| flex-wrap: wrap; | |||
| max-width: 300px; | |||
| flex: 2; | |||
| } | |||
| .button-container { | |||
| flex-wrap: wrap; | |||
| max-width: 300px; | |||