big steppy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

1570 行
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, 100);
  374. var count = 0;
  375. var loopvar = limit;
  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. if (limit > 0 && result.length == 0) {
  380. ++count;
  381. ++loopvar;
  382. }
  383. while (loopvar < limit) {
  384. if (loopvar <= clusters[candidate.name] && loopvar == 0 && Math.random() < cluster_chances[candidate.name]) {
  385. ++count;
  386. }
  387. else if (loopvar <= clusters[candidate.name]) {
  388. if (Math.random() < candidate.weight ? 1 : 0 || Math.random() < 0.75 * cluster_chances[candidate.name]) {
  389. ++count;
  390. }
  391. }
  392. else {
  393. count += Math.random() < candidate.weight ? 1 : 0;
  394. }
  395. ++loopvar;
  396. }
  397. if (limit < max) {
  398. count += Math.round((max-limit) * candidate.weight);
  399. }
  400. area -= count * candidate.area;
  401. if (count > 0)
  402. result.push(new things[candidate.name](count));
  403. }
  404. return new Container(result);
  405. }
  406. // describes everything in the container
  407. function describe_all(contents,verbose=true,except=[]) {
  408. var things = [];
  409. for (var key in contents) {
  410. if (contents.hasOwnProperty(key) && !except.includes(key)) {
  411. things.push(contents[key].describe(verbose));
  412. }
  413. }
  414. return merge_things(things);
  415. }
  416. function random_desc(list, odds=1) {
  417. if (Math.random() < odds)
  418. return list[Math.floor(Math.random() * list.length)];
  419. else
  420. return "";
  421. }
  422. // combine strings into a list with proper grammar
  423. function merge_things(list,semicolons=false) {
  424. if (list.length == 0) {
  425. return "";
  426. } else if (list.length == 1) {
  427. return list[0];
  428. } else if (list.length == 2) {
  429. return list[0] + " and " + list[1];
  430. } else {
  431. var result = "";
  432. list.slice(0,list.length-1).forEach(function(term) {
  433. result += term + ", ";
  434. });
  435. result += "and " + list[list.length-1];
  436. return result;
  437. }
  438. }
  439. // combine the adjectives for something into a single string
  440. function merge_desc(list) {
  441. var result = "";
  442. list.forEach(function(term) {
  443. if (term != "")
  444. result += term + " ";
  445. });
  446. // knock off the last space
  447. if (result.length > 0) {
  448. result = result.substring(0, result.length - 1);
  449. }
  450. return result;
  451. }
  452. // maybe make this something that approximates a
  453. // normal distribution; doing this 15,000,000 times is bad...
  454. // solution: only a few are random lul
  455. // improvement: take up to 100 samples, then use that to scale the final result
  456. function distribution(min, max, samples) {
  457. var result = 0;
  458. var limit = Math.min(100,samples);
  459. if (limit < samples) {
  460. let dist = 0;
  461. for (let i = 0; i < limit; i++) {
  462. dist += Math.random();
  463. }
  464. dist /= 100;
  465. return Math.floor(dist * samples * (max - min + 1) + samples * min);
  466. } else {
  467. for (let i = 0; i < limit; i++) {
  468. result += Math.floor(Math.random() * (max - min + 1) + min);
  469. }
  470. }
  471. return result;
  472. }
  473. function defaultMultiply(thing) {
  474. return function(amount) {
  475. thing.count *= amount;
  476. for (var key in thing.contents) {
  477. if (thing.contents.hasOwnProperty(key)) {
  478. thing.contents[key].multiply(amount);
  479. }
  480. }
  481. };
  482. }
  483. function defaultArea(thing) {
  484. return areas[thing.name];
  485. }
  486. function defaultMass(thing) {
  487. return masses[thing.name];
  488. }
  489. function defaultMerge(thing) {
  490. return function(container) {
  491. var newCount = this.count + container.count;
  492. var newThing = new things[thing.name](newCount);
  493. newThing.contents = {};
  494. for (var key in this.contents) {
  495. if (this.contents.hasOwnProperty(key)) {
  496. newThing.contents[key] = this.contents[key];
  497. }
  498. }
  499. for (key in container.contents) {
  500. if (container.contents.hasOwnProperty(key)) {
  501. if (this.contents.hasOwnProperty(key)) {
  502. newThing.contents[key] = this.contents[key].merge(container.contents[key]);
  503. } else {
  504. newThing.contents[key] = container.contents[key];
  505. }
  506. }
  507. }
  508. return newThing;
  509. };
  510. }
  511. function listSum(sum) {
  512. let result = [];
  513. for (let key in sum) {
  514. if (sum.hasOwnProperty(key)) {
  515. result.push(new things[key](sum[key]).describe(false));
  516. }
  517. }
  518. return merge_things(result);
  519. }
  520. // turn a nested object into a container with everything on one level
  521. function flatten(thing) {
  522. let dict = defaultSum(thing)();
  523. let list = [];
  524. Object.entries(dict).forEach(function([key, val]) {
  525. let obj = new things[key](val);
  526. obj.contents = [];
  527. list.push(obj);
  528. });
  529. list.sort(function(x,y) {
  530. if (y.area != x.area){
  531. return y.area - x.area;
  532. } else {
  533. return x.name.localeCompare(y.name);
  534. }
  535. });
  536. return new Container(list);
  537. }
  538. function defaultSum(thing) {
  539. return function() {
  540. var counts = {};
  541. if (thing.name != "Container")
  542. counts[thing.name] = thing.count;
  543. for (var key in thing.contents) {
  544. if (thing.contents.hasOwnProperty(key)) {
  545. var subcount = thing.contents[key].sum();
  546. for (var subkey in subcount) {
  547. if (!counts.hasOwnProperty(subkey)) {
  548. counts[subkey] = 0;
  549. }
  550. counts[subkey] += subcount[subkey];
  551. }
  552. }
  553. }
  554. return counts;
  555. };
  556. }
  557. function defaultSumProperty(thing) {
  558. return function(prop) {
  559. var total = 0;
  560. total += thing[prop] * thing.count;
  561. for (var key in thing.contents) {
  562. if (thing.contents.hasOwnProperty(key)) {
  563. total += thing.contents[key].sum_property(prop);
  564. }
  565. }
  566. return total;
  567. };
  568. }
  569. function defaultAddContent(thing) {
  570. return function(name, min, max, count) {
  571. if (min == max) {
  572. let object = new things[name](min*count);
  573. thing.contents[object.name] = object;
  574. } else {
  575. let object = new things[name](distribution(min, max, count));
  576. thing.contents[object.name] = object;
  577. }
  578. };
  579. }
  580. function defaultDescribeSimple(thing) {
  581. return function(flat) {
  582. if (flat) {
  583. return flatten(thing).describe(false)
  584. } else {
  585. return thing.describe(false);
  586. }
  587. }
  588. }
  589. function DefaultEntity() {
  590. this.sum = defaultSum;
  591. this.area = defaultArea;
  592. this.mass = defaultMass;
  593. this.sum_property = defaultSumProperty;
  594. this.merge = defaultMerge;
  595. this.multiply = defaultMultiply;
  596. this.describeSimple = defaultDescribeSimple;
  597. return this;
  598. }
  599. // god I love reinventing the wheel
  600. function copy_defaults(self,proto) {
  601. for (var key in proto) {
  602. if (proto.hasOwnProperty(key)) {
  603. self[key] = proto[key](self);
  604. }
  605. }
  606. }
  607. function Container(contents = []) {
  608. this.name = "Container";
  609. copy_defaults(this,new DefaultEntity());
  610. if (Number.isInteger(contents))
  611. this.count = contents;
  612. else
  613. this.count = 0;
  614. this.contents = {};
  615. for (var i=0; i < contents.length; i++) {
  616. this.contents[contents[i].name] = contents[i];
  617. }
  618. for (var key in this.contents) {
  619. if (this.contents.hasOwnProperty(key)) {
  620. this.count += this.contents[key].count;
  621. }
  622. }
  623. this.describe = function(verbose = true) {
  624. return describe_all(this.contents,verbose);
  625. };
  626. return this;
  627. }
  628. function Person(count = 1) {
  629. this.name = "Person";
  630. copy_defaults(this,new DefaultEntity());
  631. this.count = count;
  632. this.contents = initContents(this.name,this.count);
  633. this.describeOne = function (verbose=true) {
  634. var body = random_desc(["skinny","fat","tall","short","stocky","spindly","muscular","fit","multi-colored"], (verbose ? 0.6 : 0));
  635. var sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  636. var species = "";
  637. species = random_desc(["wolf","cat","dog","squirrel","horse","hyena","fox","jackal","crux","sergal"]);
  638. return "a " + merge_desc([body,sex,species]);
  639. };
  640. this.describe = function(verbose=true) {
  641. if (verbose) {
  642. if (count <= 3) {
  643. var list = [];
  644. for (var i = 0; i < count; i++) {
  645. list.push(this.describeOne(this.count <= 2));
  646. }
  647. return merge_things(list);
  648. } else {
  649. return this.count + " people";
  650. }
  651. } else {
  652. return (this.count > 1 ? this.count + " people" : "a person");
  653. }
  654. };
  655. return this;
  656. }
  657. function Human(count = 1) {
  658. this.name = "Person";
  659. copy_defaults(this,new DefaultEntity());
  660. this.count = count;
  661. this.contents = initContents(this.name,this.count);
  662. this.describeOne = function (verbose=true) {
  663. var body = random_desc(["skinny","fat","tall","short","stocky","spindly","muscular","fit","tanned"], (verbose ? 0.6 : 0));
  664. var sex = random_desc(["man", "woman"], 1);
  665. return "a " + merge_desc([body,sex]);
  666. };
  667. this.describe = function(verbose=true) {
  668. if (verbose) {
  669. if (count <= 3) {
  670. var list = [];
  671. for (var i = 0; i < count; i++) {
  672. list.push(this.describeOne(this.count <= 2));
  673. }
  674. return merge_things(list);
  675. } else {
  676. return this.count + " people";
  677. }
  678. } else {
  679. return (this.count > 1 ? this.count + " people" : "a person");
  680. }
  681. };
  682. return this;
  683. }
  684. function Cow(count = 1) {
  685. this.name = "Cow";
  686. copy_defaults(this,new DefaultEntity());
  687. this.count = count;
  688. this.contents = initContents(this.name,this.count);
  689. this.describeOne = function (verbose=true) {
  690. var body = random_desc(["skinny","fat","tall","short","stocky","spindly"], (verbose ? 0.6 : 0));
  691. var sex = random_desc(["male", "female"], (verbose ? 1 : 0));
  692. return "a " + merge_desc([body,sex,"cow"]);
  693. };
  694. this.describe = function(verbose=true) {
  695. if (verbose) {
  696. if (count <= 3) {
  697. var list = [];
  698. for (var i = 0; i < count; i++) {
  699. list.push(this.describeOne(this.count <= 2));
  700. }
  701. return merge_things(list);
  702. } else {
  703. return this.count + " cattle";
  704. }
  705. } else {
  706. return (this.count > 1 ? this.count + " cattle" : "a cow");
  707. }
  708. };
  709. return this;
  710. }
  711. function EmptyCar(count = 1) {
  712. this.name = "Car";
  713. copy_defaults(this,new DefaultEntity());
  714. this.count = count;
  715. this.contents = initContents(this.name,this.count);
  716. this.describeOne = function(verbose=true) {
  717. var color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"]);
  718. var adjective = random_desc(["rusty","brand-new","luxury","beat-up","dented","restored","classic"],0.3);
  719. var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  720. return "a parked " + merge_desc([adjective,color,type]);
  721. };
  722. this.describe = function(verbose = true) {
  723. if (verbose) {
  724. if (this.count <= 3) {
  725. var list = [];
  726. for (var i = 0; i < this.count; i++) {
  727. list.push(this.describeOne());
  728. }
  729. return merge_things(list);
  730. } else {
  731. return this.count + " parked cars";
  732. }
  733. } else {
  734. return (this.count > 1 ? this.count + " parked cars" : "a parked car");
  735. }
  736. };
  737. }
  738. function Car(count = 1) {
  739. this.name = "Car";
  740. copy_defaults(this,new DefaultEntity());
  741. this.count = count;
  742. this.contents = initContents(this.name,this.count);
  743. this.describeOne = function(verbose=true) {
  744. var color = random_desc(["black","black","gray","gray","blue","red","tan","white","white"], (verbose ? 1 : 0));
  745. var adjective = random_desc(["rusty","brand-new","luxury","beat-up","dented","restored","classic"], (verbose ? 0.3 : 0));
  746. var type = random_desc(["SUV","coupe","sedan","truck","van","convertible"]);
  747. return "a " + merge_desc([adjective,color,type]);
  748. };
  749. this.describe = function(verbose = true) {
  750. if (verbose) {
  751. if (this.count <= 3) {
  752. var list = [];
  753. for (var i = 0; i < this.count; i++) {
  754. list.push(this.describeOne(this.count < 2));
  755. }
  756. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  757. } else {
  758. return this.count + " cars with " + describe_all(this.contents,verbose) + " inside";
  759. }
  760. } else {
  761. return (this.count > 1 ? this.count + " cars" : "a car");
  762. }
  763. };
  764. }
  765. function Bus(count = 1) {
  766. this.name = "Bus";
  767. copy_defaults(this,new DefaultEntity());
  768. this.count = count;
  769. this.contents = initContents(this.name,this.count);
  770. this.describeOne = function(verbose=true) {
  771. var adjective = random_desc(["rusty","brand-new","aging","modern"], (verbose ? 0.3 : 0));
  772. var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  773. var type = random_desc(["bus","double-decker bus","articulating bus","open-top bus","sleeper bus","intercity bus"]);
  774. return "a " + merge_desc([adjective,color,type]);
  775. };
  776. this.describe = function(verbose = true) {
  777. if (verbose) {
  778. if (this.count <= 3) {
  779. var list = [];
  780. for (var i = 0; i < this.count; i++) {
  781. list.push(this.describeOne(this.count < 2));
  782. }
  783. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  784. } else {
  785. return this.count + " buses with " + describe_all(this.contents,verbose) + " inside";
  786. }
  787. } else {
  788. return (this.count > 1 ? this.count + " buses" : "a bus");
  789. }
  790. };
  791. }
  792. function Tram(count = 1) {
  793. this.name = "Tram";
  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","weathered","well-maintained",], (verbose ? 0.3 : 0));
  799. var color = random_desc(["blue","brown","gray"], (verbose ? 1 : 0));
  800. var type = random_desc(["tram"]);
  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 " + describe_all(this.contents,verbose) + " inside";
  811. } else {
  812. return this.count + " trams with " + describe_all(this.contents,verbose) + " inside";
  813. }
  814. } else {
  815. return (this.count > 1 ? this.count + " trams" : "a tram");
  816. }
  817. };
  818. this.anal_vore = function() {
  819. return "You slide " + this.describe() + " up your tight ass";
  820. };
  821. }
  822. function Train(count = 1) {
  823. this.name = "Train";
  824. copy_defaults(this,new DefaultEntity());
  825. this.count = count;
  826. this.contents = initContents(this.name,this.count);
  827. this.describeOne = function(verbose=true) {
  828. var adjective = random_desc(["rusty","brand-new","steam","freshly-painted"], (verbose ? 0.3 : 0));
  829. var color = random_desc(["black","tan","gray"], (verbose ? 1 : 0));
  830. var type = random_desc(["train","passenger train","freight train"]);
  831. return "a " + merge_desc([adjective,color,type]);
  832. };
  833. this.describe = function(verbose = true) {
  834. if (verbose) {
  835. if (this.count == 1) {
  836. var list = [];
  837. for (var i = 0; i < this.count; i++) {
  838. list.push(this.describeOne(verbose));
  839. }
  840. return merge_things(list) + " with " + this.contents["engine"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  841. } else {
  842. return this.count + " trains with " + this.contents["engine"].describe(false) + " in the engine and " + this.contents["Train Car"].describe() + " attached";
  843. }
  844. } else {
  845. return (this.count > 1 ? this.count + " trains" : "a train");
  846. }
  847. };
  848. this.anal_vore = function() {
  849. 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");
  850. return "You snatch up " + this.describeOne() + " and stuff it into your pucker, moaning as " + cars;
  851. };
  852. }
  853. function TrainCar(count = 1) {
  854. this.name = "Train Car";
  855. copy_defaults(this,new DefaultEntity());
  856. this.count = count;
  857. this.contents = initContents(this.name,this.count);
  858. this.describeOne = function(verbose=true) {
  859. var adjective = random_desc(["rusty","brand-new","vintage","graffitied","well-maintained"], (verbose ? 0.3 : 0));
  860. var color = random_desc(["black","tan","gray","yellow","steel","wooden"], (verbose ? 1 : 0));
  861. var type = random_desc(["train car","passenger train car","freight train car"]);
  862. return "a " + merge_desc([adjective,color,type]);
  863. };
  864. this.describe = function(verbose = true) {
  865. if (verbose) {
  866. return (this.count > 1 ? this.count + " train cars" : "a train car") + " with " + describe_all(this.contents) + " inside";
  867. } else {
  868. return (this.count > 1 ? this.count + " train cars" : "a train car");
  869. }
  870. };
  871. }
  872. function House(count = 1) {
  873. this.name = "House";
  874. copy_defaults(this,new DefaultEntity());
  875. this.count = count;
  876. this.contents = initContents(this.name,this.count);
  877. this.describeOne = function(verbose=true) {
  878. var size = random_desc(["little","two-story","large","well-built","run-down","cheap",], (verbose ? 0.5 : 0));
  879. var color = random_desc(["blue","white","gray","tan","green","wooden","brick"], (verbose ? 0.5 : 0));
  880. var name = random_desc(["house","home","house","house","house","trailer"], 1);
  881. return "a " + merge_desc([size,color,name]);
  882. };
  883. this.describe = function(verbose = true) {
  884. if (verbose) {
  885. if (this.count <= 3) {
  886. var list = [];
  887. for (var i = 0; i < this.count; i++) {
  888. list.push(this.describeOne(this.count < 2));
  889. }
  890. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  891. } else {
  892. return this.count + " homes with " + describe_all(this.contents,verbose) + " inside";
  893. }
  894. } else {
  895. return (this.count > 1 ? this.count + " houses" : "a house");
  896. }
  897. };
  898. }
  899. //might split this into a general business and resutrant categories
  900. function Business(count = 1) {
  901. this.name = "Business";
  902. copy_defaults(this,new DefaultEntity());
  903. this.count = count;
  904. this.contents = initContents(this.name,this.count);
  905. this.describeOne = function(verbose=true) {
  906. var size = random_desc(["little","two-story","large","well-built","run-down","cheap","aging","corner"], (verbose ? 0.5 : 0));
  907. var color = random_desc(["blue","white","gray","tan","green","brick","concrete"], (verbose ? 0.5 : 0));
  908. 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);
  909. return "a " + merge_desc([size,color,name]);
  910. };
  911. this.describe = function(verbose = true) {
  912. if (verbose) {
  913. if (this.count <= 3) {
  914. var list = [];
  915. for (var i = 0; i < this.count; i++) {
  916. list.push(this.describeOne(this.count < 2));
  917. }
  918. return merge_things(list) + " with " + describe_all(this.contents,verbose);
  919. } else {
  920. return this.count + " local business containing " + describe_all(this.contents,verbose);
  921. }
  922. } else {
  923. return (this.count > 1 ? this.count + " buildings" : "a local business");
  924. }
  925. };
  926. }
  927. function Barn(count = 1) {
  928. this.name = "Barn";
  929. copy_defaults(this,new DefaultEntity());
  930. this.count = count;
  931. this.contents = initContents(this.name,this.count);
  932. this.describeOne = function(verbose=true) {
  933. var size = random_desc(["little","big","large","weathered","rotted","new"], (verbose ? 0.5 : 0));
  934. var color = random_desc(["blue","white","gray","tan","green","red"], (verbose ? 0.5 : 0));
  935. var name = random_desc(["barn","barn","barn","barn","barn","farmhouse"], 1);
  936. return "a " + merge_desc([size,color,name]);
  937. };
  938. this.describe = function(verbose = true) {
  939. if (verbose) {
  940. if (this.count <= 3) {
  941. var list = [];
  942. for (var i = 0; i < this.count; i++) {
  943. list.push(this.describeOne(this.count < 2));
  944. }
  945. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  946. } else {
  947. return this.count + " barns with " + describe_all(this.contents,verbose) + " inside";
  948. }
  949. } else {
  950. return (this.count > 1 ? this.count + " barns" : "a barn");
  951. }
  952. };
  953. }
  954. function SmallSkyscraper(count = 1) {
  955. this.name = "Small Skyscraper";
  956. copy_defaults(this,new DefaultEntity());
  957. this.count = count;
  958. this.contents = initContents(this.name,this.count);
  959. this.describeOne = function(verbose=true) {
  960. var color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
  961. var name = random_desc(["skyscraper","office tower","office building","high rise"], 1);
  962. return "a " + merge_desc([color,name]);
  963. };
  964. this.describe = function(verbose = true) {
  965. if (verbose) {
  966. if (this.count <= 3) {
  967. var list = [];
  968. for (var i = 0; i < this.count; i++) {
  969. list.push(this.describeOne(this.count < 2));
  970. }
  971. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  972. } else {
  973. return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  974. }
  975. } else {
  976. return (this.count > 1 ? this.count + " small skyscrapers" : "a small skyscraper");
  977. }
  978. };
  979. }
  980. function LargeSkyscraper(count = 1) {
  981. this.name = "Large Skyscraper";
  982. copy_defaults(this,new DefaultEntity());
  983. this.count = count;
  984. this.contents = initContents(this.name,this.count);
  985. this.describeOne = function(verbose=true) {
  986. var color = random_desc(["blue","white","gray","tan","green","glass"], (verbose ? 0.5 : 0));
  987. var name = random_desc(["skyscraper","office tower","office building"], 1);
  988. return "a " + merge_desc(["towering",color,name]);
  989. };
  990. this.describe = function(verbose = true) {
  991. if (verbose) {
  992. if (this.count <= 3) {
  993. var list = [];
  994. for (var i = 0; i < this.count; i++) {
  995. list.push(this.describeOne(this.count < 2));
  996. }
  997. return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
  998. } else {
  999. return this.count + " large skyscrapers with " + describe_all(this.contents,verbose) + " inside";
  1000. }
  1001. } else {
  1002. return (this.count > 1 ? this.count + " large skyscrapers" : "a large skyscraper");
  1003. }
  1004. };
  1005. }
  1006. function ParkingGarage(count = 1) {
  1007. this.name = "Parking Garage";
  1008. copy_defaults(this,new DefaultEntity());
  1009. this.count = count;
  1010. this.contents = initContents(this.name,this.count);
  1011. this.describeOne = function(verbose=true) {
  1012. return "a parking garage";
  1013. };
  1014. this.describe = function(verbose = true) {
  1015. if (verbose) {
  1016. return (this.count == 1 ? "a parking garage" : this.count + " parking garages") + " with " + describe_all(this.contents, verbose);
  1017. } else {
  1018. return (this.count == 1 ? "a parking garage" : this.count + " parking garages");
  1019. }
  1020. };
  1021. }
  1022. function Town(count = 1) {
  1023. this.name = "Town";
  1024. copy_defaults(this,new DefaultEntity());
  1025. this.count = count;
  1026. this.contents = initContents(this.name,this.count);
  1027. this.describe = function(verbose = true) {
  1028. if (verbose) {
  1029. return (this.count == 1 ? "a town" : this.count + " towns") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  1030. } else {
  1031. return (this.count == 1 ? "a town" : this.count + " towns");
  1032. }
  1033. };
  1034. }
  1035. function City(count = 1) {
  1036. this.name = "City";
  1037. copy_defaults(this,new DefaultEntity());
  1038. this.count = count;
  1039. this.contents = initContents(this.name,this.count);
  1040. this.describe = function(verbose = true) {
  1041. if (verbose) {
  1042. return (this.count == 1 ? "a city" : this.count + " cities") + " with " + describe_all(this.contents, verbose) + " in " + (this.count == 1 ? "it" : "them");
  1043. } else {
  1044. return (this.count == 1 ? "a city" : this.count + " cities");
  1045. }
  1046. };
  1047. }
  1048. function Continent(count = 1) {
  1049. this.name = "Continent";
  1050. copy_defaults(this,new DefaultEntity());
  1051. this.count = count;
  1052. this.contents = initContents(this.name,this.count);
  1053. this.describe = function(verbose = true) {
  1054. if (verbose) {
  1055. return (this.count == 1 ? "a continent" : this.count + " continents") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  1056. } else {
  1057. return (this.count == 1 ? "a continent" : this.count + " continents");
  1058. }
  1059. };
  1060. }
  1061. function Planet(count = 1) {
  1062. this.name = "Planet";
  1063. copy_defaults(this,new DefaultEntity());
  1064. this.count = count;
  1065. this.contents = initContents(this.name,this.count);
  1066. this.describe = function(verbose = true) {
  1067. if (verbose) {
  1068. return (this.count == 1 ? "a planet" : this.count + " planets") + " with " + describe_all(this.contents, verbose) + " on " + (this.count == 1 ? "it" : "them");
  1069. } else {
  1070. return (this.count == 1 ? "a planet" : this.count + " planets");
  1071. }
  1072. };
  1073. }
  1074. function Star(count = 1) {
  1075. this.name = "Star";
  1076. copy_defaults(this,new DefaultEntity());
  1077. this.count = count;
  1078. this.contents = initContents(this.name,this.count);
  1079. this.describe = function(verbose = true) {
  1080. return (this.count == 1 ? "a star" : this.count + " stars");
  1081. };
  1082. }
  1083. function SolarSystem(count = 1) {
  1084. this.name = "Solar System";
  1085. copy_defaults(this,new DefaultEntity());
  1086. this.count = count;
  1087. this.contents = initContents(this.name,this.count);
  1088. this.describe = function(verbose = true) {
  1089. if (verbose) {
  1090. return (this.count == 1 ? "a solar system" : this.count + " solar systems") + " made up of " + describe_all(this.contents, verbose);
  1091. } else {
  1092. return (this.count == 1 ? "a solar system" : this.count + " solar systems");
  1093. }
  1094. };
  1095. }
  1096. function Galaxy(count = 1) {
  1097. this.name = "Galaxy";
  1098. copy_defaults(this,new DefaultEntity());
  1099. this.count = count;
  1100. this.contents = initContents(this.name,this.count);
  1101. this.describe = function(verbose = true) {
  1102. if (verbose) {
  1103. return (this.count == 1 ? "a galaxy" : this.count + " galaxies") + " made up of " + describe_all(this.contents, verbose);
  1104. } else {
  1105. return (this.count == 1 ? "a galaxy" : this.count + " galaxies");
  1106. }
  1107. };
  1108. }
  1109. function Cluster(count = 1) {
  1110. this.name = "Cluster";
  1111. copy_defaults(this,new DefaultEntity());
  1112. this.count = count;
  1113. this.contents = initContents(this.name,this.count);
  1114. this.describe = function(verbose = true) {
  1115. if (verbose) {
  1116. return (this.count == 1 ? "a cluster" : this.count + " clusters") + " made up of " + describe_all(this.contents, verbose);
  1117. } else {
  1118. return (this.count == 1 ? "a cluster" : this.count + " clusters");
  1119. }
  1120. };
  1121. }
  1122. function Universe(count = 1) {
  1123. this.name = "Universe";
  1124. copy_defaults(this,new DefaultEntity());
  1125. this.count = count;
  1126. this.contents = initContents(this.name,this.count);
  1127. this.describe = function(verbose = true) {
  1128. if (verbose) {
  1129. return (this.count == 1 ? "a universe" : this.count + " universes") + " made up of " + describe_all(this.contents, verbose);
  1130. } else {
  1131. return (this.count == 1 ? "a universe" : this.count + " universes");
  1132. }
  1133. };
  1134. }
  1135. function Multiverse(count = 1) {
  1136. this.name = "Multiverse";
  1137. copy_defaults(this,new DefaultEntity());
  1138. this.count = count;
  1139. this.contents = initContents(this.name,this.count);
  1140. this.describe = function(verbose = true) {
  1141. if (verbose) {
  1142. return (this.count == 1 ? "a multiverse" : this.count + " multiverses") + " made up of " + describe_all(this.contents, verbose);
  1143. } else {
  1144. return (this.count == 1 ? "a multiverse" : this.count + " multiverses");
  1145. }
  1146. };
  1147. }
  1148. function Soldier(count = 1) {
  1149. this.name = "Soldier";
  1150. copy_defaults(this,new DefaultEntity());
  1151. this.count = count;
  1152. this.contents = initContents(this.name,this.count);
  1153. this.describe = function(verbose = true) {
  1154. return (this.count == 1 ? "a soldier" : this.count + " soldiers");
  1155. };
  1156. }
  1157. function Tank(count = 1) {
  1158. this.name = "Tank";
  1159. copy_defaults(this,new DefaultEntity());
  1160. this.count = count;
  1161. this.contents = initContents(this.name,this.count);
  1162. this.describe = function(verbose = true) {
  1163. if (verbose) {
  1164. return (this.count == 1 ? "a tank" : this.count + " tanks") + " with " + describe_all(this.contents, verbose) + " trapped inside";
  1165. } else {
  1166. return (this.count == 1 ? "a tank" : this.count + " tanks");
  1167. }
  1168. };
  1169. }
  1170. function Artillery(count = 1) {
  1171. this.name = "Artillery";
  1172. copy_defaults(this,new DefaultEntity());
  1173. this.count = count;
  1174. this.contents = initContents(this.name,this.count);
  1175. this.describe = function(verbose = true) {
  1176. if (verbose) {
  1177. return (this.count == 1 ? "an artillery unit" : this.count + " artillery units") + " with " + describe_all(this.contents, verbose) + " trapped inside";
  1178. } else {
  1179. return (this.count == 1 ? "an artillery unit" : this.count + " artillery units");
  1180. }
  1181. };
  1182. }
  1183. function Helicopter(count = 1) {
  1184. this.name = "Helicopter";
  1185. copy_defaults(this,new DefaultEntity());
  1186. this.count = count;
  1187. this.contents = initContents(this.name,this.count);
  1188. this.describe = function(verbose = true) {
  1189. if (verbose) {
  1190. return (this.count == 1 ? "a helicopter" : this.count + " helicopters") + " with " + describe_all(this.contents, verbose) + " riding inside";
  1191. } else {
  1192. return (this.count == 1 ? "a helicopter" : this.count + " helicopters");
  1193. }
  1194. };
  1195. }
  1196. function Micro(count = 1) {
  1197. this.name = "Micro";
  1198. copy_defaults(this,new DefaultEntity());
  1199. this.count = count;
  1200. this.contents = initContents(this.name,this.count);
  1201. this.describe = function(verbose = true) {
  1202. return (this.count == 1 ? "a micro" : this.count + " micros");
  1203. };
  1204. }
  1205. function Macro(count = 1) {
  1206. this.name = "Macro";
  1207. copy_defaults(this,new DefaultEntity());
  1208. this.count = count;
  1209. this.contents = initContents(this.name,this.count);
  1210. this.describe = function(verbose = true) {
  1211. return (this.count == 1 ? "a smaller macro" : this.count + " smaller macros");
  1212. };
  1213. }
  1214. function Squad(count = 1) {
  1215. this.name = "Squad";
  1216. copy_defaults(this,new DefaultEntity());
  1217. this.count = count;
  1218. this.contents = initContents(this.name,this.count);
  1219. this.describeOne = function(verbose=true) {
  1220. return "a squad";
  1221. };
  1222. this.describe = function(verbose = true) {
  1223. if (verbose) {
  1224. return (this.count == 1 ? "a squad" : this.count + " squads") + " made up of " + describe_all(this.contents, verbose);
  1225. } else {
  1226. return (this.count == 1 ? "a squad" : this.count + " squads");
  1227. }
  1228. };
  1229. }
  1230. function Platoon(count = 1) {
  1231. this.name = "Platoon";
  1232. copy_defaults(this,new DefaultEntity());
  1233. this.count = count;
  1234. this.contents = initContents(this.name,this.count);
  1235. this.describeOne = function(verbose=true) {
  1236. return "a military platoon";
  1237. };
  1238. this.describe = function(verbose = true) {
  1239. if (verbose) {
  1240. return (this.count == 1 ? "a platoon" : this.count + " platoons") + " consisting of " + describe_all(this.contents, verbose);
  1241. } else {
  1242. return (this.count == 1 ? "a platoon" : this.count + " platoons");
  1243. }
  1244. };
  1245. }
  1246. function Company(count = 1) {
  1247. this.name = "Company";
  1248. copy_defaults(this,new DefaultEntity());
  1249. this.count = count;
  1250. this.contents = initContents(this.name,this.count);
  1251. this.describeOne = function(verbose=true) {
  1252. return "a company of soldiers";
  1253. };
  1254. this.describe = function(verbose = true) {
  1255. if (verbose) {
  1256. return (this.count == 1 ? "a company" : this.count + " companies") + " of " + describe_all(this.contents, verbose);
  1257. } else {
  1258. return (this.count == 1 ? "a company" : this.count + " companies");
  1259. }
  1260. };
  1261. }
  1262. function Battalion(count = 1) {
  1263. this.name = "Battalion";
  1264. copy_defaults(this,new DefaultEntity());
  1265. this.count = count;
  1266. this.contents = initContents(this.name,this.count);
  1267. this.describeOne = function(verbose=true) {
  1268. return "a battalion";
  1269. };
  1270. this.describe = function(verbose = true) {
  1271. if (verbose) {
  1272. return (this.count == 1 ? "a battalion" : this.count + " battalions") + " containing " + describe_all(this.contents, verbose);
  1273. } else {
  1274. return (this.count == 1 ? "a battalion" : this.count + " battalions");
  1275. }
  1276. };
  1277. }
  1278. function Brigade(count = 1) {
  1279. this.name = "Brigade";
  1280. copy_defaults(this,new DefaultEntity());
  1281. this.count = count;
  1282. this.contents = initContents(this.name,this.count);
  1283. this.describeOne = function(verbose=true) {
  1284. return "a brigade";
  1285. };
  1286. this.describe = function(verbose = true) {
  1287. if (verbose) {
  1288. return (this.count == 1 ? "a brigade" : this.count + " brigades") + " made up of " + describe_all(this.contents, verbose);
  1289. } else {
  1290. return (this.count == 1 ? "a brigade" : this.count + " brigades");
  1291. }
  1292. };
  1293. }
  1294. function Division(count = 1) {
  1295. this.name = "Division";
  1296. copy_defaults(this,new DefaultEntity());
  1297. this.count = count;
  1298. this.contents = initContents(this.name,this.count);
  1299. this.describeOne = function(verbose=true) {
  1300. return "a division";
  1301. };
  1302. this.describe = function(verbose = true) {
  1303. if (verbose) {
  1304. return (this.count == 1 ? "a division" : this.count + " divisions") + " of " + describe_all(this.contents, verbose);
  1305. } else {
  1306. return (this.count == 1 ? "a division" : this.count + " divisions");
  1307. }
  1308. };
  1309. }
  1310. function TankDivision(count = 1) {
  1311. this.name = "Tank Division";
  1312. copy_defaults(this,new DefaultEntity());
  1313. this.count = count;
  1314. this.contents = initContents(this.name,this.count);
  1315. this.describeOne = function(verbose=true) {
  1316. return "a tank division";
  1317. };
  1318. this.describe = function(verbose = true) {
  1319. if (verbose) {
  1320. return (this.count == 1 ? "a tank division" : this.count + " tank divisions") + " of " + describe_all(this.contents, verbose);
  1321. } else {
  1322. return (this.count == 1 ? "a tank division" : this.count + " tank divisions");
  1323. }
  1324. };
  1325. }
  1326. function Army(count = 1) {
  1327. this.name = "Army";
  1328. copy_defaults(this,new DefaultEntity());
  1329. this.count = count;
  1330. this.contents = initContents(this.name,this.count);
  1331. this.describeOne = function(verbose=true) {
  1332. return "an army";
  1333. };
  1334. this.describe = function(verbose = true) {
  1335. if (verbose) {
  1336. return (this.count == 1 ? "an army" : this.count + " armies") + " made up of " + describe_all(this.contents, verbose);
  1337. } else {
  1338. return (this.count == 1 ? "an army" : this.count + " armies");
  1339. }
  1340. };
  1341. }