big steppy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

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