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

1543 lines
42 KiB

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