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

1567 строки
42 KiB

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