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

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