big steppy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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