big steppy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

1076 строки
29 KiB

  1. var things =
  2. {
  3. "Container": Container,
  4. "Person": Person,
  5. "Cow": Cow,
  6. "Empty Car": EmptyCar,
  7. "Car": Car,
  8. "Bus": Bus,
  9. "Tram": Tram,
  10. "Motorcycle": Motorcycle,
  11. "House": House,
  12. "Barn": Barn,
  13. "Small Skyscraper": SmallSkyscraper,
  14. "Train": Train,
  15. "Train Car": TrainCar,
  16. "Parking Garage": ParkingGarage,
  17. "Overpass": Overpass,
  18. "Town": Town,
  19. "City": City,
  20. "Continent": Continent,
  21. "Planet": Planet,
  22. "Star": Star,
  23. "Solar System": SolarSystem,
  24. "Galaxy": Galaxy
  25. };
  26. var areas =
  27. {
  28. "Container": 0,
  29. "Person": 1,
  30. "Cow": 2,
  31. "Car": 4,
  32. "Bus": 12,
  33. "Tram": 20,
  34. "Motorcycle": 2,
  35. "House": 1000,
  36. "Barn": 750,
  37. "Small Skyscraper": 10000,
  38. "Train": 500,
  39. "TrainCar": 500,
  40. "Parking Garage": 5000,
  41. "Overpass": 10000,
  42. "Town": 1e7,
  43. "City": 1e9,
  44. "Continent": 1.5e13,
  45. "Planet": 2.5e14,
  46. "Star": 3e18,
  47. "Solar System": 3e21,
  48. "Galaxy": 2e42,
  49. };
  50. var masses =
  51. {
  52. "Container": 0,
  53. "Person": 80,
  54. "Cow": 300,
  55. "Car": 1000,
  56. "Bus": 5000,
  57. "Tram": 10000,
  58. "Motorcycle": 200,
  59. "House": 10000,
  60. "Barn": 5000,
  61. "Small Skyscraper": 100000,
  62. "Train": 5000,
  63. "Train Car": 5000,
  64. "Parking Garage": 100000,
  65. "Overpass": 100000,
  66. "Town": 1,
  67. "City": 1,
  68. "Continent": 1e12,
  69. "Planet": 5.972e24,
  70. "Star": 1e40,
  71. "Solar System": 1,
  72. "Galaxy": 1
  73. };
  74. var clusters =
  75. {
  76. "Container": 0,
  77. "Person": 5,
  78. "Cow": 15,
  79. "Car": 3,
  80. "Bus": 1,
  81. "Tram": 1,
  82. "Motorcycle": 1,
  83. "House": 20,
  84. "Barn": 1,
  85. "Small Skyscraper": 5,
  86. "Train": 2,
  87. "Train Car": 1,
  88. "Parking Garage": 1,
  89. "Overpass": 1,
  90. "Town": 1,
  91. "City": 1,
  92. "Continent": 5,
  93. "Planet": 1,
  94. "Star": 1,
  95. "Solar System": 1,
  96. "Galaxy": 1
  97. };
  98. // general logic: each step fills in a fraction of the remaining space
  99. function fill_area2(area, weights)
  100. {
  101. result = [];
  102. candidates = [];
  103. for (var key in weights) {
  104. if (weights.hasOwnProperty(key)) {
  105. candidates.push({"name": key, "area": areas[key], "weight": weights[key]});
  106. }
  107. }
  108. candidates = candidates.sort(function (x,y) {
  109. return x.area - y.area;
  110. });
  111. while(candidates.length > 0) {
  112. var candidate = candidates.pop();
  113. if (candidate.area > area)
  114. continue;
  115. var max = Math.floor(area / candidate.area);
  116. var limit = Math.min(max, 100);
  117. var count = 0;
  118. // for small amounts, actually do the randomness
  119. // the first few ones get a much better shot
  120. while (limit > 0) {
  121. if (limit <= clusters[candidate.name])
  122. count += 1;
  123. else
  124. count += Math.random() < candidate.weight ? 1 : 0;
  125. --limit;
  126. }
  127. if (limit < max) {
  128. count += Math.round((max-limit) * candidate.weight);
  129. }
  130. area -= count * candidate.area;
  131. if (count > 0)
  132. result.push(new things[candidate.name](count));
  133. }
  134. if (result.length > 1) {
  135. return new Container(result);
  136. } else if (result.length == 1) {
  137. return result[0];
  138. } else {
  139. return new Person(1);
  140. }
  141. }
  142. // describes everything in the container
  143. function describe_all(contents,verbose=true) {
  144. var things = [];
  145. for (var key in contents) {
  146. if (contents.hasOwnProperty(key)) {
  147. things.push(contents[key].describe(verbose));
  148. }
  149. }
  150. return merge_things(things);
  151. }
  152. function random_desc(list, odds=1) {
  153. if (Math.random() < odds)
  154. return list[Math.floor(Math.random() * list.length)];
  155. else
  156. return "";
  157. }
  158. // combine strings into a list with proper grammar
  159. function merge_things(list,semicolons=false) {
  160. if (list.length == 0) {
  161. return "";
  162. } else if (list.length == 1) {
  163. return list[0];
  164. } else if (list.length == 2) {
  165. return list[0] + " and " + list[1];
  166. } else {
  167. result = "";
  168. list.slice(0,list.length-1).forEach(function(term) {
  169. result += term + ", ";
  170. })
  171. result += "and " + list[list.length-1]
  172. return result;
  173. }
  174. }
  175. // combine the adjectives for something into a single string
  176. function merge_desc(list) {
  177. result = ""
  178. list.forEach(function(term) {
  179. if (term != "")
  180. result += term + " ";
  181. });
  182. // knock off the last space
  183. if (result.length > 0) {
  184. result = result.substring(0, result.length - 1);
  185. }
  186. return result;
  187. }
  188. // maybe make this something that approximates a
  189. // normal distribution; doing this 15,000,000 times is bad...
  190. // solution: only a few are random lul
  191. function distribution(min, max, samples) {
  192. var result = 0;
  193. var limit = Math.min(100,samples)
  194. for (var i = 0; i < limit; i++) {
  195. result += Math.floor(Math.random() * (max - min + 1) + min);
  196. }
  197. if (limit < samples) {
  198. result += Math.round((max - min) * (samples - limit));
  199. }
  200. return result;
  201. }
  202. /* default actions */
  203. function defaultStomp(thing) {
  204. return function (verbose=true,height=10) { return "You crush " + thing.describe(verbose) + " underfoot."};
  205. }
  206. function defaultKick(thing) {
  207. return function(verbose=true,height=10) { return "You punt " + thing.describe(verbose) + ", destroying " + (thing.count > 1 ? "them" : "it") + "."; }
  208. }
  209. function defaultEat(thing) {
  210. return function(verbose=true,height=10) { return "You scoop up " + thing.describe(verbose) + " and swallow " + (thing.count > 1 ? "them" : "it") + " whole."; }
  211. }
  212. function defaultAnalVore(thing) {
  213. return function(verbose=true,height=10) { return "You sit yourself down on " + thing.describe(verbose) + ". " + (thing.count > 1 ? "They slide" : "It slides") + " inside with ease."; }
  214. }
  215. function defaultButtcrush(thing) {
  216. return function(verbose=true,height=10) { return "Your heavy ass obliterates " + thing.describe(verbose) + ". "; }
  217. }
  218. function defaultBreastCrush(thing) {
  219. return function(verbose=true,height=10) { return "Your heavy breasts obliterate " + thing.describe(verbose) + ". "; }
  220. }
  221. function defaultUnbirth(thing) {
  222. return function(verbose=true,height=10) { return "You gasp as you slide " + thing.describe(verbose) + " up your slit. "; }
  223. }
  224. function defaultCockslap(thing) {
  225. return function(verbose=true,height=10) { return "Your swaying shaft crushes " + thing.describe(verbose) + ". "; }
  226. }
  227. function defaultCockVore(thing) {
  228. return function(verbose=true,height=10) { return "You stuff " + thing.describe(verbose) + " into your throbbing shaft, forcing them down to your heavy balls."; }
  229. }
  230. function defaultBallSmother(thing) {
  231. return function(verbose=true,height=10) { return "Your weighty balls spread over " + thing.describe(verbose) + ", smothering them in musk."; }
  232. }
  233. function defaultMaleOrgasm(thing) {
  234. return function(verbose=true,height=10) { return "You're cumming! Your thick cock spurts out $VOLUME of seed, splooging " + thing.describe(verbose) + "."; }
  235. }
  236. function defaultFemaleOrgasm(thing) {
  237. return function(verbose=true,height=10) { return "You're cumming! Your moist slit sprays $VOLUME of slick femcum, splooging " + thing.describe(verbose) + "."; }
  238. }
  239. function defaultArea(thing) {
  240. return areas[thing.name];
  241. }
  242. function defaultMass(thing) {
  243. return masses[thing.name];
  244. }
  245. function defaultMerge(thing) {
  246. return function(container) {
  247. var newCount = this.count + container.count;
  248. var newThing = new things[thing.name](newCount);
  249. newThing.contents = {};
  250. for (var key in this.contents) {
  251. if (this.contents.hasOwnProperty(key)) {
  252. newThing.contents[key] = this.contents[key];
  253. }
  254. }
  255. for (var key in container.contents) {
  256. if (container.contents.hasOwnProperty(key)) {
  257. if (this.contents.hasOwnProperty(key)) {
  258. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  259. } else {;
  260. newThing.contents[key] = container.contents[key];
  261. }
  262. }
  263. }
  264. return newThing;
  265. }
  266. }
  267. function defaultSum(thing) {
  268. return function() {
  269. var counts = {}
  270. if (thing.name != "Container")
  271. counts[thing.name] = thing.count;
  272. for (var key in thing.contents) {
  273. if (thing.contents.hasOwnProperty(key)) {
  274. subcount = thing.contents[key].sum();
  275. for (var subkey in subcount) {
  276. if (!counts.hasOwnProperty(subkey)) {
  277. counts[subkey] = 0;
  278. }
  279. counts[subkey] += subcount[subkey];
  280. }
  281. }
  282. }
  283. return counts;
  284. }
  285. }
  286. function defaultSumProperty(thing) {
  287. return function(prop) {
  288. var total = 0;
  289. total += thing[prop] * thing.count;
  290. for (var key in thing.contents) {
  291. if (thing.contents.hasOwnProperty(key)) {
  292. total += thing.contents[key].sum_property(prop);
  293. }
  294. }
  295. return total;
  296. }
  297. }
  298. function DefaultEntity() {
  299. this.stomp = defaultStomp;
  300. this.eat = defaultEat;
  301. this.kick = defaultKick;
  302. this.anal_vore = defaultAnalVore;
  303. this.buttcrush = defaultButtcrush;
  304. this.breast_crush = defaultBreastCrush;
  305. this.unbirth = defaultUnbirth;
  306. this.cockslap = defaultCockslap;
  307. this.cock_vore = defaultCockVore;
  308. this.ball_smother = defaultBallSmother;
  309. this.male_orgasm = defaultMaleOrgasm;
  310. this.female_orgasm = defaultFemaleOrgasm;
  311. this.sum = defaultSum;
  312. this.area = defaultArea;
  313. this.mass = defaultMass;
  314. this.sum_property = defaultSumProperty;
  315. this.merge = defaultMerge;
  316. return this;
  317. }
  318. // god I love reinventing the wheel
  319. function copy_defaults(self,proto) {
  320. for (var key in proto) {
  321. if (proto.hasOwnProperty(key)) {
  322. self[key] = proto[key](self)
  323. }
  324. }
  325. }
  326. function Container(contents = []) {
  327. this.name = "Container";
  328. copy_defaults(this,new DefaultEntity());
  329. this.count = 0;
  330. this.contents = {}
  331. for (var i=0; i < contents.length; i++) {
  332. this.contents[contents[i].name] = contents[i];
  333. }
  334. for (var key in this.contents) {
  335. if (this.contents.hasOwnProperty(key)) {
  336. this.count += this.contents[key].count;
  337. }
  338. }
  339. this.describe = function(verbose = true) {
  340. return describe_all(this.contents,verbose)
  341. }
  342. this.eat = function(verbose=true) {
  343. var line = containerEat(this,verbose);
  344. if (line == "")
  345. return defaultEat(this)(verbose);
  346. else
  347. return line;
  348. };
  349. return this;
  350. }
  351. function Person(count = 1) {
  352. this.name = "Person";
  353. copy_defaults(this,new DefaultEntity());
  354. this.count = count;
  355. this.contents = {};
  356. this.describeOne = function (verbose=true) {
  357. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  358. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  359. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]);
  360. return "a " + merge_desc([body,sex,species]);
  361. }
  362. this.describe = function(verbose=true) {
  363. if (verbose) {
  364. if (count <= 3) {
  365. list = [];
  366. for (var i = 0; i < count; i++) {
  367. list.push(this.describeOne(this.count <= 2));
  368. }
  369. return merge_things(list);
  370. } else {
  371. return this.count + " people"
  372. }
  373. } else {
  374. return (this.count > 1 ? this.count + " people" : "a person");
  375. }
  376. }
  377. this.stomp = function(verbose=true) {
  378. var line = personStomp(this);
  379. if (line == "")
  380. return defaultStomp(this)(verbose);
  381. else
  382. return line;
  383. };
  384. this.eat = function(verbose=true) {
  385. var line = personEat(this);
  386. if (line == "")
  387. return defaultEat(this)(verbose);
  388. else
  389. return line;
  390. };
  391. return this;
  392. }
  393. function Cow(count = 1) {
  394. this.name = "Cow";
  395. copy_defaults(this,new DefaultEntity());
  396. this.count = count;
  397. this.contents = {};
  398. this.describeOne = function (verbose=true) {
  399. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  400. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  401. return "a " + merge_desc([body,sex,"cow"]);
  402. }
  403. this.describe = function(verbose=true) {
  404. if (verbose) {
  405. if (count <= 3) {
  406. list = [];
  407. for (var i = 0; i < count; i++) {
  408. list.push(this.describeOne(this.count <= 2));
  409. }
  410. return merge_things(list);
  411. } else {
  412. return this.count + " cattle"
  413. }
  414. } else {
  415. return (this.count > 1 ? this.count + " cattle" : "a cow");
  416. }
  417. }
  418. return this;
  419. }
  420. function EmptyCar(count = 1) {
  421. this.name = "Car";
  422. copy_defaults(this,new DefaultEntity());
  423. this.count = count;
  424. this.contents = {};
  425. this.describeOne = function(verbose=true) {
  426. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  427. adjective = random_desc(["rusty","brand-new"],0.3);
  428. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  429. return "a parked " + merge_desc([adjective,color,type]);
  430. }
  431. this.describe = function(verbose = true) {
  432. if (verbose) {
  433. if (this.count <= 3) {
  434. list = [];
  435. for (var i = 0; i < this.count; i++) {
  436. list.push(this.describeOne());
  437. }
  438. return merge_things(list);
  439. } else {
  440. return this.count + " parked cars";
  441. }
  442. } else {
  443. return (this.count > 1 ? this.count + " parked cars" : "a parked car");
  444. }
  445. }
  446. }
  447. function Car(count = 1) {
  448. this.name = "Car";
  449. copy_defaults(this,new DefaultEntity());
  450. this.count = count;
  451. this.contents = {};
  452. var amount = distribution(2,5,count);
  453. this.contents.person = new Person(amount);
  454. this.describeOne = function(verbose=true) {
  455. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  456. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  457. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  458. return "a " + merge_desc([adjective,color,type]);
  459. }
  460. this.describe = function(verbose = true) {
  461. if (verbose) {
  462. if (this.count <= 3) {
  463. list = [];
  464. for (var i = 0; i < this.count; i++) {
  465. list.push(this.describeOne(this.count < 2));
  466. }
  467. return merge_things(list) + " with " + this.contents.person.describe(false) + " inside";
  468. } else {
  469. return this.count + " cars with " + this.contents.person.describe(false) + " inside";
  470. }
  471. } else {
  472. return (this.count > 1 ? this.count + " cars" : "a car");
  473. }
  474. }
  475. }
  476. function Bus(count = 1) {
  477. this.name = "Bus";
  478. copy_defaults(this,new DefaultEntity());
  479. this.count = count;
  480. this.contents = {};
  481. var amount = distribution(10,35,count);
  482. this.contents.person = new Person(amount);
  483. this.describeOne = function(verbose=true) {
  484. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  485. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  486. type = random_desc(["bus","double-decker bus","articulating bus"]);
  487. return "a " + merge_desc([adjective,color,type]);
  488. }
  489. this.describe = function(verbose = true) {
  490. if (verbose) {
  491. if (this.count <= 3) {
  492. list = [];
  493. for (var i = 0; i < this.count; i++) {
  494. list.push(this.describeOne(this.count < 2));
  495. }
  496. return merge_things(list) + " with " + this.contents.person.describe() + " inside";
  497. } else {
  498. return this.count + " buses with " + this.contents.person.describe() + " inside";
  499. }
  500. } else {
  501. return (this.count > 1 ? this.count + " buses" : "a bus");
  502. }
  503. }
  504. }
  505. function Tram(count = 1) {
  506. this.name = "Tram";
  507. copy_defaults(this,new DefaultEntity());
  508. this.count = count;
  509. this.contents = {};
  510. var amount = distribution(40,60,count);
  511. this.contents.person = new Person(amount);
  512. this.describeOne = function(verbose=true) {
  513. adjective = random_desc(["rusty","weathered"], (verbose ? 0.3 : 0));
  514. color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  515. type = random_desc(["tram"]);
  516. return "a " + merge_desc([adjective,color,type]);
  517. }
  518. this.describe = function(verbose = true) {
  519. if (verbose) {
  520. if (this.count == 1) {
  521. list = [];
  522. for (var i = 0; i < this.count; i++) {
  523. list.push(this.describeOne(verbose));
  524. }
  525. return merge_things(list) + " with " + this.contents.person.describe(verbose) + " inside";
  526. } else {
  527. return this.count + " trams with " + this.contents.person.describe(verbose) + " inside";
  528. }
  529. } else {
  530. return (this.count > 1 ? this.count + " trams" : "a tram");
  531. }
  532. }
  533. this.anal_vore = function() {
  534. return "You slide " + this.describe() + " up your tight ass";
  535. }
  536. }
  537. function Motorcycle(count = 1) {
  538. this.name = "Motorcycle";
  539. copy_defaults(this,new DefaultEntity());
  540. this.count = count;
  541. this.contents = {};
  542. var amount = distribution(1,2,count);
  543. this.contents.person = new Person(amount);
  544. }
  545. function Train(count = 1) {
  546. this.name = "Train";
  547. copy_defaults(this,new DefaultEntity());
  548. this.count = count;
  549. this.contents = {};
  550. var amount = distribution(1,4,count);
  551. this.contents.person = new Person(amount);
  552. amount = distribution(1,10,count);
  553. this.contents.traincar = new TrainCar(amount);
  554. this.describeOne = function(verbose=true) {
  555. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  556. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  557. type = random_desc(["train","passenger train","freight train"]);
  558. return "a " + merge_desc([adjective,color,type]);
  559. }
  560. this.describe = function(verbose = true) {
  561. if (verbose) {
  562. if (this.count == 1) {
  563. list = [];
  564. for (var i = 0; i < this.count; i++) {
  565. list.push(this.describeOne(verbose));
  566. }
  567. return merge_things(list) + " with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  568. } else {
  569. return this.count + " trains with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  570. }
  571. } else {
  572. return (this.count > 1 ? this.count + " trains" : "a train");
  573. }
  574. }
  575. this.anal_vore = function() {
  576. var cars = (this.contents.traincar.count == 1 ? this.contents.traincar.describe() + " follows it inside" : this.contents.traincar.describe() + " are pulled slowly inside");
  577. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  578. }
  579. }
  580. function TrainCar(count = 1) {
  581. this.name = "Train Car";
  582. copy_defaults(this,new DefaultEntity());
  583. this.count = count;
  584. this.contents = {};
  585. var amount = distribution(10,40,count);
  586. this.contents.person = new Person(amount);
  587. this.describeOne = function(verbose=true) {
  588. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  589. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  590. type = random_desc(["train car","passenger train car","freight train car"]);
  591. return "a " + merge_desc([adjective,color,type]);
  592. }
  593. this.describe = function(verbose = true) {
  594. if (verbose) {
  595. if (this.count <= 3) {
  596. list = [];
  597. for (var i = 0; i < this.count; i++) {
  598. list.push(this.describeOne(this.count < 2));
  599. }
  600. return merge_things(list) + " with " + describe_all(this.contents) + " inside";
  601. } else {
  602. return this.count + " train cars with " + describe_all(this.contents) + " inside";
  603. }
  604. } else {
  605. return (this.count > 1 ? this.count + " train cars" : "a train car");
  606. }
  607. }
  608. }
  609. function House(count = 1) {
  610. this.name = "House";
  611. copy_defaults(this,new DefaultEntity());
  612. this.count = count;
  613. this.contents = {};
  614. var amount = distribution(0,8,count);
  615. this.contents.person = new Person(amount);
  616. amount = distribution(0,2,count);
  617. this.contents.emptycar = new EmptyCar(amount);
  618. this.describeOne = function(verbose=true) {
  619. size = random_desc(["little","two-story","large"], (verbose ? 0.5 : 0));
  620. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  621. name = random_desc(["house","house","house","house","house","trailer"], 1);
  622. return "a " + merge_desc([size,color,name]);
  623. }
  624. this.describe = function(verbose = true) {
  625. if (verbose) {
  626. if (this.count <= 3) {
  627. list = [];
  628. for (var i = 0; i < this.count; i++) {
  629. list.push(this.describeOne(this.count < 2));
  630. }
  631. return merge_things(list) + " with " + this.contents.person.describe(verbose) + " inside";
  632. } else {
  633. return this.count + " homes with " + this.contents.person.describe(verbose) + " inside";
  634. }
  635. } else {
  636. return (this.count > 1 ? this.count + " houses" : "a house");
  637. }
  638. }
  639. }
  640. function Barn(count = 1) {
  641. this.name = "Barn";
  642. copy_defaults(this,new DefaultEntity());
  643. this.count = count;
  644. this.contents = {};
  645. var amount = distribution(0,2,count);
  646. this.contents.person = new Person(amount);
  647. amount = distribution(30,70,count);
  648. this.contents.cow = new Cow(amount);
  649. this.describeOne = function(verbose=true) {
  650. size = random_desc(["little","big","large"], (verbose ? 0.5 : 0));
  651. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  652. name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  653. return "a " + merge_desc([size,color,name]);
  654. }
  655. this.describe = function(verbose = true) {
  656. if (verbose) {
  657. if (this.count <= 3) {
  658. list = [];
  659. for (var i = 0; i < this.count; i++) {
  660. list.push(this.describeOne(this.count < 2));
  661. }
  662. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  663. } else {
  664. return this.count + " barns with " + describe_all(this.contents,verbose) + " inside";
  665. }
  666. } else {
  667. return (this.count > 1 ? this.count + " barns" : "a barn");
  668. }
  669. }
  670. }
  671. function SmallSkyscraper(count = 1) {
  672. this.name = "Small Skyscraper";
  673. copy_defaults(this,new DefaultEntity());
  674. this.count = count;
  675. this.contents = {};
  676. var amount = distribution(50,500,count);
  677. this.contents.person = new Person(amount);
  678. amount = distribution(10,50,count);
  679. this.contents.emptycar = new EmptyCar(amount);
  680. this.describeOne = function(verbose=true) {
  681. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  682. name = random_desc(["skyscraper","office tower","office building"], 1);
  683. return "a " + merge_desc([color,name]);
  684. }
  685. this.describe = function(verbose = true) {
  686. if (verbose) {
  687. if (this.count <= 3) {
  688. list = [];
  689. for (var i = 0; i < this.count; i++) {
  690. list.push(this.describeOne(this.count < 2));
  691. }
  692. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  693. } else {
  694. return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  695. }
  696. } else {
  697. return (this.count > 1 ? this.count + " skyscrapers" : "a skyscraper");
  698. }
  699. }
  700. this.anal_vore = function(verbose=true,height=10) {
  701. var line = skyscraperAnalVore(this,verbose,height);
  702. if (line == "")
  703. return defaultAnalVore(this)(verbose);
  704. else
  705. return line;
  706. };
  707. }
  708. function ParkingGarage(count = 1) {
  709. this.name = "Parking Garage";
  710. copy_defaults(this,new DefaultEntity());
  711. this.count = count;
  712. this.contents = {};
  713. var amount = distribution(10,200,count);
  714. this.contents.person = new Person(amount);
  715. amount = distribution(30,100,count);
  716. this.contents.emptycar = new EmptyCar(amount);
  717. amount = distribution(5,20,count);
  718. this.contents.car = new Car(amount);
  719. this.describeOne = function(verbose=true) {
  720. return "a parking garage";
  721. }
  722. this.describe = function(verbose = true) {
  723. if (verbose) {
  724. return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose) + " inside";
  725. } else {
  726. return (this.count == 1 ? "a parking garage" : this.count + " parking garages");
  727. }
  728. }
  729. }
  730. function Overpass(count = 1) {
  731. this.name = "Overpass";
  732. copy_defaults(this,new DefaultEntity());
  733. this.count = count;
  734. this.contents = {};
  735. var amount = distribution(0,20,count);
  736. this.contents.person = new Person(amount);
  737. amount = distribution(25,100,count);
  738. this.contents.car = new Car(amount);
  739. }
  740. function Town(count = 1) {
  741. this.name = "Town";
  742. copy_defaults(this,new DefaultEntity());
  743. this.count = count;
  744. this.contents = {};
  745. var amount = distribution(1000,15000,count);
  746. this.contents.person = new Person(amount);
  747. var amount = distribution(500,10000,count);
  748. this.contents.house = new House(amount);
  749. var amount = distribution(250,3750,count);
  750. this.contents.emptycar = new EmptyCar(amount);
  751. var amount = distribution(250,3750,count);
  752. this.contents.car = new Car(amount);
  753. var amount = distribution(5,10,count);
  754. this.contents.train = new Train(amount);
  755. var amount = distribution(2,10,count);
  756. this.contents.smallskyscraper = new SmallSkyscraper(amount);
  757. var amount = distribution(1,5,count);
  758. this.contents.parkinggarage = new ParkingGarage(amount);
  759. this.describe = function(verbose = true) {
  760. if (verbose) {
  761. return (this.count == 1 ? "a town" : this.count + " towns") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  762. } else {
  763. return (this.count == 1 ? "a town" : this.count + " towns");
  764. }
  765. }
  766. }
  767. function City(count = 1) {
  768. this.name = "City";
  769. copy_defaults(this,new DefaultEntity());
  770. this.count = count;
  771. this.contents = {};
  772. var amount = distribution(10000,150000,count);
  773. this.contents.person = new Person(amount);
  774. var amount = distribution(5000,100000,count);
  775. this.contents.house = new House(amount);
  776. var amount = distribution(2500,37500,count);
  777. this.contents.emptycar = new EmptyCar(amount);
  778. var amount = distribution(2500,37500,count);
  779. this.contents.car = new Car(amount);
  780. var amount = distribution(50,100,count);
  781. this.contents.train = new Train(amount);
  782. var amount = distribution(100,300,count);
  783. this.contents.tram = new Tram(amount);
  784. var amount = distribution(20,100,count);
  785. this.contents.smallskyscraper = new SmallSkyscraper(amount);
  786. var amount = distribution(10,50,count);
  787. this.contents.parkinggarage = new ParkingGarage(amount);
  788. this.describe = function(verbose = true) {
  789. if (verbose) {
  790. return (this.count == 1 ? "a city" : this.count + " cities") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  791. } else {
  792. return (this.count == 1 ? "a city" : this.count + " cities");
  793. }
  794. }
  795. }
  796. function Continent(count = 1) {
  797. this.name = "Continent";
  798. copy_defaults(this,new DefaultEntity());
  799. this.count = count;
  800. this.contents = {};
  801. var amount = distribution(100000,1500000,count);
  802. this.contents.person = new Person(amount);
  803. var amount = distribution(5000,100000,count);
  804. this.contents.house = new House(amount);
  805. var amount = distribution(25000,375000,count);
  806. this.contents.car = new Car(amount);
  807. var amount = distribution(500,1000,count);
  808. this.contents.train = new Train(amount);
  809. var amount = distribution(2000,5000,count);
  810. this.contents.town = new Town(amount);
  811. var amount = distribution(200,500,count);
  812. this.contents.city = new City(amount);
  813. this.describe = function(verbose = true) {
  814. if (verbose) {
  815. return (this.count == 1 ? "a continent" : this.count + " continents") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  816. } else {
  817. return (this.count == 1 ? "a continent" : this.count + " continents");
  818. }
  819. }
  820. }
  821. function Planet(count = 1) {
  822. this.name = "Planet";
  823. copy_defaults(this,new DefaultEntity());
  824. this.count = count;
  825. this.contents = {};
  826. var amount = distribution(4,9,count);
  827. this.contents.continent = new Continent(amount);
  828. this.describe = function(verbose = true) {
  829. if (verbose) {
  830. return (this.count == 1 ? "a planet" : this.count + " planets") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  831. } else {
  832. return (this.count == 1 ? "a planet" : this.count + " planets");
  833. }
  834. }
  835. }
  836. function Star(count = 1) {
  837. this.name = "Star";
  838. copy_defaults(this,new DefaultEntity());
  839. this.count = count;
  840. this.contents = {};
  841. this.describe = function(verbose = true) {
  842. return (this.count == 1 ? "a star" : this.count + " stars");
  843. }
  844. }
  845. function SolarSystem(count = 1) {
  846. this.name = "Solar System";
  847. copy_defaults(this,new DefaultEntity());
  848. this.count = count;
  849. this.contents = {};
  850. this.contents.star = new Star(1);
  851. var amount = distribution(5,15,count);
  852. this.contents.planet = new Continent(amount);
  853. this.describe = function(verbose = true) {
  854. if (verbose) {
  855. return (this.count == 1 ? "a solar system" : this.count + " solar systems") + " made up of " + describe_all(this.contents, verbose);
  856. } else {
  857. return (this.count == 1 ? "a solar system" : this.count + " solar systems");
  858. }
  859. }
  860. }
  861. function Galaxy(count = 1) {
  862. this.name = "Galaxy";
  863. copy_defaults(this,new DefaultEntity());
  864. this.count = count;
  865. this.contents = {};
  866. var amount = distribution(1e9,500e9,count);
  867. this.contents.star = new Star(amount);
  868. var amount = distribution(1e8,500e8,count);
  869. this.contents.solarsystem = new SolarSystem(amount);
  870. this.describe = function(verbose = true) {
  871. if (verbose) {
  872. return (this.count == 1 ? "a galaxy" : this.count + " galaxies") + " made up of " + describe_all(this.contents, verbose);
  873. } else {
  874. return (this.count == 1 ? "a galaxy" : this.count + " galaxies");
  875. }
  876. }
  877. }