big steppy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

871 行
23 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 defaultBreastCrush(thing) {
  207. return function(verbose=true,height=10) { return "Your heavy breasts obliterate " + thing.describe(verbose) + ". "; }
  208. }
  209. function defaultUnbirth(thing) {
  210. return function(verbose=true,height=10) { return "You gasp as you slide " + thing.describe(verbose) + " up your slit. "; }
  211. }
  212. function defaultCockslap(thing) {
  213. return function(verbose=true,height=10) { return "Your swaying shaft crushes " + thing.describe(verbose) + ". "; }
  214. }
  215. function defaultBallSmother(thing) {
  216. return function(verbose=true,height=10) { return "Your weighty balls spread over " + thing.describe(verbose) + ", smothering them in musk. "; }
  217. }
  218. function defaultArea(thing) {
  219. return areas[thing.name];
  220. }
  221. function defaultMass(thing) {
  222. return masses[thing.name];
  223. }
  224. function defaultMerge(thing) {
  225. return function(container) {
  226. var newCount = this.count + container.count;
  227. var newThing = new things[thing.name](newCount);
  228. newThing.contents = {};
  229. for (var key in this.contents) {
  230. if (this.contents.hasOwnProperty(key)) {
  231. newThing.contents[key] = this.contents[key];
  232. }
  233. }
  234. for (var key in container.contents) {
  235. if (container.contents.hasOwnProperty(key)) {
  236. if (this.contents.hasOwnProperty(key)) {
  237. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  238. } else {;
  239. newThing.contents[key] = container.contents[key];
  240. }
  241. }
  242. }
  243. return newThing;
  244. }
  245. }
  246. function defaultSum(thing) {
  247. return function() {
  248. var counts = {}
  249. if (thing.name != "Container")
  250. counts[thing.name] = thing.count;
  251. for (var key in thing.contents) {
  252. if (thing.contents.hasOwnProperty(key)) {
  253. subcount = thing.contents[key].sum();
  254. for (var subkey in subcount) {
  255. if (!counts.hasOwnProperty(subkey)) {
  256. counts[subkey] = 0;
  257. }
  258. counts[subkey] += subcount[subkey];
  259. }
  260. }
  261. }
  262. return counts;
  263. }
  264. }
  265. function defaultSumProperty(thing) {
  266. return function(prop) {
  267. var total = 0;
  268. total += thing[prop] * thing.count;
  269. for (var key in thing.contents) {
  270. if (thing.contents.hasOwnProperty(key)) {
  271. total += thing.contents[key].sum_property(prop);
  272. }
  273. }
  274. return total;
  275. }
  276. }
  277. function DefaultEntity() {
  278. this.stomp = defaultStomp;
  279. this.eat = defaultEat;
  280. this.kick = defaultKick;
  281. this.anal_vore = defaultAnalVore;
  282. this.buttcrush = defaultButtcrush;
  283. this.breast_crush = defaultBreastCrush;
  284. this.unbirth = defaultUnbirth;
  285. this.cockslap = defaultCockslap;
  286. this.ball_smother = defaultBallSmother;
  287. this.sum = defaultSum;
  288. this.area = defaultArea;
  289. this.mass = defaultMass;
  290. this.sum_property = defaultSumProperty;
  291. this.merge = defaultMerge;
  292. return this;
  293. }
  294. // god I love reinventing the wheel
  295. function copy_defaults(self,proto) {
  296. for (var key in proto) {
  297. if (proto.hasOwnProperty(key)) {
  298. self[key] = proto[key](self)
  299. }
  300. }
  301. }
  302. function Container(contents = []) {
  303. this.name = "Container";
  304. copy_defaults(this,new DefaultEntity());
  305. this.count = 0;
  306. this.contents = {}
  307. for (var i=0; i < contents.length; i++) {
  308. this.contents[contents[i].name] = contents[i];
  309. }
  310. for (var key in this.contents) {
  311. if (this.contents.hasOwnProperty(key)) {
  312. this.count += this.contents[key].count;
  313. }
  314. }
  315. this.describe = function(verbose = true) {
  316. return describe_all(this.contents,verbose)
  317. }
  318. this.eat = function(verbose=true) {
  319. var line = containerEat(this,verbose);
  320. if (line == "")
  321. return defaultEat(this)(verbose);
  322. else
  323. return line;
  324. };
  325. return this;
  326. }
  327. function Person(count = 1) {
  328. this.name = "Person";
  329. copy_defaults(this,new DefaultEntity());
  330. this.count = count;
  331. this.contents = {};
  332. this.describeOne = function (verbose=true) {
  333. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  334. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  335. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]);
  336. return "a " + merge_desc([body,sex,species]);
  337. }
  338. this.describe = function(verbose=true) {
  339. if (verbose) {
  340. if (count <= 3) {
  341. list = [];
  342. for (var i = 0; i < count; i++) {
  343. list.push(this.describeOne(this.count <= 2));
  344. }
  345. return merge_things(list);
  346. } else {
  347. return this.count + " people"
  348. }
  349. } else {
  350. return (this.count > 1 ? this.count + " people" : "a person");
  351. }
  352. }
  353. this.stomp = function(verbose=true) {
  354. var line = personStomp(this);
  355. if (line == "")
  356. return defaultStomp(this)(verbose);
  357. else
  358. return line;
  359. };
  360. this.eat = function(verbose=true) {
  361. var line = personEat(this);
  362. if (line == "")
  363. return defaultEat(this)(verbose);
  364. else
  365. return line;
  366. };
  367. return this;
  368. }
  369. function Cow(count = 1) {
  370. this.name = "Cow";
  371. copy_defaults(this,new DefaultEntity());
  372. this.count = count;
  373. this.contents = {};
  374. this.describeOne = function (verbose=true) {
  375. body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  376. sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  377. return "a " + merge_desc([body,sex,"cow"]);
  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 + " cattle"
  389. }
  390. } else {
  391. return (this.count > 1 ? this.count + " cattle" : "a cow");
  392. }
  393. }
  394. return this;
  395. }
  396. function EmptyCar(count = 1) {
  397. this.name = "Car";
  398. copy_defaults(this,new DefaultEntity());
  399. this.count = count;
  400. this.contents = {};
  401. this.describeOne = function(verbose=true) {
  402. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  403. adjective = random_desc(["rusty","brand-new"],0.3);
  404. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  405. return "a parked " + merge_desc([adjective,color,type]);
  406. }
  407. this.describe = function(verbose = true) {
  408. if (verbose) {
  409. if (this.count <= 3) {
  410. list = [];
  411. for (var i = 0; i < this.count; i++) {
  412. list.push(this.describeOne());
  413. }
  414. return merge_things(list);
  415. } else {
  416. return this.count + " parked cars";
  417. }
  418. } else {
  419. return (this.count > 1 ? this.count + " parked cars" : "a parked car");
  420. }
  421. }
  422. }
  423. function Car(count = 1) {
  424. this.name = "Car";
  425. copy_defaults(this,new DefaultEntity());
  426. this.count = count;
  427. this.contents = {};
  428. var amount = distribution(2,5,count);
  429. this.contents.person = new Person(amount);
  430. this.describeOne = function(verbose=true) {
  431. color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  432. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  433. type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  434. return "a " + merge_desc([adjective,color,type]);
  435. }
  436. this.describe = function(verbose = true) {
  437. if (verbose) {
  438. if (this.count <= 3) {
  439. list = [];
  440. for (var i = 0; i < this.count; i++) {
  441. list.push(this.describeOne(this.count < 2));
  442. }
  443. return merge_things(list) + " with " + this.contents.person.describe(false) + " inside";
  444. } else {
  445. return this.count + " cars with " + this.contents.person.describe(false) + " inside";
  446. }
  447. } else {
  448. return (this.count > 1 ? this.count + " cars" : "a car");
  449. }
  450. }
  451. }
  452. function Bus(count = 1) {
  453. this.name = "Bus";
  454. copy_defaults(this,new DefaultEntity());
  455. this.count = count;
  456. this.contents = {};
  457. var amount = distribution(10,35,count);
  458. this.contents.person = new Person(amount);
  459. this.describeOne = function(verbose=true) {
  460. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  461. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  462. type = random_desc(["bus","double-decker bus","articulating bus"]);
  463. return "a " + merge_desc([adjective,color,type]);
  464. }
  465. this.describe = function(verbose = true) {
  466. if (verbose) {
  467. if (this.count <= 3) {
  468. list = [];
  469. for (var i = 0; i < this.count; i++) {
  470. list.push(this.describeOne(this.count < 2));
  471. }
  472. return merge_things(list) + " with " + this.contents.person.describe() + " inside";
  473. } else {
  474. return this.count + " buses with " + this.contents.person.describe() + " inside";
  475. }
  476. } else {
  477. return (this.count > 1 ? this.count + " buses" : "a bus");
  478. }
  479. }
  480. }
  481. function Tram(count = 1) {
  482. this.name = "Tram";
  483. copy_defaults(this,new DefaultEntity());
  484. this.count = count;
  485. this.contents = {};
  486. var amount = distribution(40,60,count);
  487. this.contents.person = new Person(amount);
  488. this.describeOne = function(verbose=true) {
  489. adjective = random_desc(["rusty","weathered"], (verbose ? 0.3 : 0));
  490. color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  491. type = random_desc(["tram"]);
  492. return "a " + merge_desc([adjective,color,type]);
  493. }
  494. this.describe = function(verbose = true) {
  495. if (verbose) {
  496. if (this.count <= 3) {
  497. list = [];
  498. for (var i = 0; i < this.count; i++) {
  499. list.push(this.describeOne(this.count < 2));
  500. }
  501. return merge_things(list) + " with " + this.contents.person.describe() + " inside";
  502. } else {
  503. return this.count + " trams with " + this.contents.person.describe() + " inside";
  504. }
  505. } else {
  506. return (this.count > 1 ? this.count + " trams" : "a tram");
  507. }
  508. }
  509. this.anal_vore = function() {
  510. return "You slide " + this.describe() + " up your tight ass";
  511. }
  512. }
  513. function Motorcycle(count = 1) {
  514. this.name = "Motorcycle";
  515. copy_defaults(this,new DefaultEntity());
  516. this.count = count;
  517. this.contents = {};
  518. var amount = distribution(1,2,count);
  519. this.contents.person = new Person(amount);
  520. }
  521. function Train(count = 1) {
  522. this.name = "Train";
  523. copy_defaults(this,new DefaultEntity());
  524. this.count = count;
  525. this.contents = {};
  526. var amount = distribution(1,4,count);
  527. this.contents.person = new Person(amount);
  528. amount = distribution(1,10,count);
  529. this.contents.traincar = new TrainCar(amount);
  530. this.describeOne = function(verbose=true) {
  531. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  532. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  533. type = random_desc(["train","passenger train","freight train"]);
  534. return "a " + merge_desc([adjective,color,type]);
  535. }
  536. this.describe = function(verbose = true) {
  537. if (verbose) {
  538. if (this.count <= 3) {
  539. list = [];
  540. for (var i = 0; i < this.count; i++) {
  541. list.push(this.describeOne(this.count < 2));
  542. }
  543. return merge_things(list) + " with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  544. } else {
  545. return this.count + " trains with " + this.contents.person.describe() + " in the engine and " + this.contents.traincar.describe() + " attached";
  546. }
  547. } else {
  548. return (this.count > 1 ? this.count + " trains" : "a train");
  549. }
  550. }
  551. this.anal_vore = function() {
  552. var cars = (this.contents.traincar.count == 1 ? this.contents.traincar.describe() + " follows it inside" : this.contents.traincar.describe() + " are pulled slowly inside");
  553. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  554. }
  555. }
  556. function TrainCar(count = 1) {
  557. this.name = "Train Car";
  558. copy_defaults(this,new DefaultEntity());
  559. this.count = count;
  560. this.contents = {};
  561. var amount = distribution(10,40,count);
  562. this.contents.person = new Person(amount);
  563. this.describeOne = function(verbose=true) {
  564. adjective = random_desc(["rusty","brand-new"], (verbose ? 0.3 : 0));
  565. color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  566. type = random_desc(["train car","passenger train car","freight train car"]);
  567. return "a " + merge_desc([adjective,color,type]);
  568. }
  569. this.describe = function(verbose = true) {
  570. if (verbose) {
  571. if (this.count <= 3) {
  572. list = [];
  573. for (var i = 0; i < this.count; i++) {
  574. list.push(this.describeOne(this.count < 2));
  575. }
  576. return merge_things(list) + " with " + describe_all(this.contents) + " inside";
  577. } else {
  578. return this.count + " train cars with " + describe_all(this.contents) + " inside";
  579. }
  580. } else {
  581. return (this.count > 1 ? this.count + " train cars" : "a train car");
  582. }
  583. }
  584. }
  585. function House(count = 1) {
  586. this.name = "House";
  587. copy_defaults(this,new DefaultEntity());
  588. this.count = count;
  589. this.contents = {};
  590. var amount = distribution(0,8,count);
  591. this.contents.person = new Person(amount);
  592. amount = distribution(0,2,count);
  593. this.contents.emptycar = new EmptyCar(amount);
  594. this.describeOne = function(verbose=true) {
  595. size = random_desc(["little","two-story","large"], (verbose ? 0.5 : 0));
  596. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  597. name = random_desc(["house","house","house","house","house","trailer"], 1);
  598. return "a " + merge_desc([size,color,name]);
  599. }
  600. this.describe = function(verbose = true) {
  601. if (verbose) {
  602. if (this.count <= 3) {
  603. list = [];
  604. for (var i = 0; i < this.count; i++) {
  605. list.push(this.describeOne(this.count < 2));
  606. }
  607. return merge_things(list) + " with " + this.contents.person.describe(verbose) + " inside";
  608. } else {
  609. return this.count + " homes with " + this.contents.person.describe(verbose) + " inside";
  610. }
  611. } else {
  612. return (this.count > 1 ? this.count + " houses" : "a house");
  613. }
  614. }
  615. }
  616. function Barn(count = 1) {
  617. this.name = "Barn";
  618. copy_defaults(this,new DefaultEntity());
  619. this.count = count;
  620. this.contents = {};
  621. var amount = distribution(0,2,count);
  622. this.contents.person = new Person(amount);
  623. amount = distribution(30,70,count);
  624. this.contents.cow = new Cow(amount);
  625. this.describeOne = function(verbose=true) {
  626. size = random_desc(["little","big","large"], (verbose ? 0.5 : 0));
  627. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  628. name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  629. return "a " + merge_desc([size,color,name]);
  630. }
  631. this.describe = function(verbose = true) {
  632. if (verbose) {
  633. if (this.count <= 3) {
  634. list = [];
  635. for (var i = 0; i < this.count; i++) {
  636. list.push(this.describeOne(this.count < 2));
  637. }
  638. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  639. } else {
  640. return this.count + " barns with " + describe_all(this.contents,verbose) + " inside";
  641. }
  642. } else {
  643. return (this.count > 1 ? this.count + " barns" : "a barn");
  644. }
  645. }
  646. }
  647. function SmallSkyscraper(count = 1) {
  648. this.name = "Small Skyscraper";
  649. copy_defaults(this,new DefaultEntity());
  650. this.count = count;
  651. this.contents = {};
  652. var amount = distribution(50,500,count);
  653. this.contents.person = new Person(amount);
  654. amount = distribution(10,50,count);
  655. this.contents.emptycar = new EmptyCar(amount);
  656. this.describeOne = function(verbose=true) {
  657. color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  658. name = random_desc(["skyscraper","office tower","office building"], 1);
  659. return "a " + merge_desc([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 + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  671. }
  672. } else {
  673. return (this.count > 1 ? this.count + " skyscrapers" : "a skyscraper");
  674. }
  675. }
  676. this.anal_vore = function(verbose=true,height=10) {
  677. var line = skyscraperAnalVore(this,verbose,height);
  678. if (line == "")
  679. return defaultAnalVore(this)(verbose);
  680. else
  681. return line;
  682. };
  683. }
  684. function ParkingGarage(count = 1) {
  685. this.name = "Parking Garage";
  686. copy_defaults(this,new DefaultEntity());
  687. this.count = count;
  688. this.contents = {};
  689. var amount = distribution(10,200,count);
  690. this.contents.person = new Person(amount);
  691. amount = distribution(30,100,count);
  692. this.contents.emptycar = new EmptyCar(amount);
  693. amount = distribution(5,20,count);
  694. this.contents.car = new Car(amount);
  695. this.describeOne = function(verbose=true) {
  696. return "a parking garage";
  697. }
  698. this.describe = function(verbose = true) {
  699. if (verbose) {
  700. return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose) + " inside";
  701. } else {
  702. return (this.count == 1 ? "a parking garage" : this.count + " parking garages");
  703. }
  704. }
  705. }
  706. function Overpass(count = 1) {
  707. this.name = "Overpass";
  708. copy_defaults(this,new DefaultEntity());
  709. this.count = count;
  710. this.contents = {};
  711. var amount = distribution(0,20,count);
  712. this.contents.person = new Person(amount);
  713. amount = distribution(25,100,count);
  714. this.contents.car = new Car(amount);
  715. }