big steppy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

1608 рядки
42 KiB

  1. 'use strict';
  2. var things =
  3. {
  4. "Container": {
  5. "Container": Container,
  6. mass: 0,
  7. area: 0,
  8. clusters: 0,
  9. cluster_chances: 0,
  10. contents: [],
  11. },
  12. //Creatures
  13. "Person": {
  14. "Person": Person,
  15. mass: 80,
  16. area: .33,
  17. clusters: 5,
  18. cluster_chances: .8,
  19. contents: [],
  20. descriptor: ["a person", "people"]
  21. },
  22. "Human": {
  23. "Human": Human,
  24. mass: 80,
  25. area: .33,
  26. clusters: 5,
  27. cluster_chances: .8,
  28. contents: [],
  29. descriptor: ["a person", "people"]
  30. },
  31. "Cow": {
  32. "Cow": Cow,
  33. mass: 300,
  34. area: 2,
  35. clusters: 15,
  36. cluster_chances: .5,
  37. contents: [],
  38. descriptor: ["a cow", "cattle"]
  39. },
  40. "Micro": {
  41. "Micro": Micro,
  42. mass: .01,
  43. area: .05,
  44. clusters: 50,
  45. cluster_chances: 1,
  46. contents: [],
  47. descriptor: ["a micro", "micros"]
  48. },
  49. "Macro": {
  50. "Macro": Macro,
  51. mass: 8e4,
  52. area: 100,
  53. clusters: 0,
  54. cluster_chances: 0,
  55. contents: [],
  56. descriptor: ["a smaller macro", "smaller macros"]
  57. },
  58. //Vehicles
  59. "Empty Car": {
  60. "Empty Car": EmptyCar,
  61. mass: 1000,
  62. area: 4,
  63. clusters: 2,
  64. cluster_chances: .3,
  65. contents: [],
  66. descriptor: ["a parked car", "parked cars"]
  67. },
  68. "Car": {
  69. "Car": Car,
  70. mass: 1000,
  71. area: 4,
  72. clusters: 4,
  73. cluster_chances: .5,
  74. contents: [["Person",1,4]],
  75. descriptor: ["a car", "cars"]
  76. },
  77. "Bus": {
  78. "Bus": Bus,
  79. mass: 5000,
  80. area: 12,
  81. clusters: 1,
  82. cluster_chances: .25,
  83. contents: [["Person",2,30]],
  84. descriptor: ["a bus", "busses"]
  85. },
  86. "Tram": {
  87. "Tram": Tram,
  88. mass: 1e4,
  89. area: 20,
  90. clusters: 1,
  91. cluster_chances: .2,
  92. contents: [["Person",10,50]],
  93. descriptor: ["a tram", "trams"]
  94. },
  95. "Train": {
  96. "Train": Train,
  97. mass: 5e4,
  98. area: 40,
  99. clusters: 2,
  100. cluster_chances: .1,
  101. contents: [["Person",1,4,"engine"],["Train Car",2,10]],
  102. },
  103. "Train Car": {
  104. "Train Car": TrainCar,
  105. mass: 7500,
  106. area: 20,
  107. clusters: 1,
  108. cluster_chances: .05,
  109. contents: [["Person",10,40]],
  110. descriptor: ["a train car", "train cars"]
  111. },
  112. "Business Jet": {
  113. "Business Jet": BusinessJet,
  114. mass: 6500,
  115. area: 50,
  116. clusters: 1,
  117. cluster_chances: .05,
  118. contents: [["Person",2,9]],
  119. descriptor: ["a business jet", "business jets"]
  120. },
  121. "Airliner": {
  122. "Airliner": Airliner,
  123. mass: 6500,
  124. area: 50,
  125. clusters: 1,
  126. cluster_chances: .05,
  127. contents: [["Person",5,300]],
  128. descriptor: ["an airliner", "airliners"]
  129. },
  130. //Buildings
  131. "House": {
  132. "House": House,
  133. mass: 1e4,
  134. area: 150,
  135. clusters: 5,
  136. cluster_chances: .5,
  137. contents: [["Person",0,8],["Empty Car",0,2]],
  138. descriptor: ["house", "houses"]
  139. },
  140. "Business": {
  141. "Business": Business,
  142. mass: 5e4,
  143. area: 400,
  144. clusters: 5,
  145. cluster_chances: .25,
  146. contents: [["Person",0,30],["Car",0,5],["Empty Car",0,20]],
  147. descriptor: ["a local business", "buildings"]
  148. },
  149. "Barn": {
  150. "Barn": Barn,
  151. mass: 5e3,
  152. area: 300,
  153. clusters: 1,
  154. cluster_chances: .1,
  155. contents: [["Person",0,2],["Cow",30,70]],
  156. descriptor: ["a barn", "barns"]
  157. },
  158. "Small Skyscraper": {
  159. "Small Skyscraper": SmallSkyscraper,
  160. mass: 1e7,
  161. area: 1000,
  162. clusters: 2,
  163. cluster_chances: .25,
  164. contents: [["Person",150,750],["Empty Car",10,50]],
  165. descriptor: ["a small skyscraper", "small skyscrapers"]
  166. },
  167. "Large Skyscraper": {
  168. "Large Skyscraper": LargeSkyscraper,
  169. mass: 8e7,
  170. area: 2000,
  171. clusters: 1,
  172. cluster_chances: .25,
  173. contents: [["Person",500,1500],["Empty Car",20,100]],
  174. descriptor: ["a large skyscraper", "large skyscrapers"]
  175. },
  176. "Parking Garage": {
  177. "Parking Garage": ParkingGarage,
  178. mass: 1e7,
  179. area: 750,
  180. clusters: 1,
  181. cluster_chances: .1,
  182. contents: [["Person",10,200],["Empty Car",100,300],["Car",5,30]],
  183. descriptor: ["a parking garage", "parking garages"]
  184. },
  185. //Places
  186. "Town": {
  187. "Town": Town,
  188. mass: 1,
  189. area: 1e7,
  190. clusters: 5,
  191. cluster_chances: .1,
  192. contents: [["Person",10000,100000],["House",5000,50000],["Empty Car",200,800],["Car",500,80000],["Bus",5,25],["Train",5,25],["Business",500,5000]],
  193. descriptor: ["a town", "towns"]
  194. },
  195. "City": {
  196. "City": City,
  197. mass: 1,
  198. area: 1e9,
  199. clusters: 0,
  200. cluster_chances: .2,
  201. contents: [["Person",100000,1500000],["House",20000,200000],["Empty Car",10000,100000],["Car",7500,125000],["Bus",200,400],["Train",10,50],["Tram",25,100],["Small Skyscraper",50,300],["Large Skyscraper",10,75],["Parking Garage",5,10],["Business",2000,10000]],
  202. descriptor: ["a city", "cities"]
  203. },
  204. "Continent": {
  205. "Continent": Continent,
  206. mass: 1e21,
  207. area: 1.5e13,
  208. clusters: 5,
  209. cluster_chances: .5,
  210. contents: [["Person",1000000,15000000],["House",2500,10000],["Car",25000,375000],["Train",50,500],["Town",500,1000],["City",50,250],["Business",250,1000]],
  211. descriptor: ["a continent", "continents"]
  212. },
  213. "Planet": {
  214. "Planet": Planet,
  215. mass: 5.972e24,
  216. area: 2.5e14,
  217. clusters: 0,
  218. cluster_chances: 1,
  219. contents: [["Continent",4,9]],
  220. descriptor: ["a planet", "planets"]
  221. },
  222. "Star": {
  223. "Star": Star,
  224. mass: 1e40,
  225. area: 3e18,
  226. clusters: 1,
  227. cluster_chances: 1,
  228. contents: [],
  229. },
  230. "Solar System": {
  231. "Solar System": SolarSystem,
  232. mass: 1,
  233. area: 3e21,
  234. clusters: 1,
  235. cluster_chances: 1,
  236. contents: [["Star",1,1],["Planet",5,15]],
  237. descriptor: ["a solar system", "solar systems"]
  238. },
  239. "Galaxy": {
  240. "Galaxy": Galaxy,
  241. mass: 1,
  242. area: 2e45,
  243. clusters: 1,
  244. cluster_chances: 1,
  245. contents: [["Star",1e9,500e9],["Solar System",1e8,500e8]],
  246. descriptor: ["a galaxy", "galaxies"]
  247. },
  248. "Cluster": {
  249. "Cluster": Cluster,
  250. mass: 1,
  251. area: 2e49,
  252. clusters: 1,
  253. cluster_chances: 1,
  254. contents: [["Galaxy",200,5000]],
  255. descriptor: ["a cluster", "clusters"]
  256. },
  257. "Universe": {
  258. "Universe": Universe,
  259. mass: 1,
  260. area: 7e53,
  261. clusters: 1,
  262. cluster_chances: 1,
  263. contents: [["Cluster",1.5e9,2.5e9]],
  264. descriptor: ["a universe", "universes"]
  265. },
  266. "Multiverse": {
  267. "Multiverse": Multiverse,
  268. mass: 1,
  269. area: 5e56,
  270. clusters: 1,
  271. cluster_chances: 1,
  272. contents: [["Universe",100,1000]],
  273. descriptor: ["a multiverse", "multiverses"]
  274. },
  275. //Military
  276. "Soldier": {
  277. "Soldier": Soldier,
  278. mass: 80,
  279. area: 1,
  280. clusters: 2,
  281. cluster_chances: .2,
  282. contents: [],
  283. descriptor: ["a soldier","soldiers"]
  284. },
  285. "Tank": {
  286. "Tank": Tank,
  287. mass: 5000,
  288. area: 20,
  289. clusters: 2,
  290. cluster_chances: .25,
  291. contents: [["Soldier",3,5]],
  292. descriptor: ["a tank", "tanks"]
  293. },
  294. "Artillery": {
  295. "Artillery": Artillery,
  296. mass: 7000,
  297. area: 25,
  298. clusters: 3,
  299. cluster_chances: .5,
  300. contents: [["Soldier",4,6]],
  301. descriptor: ["an artillery tank", "artillery tanks"]
  302. },
  303. "Helicopter": {
  304. "Helicopter": Helicopter,
  305. mass: 1500,
  306. area: 12,
  307. clusters: 0,
  308. cluster_chances: 0,
  309. contents: [["Soldier",4,16]],
  310. descriptor: ["a helicoptor", "helicoptors"]
  311. },
  312. "Squad": {
  313. "Squad": Squad,
  314. mass: 1,
  315. area: 30,
  316. clusters: 20,
  317. cluster_chances: .05,
  318. contents: [["Soldier",6,9]],
  319. descriptor: ["a squad", "squads"]
  320. },
  321. "Platoon": {
  322. "Platoon": Platoon,
  323. mass: 100,
  324. area: 150,
  325. clusters: 2,
  326. cluster_chances: .1,
  327. contents: [["Soldier",16,44]],
  328. descriptor: ["a military platoon", "platoons"]
  329. },
  330. "Company": {
  331. "Company": Company,
  332. mass: 500,
  333. area: 600,
  334. clusters: 2,
  335. cluster_chances: .1,
  336. contents: [["Soldier",60,200]],
  337. descriptor: ["a company of soldiers", "companies"]
  338. },
  339. "Battalion": {
  340. "Battalion": Battalion,
  341. mass: 1000,
  342. area: 3500,
  343. clusters: 2,
  344. cluster_chances: .1,
  345. contents: [["Soldier",300,1000]],
  346. descriptor: ["a battalion", "battalions"]
  347. },
  348. "Brigade": {
  349. "Brigade": Brigade,
  350. mass: 1500,
  351. area: 2e4,
  352. clusters: 2,
  353. cluster_chances: .1,
  354. contents: [["Soldier",1500,3200]],
  355. descriptor: ["a brigade", "brigades"]
  356. },
  357. "Division": {
  358. "Division": Division,
  359. mass: 2000,
  360. area: 8e4,
  361. clusters: 3,
  362. cluster_chances: .1,
  363. contents: [["Soldier",10000,16000]],
  364. descriptor: ["a division", "divisions"]
  365. },
  366. "Tank Division": {
  367. "Tank Division": TankDivision,
  368. mass: 3000,
  369. area: 1e5,
  370. clusters: 1,
  371. cluster_chances: .15,
  372. contents: [["Soldier",8000,1200],["Tank",250,500]],
  373. descriptor: ["a tank division", "tank divisions"]
  374. },
  375. "Army": {
  376. "Army": Army,
  377. mass: 5000,
  378. area: 1e6,
  379. clusters: 2,
  380. cluster_chances: .1,
  381. contents: [["Soldier",40000,75000]],
  382. descriptor: ["an army", "armies"]
  383. },
  384. };
  385. //Alterante Army Structuring, may be used later
  386. //"Squad": [["Soldier",6,9]],
  387. // "Platoon": [["Squad",3,4]],
  388. //"Company": [["Platoon",3,5],["Squad",0,2]],
  389. //"Battalion": [["Company",4,6]],
  390. //"Brigade": [["Battalion",2,5],["Company",0,3]],
  391. //"Division": [["Brigade",2,4]],
  392. //"Tank Division": [["Brigade",2,4],["Tank",250,500]],
  393. //"Army": [["Division",3,8],["Tank Division",1,5]],
  394. // replace all instances of from with to
  395. function contents_substitute(from,to) {
  396. for (let key in contents) {
  397. if (contents.hasOwnProperty(key)) {
  398. let type = contents[key];
  399. for (let i=0; i<type.length; i++) {
  400. if (type[i][0] == from) {
  401. type[i][0] = to;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. // remove all instances of thing
  408. function contents_remove(thing) {
  409. for (let key in contents) {
  410. if (contents.hasOwnProperty(key)) {
  411. let type = contents[key];
  412. for (let i=0; i<type.length; i++) {
  413. if (type[i][0] == thing) {
  414. type.splice(i,1);
  415. --i;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. // adds thing to parent
  422. function contents_insert(parent,thing,min,max,label) {
  423. let owner = things[parent].contents;
  424. if (label == undefined)
  425. owner.push([thing,min,max]);
  426. else
  427. owner.push([thing,min,max,label]);
  428. }
  429. function initContents(name,count) { //builds the contents for each destrucable(thing) when called
  430. let result = {};
  431. let type = things[name].contents;
  432. for (let i=0; i<type.length; i++) {
  433. let amount = distribution(type[i][1],type[i][2],count); //arrays of contents look like ["thing name",min,max,"optional name"] so those values have to pulled out
  434. if (amount > 0) {
  435. // if a custom label is supplied, use it!
  436. if (type[i].length == 4) //if has optional name
  437. result[type[i][3]] = new things[type[i][0]][type[i][0]](amount); //creates a "thing name" under the key of "optional name"
  438. else
  439. result[type[i][0]] = new things[type[i][0]][type[i][0]](amount);
  440. }
  441. }
  442. return result;
  443. }
  444. function get_living_prey(sum) {
  445. let total = 0;
  446. for (let key in sum) {
  447. if (sum.hasOwnProperty(key)) {
  448. if (key == "Micro" || key == "Macro" || key == "Person" || key == "Cow" || key == 'Soldier')
  449. total += sum[key];
  450. }
  451. }
  452. return total;
  453. }
  454. // general logic: each step fills in a fraction of the remaining space
  455. function fill_area(area, weights, variance=0.15)
  456. {
  457. area = area + Math.random() * variance * 2 * area - variance * area;
  458. var result = [];
  459. var candidates = [];
  460. for (var key in weights) {
  461. if (weights.hasOwnProperty(key)) {
  462. candidates.push({"name": key, "area": things[key].area, "weight": weights[key]});
  463. }
  464. }
  465. candidates = candidates.sort(function (x,y) {
  466. return x.area - y.area;
  467. });
  468. while(candidates.length > 0) {
  469. var candidate = candidates.pop();
  470. if (candidate.area > area)
  471. continue;
  472. var max = Math.floor(area / candidate.area);
  473. var limit = Math.min(max, 1000);
  474. var count = 0;
  475. var loopvar = 0;
  476. // for small amounts, actually do the randomness
  477. // the first few ones get a much better shot
  478. // if we have nothing at all, it's even better!
  479. while (loopvar < limit) {
  480. if (loopvar == 0 && result.length == 0) {
  481. ++count;
  482. }
  483. else if (loopvar <= things[candidate.name].clusters) {
  484. if (Math.random() < candidate.weight ? 1 : Math.random() < things[candidate.name].cluster_chances) {
  485. ++count;
  486. }
  487. }
  488. else {
  489. count += Math.random() < candidate.weight ? 1 : 0;
  490. }
  491. ++loopvar;
  492. }
  493. // if we're doing more than the limit, then we just add on the rest, with some variance
  494. if (limit < max) {
  495. const base = (max-limit) * candidate.weight;
  496. count += Math.round(base - base / 10 + base * Math.random() / 5);
  497. }
  498. area -= count * candidate.area;
  499. if (count > 0)
  500. result.push(new things[candidate.name][candidate.name](count));
  501. }
  502. return new Container(result);
  503. }
  504. // maybe make this something that approximates a
  505. // normal distribution; doing this 15,000,000 times is bad...
  506. // solution: only a few are random lul
  507. // improvement: take up to 100 samples, then use that to scale the final result
  508. function distribution(min, max, samples) {
  509. var result = 0;
  510. var limit = Math.min(100,samples);
  511. if (limit < samples) {
  512. let dist = 0;
  513. for (let i = 0; i < limit; i++) {
  514. dist += Math.random();
  515. }
  516. dist /= 100;
  517. return Math.floor(dist * samples * (max - min + 1) + samples * min);
  518. } else {
  519. for (let i = 0; i < limit; i++) {
  520. result += Math.floor(Math.random() * (max - min + 1) + min);
  521. }
  522. }
  523. return result;
  524. }
  525. function defaultMultiply(thing) {
  526. return function(amount) {
  527. thing.count *= amount;
  528. for (var key in thing.contents) {
  529. if (thing.contents.hasOwnProperty(key)) {
  530. thing.contents[key].multiply(amount);
  531. }
  532. }
  533. };
  534. }
  535. function defaultArea(thing) {
  536. return things[thing.name].area;
  537. }
  538. function defaultMass(thing) {
  539. return things[thing.name].mass;
  540. }
  541. function defaultMerge(thing) { //this merges all objects into one containers
  542. return function(container) {
  543. var newCount = this.count + container.count;
  544. var newThing = new things[thing.name][thing.name](newCount);
  545. newThing.contents = {};
  546. for (var key in this.contents) {
  547. if (this.contents.hasOwnProperty(key)) {
  548. newThing.contents[key] = this.contents[key];
  549. }
  550. }
  551. for (key in container.contents) {
  552. if (container.contents.hasOwnProperty(key)) {
  553. if (this.contents.hasOwnProperty(key)) {
  554. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  555. } else {
  556. newThing.contents[key] = container.contents[key];
  557. }
  558. }
  559. }
  560. return newThing;
  561. };
  562. }
  563. function listSum(sum) {
  564. let result = [];
  565. for (let key in sum) {
  566. if (sum.hasOwnProperty(key)) {
  567. result.push(new things[key][key](sum[key]).describe(false));
  568. }
  569. }
  570. return merge_things(result);
  571. }
  572. // turn a nested object into a container with everything on one level
  573. function flatten(thing) {
  574. let dict = defaultSum(thing)();
  575. let list = [];
  576. Object.entries(dict).forEach(function([key, val]) {
  577. let obj = new things[key][key](val);
  578. obj.contents = [];
  579. list.push(obj);
  580. });
  581. list.sort(function(x,y) {
  582. if (y.area != x.area){
  583. return y.area - x.area;
  584. } else {
  585. return x.name.localeCompare(y.name);
  586. }
  587. });
  588. return new Container(list);
  589. }
  590. function defaultSum(thing) {
  591. return function() {
  592. var counts = {};
  593. if (thing.name != "Container")
  594. counts[thing.name] = thing.count;
  595. for (var key in thing.contents) {
  596. if (thing.contents.hasOwnProperty(key)) {
  597. var subcount = thing.contents[key].sum();
  598. for (var subkey in subcount) {
  599. if (!counts.hasOwnProperty(subkey)) {
  600. counts[subkey] = 0;
  601. }
  602. counts[subkey] += subcount[subkey];
  603. }
  604. }
  605. }
  606. return counts;
  607. };
  608. }
  609. function defaultSumProperty(thing) {
  610. return function(prop) {
  611. var total = 0;
  612. total += thing[prop] * thing.count;
  613. for (var key in thing.contents) {
  614. if (thing.contents.hasOwnProperty(key)) {
  615. total += thing.contents[key].sum_property(prop);
  616. }
  617. }
  618. return total;
  619. };
  620. }
  621. function defaultAddContent(thing) {
  622. return function(name, min, max, count) {
  623. if (min == max) {
  624. let object = new things[name](min*count);
  625. thing.contents[object.name] = object;
  626. } else {
  627. let object = new things[name](distribution(min, max, count));
  628. thing.contents[object.name] = object;
  629. }
  630. };
  631. }
  632. function DefaultEntity() {
  633. this.sum = defaultSum;
  634. this.area = defaultArea;
  635. this.mass = defaultMass;
  636. this.sum_property = defaultSumProperty;
  637. this.merge = defaultMerge;
  638. this.multiply = defaultMultiply;
  639. this.describeSimple = defaultDescribeSimple;
  640. return this;
  641. }
  642. // god I love reinventing the wheel
  643. function copy_defaults(self,proto) { //loads the values defined in things into the fuction that calls it
  644. for (var key in proto) { //proto will always be a new DefaultEntity, self is the parent function
  645. if (proto.hasOwnProperty(key)) {
  646. self[key] = proto[key](self);
  647. }
  648. }
  649. }
  650. // combine strings into a list with proper grammar
  651. function merge_things(list,semicolons=false) {
  652. if (list.length == 0) {
  653. return "";
  654. } else if (list.length == 1) {
  655. return list[0];
  656. } else if (list.length == 2) {
  657. return list[0] + " and " + list[1];
  658. } else {
  659. var result = "";
  660. list.slice(0,list.length-1).forEach(function(term) {
  661. result += term + ", ";
  662. });
  663. result += "and " + list[list.length-1];
  664. return result;
  665. }
  666. }
  667. // combine the adjectives for something into a single string
  668. function merge_desc(list) {
  669. var result = "";
  670. list.forEach(function(term) {
  671. if (term != "")
  672. result += term + " ";
  673. });
  674. // knock off the last space
  675. if (result.length > 0) {
  676. result = result.substring(0, result.length - 1);
  677. }
  678. let article = "a "
  679. //a/an overwriting terms
  680. let forcedTerms = ["honor","heir"]; //words that need to start with an but don't start with a,e,i,o,u
  681. let force = false;
  682. for (let i of forcedTerms){
  683. if (i === result.substring(0, i.length)){force = true;}
  684. }
  685. let exceptionTerms = ["uniform","unique"]; //words that need to start with a and start with a,e,i,o,u
  686. let exception = false;
  687. for (let i of exceptionTerms){
  688. if (i === result.substring(0, i.length)){exception = true;}
  689. }
  690. //check if the string should start with an
  691. if ((force == true) || (exception == false && ((result.charAt(0) == "a")||(result.charAt(0) == "e")||(result.charAt(0) == "i")||(result.charAt(0) == "o")||(result.charAt(0) == "u")))){
  692. article = "an ";
  693. }
  694. result = article + result;
  695. return result;
  696. }
  697. // describes everything in the container
  698. function describe_all(contents,verbose=true,except=[]) {
  699. var things = [];
  700. for (var key in contents) {
  701. if (contents.hasOwnProperty(key) && !except.includes(key)) {
  702. things.push(contents[key].describe(verbose));
  703. }
  704. }
  705. return merge_things(things);
  706. }
  707. function random_desc(list, odds=1) { //strings together an array into a series of words
  708. if (Math.random() < odds)
  709. return list[Math.floor(Math.random() * list.length)];
  710. else
  711. return "";
  712. }
  713. function defaultDescribeSimple(thing) {
  714. return function(flat) {
  715. if (flat) {
  716. return flatten(thing).describe(false)
  717. } else {
  718. return thing.describe(false);
  719. }
  720. }
  721. }
  722. function defaultDescribe(verbose=true, parent, descAs){
  723. let descriptorEnd = " inside";
  724. let descriptorConjunction = " with ";
  725. let groupLessThan3 = false;
  726. switch(descAs) {
  727. case "vehicle":
  728. descriptorEnd = pickString(" inside"," inside"," inside", " inside"," riding inside", " trapped inside", " sitting inside");
  729. break;
  730. case "community":
  731. groupLessThan3 = true;
  732. descriptorEnd = " in " + (parent.count == 1 ? "it" : "them");
  733. break;
  734. case "celestial":
  735. groupLessThan3 = true;
  736. descriptorConjunction = pickString(" made up of "," consisting of "," containing ");
  737. descriptorEnd = "";
  738. break;
  739. case "military":
  740. groupLessThan3 = true;
  741. descriptorConjunction = pickString(" of "," of "," made up of "," comprised of "," containing ");
  742. descriptorEnd = "";
  743. break;
  744. } if (verbose) {
  745. if (parent.count <= 3 && groupLessThan3 == false) {
  746. var list = [];
  747. for (var i = 0; i < parent.count; i++) {
  748. list.push(parent.describeOne(parent.count <= 2));
  749. }
  750. if (things[parent.name].contents.length > 0){
  751. return (merge_things(list) + descriptorConjunction + describe_all(parent.contents,false) + descriptorEnd);
  752. } else {
  753. return (merge_things(list));
  754. }
  755. } else {//if there are more than 3 of the object
  756. if (things[parent.name].contents.length > 0){
  757. return (parent.count + " " + things[parent.name].descriptor[1] + descriptorConjunction + describe_all(parent.contents,false) + descriptorEnd);
  758. } else {
  759. return (parent.count + " " + things[parent.name].descriptor[0]);
  760. }
  761. }
  762. } else {//not verbose
  763. return (parent.count > 1 ? (parent.count + " " + things[parent.name].descriptor[1]) : things[parent.name].descriptor[0]);
  764. }
  765. }
  766. function Container(contents = []) {
  767. this.name = "Container";
  768. copy_defaults(this,new DefaultEntity());
  769. if (Number.isInteger(contents))
  770. this.count = contents;
  771. else
  772. this.count = 0;
  773. this.contents = {};
  774. for (var i=0; i < contents.length; i++) {
  775. this.contents[contents[i].name] = contents[i];
  776. }
  777. for (var key in this.contents) {
  778. if (this.contents.hasOwnProperty(key)) {
  779. this.count += this.contents[key].count;
  780. }
  781. }
  782. this.describe = function(verbose = true) {
  783. return describe_all(this.contents,verbose);
  784. };
  785. return this;
  786. }
  787. function Person(count = 1) {
  788. this.name = "Person";
  789. copy_defaults(this,new DefaultEntity());
  790. this.mass = ((Math.random() -.5)*20)+this.mass;
  791. this.count = count;
  792. this.contents = initContents(this.name,this.count);
  793. this.describeOne = function (verbose=true) {
  794. var body = random_desc(["skinny","fat","tall","short","stocky","spindly","muscular","fit","multi-colored"], (verbose ? 0.6 : 0));
  795. var sex = random_desc(["male", "female"], (verbose ? 0.75 : 0));
  796. var species = "";
  797. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal","coyote","rabbit","lizard","avian"]);
  798. return merge_desc([body,sex,species]);
  799. };
  800. this.describe = function(verbose=true) {
  801. return defaultDescribe(verbose, this);
  802. }
  803. return this;
  804. }
  805. function Human(count = 1) {
  806. this.name = "Person";
  807. copy_defaults(this,new DefaultEntity());
  808. this.mass = ((Math.random() -.5)*20)+this.mass;
  809. this.count = count;
  810. this.contents = initContents(this.name,this.count);
  811. this.describeOne = function (verbose=true) {
  812. var body = random_desc(["skinny","fat","tall","short","stocky","spindly","muscular","fit","tanned"], (verbose ? 0.6 : 0));
  813. var sex = random_desc(["man", "woman"], 1);
  814. return merge_desc([body,sex]);
  815. };
  816. this.describe = function(verbose=true) {
  817. return defaultDescribe(verbose, this);
  818. }
  819. return this;
  820. }
  821. function Cow(count = 1) {
  822. this.name = "Cow";
  823. copy_defaults(this,new DefaultEntity());
  824. this.count = count;
  825. this.contents = initContents(this.name,this.count);
  826. this.describeOne = function (verbose=true) {
  827. var body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  828. var sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  829. return merge_desc([body,sex,"cow"]);
  830. };
  831. this.describe = function(verbose=true) {
  832. return defaultDescribe(verbose, this);
  833. }
  834. return this;
  835. }
  836. function EmptyCar(count = 1) {
  837. this.name = "Empty Car";
  838. copy_defaults(this,new DefaultEntity());
  839. this.count = count;
  840. this.contents = initContents(this.name,this.count);
  841. this.describeOne = function(verbose=true) {
  842. var color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  843. var adjective = random_desc(["rusty","brand-new","luxury","beat-up","dented","restored","classic"],0.3);
  844. var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  845. return merge_desc(["parked",adjective,color,type]);
  846. };
  847. this.describe = function(verbose=true) {
  848. return defaultDescribe(verbose, this);
  849. }
  850. }
  851. function Car(count = 1) {
  852. this.name = "Car";
  853. copy_defaults(this,new DefaultEntity());
  854. this.count = count;
  855. this.contents = initContents(this.name,this.count);
  856. this.describeOne = function(verbose=true) {
  857. var color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  858. var adjective = random_desc(["rusty","brand-new","luxury","beat-up","dented","restored","classic"], (verbose ? 0.3 : 0));
  859. var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  860. return merge_desc([adjective,color,type]);
  861. };
  862. this.describe = function(verbose=true) {
  863. return defaultDescribe(verbose, this, "vehicle");
  864. }
  865. }
  866. function Bus(count = 1) {
  867. this.name = "Bus";
  868. copy_defaults(this,new DefaultEntity());
  869. this.count = count;
  870. this.contents = initContents(this.name,this.count);
  871. this.describeOne = function(verbose=true) {
  872. var adjective = random_desc(["rusty","brand-new","aging","modern"], (verbose ? 0.3 : 0));
  873. var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  874. var type = random_desc(["bus","double-decker bus","articulating bus","open-top bus","sleeper bus","intercity bus"]);
  875. return merge_desc([adjective,color,type]);
  876. };
  877. this.describe = function(verbose=true) {
  878. return defaultDescribe(verbose, this, "vehicle");
  879. }
  880. }
  881. function Tram(count = 1) {
  882. this.name = "Tram";
  883. copy_defaults(this,new DefaultEntity());
  884. this.count = count;
  885. this.contents = initContents(this.name,this.count);
  886. this.describeOne = function(verbose=true) {
  887. var adjective = random_desc(["rusty","weathered","well-maintained",], (verbose ? 0.3 : 0));
  888. var color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  889. var type = random_desc(["tram"]);
  890. return merge_desc([adjective,color,type]);
  891. };
  892. this.describe = function(verbose=true) {
  893. return defaultDescribe(verbose, this, "vehicle");
  894. }
  895. this.anal_vore = function() {
  896. return "You slide " + this.describe() + " up your tight ass";
  897. };
  898. }
  899. function BusinessJet(count = 1) {
  900. this.name = "Business Jet";
  901. copy_defaults(this,new DefaultEntity());
  902. this.count = count;
  903. this.contents = initContents(this.name,this.count);
  904. this.describeOne = function(verbose=true) {
  905. var adjective = random_desc(["brand-new","aging","modern"], (verbose ? 0.2 : 0));
  906. var color = random_desc(["blue","white","white","blue and white","red and white","black","gold"], (verbose ? 0.9 : 0));
  907. var type = random_desc(["luxury jet","business jet","single-engine plane","light aircraft"]);
  908. return merge_desc([adjective,color,type]);
  909. };
  910. this.describe = function(verbose=true) {
  911. return defaultDescribe(verbose, this, "vehicle");
  912. }
  913. }
  914. function Airliner(count = 1) {
  915. this.name = "Airliner";
  916. copy_defaults(this,new DefaultEntity());
  917. this.count = count;
  918. this.contents = initContents(this.name,this.count);
  919. this.describeOne = function(verbose=true) {
  920. var adjective = random_desc(["brand-new","aging","modern"], (verbose ? 0.2 : 0));
  921. var color = random_desc(["blue","white","white","blue and white"], (verbose ? 0.9 : 0));
  922. var type = random_desc(["airliner","twin-engine jet","trijet","four engine jet","double-decker airliner","widebody airliner","passenger jet","airliner"]);
  923. return merge_desc([adjective,color,type]);
  924. };
  925. this.describe = function(verbose=true) {
  926. return defaultDescribe(verbose, this, "vehicle");
  927. }
  928. }
  929. function Train(count = 1) {
  930. this.name = "Train";
  931. copy_defaults(this,new DefaultEntity());
  932. this.count = count;
  933. this.contents = initContents(this.name,this.count);
  934. this.describeOne = function(verbose=true) {
  935. var adjective = random_desc(["rusty","brand-new","steam","freshly-painted"], (verbose ? 0.3 : 0));
  936. var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  937. var type = random_desc(["train","passenger train","freight train"]);
  938. return merge_desc([adjective,color,type]);
  939. };
  940. this.describe = function(verbose = true) {
  941. if (verbose) {
  942. if (this.count == 1) {
  943. var list = [];
  944. for (var i = 0; i < this.count; i++) {
  945. list.push(this.describeOne(verbose));
  946. }
  947. return merge_things(list) + " with " + this.contents["engine"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  948. } else {
  949. return this.count + " trains with " + this.contents["engine"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  950. }
  951. } else {
  952. return (this.count > 1 ? this.count + " trains" : "a train");
  953. }
  954. };
  955. this.anal_vore = function() {
  956. var cars = (this.contents["Train Car"].count == 1 ? this.contents["Train Car"].describe() + " follows it inside" : this.contents["Train Car"].describe() + " are pulled slowly inside");
  957. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  958. };
  959. }
  960. function TrainCar(count = 1) {
  961. this.name = "Train Car";
  962. copy_defaults(this,new DefaultEntity());
  963. this.count = count;
  964. this.contents = initContents(this.name,this.count);
  965. this.describeOne = function(verbose=true) {
  966. var adjective = random_desc(["rusty","brand-new","vintage","graffitied","well-maintained"], (verbose ? 0.3 : 0));
  967. var color = random_desc(["black","tan","gray","yellow","steel","wooden"], (verbose ? 1 : 0));
  968. var type = random_desc(["train car","passenger train car","freight train car"]);
  969. return merge_desc([adjective,color,type]);
  970. };
  971. this.describe = function(verbose=true) {
  972. return defaultDescribe(verbose, this, "vehicle");
  973. }
  974. }
  975. function House(count = 1) {
  976. this.name = "House";
  977. copy_defaults(this,new DefaultEntity());
  978. this.count = count;
  979. this.contents = initContents(this.name,this.count);
  980. this.describeOne = function(verbose=true) {
  981. var size = random_desc(["little","two-story","large","well-built","run-down","cheap",], (verbose ? 0.5 : 0));
  982. var color = random_desc(["blue","white","gray","tan","green","wooden","brick"], (verbose ? 0.5 : 0));
  983. var name = random_desc(["house","home","duplex","house","house","trailer"], 1);
  984. return merge_desc([size,color,name]);
  985. };
  986. this.describe = function(verbose=true) {
  987. return defaultDescribe(verbose, this);
  988. }
  989. }
  990. //might split this into a general business and resutrant categories
  991. function Business(count = 1) {
  992. this.name = "Business";
  993. copy_defaults(this,new DefaultEntity());
  994. this.count = count;
  995. this.contents = initContents(this.name,this.count);
  996. this.describeOne = function(verbose=true) {
  997. var size = random_desc(["little","two-story","large","well-built","run-down","cheap","aging","corner"], (verbose ? 0.5 : 0));
  998. var color = random_desc(["blue","white","gray","tan","green","brick","concrete"], (verbose ? 0.5 : 0));
  999. var name = random_desc(["mall","resturant","bank","clinic","shop","post office","tire shop","chain resturant","grocery store","barber shop","pizza resturant","hardware store","movie theather","gas station"], 1);
  1000. return merge_desc([size,color,name]);
  1001. };
  1002. this.describe = function(verbose=true) {
  1003. return defaultDescribe(verbose, this);
  1004. }
  1005. }
  1006. function Barn(count = 1) {
  1007. this.name = "Barn";
  1008. copy_defaults(this,new DefaultEntity());
  1009. this.count = count;
  1010. this.contents = initContents(this.name,this.count);
  1011. this.describeOne = function(verbose=true) {
  1012. var size = random_desc(["little","big","large","weathered","rotted","new"], (verbose ? 0.5 : 0));
  1013. var color = random_desc(["blue","white","gray","tan","green","red"], (verbose ? 0.5 : 0));
  1014. var name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  1015. return merge_desc([size,color,name]);
  1016. };
  1017. this.describe = function(verbose=true) {
  1018. return defaultDescribe(verbose, this);
  1019. }
  1020. }
  1021. function SmallSkyscraper(count = 1) {
  1022. this.name = "Small Skyscraper";
  1023. copy_defaults(this,new DefaultEntity());
  1024. this.count = count;
  1025. this.contents = initContents(this.name,this.count);
  1026. this.describeOne = function(verbose=true) {
  1027. var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  1028. var name = random_desc(["skyscraper","office tower","office building","high rise"], 1);
  1029. return merge_desc([color,name]);
  1030. };
  1031. this.describe = function(verbose=true) {
  1032. return defaultDescribe(verbose, this);
  1033. }
  1034. }
  1035. function LargeSkyscraper(count = 1) {
  1036. this.name = "Large Skyscraper";
  1037. copy_defaults(this,new DefaultEntity());
  1038. this.count = count;
  1039. this.contents = initContents(this.name,this.count);
  1040. this.describeOne = function(verbose=true) {
  1041. var color = random_desc(["blue","white","gray","tan","green","glass"], (verbose ? 0.5 : 0));
  1042. var name = random_desc(["skyscraper","office tower","office building"], 1);
  1043. return merge_desc(["towering",color,name]);
  1044. };
  1045. this.describe = function(verbose=true) {
  1046. return defaultDescribe(verbose, this);
  1047. }
  1048. }
  1049. function ParkingGarage(count = 1) {
  1050. this.name = "Parking Garage";
  1051. copy_defaults(this,new DefaultEntity());
  1052. this.count = count;
  1053. this.contents = initContents(this.name,this.count);
  1054. this.describeOne = function(verbose=true) {
  1055. return things[this.name].descriptor[0];
  1056. };
  1057. this.describe = function(verbose=true) {
  1058. return defaultDescribe(verbose, this);
  1059. }
  1060. }
  1061. function Town(count = 1) {
  1062. this.name = "Town";
  1063. copy_defaults(this,new DefaultEntity());
  1064. this.count = count;
  1065. this.contents = initContents(this.name,this.count);
  1066. this.describeOne = function(verbose=true) {
  1067. return things[this.name].descriptor[0];
  1068. };
  1069. this.describe = function(verbose=true) {
  1070. return defaultDescribe(verbose, this, "community");
  1071. }
  1072. }
  1073. function City(count = 1) {
  1074. this.name = "City";
  1075. copy_defaults(this,new DefaultEntity());
  1076. this.count = count;
  1077. this.contents = initContents(this.name,this.count);
  1078. this.describeOne = function(verbose=true) {
  1079. return things[this.name].descriptor[0];
  1080. };
  1081. this.describe = function(verbose=true) {
  1082. return defaultDescribe(verbose, this, "community");
  1083. }
  1084. }
  1085. function Continent(count = 1) {
  1086. this.name = "Continent";
  1087. copy_defaults(this,new DefaultEntity());
  1088. this.count = count;
  1089. this.contents = initContents(this.name,this.count);
  1090. this.describeOne = function(verbose=true) {
  1091. return things[this.name].descriptor[0];
  1092. };
  1093. this.describe = function(verbose=true) {
  1094. return defaultDescribe(verbose, this, "community");
  1095. }
  1096. }
  1097. function Planet(count = 1) {
  1098. this.name = "Planet";
  1099. copy_defaults(this,new DefaultEntity());
  1100. this.count = count;
  1101. this.contents = initContents(this.name,this.count);
  1102. this.describeOne = function(verbose=true) {
  1103. return things[this.name].descriptor[0];
  1104. };
  1105. this.describe = function(verbose=true) {
  1106. return defaultDescribe(verbose, this, "community");
  1107. }
  1108. }
  1109. function Star(count = 1) {
  1110. this.name = "Star";
  1111. copy_defaults(this,new DefaultEntity());
  1112. this.count = count;
  1113. this.contents = initContents(this.name,this.count);
  1114. this.describe = function(verbose = true) {
  1115. return (this.count == 1 ? "a star" : this.count + " stars");
  1116. };
  1117. }
  1118. function SolarSystem(count = 1) {
  1119. this.name = "Solar System";
  1120. copy_defaults(this,new DefaultEntity());
  1121. this.count = count;
  1122. this.contents = initContents(this.name,this.count);
  1123. this.describeOne = function(verbose=true) {
  1124. return things[this.name].descriptor[0];
  1125. };
  1126. this.describe = function(verbose=true) {
  1127. return defaultDescribe(verbose, this, "celestial");
  1128. }
  1129. }
  1130. function Galaxy(count = 1) {
  1131. this.name = "Galaxy";
  1132. copy_defaults(this,new DefaultEntity());
  1133. this.count = count;
  1134. this.contents = initContents(this.name,this.count);
  1135. this.describeOne = function(verbose=true) {
  1136. return things[this.name].descriptor[0];
  1137. };
  1138. this.describe = function(verbose=true) {
  1139. return defaultDescribe(verbose, this, "celestial");
  1140. }
  1141. }
  1142. function Cluster(count = 1) {
  1143. this.name = "Cluster";
  1144. copy_defaults(this,new DefaultEntity());
  1145. this.count = count;
  1146. this.contents = initContents(this.name,this.count);
  1147. this.describeOne = function(verbose=true) {
  1148. return things[this.name].descriptor[0];
  1149. };
  1150. this.describe = function(verbose=true) {
  1151. return defaultDescribe(verbose, this, "celestial");
  1152. }
  1153. }
  1154. function Universe(count = 1) {
  1155. this.name = "Universe";
  1156. copy_defaults(this,new DefaultEntity());
  1157. this.count = count;
  1158. this.contents = initContents(this.name,this.count);
  1159. this.describeOne = function(verbose=true) {
  1160. return things[this.name].descriptor[0];
  1161. };
  1162. this.describe = function(verbose=true) {
  1163. return defaultDescribe(verbose, this, "celestial");
  1164. }
  1165. }
  1166. function Multiverse(count = 1) {
  1167. this.name = "Multiverse";
  1168. copy_defaults(this,new DefaultEntity());
  1169. this.count = count;
  1170. this.contents = initContents(this.name,this.count);
  1171. this.describeOne = function(verbose=true) {
  1172. return things[this.name].descriptor[0];
  1173. };
  1174. this.describe = function(verbose=true) {
  1175. return defaultDescribe(verbose, this, "celestial");
  1176. }
  1177. }
  1178. function Soldier(count = 1) {
  1179. this.name = "Soldier";
  1180. copy_defaults(this,new DefaultEntity());
  1181. this.count = count;
  1182. this.contents = initContents(this.name,this.count);
  1183. this.describeOne = function(verbose=true) {
  1184. return things[this.name].descriptor[0];
  1185. };
  1186. this.describe = function(verbose=true) {
  1187. return defaultDescribe(verbose, this);
  1188. }
  1189. }
  1190. function Tank(count = 1) {
  1191. this.name = "Tank";
  1192. copy_defaults(this,new DefaultEntity());
  1193. this.count = count;
  1194. this.contents = initContents(this.name,this.count);
  1195. this.describeOne = function(verbose=true) {
  1196. return things[this.name].descriptor[0];
  1197. };
  1198. this.describe = function(verbose=true) {
  1199. return defaultDescribe(verbose, this, "vehicle");
  1200. }
  1201. }
  1202. function Artillery(count = 1) {
  1203. this.name = "Artillery";
  1204. copy_defaults(this,new DefaultEntity());
  1205. this.count = count;
  1206. this.contents = initContents(this.name,this.count);
  1207. this.describeOne = function(verbose=true) {
  1208. return things[this.name].descriptor[0];
  1209. };
  1210. this.describe = function(verbose=true) {
  1211. return defaultDescribe(verbose, this, "vehicle");
  1212. }
  1213. }
  1214. function Helicopter(count = 1) {
  1215. this.name = "Helicopter";
  1216. copy_defaults(this,new DefaultEntity());
  1217. this.count = count;
  1218. this.contents = initContents(this.name,this.count);
  1219. this.describeOne = function(verbose=true) {
  1220. return things[this.name].descriptor[0];
  1221. };
  1222. this.describe = function(verbose=true) {
  1223. return defaultDescribe(verbose, this, "vehicle");
  1224. }
  1225. }
  1226. function Micro(count = 1) {
  1227. this.name = "Micro";
  1228. copy_defaults(this,new DefaultEntity());
  1229. this.count = count;
  1230. this.contents = initContents(this.name,this.count);
  1231. this.describeOne = function(verbose=true) {
  1232. return things[this.name].descriptor[0];
  1233. };
  1234. this.describe = function(verbose=true) {
  1235. return defaultDescribe(verbose, this);
  1236. }
  1237. }
  1238. function Macro(count = 1) {
  1239. this.name = "Macro";
  1240. copy_defaults(this,new DefaultEntity());
  1241. this.count = count;
  1242. this.contents = initContents(this.name,this.count);
  1243. this.describeOne = function(verbose=true) {
  1244. return things[this.name].descriptor[0];
  1245. };
  1246. this.describe = function(verbose=true) {
  1247. return defaultDescribe(verbose, this);
  1248. }
  1249. }
  1250. function Squad(count = 1) {
  1251. this.name = "Squad";
  1252. copy_defaults(this,new DefaultEntity());
  1253. this.count = count;
  1254. this.contents = initContents(this.name,this.count);
  1255. this.describeOne = function(verbose=true) {
  1256. return things[this.name].descriptor[0];
  1257. };
  1258. this.describe = function(verbose=true) {
  1259. return defaultDescribe(verbose, this, "military");
  1260. }
  1261. }
  1262. function Platoon(count = 1) {
  1263. this.name = "Platoon";
  1264. copy_defaults(this,new DefaultEntity());
  1265. this.count = count;
  1266. this.contents = initContents(this.name,this.count);
  1267. this.describeOne = function(verbose=true) {
  1268. return things[this.name].descriptor[0];
  1269. };
  1270. this.describe = function(verbose=true) {
  1271. return defaultDescribe(verbose, this, "military");
  1272. }
  1273. }
  1274. function Company(count = 1) {
  1275. this.name = "Company";
  1276. copy_defaults(this,new DefaultEntity());
  1277. this.count = count;
  1278. this.contents = initContents(this.name,this.count);
  1279. this.describeOne = function(verbose=true) {
  1280. return things[this.name].descriptor[0];
  1281. };
  1282. this.describe = function(verbose=true) {
  1283. return defaultDescribe(verbose, this, "military");
  1284. }
  1285. }
  1286. function Battalion(count = 1) {
  1287. this.name = "Battalion";
  1288. copy_defaults(this,new DefaultEntity());
  1289. this.count = count;
  1290. this.contents = initContents(this.name,this.count);
  1291. this.describeOne = function(verbose=true) {
  1292. return things[this.name].descriptor[0];
  1293. };
  1294. this.describe = function(verbose=true) {
  1295. return defaultDescribe(verbose, this, "military");
  1296. }
  1297. }
  1298. function Brigade(count = 1) {
  1299. this.name = "Brigade";
  1300. copy_defaults(this,new DefaultEntity());
  1301. this.count = count;
  1302. this.contents = initContents(this.name,this.count);
  1303. this.describeOne = function(verbose=true) {
  1304. return things[this.name].descriptor[0];
  1305. };
  1306. this.describe = function(verbose=true) {
  1307. return defaultDescribe(verbose, this, "military");
  1308. }
  1309. }
  1310. function Division(count = 1) {
  1311. this.name = "Division";
  1312. copy_defaults(this,new DefaultEntity());
  1313. this.count = count;
  1314. this.contents = initContents(this.name,this.count);
  1315. this.describeOne = function(verbose=true) {
  1316. return things[this.name].descriptor[0];
  1317. };
  1318. this.describe = function(verbose=true) {
  1319. return defaultDescribe(verbose, this, "military");
  1320. }
  1321. }
  1322. function TankDivision(count = 1) {
  1323. this.name = "Tank Division";
  1324. copy_defaults(this,new DefaultEntity());
  1325. this.count = count;
  1326. this.contents = initContents(this.name,this.count);
  1327. this.describeOne = function(verbose=true) {
  1328. return things[this.name].descriptor[0];
  1329. };
  1330. this.describe = function(verbose=true) {
  1331. return defaultDescribe(verbose, this, "military");
  1332. }
  1333. }
  1334. function Army(count = 1) {
  1335. this.name = "Army";
  1336. copy_defaults(this,new DefaultEntity());
  1337. this.count = count;
  1338. this.contents = initContents(this.name,this.count);
  1339. this.describeOne = function(verbose=true) {
  1340. return things[this.name].descriptor[0];
  1341. };
  1342. this.describe = function(verbose=true) {
  1343. return defaultDescribe(verbose, this, "military");
  1344. }
  1345. }
  1346. //todo
  1347. //airports
  1348. //farms
  1349. //racetracks
  1350. //more building types
  1351. //cranes and other construction equipment
  1352. //nebula
  1353. //chemical factory
  1354. //grand army
  1355. //armada