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

1061 строка
27 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. // improvement: take up to 100 samples, then use that to scale the final result
  192. function distribution(min, max, samples) {
  193. var result = 0;
  194. var limit = Math.min(100,samples)
  195. if (limit < samples) {
  196. for (var i = 0; i < limit; i++) {
  197. result += (i/10 + 1) * Math.floor(Math.random() * (max - min + 1) + min);
  198. }
  199. result = Math.round((result / 595) * samples * (max - min) + min);
  200. } else {
  201. for (var i = 0; i < limit; i++) {
  202. result += Math.floor(Math.random() * (max - min + 1) + min);
  203. }
  204. }
  205. return result;
  206. }
  207. /* default actions */
  208. function defaultStomp(thing) {
  209. return function (verbose=true,height=10) { return "You crush " + thing.describe(verbose) + " underfoot."};
  210. }
  211. function defaultKick(thing) {
  212. return function(verbose=true,height=10) { return "You punt " + thing.describe(verbose) + ", destroying " + (thing.count > 1 ? "them" : "it") + "."; }
  213. }
  214. function defaultEat(thing) {
  215. return function(verbose=true,height=10) { return "You scoop up " + thing.describe(verbose) + " and swallow " + (thing.count > 1 ? "them" : "it") + " whole."; }
  216. }
  217. function defaultAnalVore(thing) {
  218. 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."; }
  219. }
  220. function defaultButtcrush(thing) {
  221. return function(verbose=true,height=10) { return "Your heavy ass obliterates " + thing.describe(verbose) + ". "; }
  222. }
  223. function defaultBreastCrush(thing) {
  224. return function(verbose=true,height=10) { return "Your heavy breasts obliterate " + thing.describe(verbose) + ". "; }
  225. }
  226. function defaultUnbirth(thing) {
  227. return function(verbose=true,height=10) { return "You gasp as you slide " + thing.describe(verbose) + " up your slit. "; }
  228. }
  229. function defaultCockslap(thing) {
  230. return function(verbose=true,height=10) { return "Your swaying shaft crushes " + thing.describe(verbose) + ". "; }
  231. }
  232. function defaultCockVore(thing) {
  233. return function(verbose=true,height=10) { return "You stuff " + thing.describe(verbose) + " into your throbbing shaft, forcing them down to your heavy balls."; }
  234. }
  235. function defaultBallSmother(thing) {
  236. return function(verbose=true,height=10) { return "Your weighty balls spread over " + thing.describe(verbose) + ", smothering them in musk."; }
  237. }
  238. function defaultMaleOrgasm(thing) {
  239. return function(verbose=true,height=10) { return "You're cumming! Your thick cock spurts out $VOLUME of seed, splooging " + thing.describe(verbose) + "."; }
  240. }
  241. function defaultFemaleOrgasm(thing) {
  242. return function(verbose=true,height=10) { return "You're cumming! Your moist slit sprays $VOLUME of slick femcum, splooging " + thing.describe(verbose) + "."; }
  243. }
  244. function defaultArea(thing) {
  245. return areas[thing.name];
  246. }
  247. function defaultMass(thing) {
  248. return masses[thing.name];
  249. }
  250. function defaultMerge(thing) {
  251. return function(container) {
  252. var newCount = this.count + container.count;
  253. var newThing = new things[thing.name](newCount);
  254. newThing.contents = {};
  255. for (var key in this.contents) {
  256. if (this.contents.hasOwnProperty(key)) {
  257. newThing.contents[key] = this.contents[key];
  258. }
  259. }
  260. for (var key in container.contents) {
  261. if (container.contents.hasOwnProperty(key)) {
  262. if (this.contents.hasOwnProperty(key)) {
  263. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  264. } else {
  265. newThing.contents[key] = container.contents[key];
  266. }
  267. }
  268. }
  269. return newThing;
  270. }
  271. }
  272. function defaultSum(thing) {
  273. return function() {
  274. var counts = {}
  275. if (thing.name != "Container")
  276. counts[thing.name] = thing.count;
  277. for (var key in thing.contents) {
  278. if (thing.contents.hasOwnProperty(key)) {
  279. subcount = thing.contents[key].sum();
  280. for (var subkey in subcount) {
  281. if (!counts.hasOwnProperty(subkey)) {
  282. counts[subkey] = 0;
  283. }
  284. counts[subkey] += subcount[subkey];
  285. }
  286. }
  287. }
  288. return counts;
  289. }
  290. }
  291. function defaultSumProperty(thing) {
  292. return function(prop) {
  293. var total = 0;
  294. total += thing[prop] * thing.count;
  295. for (var key in thing.contents) {
  296. if (thing.contents.hasOwnProperty(key)) {
  297. total += thing.contents[key].sum_property(prop);
  298. }
  299. }
  300. return total;
  301. }
  302. }
  303. function defaultAddContent(thing) {
  304. return function(name, min, max, count) {
  305. if (min == max) {
  306. var object = new things[name](min*count);
  307. thing.contents[object.name] = object;
  308. } else {
  309. var object = new things[name](distribution(min, max, count));
  310. thing.contents[object.name] = object;
  311. }
  312. }
  313. }
  314. function DefaultEntity() {
  315. this.stomp = defaultStomp;
  316. this.eat = defaultEat;
  317. this.kick = defaultKick;
  318. this.anal_vore = defaultAnalVore;
  319. this.buttcrush = defaultButtcrush;
  320. this.breast_crush = defaultBreastCrush;
  321. this.unbirth = defaultUnbirth;
  322. this.cockslap = defaultCockslap;
  323. this.cock_vore = defaultCockVore;
  324. this.ball_smother = defaultBallSmother;
  325. this.male_orgasm = defaultMaleOrgasm;
  326. this.female_orgasm = defaultFemaleOrgasm;
  327. this.sum = defaultSum;
  328. this.area = defaultArea;
  329. this.mass = defaultMass;
  330. this.sum_property = defaultSumProperty;
  331. this.merge = defaultMerge;
  332. this.addContent = defaultAddContent;
  333. return this;
  334. }
  335. // god I love reinventing the wheel
  336. function copy_defaults(self,proto) {
  337. for (var key in proto) {
  338. if (proto.hasOwnProperty(key)) {
  339. self[key] = proto[key](self)
  340. }
  341. }
  342. }
  343. function Container(contents = []) {
  344. this.name = "Container";
  345. copy_defaults(this,new DefaultEntity());
  346. this.count = 0;
  347. this.contents = {}
  348. for (var i=0; i < contents.length; i++) {
  349. this.contents[contents[i].name] = contents[i];
  350. }
  351. for (var key in this.contents) {
  352. if (this.contents.hasOwnProperty(key)) {
  353. this.count += this.contents[key].count;
  354. }
  355. }
  356. this.describe = function(verbose = true) {
  357. return describe_all(this.contents,verbose)
  358. }
  359. this.eat = function(verbose=true) {
  360. var line = containerEat(this,verbose);
  361. if (line == "")
  362. return defaultEat(this)(verbose);
  363. else
  364. return line;
  365. };
  366. return this;
  367. }
  368. function Person(count = 1) {
  369. this.name = "Person";
  370. copy_defaults(this,new DefaultEntity());
  371. this.count = count;
  372. this.contents = {};
  373. this.describeOne = function (verbose=true) {
  374. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  375. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  376. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]);
  377. return "a " + merge_desc([body,sex,species]);
  378. }
  379. this.describe = function(verbose=true) {
  380. if (verbose) {
  381. if (count <= 3) {
  382. list = [];
  383. for (var i = 0; i < count; i++) {
  384. list.push(this.describeOne(this.count <= 2));
  385. }
  386. return merge_things(list);
  387. } else {
  388. return this.count + " people"
  389. }
  390. } else {
  391. return (this.count > 1 ? this.count + " people" : "a person");
  392. }
  393. }
  394. this.stomp = function(verbose=true) {
  395. var line = personStomp(this);
  396. if (line == "")
  397. return defaultStomp(this)(verbose);
  398. else
  399. return line;
  400. };
  401. this.eat = function(verbose=true) {
  402. var line = personEat(this);
  403. if (line == "")
  404. return defaultEat(this)(verbose);
  405. else
  406. return line;
  407. };
  408. return this;
  409. }
  410. function Cow(count = 1) {
  411. this.name = "Cow";
  412. copy_defaults(this,new DefaultEntity());
  413. this.count = count;
  414. this.contents = {};
  415. this.describeOne = function (verbose=true) {
  416. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  417. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  418. return "a " + merge_desc([body,sex,"cow"]);
  419. }
  420. this.describe = function(verbose=true) {
  421. if (verbose) {
  422. if (count <= 3) {
  423. list = [];
  424. for (var i = 0; i < count; i++) {
  425. list.push(this.describeOne(this.count <= 2));
  426. }
  427. return merge_things(list);
  428. } else {
  429. return this.count + " cattle"
  430. }
  431. } else {
  432. return (this.count > 1 ? this.count + " cattle" : "a cow");
  433. }
  434. }
  435. return this;
  436. }
  437. function EmptyCar(count = 1) {
  438. this.name = "Car";
  439. copy_defaults(this,new DefaultEntity());
  440. this.count = count;
  441. this.contents = {};
  442. this.describeOne = function(verbose=true) {
  443. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  444. adjective = random_desc(["rusty","brand-new"],0.3);
  445. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  446. return "a parked " + merge_desc([adjective,color,type]);
  447. }
  448. this.describe = function(verbose = true) {
  449. if (verbose) {
  450. if (this.count <= 3) {
  451. list = [];
  452. for (var i = 0; i < this.count; i++) {
  453. list.push(this.describeOne());
  454. }
  455. return merge_things(list);
  456. } else {
  457. return this.count + " parked cars";
  458. }
  459. } else {
  460. return (this.count > 1 ? this.count + " parked cars" : "a parked car");
  461. }
  462. }
  463. }
  464. function Car(count = 1) {
  465. this.name = "Car";
  466. copy_defaults(this,new DefaultEntity());
  467. this.count = count;
  468. this.contents = {};
  469. this.addContent("Person", 2, 5, count);
  470. this.describeOne = function(verbose=true) {
  471. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  472. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  473. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  474. return "a " + merge_desc([adjective,color,type]);
  475. }
  476. this.describe = function(verbose = true) {
  477. if (verbose) {
  478. if (this.count <= 3) {
  479. list = [];
  480. for (var i = 0; i < this.count; i++) {
  481. list.push(this.describeOne(this.count < 2));
  482. }
  483. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  484. } else {
  485. return this.count + " cars with " + describe_all(this.contents,verbose) + " inside";
  486. }
  487. } else {
  488. return (this.count > 1 ? this.count + " cars" : "a car");
  489. }
  490. }
  491. }
  492. function Bus(count = 1) {
  493. this.name = "Bus";
  494. copy_defaults(this,new DefaultEntity());
  495. this.count = count;
  496. this.contents = {};
  497. this.addContent("Person",10,35,count);
  498. this.describeOne = function(verbose=true) {
  499. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  500. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  501. type = random_desc(["bus","double-decker bus","articulating bus"]);
  502. return "a " + merge_desc([adjective,color,type]);
  503. }
  504. this.describe = function(verbose = true) {
  505. if (verbose) {
  506. if (this.count <= 3) {
  507. list = [];
  508. for (var i = 0; i < this.count; i++) {
  509. list.push(this.describeOne(this.count < 2));
  510. }
  511. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  512. } else {
  513. return this.count + " buses with " + describe_all(this.contents,verbose) + " inside";
  514. }
  515. } else {
  516. return (this.count > 1 ? this.count + " buses" : "a bus");
  517. }
  518. }
  519. }
  520. function Tram(count = 1) {
  521. this.name = "Tram";
  522. copy_defaults(this,new DefaultEntity());
  523. this.count = count;
  524. this.contents = {};
  525. this.addContent("Person",40,60,count);
  526. this.describeOne = function(verbose=true) {
  527. adjective = random_desc(["rusty","weathered"], (verbose ? 0.3 : 0));
  528. color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  529. type = random_desc(["tram"]);
  530. return "a " + merge_desc([adjective,color,type]);
  531. }
  532. this.describe = function(verbose = true) {
  533. if (verbose) {
  534. if (this.count == 1) {
  535. list = [];
  536. for (var i = 0; i < this.count; i++) {
  537. list.push(this.describeOne(verbose));
  538. }
  539. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  540. } else {
  541. return this.count + " trams with " + describe_all(this.contents,verbose) + " inside";
  542. }
  543. } else {
  544. return (this.count > 1 ? this.count + " trams" : "a tram");
  545. }
  546. }
  547. this.anal_vore = function() {
  548. return "You slide " + this.describe() + " up your tight ass";
  549. }
  550. }
  551. function Motorcycle(count = 1) {
  552. this.name = "Motorcycle";
  553. copy_defaults(this,new DefaultEntity());
  554. this.count = count;
  555. this.contents = {};
  556. this.addContent("Person",1,2,count);
  557. }
  558. function Train(count = 1) {
  559. this.name = "Train";
  560. copy_defaults(this,new DefaultEntity());
  561. this.count = count;
  562. this.contents = {};
  563. this.addContent("Person", 1, 4, count);
  564. this.addContent("Train Car", 2, 10, count);
  565. this.describeOne = function(verbose=true) {
  566. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  567. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  568. type = random_desc(["train","passenger train","freight train"]);
  569. return "a " + merge_desc([adjective,color,type]);
  570. }
  571. this.describe = function(verbose = true) {
  572. if (verbose) {
  573. if (this.count == 1) {
  574. list = [];
  575. for (var i = 0; i < this.count; i++) {
  576. list.push(this.describeOne(verbose));
  577. }
  578. return merge_things(list) + " with " + this.contents["Person"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  579. } else {
  580. return this.count + " trains with " + this.contents["Person"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  581. }
  582. } else {
  583. return (this.count > 1 ? this.count + " trains" : "a train");
  584. }
  585. }
  586. this.anal_vore = function() {
  587. 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");
  588. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  589. }
  590. }
  591. function TrainCar(count = 1) {
  592. this.name = "Train Car";
  593. copy_defaults(this,new DefaultEntity());
  594. this.count = count;
  595. this.contents = {};
  596. this.addContent("Person",10,40,count);
  597. this.describeOne = function(verbose=true) {
  598. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  599. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  600. type = random_desc(["train car","passenger train car","freight train car"]);
  601. return "a " + merge_desc([adjective,color,type]);
  602. }
  603. this.describe = function(verbose = true) {
  604. if (verbose) {
  605. if (this.count <= 3) {
  606. list = [];
  607. for (var i = 0; i < this.count; i++) {
  608. list.push(this.describeOne(this.count < 2));
  609. }
  610. return merge_things(list) + " with " + describe_all(this.contents) + " inside";
  611. } else {
  612. return this.count + " train cars with " + describe_all(this.contents) + " inside";
  613. }
  614. } else {
  615. return (this.count > 1 ? this.count + " train cars" : "a train car");
  616. }
  617. }
  618. }
  619. function House(count = 1) {
  620. this.name = "House";
  621. copy_defaults(this,new DefaultEntity());
  622. this.count = count;
  623. this.contents = {};
  624. this.addContent("Person",0,8,count);
  625. this.addContent("Empty Car",0,2,count);
  626. this.describeOne = function(verbose=true) {
  627. size = random_desc(["little","two-story","large"], (verbose ? 0.5 : 0));
  628. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  629. name = random_desc(["house","house","house","house","house","trailer"], 1);
  630. return "a " + merge_desc([size,color,name]);
  631. }
  632. this.describe = function(verbose = true) {
  633. if (verbose) {
  634. if (this.count <= 3) {
  635. list = [];
  636. for (var i = 0; i < this.count; i++) {
  637. list.push(this.describeOne(this.count < 2));
  638. }
  639. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  640. } else {
  641. return this.count + " homes with " + describe_all(this.contents,verbose) + " inside";
  642. }
  643. } else {
  644. return (this.count > 1 ? this.count + " houses" : "a house");
  645. }
  646. }
  647. }
  648. function Barn(count = 1) {
  649. this.name = "Barn";
  650. copy_defaults(this,new DefaultEntity());
  651. this.count = count;
  652. this.contents = {};
  653. this.addContent("Person",0,2,count);
  654. this.addContent("Cow",30,70,count);
  655. this.describeOne = function(verbose=true) {
  656. size = random_desc(["little","big","large"], (verbose ? 0.5 : 0));
  657. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  658. name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  659. return "a " + merge_desc([size,color,name]);
  660. }
  661. this.describe = function(verbose = true) {
  662. if (verbose) {
  663. if (this.count <= 3) {
  664. list = [];
  665. for (var i = 0; i < this.count; i++) {
  666. list.push(this.describeOne(this.count < 2));
  667. }
  668. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  669. } else {
  670. return this.count + " barns with " + describe_all(this.contents,verbose) + " inside";
  671. }
  672. } else {
  673. return (this.count > 1 ? this.count + " barns" : "a barn");
  674. }
  675. }
  676. }
  677. function SmallSkyscraper(count = 1) {
  678. this.name = "Small Skyscraper";
  679. copy_defaults(this,new DefaultEntity());
  680. this.count = count;
  681. this.contents = {};
  682. this.addContent("Person",50,500,count);
  683. this.addContent("Empty Car",10,50,count);
  684. this.describeOne = function(verbose=true) {
  685. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  686. name = random_desc(["skyscraper","office tower","office building"], 1);
  687. return "a " + merge_desc([color,name]);
  688. }
  689. this.describe = function(verbose = true) {
  690. if (verbose) {
  691. if (this.count <= 3) {
  692. list = [];
  693. for (var i = 0; i < this.count; i++) {
  694. list.push(this.describeOne(this.count < 2));
  695. }
  696. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  697. } else {
  698. return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  699. }
  700. } else {
  701. return (this.count > 1 ? this.count + " skyscrapers" : "a skyscraper");
  702. }
  703. }
  704. this.anal_vore = function(verbose=true,height=10) {
  705. var line = skyscraperAnalVore(this,verbose,height);
  706. if (line == "")
  707. return defaultAnalVore(this)(verbose);
  708. else
  709. return line;
  710. };
  711. }
  712. function ParkingGarage(count = 1) {
  713. this.name = "Parking Garage";
  714. copy_defaults(this,new DefaultEntity());
  715. this.count = count;
  716. this.contents = {};
  717. this.addContent("Person",10,200,count);
  718. this.addContent("Empty Car",30,100,count);
  719. this.addContent("Car",5,30,count);
  720. this.describeOne = function(verbose=true) {
  721. return "a parking garage";
  722. }
  723. this.describe = function(verbose = true) {
  724. if (verbose) {
  725. return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose) + " inside";
  726. } else {
  727. return (this.count == 1 ? "a parking garage" : this.count + " parking garages");
  728. }
  729. }
  730. }
  731. function Overpass(count = 1) {
  732. this.name = "Overpass";
  733. copy_defaults(this,new DefaultEntity());
  734. this.count = count;
  735. this.contents = {};
  736. this.addContent("Person",0,20,count);
  737. this.addContent("Car",25,100,count);
  738. }
  739. function Town(count = 1) {
  740. this.name = "Town";
  741. copy_defaults(this,new DefaultEntity());
  742. this.count = count;
  743. this.contents = {};
  744. this.addContent("Person",1000,15000,count);
  745. this.addContent("House",500,10000,count);
  746. this.addContent("Empty Car",250,3750,count);
  747. this.addContent("Car",250,3750,count);
  748. this.addContent("Train",5,10,count);
  749. this.addContent("Small Skyscraper",2,10,count);
  750. this.addContent("Parking Garage",1,5,count);
  751. this.describe = function(verbose = true) {
  752. if (verbose) {
  753. return (this.count == 1 ? "a town" : this.count + " towns") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  754. } else {
  755. return (this.count == 1 ? "a town" : this.count + " towns");
  756. }
  757. }
  758. }
  759. function City(count = 1) {
  760. this.name = "City";
  761. copy_defaults(this,new DefaultEntity());
  762. this.count = count;
  763. this.contents = {};
  764. this.addContent("Person",10000,150000,count);
  765. this.addContent("House",5000,100000,count);
  766. this.addContent("Empty Car",2500,37500,count);
  767. this.addContent("Car",2500,37500,count);
  768. this.addContent("Train",50,100,count);
  769. this.addContent("Tram",100,300,count);
  770. this.addContent("Small Skyscraper",20,100,count);
  771. this.addContent("Parking Garage",10,50,count);
  772. this.describe = function(verbose = true) {
  773. if (verbose) {
  774. return (this.count == 1 ? "a city" : this.count + " cities") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  775. } else {
  776. return (this.count == 1 ? "a city" : this.count + " cities");
  777. }
  778. }
  779. }
  780. function Continent(count = 1) {
  781. this.name = "Continent";
  782. copy_defaults(this,new DefaultEntity());
  783. this.count = count;
  784. this.contents = {};
  785. this.addContent("Person",100000,1500000,count);
  786. this.addContent("House",5000,100000,count);
  787. this.addContent("Car",25000,375000,count);
  788. this.addContent("Train",500,1000,count);
  789. this.addContent("Town",2000,5000,count);
  790. this.addContent("City",200,500,count);
  791. this.describe = function(verbose = true) {
  792. if (verbose) {
  793. return (this.count == 1 ? "a continent" : this.count + " continents") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  794. } else {
  795. return (this.count == 1 ? "a continent" : this.count + " continents");
  796. }
  797. }
  798. }
  799. function Planet(count = 1) {
  800. this.name = "Planet";
  801. copy_defaults(this,new DefaultEntity());
  802. this.count = count;
  803. this.contents = {};
  804. this.addContent("Continent",4,9,count);
  805. this.describe = function(verbose = true) {
  806. if (verbose) {
  807. return (this.count == 1 ? "a planet" : this.count + " planets") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  808. } else {
  809. return (this.count == 1 ? "a planet" : this.count + " planets");
  810. }
  811. }
  812. }
  813. function Star(count = 1) {
  814. this.name = "Star";
  815. copy_defaults(this,new DefaultEntity());
  816. this.count = count;
  817. this.contents = {};
  818. this.describe = function(verbose = true) {
  819. return (this.count == 1 ? "a star" : this.count + " stars");
  820. }
  821. }
  822. function SolarSystem(count = 1) {
  823. this.name = "Solar System";
  824. copy_defaults(this,new DefaultEntity());
  825. this.count = count;
  826. this.contents = {};
  827. this.addContent("Star",1,1,count);
  828. this.addContent("Planet",5,15,count);
  829. this.describe = function(verbose = true) {
  830. if (verbose) {
  831. return (this.count == 1 ? "a solar system" : this.count + " solar systems") + " made up of " + describe_all(this.contents, verbose);
  832. } else {
  833. return (this.count == 1 ? "a solar system" : this.count + " solar systems");
  834. }
  835. }
  836. }
  837. function Galaxy(count = 1) {
  838. this.name = "Galaxy";
  839. copy_defaults(this,new DefaultEntity());
  840. this.count = count;
  841. this.contents = {};
  842. this.addContent("Star",1e9,500e9,count);
  843. this.addContent("Solar System",1e8,500e8,count);
  844. this.describe = function(verbose = true) {
  845. if (verbose) {
  846. return (this.count == 1 ? "a galaxy" : this.count + " galaxies") + " made up of " + describe_all(this.contents, verbose);
  847. } else {
  848. return (this.count == 1 ? "a galaxy" : this.count + " galaxies");
  849. }
  850. }
  851. }