big steppy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

851 Zeilen
22 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. };
  19. var areas =
  20. {
  21. "Container": 0,
  22. "Person": 1,
  23. "Cow": 2,
  24. "Car": 4,
  25. "Bus": 12,
  26. "Tram": 20,
  27. "Motorcycle": 2,
  28. "House": 1000,
  29. "Barn": 750,
  30. "Small Skyscraper": 10000,
  31. "Train": 500,
  32. "TrainCar": 500,
  33. "Parking Garage": 5000,
  34. "Overpass": 10000,
  35. };
  36. var masses =
  37. {
  38. "Container": 0,
  39. "Person": 80,
  40. "Cow": 300,
  41. "Car": 1000,
  42. "Bus": 5000,
  43. "Tram": 10000,
  44. "Motorcycle": 200,
  45. "House": 10000,
  46. "Barn": 5000,
  47. "Small Skyscraper": 100000,
  48. "Train": 5000,
  49. "Train Car": 5000,
  50. "Parking Garage": 100000,
  51. "Overpass": 100000,
  52. };
  53. // general logic: each step fills in a fraction of the remaining space
  54. function fill_area2(area, weights)
  55. {
  56. result = [];
  57. candidates = [];
  58. for (var key in weights) {
  59. if (weights.hasOwnProperty(key)) {
  60. candidates.push({"name": key, "area": areas[key], "weight": weights[key]});
  61. }
  62. }
  63. candidates = candidates.sort(function (x,y) {
  64. return x.area - y.area;
  65. });
  66. while(candidates.length > 0) {
  67. var candidate = candidates.pop();
  68. if (candidate.area > area)
  69. continue;
  70. var max = Math.floor(area / candidate.area);
  71. var limit = Math.min(max, 100);
  72. var count = 0;
  73. // for small amounts, actually do the randomness
  74. // the first few ones get a much better shot
  75. while (limit > 0) {
  76. if (limit <= 3)
  77. count += Math.random() < (1 - Math.pow((1 - candidate.weight),limit*3)) ? 1 : 0;
  78. else
  79. count += Math.random() < candidate.weight ? 1 : 0;
  80. --limit;
  81. }
  82. if (limit < max) {
  83. count += Math.round((max-limit) * candidate.weight);
  84. }
  85. area -= count * candidate.area;
  86. if (count > 0)
  87. result.push(new things[candidate.name](count));
  88. }
  89. if (result.length > 1) {
  90. return new Container(result);
  91. } else if (result.length == 1) {
  92. return result[0];
  93. } else {
  94. return new Person(1);
  95. }
  96. }
  97. function fill_area(area, weights = {"Person": 0.1})
  98. {
  99. var testRadius = Math.sqrt(area / Math.PI);
  100. result = []
  101. for (var key in weights) {
  102. if (weights.hasOwnProperty(key)) {
  103. var objArea = areas[key];
  104. var objRadius = Math.sqrt(objArea / Math.PI);
  105. var newRadius = testRadius - objRadius;
  106. if (newRadius > 0) {
  107. var newArea = newRadius * newRadius * Math.PI;
  108. var numObjs = weights[key] * newArea;
  109. if (numObjs < 1) {
  110. numObjs = Math.random() > numObjs ? 0 : 1;
  111. }
  112. else {
  113. numObjs = Math.round(numObjs);
  114. }
  115. if (numObjs > 0)
  116. result.push(new things[key](numObjs));
  117. else {
  118. // try again with a better chance for just one
  119. }
  120. }
  121. }
  122. }
  123. if (result.length > 1)
  124. return new Container(result);
  125. else if (result.length == 1)
  126. return result[0];
  127. else
  128. return new Person();
  129. }
  130. // describes everything in the container
  131. function describe_all(contents,verbose=true) {
  132. var things = [];
  133. for (var key in contents) {
  134. if (contents.hasOwnProperty(key)) {
  135. things.push(contents[key].describe(verbose));
  136. }
  137. }
  138. return merge_things(things);
  139. }
  140. function random_desc(list, odds=1) {
  141. if (Math.random() < odds)
  142. return list[Math.floor(Math.random() * list.length)];
  143. else
  144. return "";
  145. }
  146. // combine strings into a list with proper grammar
  147. function merge_things(list,semicolons=false) {
  148. if (list.length == 0) {
  149. return "";
  150. } else if (list.length == 1) {
  151. return list[0];
  152. } else if (list.length == 2) {
  153. return list[0] + " and " + list[1];
  154. } else {
  155. result = "";
  156. list.slice(0,list.length-1).forEach(function(term) {
  157. result += term + ", ";
  158. })
  159. result += "and " + list[list.length-1]
  160. return result;
  161. }
  162. }
  163. // combine the adjectives for something into a single string
  164. function merge_desc(list) {
  165. result = ""
  166. list.forEach(function(term) {
  167. if (term != "")
  168. result += term + " ";
  169. });
  170. // knock off the last space
  171. if (result.length > 0) {
  172. result = result.substring(0, result.length - 1);
  173. }
  174. return result;
  175. }
  176. // maybe make this something that approximates a
  177. // normal distribution; doing this 15,000,000 times is bad...
  178. // solution: only a few are random lul
  179. function distribution(min, max, samples) {
  180. var result = 0;
  181. var limit = Math.min(100,samples)
  182. for (var i = 0; i < limit; i++) {
  183. result += Math.floor(Math.random() * (max - min + 1) + min);
  184. }
  185. if (limit < samples) {
  186. result += Math.round((max - min) * (samples - limit));
  187. }
  188. return result;
  189. }
  190. /* default actions */
  191. function defaultStomp(thing) {
  192. return function (verbose=true,height=10) { return "You crush " + thing.describe(verbose) + " underfoot."};
  193. }
  194. function defaultKick(thing) {
  195. return function(verbose=true,height=10) { return "You punt " + thing.describe(verbose) + ", destroying " + (thing.count > 1 ? "them" : "it") + "."; }
  196. }
  197. function defaultEat(thing) {
  198. return function(verbose=true,height=10) { return "You scoop up " + thing.describe(verbose) + " and swallow " + (thing.count > 1 ? "them" : "it") + " whole."; }
  199. }
  200. function defaultAnalVore(thing) {
  201. 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."; }
  202. }
  203. function defaultButtcrush(thing) {
  204. return function(verbose=true,height=10) { return "Your heavy ass obliterates " + thing.describe(verbose) + ". "; }
  205. }
  206. function defaultArea(thing) {
  207. return areas[thing.name];
  208. }
  209. function defaultMass(thing) {
  210. return masses[thing.name];
  211. }
  212. function defaultMerge(thing) {
  213. return function(container) {
  214. var newCount = this.count + container.count;
  215. var newThing = new things[thing.name](newCount);
  216. newThing.contents = {};
  217. for (var key in this.contents) {
  218. if (this.contents.hasOwnProperty(key)) {
  219. newThing.contents[key] = this.contents[key];
  220. }
  221. }
  222. for (var key in container.contents) {
  223. if (container.contents.hasOwnProperty(key)) {
  224. if (this.contents.hasOwnProperty(key)) {
  225. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  226. } else {;
  227. newThing.contents[key] = container.contents[key];
  228. }
  229. }
  230. }
  231. return newThing;
  232. }
  233. }
  234. function defaultSum(thing) {
  235. return function() {
  236. var counts = {}
  237. if (thing.name != "Container")
  238. counts[thing.name] = thing.count;
  239. for (var key in thing.contents) {
  240. if (thing.contents.hasOwnProperty(key)) {
  241. subcount = thing.contents[key].sum();
  242. for (var subkey in subcount) {
  243. if (!counts.hasOwnProperty(subkey)) {
  244. counts[subkey] = 0;
  245. }
  246. counts[subkey] += subcount[subkey];
  247. }
  248. }
  249. }
  250. return counts;
  251. }
  252. }
  253. function defaultSumProperty(thing) {
  254. return function(prop) {
  255. var total = 0;
  256. total += thing[prop] * thing.count;
  257. for (var key in thing.contents) {
  258. if (thing.contents.hasOwnProperty(key)) {
  259. total += thing.contents[key].sum_property(prop);
  260. }
  261. }
  262. return total;
  263. }
  264. }
  265. function DefaultEntity() {
  266. this.stomp = defaultStomp;
  267. this.eat = defaultEat;
  268. this.kick = defaultKick;
  269. this.anal_vore = defaultAnalVore;
  270. this.buttcrush = defaultButtcrush;
  271. this.sum = defaultSum;
  272. this.area = defaultArea;
  273. this.mass = defaultMass;
  274. this.sum_property = defaultSumProperty;
  275. this.merge = defaultMerge;
  276. return this;
  277. }
  278. // god I love reinventing the wheel
  279. function copy_defaults(self,proto) {
  280. for (var key in proto) {
  281. if (proto.hasOwnProperty(key)) {
  282. self[key] = proto[key](self)
  283. }
  284. }
  285. }
  286. function Container(contents = []) {
  287. this.name = "Container";
  288. copy_defaults(this,new DefaultEntity());
  289. this.count = 0;
  290. this.contents = {}
  291. for (var i=0; i < contents.length; i++) {
  292. this.contents[contents[i].name] = contents[i];
  293. }
  294. for (var key in this.contents) {
  295. if (this.contents.hasOwnProperty(key)) {
  296. this.count += this.contents[key].count;
  297. }
  298. }
  299. this.describe = function(verbose = true) {
  300. return describe_all(this.contents,verbose)
  301. }
  302. this.eat = function(verbose=true) {
  303. var line = containerEat(this,verbose);
  304. if (line == "")
  305. return defaultEat(this)(verbose);
  306. else
  307. return line;
  308. };
  309. return this;
  310. }
  311. function Person(count = 1) {
  312. this.name = "Person";
  313. copy_defaults(this,new DefaultEntity());
  314. this.count = count;
  315. this.contents = {};
  316. this.describeOne = function (verbose=true) {
  317. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  318. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  319. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]);
  320. return "a " + merge_desc([body,sex,species]);
  321. }
  322. this.describe = function(verbose=true) {
  323. if (verbose) {
  324. if (count <= 3) {
  325. list = [];
  326. for (var i = 0; i < count; i++) {
  327. list.push(this.describeOne(this.count <= 2));
  328. }
  329. return merge_things(list);
  330. } else {
  331. return this.count + " people"
  332. }
  333. } else {
  334. return (this.count > 1 ? this.count + " people" : "a person");
  335. }
  336. }
  337. this.stomp = function(verbose=true) {
  338. var line = personStomp(this);
  339. if (line == "")
  340. return defaultStomp(this)(verbose);
  341. else
  342. return line;
  343. };
  344. this.eat = function(verbose=true) {
  345. var line = personEat(this);
  346. if (line == "")
  347. return defaultEat(this)(verbose);
  348. else
  349. return line;
  350. };
  351. return this;
  352. }
  353. function Cow(count = 1) {
  354. this.name = "Cow";
  355. copy_defaults(this,new DefaultEntity());
  356. this.count = count;
  357. this.contents = {};
  358. this.describeOne = function (verbose=true) {
  359. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  360. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  361. return "a " + merge_desc([body,sex,"cow"]);
  362. }
  363. this.describe = function(verbose=true) {
  364. if (verbose) {
  365. if (count <= 3) {
  366. list = [];
  367. for (var i = 0; i < count; i++) {
  368. list.push(this.describeOne(this.count <= 2));
  369. }
  370. return merge_things(list);
  371. } else {
  372. return this.count + " cattle"
  373. }
  374. } else {
  375. return (this.count > 1 ? this.count + " cattle" : "a cow");
  376. }
  377. }
  378. return this;
  379. }
  380. function EmptyCar(count = 1) {
  381. this.name = "Car";
  382. copy_defaults(this,new DefaultEntity());
  383. this.count = count;
  384. this.contents = {};
  385. this.describeOne = function(verbose=true) {
  386. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  387. adjective = random_desc(["rusty","brand-new"],0.3);
  388. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  389. return "a parked " + merge_desc([adjective,color,type]);
  390. }
  391. this.describe = function(verbose = true) {
  392. if (verbose) {
  393. if (this.count <= 3) {
  394. list = [];
  395. for (var i = 0; i < this.count; i++) {
  396. list.push(this.describeOne());
  397. }
  398. return merge_things(list);
  399. } else {
  400. return this.count + " parked cars";
  401. }
  402. } else {
  403. return (this.count > 1 ? this.count + " parked cars" : "a parked car");
  404. }
  405. }
  406. }
  407. function Car(count = 1) {
  408. this.name = "Car";
  409. copy_defaults(this,new DefaultEntity());
  410. this.count = count;
  411. this.contents = {};
  412. var amount = distribution(2,5,count);
  413. this.contents.person = new Person(amount);
  414. this.describeOne = function(verbose=true) {
  415. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  416. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  417. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  418. return "a " + merge_desc([adjective,color,type]);
  419. }
  420. this.describe = function(verbose = true) {
  421. if (verbose) {
  422. if (this.count <= 3) {
  423. list = [];
  424. for (var i = 0; i < this.count; i++) {
  425. list.push(this.describeOne(this.count < 2));
  426. }
  427. return merge_things(list) + " with " + this.contents.person.describe(false) + " inside";
  428. } else {
  429. return this.count + " cars with " + this.contents.person.describe(false) + " inside";
  430. }
  431. } else {
  432. return (this.count > 1 ? this.count + " cars" : "a car");
  433. }
  434. }
  435. }
  436. function Bus(count = 1) {
  437. this.name = "Bus";
  438. copy_defaults(this,new DefaultEntity());
  439. this.count = count;
  440. this.contents = {};
  441. var amount = distribution(10,35,count);
  442. this.contents.person = new Person(amount);
  443. this.describeOne = function(verbose=true) {
  444. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  445. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  446. type = random_desc(["bus","double-decker bus","articulating bus"]);
  447. return "a " + merge_desc([adjective,color,type]);
  448. }
  449. this.describe = function(verbose = true) {
  450. if (verbose) {
  451. if (this.count <= 3) {
  452. list = [];
  453. for (var i = 0; i < this.count; i++) {
  454. list.push(this.describeOne(this.count < 2));
  455. }
  456. return merge_things(list) + " with " + this.contents.person.describe() + " inside";
  457. } else {
  458. return this.count + " buses with " + this.contents.person.describe() + " inside";
  459. }
  460. } else {
  461. return (this.count > 1 ? this.count + " buses" : "a bus");
  462. }
  463. }
  464. }
  465. function Tram(count = 1) {
  466. this.name = "Tram";
  467. copy_defaults(this,new DefaultEntity());
  468. this.count = count;
  469. this.contents = {};
  470. var amount = distribution(40,60,count);
  471. this.contents.person = new Person(amount);
  472. this.describeOne = function(verbose=true) {
  473. adjective = random_desc(["rusty","weathered"], (verbose ? 0.3 : 0));
  474. color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  475. type = random_desc(["tram"]);
  476. return "a " + merge_desc([adjective,color,type]);
  477. }
  478. this.describe = function(verbose = true) {
  479. if (verbose) {
  480. if (this.count <= 3) {
  481. list = [];
  482. for (var i = 0; i < this.count; i++) {
  483. list.push(this.describeOne(this.count < 2));
  484. }
  485. return merge_things(list) + " with " + this.contents.person.describe() + " inside";
  486. } else {
  487. return this.count + " trams with " + this.contents.person.describe() + " inside";
  488. }
  489. } else {
  490. return (this.count > 1 ? this.count + " trams" : "a tram");
  491. }
  492. }
  493. this.anal_vore = function() {
  494. return "You slide " + this.describe() + " up your tight ass";
  495. }
  496. }
  497. function Motorcycle(count = 1) {
  498. this.name = "Motorcycle";
  499. copy_defaults(this,new DefaultEntity());
  500. this.count = count;
  501. this.contents = {};
  502. var amount = distribution(1,2,count);
  503. this.contents.person = new Person(amount);
  504. }
  505. function Train(count = 1) {
  506. this.name = "Train";
  507. copy_defaults(this,new DefaultEntity());
  508. this.count = count;
  509. this.contents = {};
  510. var amount = distribution(1,4,count);
  511. this.contents.person = new Person(amount);
  512. amount = distribution(1,10,count);
  513. this.contents.traincar = new TrainCar(amount);
  514. this.describeOne = function(verbose=true) {
  515. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  516. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  517. type = random_desc(["train","passenger train","freight train"]);
  518. return "a " + merge_desc([adjective,color,type]);
  519. }
  520. this.describe = function(verbose = true) {
  521. if (verbose) {
  522. if (this.count <= 3) {
  523. list = [];
  524. for (var i = 0; i < this.count; i++) {
  525. list.push(this.describeOne(this.count < 2));
  526. }
  527. return merge_things(list) + " with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  528. } else {
  529. return this.count + " trains with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  530. }
  531. } else {
  532. return (this.count > 1 ? this.count + " trains" : "a train");
  533. }
  534. }
  535. this.anal_vore = function() {
  536. var cars = (this.contents.traincar.count == 1 ? this.contents.traincar.describe() + " follows it inside" : this.contents.traincar.describe() + " are pulled slowly inside");
  537. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  538. }
  539. }
  540. function TrainCar(count = 1) {
  541. this.name = "Train Car";
  542. copy_defaults(this,new DefaultEntity());
  543. this.count = count;
  544. this.contents = {};
  545. var amount = distribution(10,40,count);
  546. this.contents.person = new Person(amount);
  547. this.describeOne = function(verbose=true) {
  548. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  549. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  550. type = random_desc(["train car","passenger train car","freight train car"]);
  551. return "a " + merge_desc([adjective,color,type]);
  552. }
  553. this.describe = function(verbose = true) {
  554. if (verbose) {
  555. if (this.count <= 3) {
  556. list = [];
  557. for (var i = 0; i < this.count; i++) {
  558. list.push(this.describeOne(this.count < 2));
  559. }
  560. return merge_things(list) + " with " + describe_all(this.contents) + " inside";
  561. } else {
  562. return this.count + " train cars with " + describe_all(this.contents) + " inside";
  563. }
  564. } else {
  565. return (this.count > 1 ? this.count + " train cars" : "a train car");
  566. }
  567. }
  568. }
  569. function House(count = 1) {
  570. this.name = "House";
  571. copy_defaults(this,new DefaultEntity());
  572. this.count = count;
  573. this.contents = {};
  574. var amount = distribution(0,8,count);
  575. this.contents.person = new Person(amount);
  576. amount = distribution(0,2,count);
  577. this.contents.emptycar = new EmptyCar(amount);
  578. this.describeOne = function(verbose=true) {
  579. size = random_desc(["little","two-story","large"], (verbose ? 0.5 : 0));
  580. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  581. name = random_desc(["house","house","house","house","house","trailer"], 1);
  582. return "a " + merge_desc([size,color,name]);
  583. }
  584. this.describe = function(verbose = true) {
  585. if (verbose) {
  586. if (this.count <= 3) {
  587. list = [];
  588. for (var i = 0; i < this.count; i++) {
  589. list.push(this.describeOne(this.count < 2));
  590. }
  591. return merge_things(list) + " with " + this.contents.person.describe(verbose) + " inside";
  592. } else {
  593. return this.count + " homes with " + this.contents.person.describe(verbose) + " inside";
  594. }
  595. } else {
  596. return (this.count > 1 ? this.count + " houses" : "a house");
  597. }
  598. }
  599. }
  600. function Barn(count = 1) {
  601. this.name = "Barn";
  602. copy_defaults(this,new DefaultEntity());
  603. this.count = count;
  604. this.contents = {};
  605. var amount = distribution(0,2,count);
  606. this.contents.person = new Person(amount);
  607. amount = distribution(30,70,count);
  608. this.contents.cow = new Cow(amount);
  609. this.describeOne = function(verbose=true) {
  610. size = random_desc(["little","big","large"], (verbose ? 0.5 : 0));
  611. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  612. name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  613. return "a " + merge_desc([size,color,name]);
  614. }
  615. this.describe = function(verbose = true) {
  616. if (verbose) {
  617. if (this.count <= 3) {
  618. list = [];
  619. for (var i = 0; i < this.count; i++) {
  620. list.push(this.describeOne(this.count < 2));
  621. }
  622. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  623. } else {
  624. return this.count + " barns with " + describe_all(this.contents,verbose) + " inside";
  625. }
  626. } else {
  627. return (this.count > 1 ? this.count + " barns" : "a barn");
  628. }
  629. }
  630. }
  631. function SmallSkyscraper(count = 1) {
  632. this.name = "Small Skyscraper";
  633. copy_defaults(this,new DefaultEntity());
  634. this.count = count;
  635. this.contents = {};
  636. var amount = distribution(50,500,count);
  637. this.contents.person = new Person(amount);
  638. amount = distribution(10,50,count);
  639. this.contents.emptycar = new EmptyCar(amount);
  640. this.describeOne = function(verbose=true) {
  641. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  642. name = random_desc(["skyscraper","office tower","office building"], 1);
  643. return "a " + merge_desc([color,name]);
  644. }
  645. this.describe = function(verbose = true) {
  646. if (verbose) {
  647. if (this.count <= 3) {
  648. list = [];
  649. for (var i = 0; i < this.count; i++) {
  650. list.push(this.describeOne(this.count < 2));
  651. }
  652. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  653. } else {
  654. return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  655. }
  656. } else {
  657. return (this.count > 1 ? this.count + " skyscrapers" : "a skyscraper");
  658. }
  659. }
  660. this.anal_vore = function(verbose=true,height=10) {
  661. var line = skyscraperAnalVore(this,verbose,height);
  662. if (line == "")
  663. return defaultAnalVore(this)(verbose);
  664. else
  665. return line;
  666. };
  667. }
  668. function ParkingGarage(count = 1) {
  669. this.name = "Parking Garage";
  670. copy_defaults(this,new DefaultEntity());
  671. this.count = count;
  672. this.contents = {};
  673. var amount = distribution(10,200,count);
  674. this.contents.person = new Person(amount);
  675. amount = distribution(30,100,count);
  676. this.contents.emptycar = new EmptyCar(amount);
  677. amount = distribution(5,20,count);
  678. this.contents.car = new Car(amount);
  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. var amount = distribution(0,20,count);
  696. this.contents.person = new Person(amount);
  697. amount = distribution(25,100,count);
  698. this.contents.car = new Car(amount);
  699. }