cookie clicker but bigger
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.
 
 
 
 

1336 lines
30 KiB

  1. "use strict";
  2. const resourceTypes = {
  3. "food": {
  4. name: "food",
  5. generated: true
  6. },
  7. "powerups": {
  8. name: "power crystals",
  9. generated: false
  10. }
  11. }
  12. deepFreeze(resourceTypes);
  13. const buildings = {
  14. "micro": {
  15. "name": "Micro",
  16. "plural": "Micros",
  17. "desc": "A tasty, squirmy treat.",
  18. "cost": {
  19. "food": 1e1
  20. },
  21. "prod": {
  22. "food": 1e-1 / 1
  23. },
  24. "icon": "fa-universal-access"
  25. },
  26. "anthro": {
  27. "name": "Anthro",
  28. "plural": "Anthros",
  29. "desc": "Something more substantial to sate your hunger.",
  30. "cost": {
  31. "food": 1e2
  32. },
  33. "prod": {
  34. "food": 1e0 / 1.1
  35. },
  36. "icon": "fa-male"
  37. },
  38. "car": {
  39. "name": "Car",
  40. "plural": "Cars",
  41. "desc": "Crunchy shell, tasty center.",
  42. "cost": {
  43. "food": 1.2e3
  44. },
  45. "prod": {
  46. "food": 1e1 / 1.2
  47. },
  48. "icon": "fa-car"
  49. },
  50. "bus": {
  51. "name": "Bus",
  52. "plural": "Buses",
  53. "desc": "Probably the worst place to be when a macro is aroud.",
  54. "cost": {
  55. "food": 1.4e4
  56. },
  57. "prod": {
  58. "food": 1e2 / 1.3
  59. },
  60. "icon": "fa-bus"
  61. },
  62. "house": {
  63. "name": "House",
  64. "plural": "Houses",
  65. "desc": "Home sweet home - but it doesn't taste sweet?",
  66. "cost": {
  67. "food": 1.6e5
  68. },
  69. "prod": {
  70. "food": 1e3 / 1.4
  71. },
  72. "icon": "fa-home"
  73. },
  74. "apartment": {
  75. "name": "Apartment",
  76. "plural": "Apartments",
  77. "desc": "More snacks, less packaging.",
  78. "cost": {
  79. "food": 1.8e6
  80. },
  81. "prod": {
  82. "food": 1e4 / 1.5
  83. },
  84. "icon": "fa-building"
  85. },
  86. "block": {
  87. "name": "Block",
  88. "plural": "Blocks",
  89. "desc": "A whole pile of buildings.",
  90. "cost": {
  91. "food": 2e7
  92. },
  93. "prod": {
  94. "food": 1e5 / 1.6
  95. },
  96. "icon": "fa-warehouse"
  97. },
  98. "town": {
  99. "name": "Town",
  100. "plural": "Towns",
  101. "desc": "'Tourist trap' has never been this literal.",
  102. "cost": {
  103. "food": 2.2e8
  104. },
  105. "prod": {
  106. "food": 1e6 / 1.7
  107. },
  108. "icon": "fa-store"
  109. },
  110. "city": {
  111. "name": "City",
  112. "plural": "Cities",
  113. "desc": "Please no sitty on our city.",
  114. "cost": {
  115. "food": 2.4e9
  116. },
  117. "prod": {
  118. "food": 1e7 / 1.8
  119. },
  120. "icon": "fa-city"
  121. },
  122. "metro": {
  123. "name": "Metropolis",
  124. "plural": "Metropolises",
  125. "desc": "A big ol' city. Tasty, too.",
  126. "cost": {
  127. "food": 2.6e10
  128. },
  129. "prod": {
  130. "food": 1e8 / 1.9
  131. },
  132. "icon": "fa-landmark"
  133. },
  134. "county": {
  135. "name": "County",
  136. "plural": "Counties",
  137. "desc": "Why salt the land when you can slurp it?",
  138. "cost": {
  139. "food": 2.8e11
  140. },
  141. "prod": {
  142. "food": 1e9 / 2
  143. },
  144. "icon": "fa-map"
  145. },
  146. "state": {
  147. "name": "State",
  148. "plural": "States",
  149. "desc": "The United States is made up of...43 states - no, 42...",
  150. "cost": {
  151. "food": 3e12
  152. },
  153. "prod": {
  154. "food": 1e10 / 2.1
  155. },
  156. "icon": "fa-map-signs"
  157. },
  158. "country": {
  159. "name": "Country",
  160. "plural": "Countries",
  161. "desc": "One nation, under paw.",
  162. "cost": {
  163. "food": 3.2e13
  164. },
  165. "prod": {
  166. "food": 1e11 / 2.2
  167. },
  168. "icon": "fa-flag"
  169. },
  170. "continent": {
  171. "name": "Continent",
  172. "plural": "Continents",
  173. "desc": "Earth-shattering appetite!",
  174. "cost": {
  175. "food": 3.4e14
  176. },
  177. "prod": {
  178. "food": 1e12 / 2.3
  179. },
  180. "icon": "fa-mountain"
  181. },
  182. "planet": {
  183. "name": "Planet",
  184. "plural": "Planets",
  185. "desc": "Earth appetite!",
  186. "cost": {
  187. "food": 3.6e15
  188. },
  189. "prod": {
  190. "food": 1e13 / 2.4
  191. },
  192. "icon": "fa-globe-europe"
  193. },
  194. "solar-system": {
  195. "name": "Solar System",
  196. "plural": "Solar Systems",
  197. "desc": "Earths appetite!",
  198. "cost": {
  199. "food": 3.8e16
  200. },
  201. "prod": {
  202. "food": 1e14 / 2.5
  203. },
  204. "icon": "fa-meteor"
  205. },
  206. "galaxy": {
  207. "name": "Galaxy",
  208. "plural": "Galaxies",
  209. "desc": "In a galaxy far, far down your gullet...",
  210. "cost": {
  211. "food": 4.0e17
  212. },
  213. "prod": {
  214. "food": 1e15 / 2.6
  215. },
  216. "icon": "fa-sun"
  217. },
  218. "universe": {
  219. "name": "Universe",
  220. "plural": "Universes",
  221. "desc": "Into the you-verse.",
  222. "cost": {
  223. "food": 4.2e18
  224. },
  225. "prod": {
  226. "food": 1e16 / 2.7
  227. },
  228. "icon": "fa-asterisk"
  229. },
  230. "multiverse": {
  231. "name": "Multiverse",
  232. "plural": "Multiverses",
  233. "desc": "This is getting very silly.",
  234. "cost": {
  235. "food": 4.4e19
  236. },
  237. "prod": {
  238. "food": 1e17 / 2.8
  239. },
  240. "icon": "fa-infinity"
  241. }
  242. }
  243. deepFreeze(buildings);
  244. const effect_types = {
  245. "prod": {
  246. "apply": function (effect, productivity) {
  247. return scaleCost(productivity, effect.amount);
  248. },
  249. "desc": function (effect) {
  250. return round(effect.amount, 2) + "x food production from " + buildings[effect.target].plural;
  251. }
  252. },
  253. "prod-all": {
  254. "apply": function (effect, productivity) {
  255. return scaleCost(productivity, effect.amount);
  256. },
  257. "desc": function (effect) {
  258. return round((effect.amount - 1) * 100) + "% increase to food production";
  259. }
  260. },
  261. "helper": {
  262. "apply": function (effect, productivity, helperCount) {
  263. return scaleCost(productivity, 1 + effect.amount * helperCount);
  264. },
  265. "desc": function (effect) {
  266. return "+" + round(effect.amount * 100) + "% food/sec from " + buildings[effect.helped].name + " for every " + buildings[effect.helper].name + " owned.";
  267. }
  268. },
  269. "click": {
  270. "apply": function (effect, bonus, productivity) {
  271. return bonus + productivity * effect.amount;
  272. },
  273. "desc": function (effect) {
  274. return round(effect.amount * 100) + "% of food/sec gained per click";
  275. }
  276. },
  277. "click-victim": {
  278. "desc": function (effect) {
  279. return "Devour larger prey";
  280. }
  281. },
  282. "powerup-freq": {
  283. "apply": function (effect, delay) {
  284. return delay * effect.amount;
  285. },
  286. "desc": function (effect) {
  287. return "Speed up powerup spawns by " + Math.round((1 / effect.amount - 1) * 100) + "%";
  288. }
  289. }
  290. }
  291. deepFreeze(effect_types);
  292. let upgrades = {
  293. }
  294. function createTemplateUpgrades() {
  295. createProdUpgrades();
  296. createProdAllUpgrades();
  297. createClickUpgrades();
  298. createHelperUpgrades();
  299. createClickVictimUpgrades();
  300. createPowerupFreqUpgrades();
  301. createFreeBuildingPowerups();
  302. createNews();
  303. deepFreeze(upgrades);
  304. deepFreeze(powerups);
  305. deepFreeze(news);
  306. }
  307. const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100];
  308. function createProdUpgrades() {
  309. for (const [key, value] of Object.entries(prodUpgradeText)) {
  310. let counter = 1;
  311. let prefix = key + "-prod-";
  312. for (let contents of value) {
  313. upgrades[prefix + counter] = {
  314. "name": contents.name,
  315. "desc": contents.desc,
  316. "icon": buildings[key].icon,
  317. "cost": {
  318. "food": buildings[key].cost.food * 5 * Math.pow(10, counter - 1)
  319. },
  320. "effects": [
  321. {
  322. "type": "prod",
  323. "amount": 2 + (counter - 1) * 0.25,
  324. "target": key
  325. }
  326. ]
  327. };
  328. upgrades[prefix + counter]["prereqs"] = {};
  329. upgrades[prefix + counter]["prereqs"]["buildings"] = {};
  330. upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1];
  331. if (counter > 1) {
  332. upgrades[prefix + counter]["prereqs"]["upgrades"] = [
  333. prefix + (counter - 1)
  334. ];
  335. }
  336. counter += 1;
  337. }
  338. }
  339. }
  340. function createProdAllUpgrades() {
  341. let prefix = "prod-all-"
  342. let counter = 1;
  343. for (let contents of prodAllUpgradeText) {
  344. upgrades[prefix + counter] = {
  345. "name": contents.name,
  346. "desc": contents.desc,
  347. "icon": "fa-cogs",
  348. "cost": {
  349. "food": 5 * Math.pow(10, counter + 1)
  350. },
  351. "effects": [
  352. {
  353. "type": "prod-all",
  354. "amount": 1.05
  355. }
  356. ],
  357. "prereqs": {
  358. "productivity": {
  359. "food": Math.pow(10, counter)
  360. }
  361. }
  362. };
  363. if (counter > 1) {
  364. upgrades[prefix + counter]["prereqs"].upgrades = [
  365. prefix + (counter - 1)
  366. ];
  367. }
  368. counter += 1;
  369. }
  370. }
  371. function createClickUpgrades() {
  372. let prefix = "prod-click-";
  373. let counter = 1;
  374. for (let contents of clickUpgradeText) {
  375. upgrades[prefix + counter] = {
  376. name: contents.name,
  377. desc: contents.desc,
  378. icon: "fa-hand-pointer",
  379. cost: {
  380. food: Math.pow(10, (counter * 2) + 1)
  381. },
  382. effects: [
  383. {
  384. type: "click",
  385. amount: 0.01
  386. }
  387. ],
  388. prereqs: {
  389. productivity: {
  390. food: Math.pow(10, counter)
  391. }
  392. }
  393. };
  394. if (counter > 1) {
  395. upgrades[prefix + counter]["prereqs"].upgrades = [
  396. prefix + (counter - 1)
  397. ];
  398. }
  399. counter += 1;
  400. }
  401. }
  402. function createHelperUpgrades() {
  403. const infix = "-help-";
  404. Object.entries(helperUpgradeText).forEach(([helper, helpees]) => {
  405. const prefix = helper;
  406. Object.entries(helpees).forEach(([helped, texts]) => {
  407. const suffix = helped;
  408. let counter = 1;
  409. for (let text of texts) {
  410. const key = prefix + infix + suffix + "-" + counter;
  411. upgrades[key] = {
  412. "name": text.name,
  413. "desc": text.desc,
  414. "icon": "fa-hand-holding",
  415. "cost": {
  416. "food": buildings[helper].cost.food * 25 * counter + buildings[helped].cost.food * 50 * counter
  417. },
  418. "effects": [
  419. {
  420. "type": "helper",
  421. "helper": helper,
  422. "helped": helped,
  423. "amount": 0.01 * counter
  424. }
  425. ],
  426. "prereqs": {
  427. "buildings": {
  428. },
  429. "upgrades": [
  430. helper + "-prod-1"
  431. ]
  432. }
  433. };
  434. upgrades[key]["prereqs"]["buildings"][helper] = 10 * counter;
  435. if (counter > 1) {
  436. upgrades[key]["prereqs"]["upgrades"].push(prefix + infix + suffix + "-" + (counter - 1))
  437. }
  438. counter += 1;
  439. }
  440. });
  441. });
  442. }
  443. function createClickVictimUpgrades() {
  444. const prefix = "click-";
  445. let counter = 1;
  446. let previous = "micro";
  447. Object.entries(clickVictimUpgradeText).forEach(([key, text]) => {
  448. upgrades[prefix + key] = {
  449. "name": text.name,
  450. "desc": text.desc,
  451. "icon": buildings[key].icon,
  452. "cost": {
  453. "food": 1000 * Math.pow(10, counter)
  454. },
  455. "effects": [
  456. {
  457. "type": "click-victim",
  458. "id": key
  459. }
  460. ],
  461. "prereqs": {
  462. "upgrades": [
  463. ]
  464. }
  465. };
  466. if (counter > 1) {
  467. upgrades[prefix + key].prereqs.upgrades.push(prefix + previous);
  468. }
  469. counter += 1;
  470. previous = key;
  471. });
  472. }
  473. function createPowerupFreqUpgrades() {
  474. const prefix = "powerup-freq-";
  475. let counter = 1;
  476. powerupFreqUpgradeText.forEach(text => {
  477. upgrades[prefix + counter] = {
  478. "name": text.name,
  479. "desc": text.desc,
  480. "icon": "fa-drumstick-bite",
  481. "cost": {
  482. "powerups": 5 * counter
  483. },
  484. "effects": [
  485. {
  486. "type": "powerup-freq",
  487. "id": prefix + counter,
  488. "amount": 0.75 + 0.03 * (counter - 1)
  489. }
  490. ],
  491. "prereqs": {
  492. "upgrades": [
  493. ],
  494. "resources": {
  495. "powerups": 1
  496. }
  497. }
  498. };
  499. if (counter > 1) {
  500. upgrades[prefix + counter].prereqs.upgrades.push(prefix + (counter - 1));
  501. }
  502. counter += 1;
  503. });
  504. }
  505. let prodUpgradeText = {
  506. "micro": [
  507. {
  508. "name": "Bigger Micros",
  509. "desc": "A macro micro? It's more filling, for sure.",
  510. },
  511. {
  512. "name": "Beefy Micros",
  513. "desc": "25% more protein, 10% fewer carbs."
  514. },
  515. {
  516. "name": "Delicious Micros",
  517. "desc": "Betcha' can't eat just one."
  518. },
  519. {
  520. "name": "Irresistable Micros",
  521. "desc": "Genetically engineered to be delectable."
  522. },
  523. {
  524. "name": "Exquisite Micros",
  525. "desc": "Dangerously delicious."
  526. }
  527. ],
  528. "anthro": [
  529. {
  530. "name": "Willing Prey",
  531. "desc": "Why bother chasing down your meal?"
  532. },
  533. {
  534. "name": "Fattened Prey",
  535. "desc": "9 calories per gram!"
  536. },
  537. {
  538. "name": "Mesmerized Prey",
  539. "desc": "Why bother walking to your meal?"
  540. },
  541. {
  542. "name": "Food-Safe Lubricant",
  543. "desc": "Ease them down your gullet with ease. Thanks, chemistry!"
  544. },
  545. {
  546. "name": "Mandatory Meal Training",
  547. "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%."
  548. }
  549. ],
  550. "car": [
  551. {
  552. "name": "HOV Lane",
  553. "desc": "Think of the environment! And of your impending digestion, I guess."
  554. },
  555. {
  556. "name": "Lightweight Frames",
  557. "desc": "Although crunchy, the shell around the snacks isn't very appetizing."
  558. },
  559. {
  560. "name": "Traffic Engineering",
  561. "desc": "Maximizing throughput into your gullet."
  562. },
  563. {
  564. "name": "Super Highways",
  565. "desc": "Six lanes! Fresh pavement! A ravenous maw!"
  566. },
  567. {
  568. "name": "Stacked Cars",
  569. "desc": "When we couldn't make the roads any wider, we tried stacking the cars higher."
  570. }
  571. ],
  572. "bus": [
  573. {
  574. "name": "Bus Passes",
  575. "desc": "Save on greenhouse emissions. Save your predator's effort. Everyone wins!"
  576. },
  577. {
  578. "name": "Double Deckers",
  579. "desc": "Stack 'em up! Slurp 'em down!"
  580. },
  581. {
  582. "name": "Articulated Buses",
  583. "desc": "The bend really helps them slip down your throat."
  584. },
  585. {
  586. "name": "Tour Buses",
  587. "desc": "People come from around the world to see your intestinal tract.",
  588. },
  589. {
  590. "name": "Double Double Deckers",
  591. "desc": "Hard to swallow, true, but filling nonetheless."
  592. }
  593. ],
  594. "house": [
  595. {
  596. "name": "Second Story",
  597. "desc": "Twice as many snacks, half as much chewing."
  598. },
  599. {
  600. "name": "Remodeling",
  601. "desc": "Strip out that icky asbestos."
  602. },
  603. {
  604. "name": "Smaller Yards",
  605. "desc": "Less wasted space. More wasted homes."
  606. },
  607. {
  608. "name": "House Parties",
  609. "desc": "More people! More party! More prey!"
  610. },
  611. {
  612. "name": "Suburbia",
  613. "desc": "It's like a buffet line!"
  614. }
  615. ],
  616. "apartment": [
  617. {
  618. "name": "Rent Subsidies",
  619. "desc": "Encourage high-density living. Enjoy the result."
  620. },
  621. {
  622. "name": "High-Rises",
  623. "desc": "These sure are some Tilted Towers..."
  624. },
  625. {
  626. "name": "Reverse Eviction",
  627. "desc": "Forcibly putting people IN your lunch!"
  628. },
  629. {
  630. "name": "Higher High-Rises",
  631. "desc": "Almost as tall as you! Almost."
  632. },
  633. {
  634. "name": "Vertical Beds",
  635. "desc": "You can fit way more people in a studio apartment with this one weird tip..."
  636. }
  637. ],
  638. "block": [
  639. {
  640. "name": "Street Sweepers",
  641. "desc": "Keeps the gunk off the sidewalk, and thus, off your tongue."
  642. },
  643. {
  644. "name": "Zoning Laws",
  645. "desc": "Mandatory prey-per-square-meter requirements."
  646. },
  647. {
  648. "name": "Alleyway Appetizers",
  649. "desc": "You can fit people *between* the buildings."
  650. },
  651. {
  652. "name": "Block Party",
  653. "desc": "Everyone's invited!"
  654. },
  655. {
  656. "name": "Vertical Blocks",
  657. "desc": "There's no reason you can't stack them on top of each other, right?"
  658. }
  659. ],
  660. "town": [
  661. {
  662. "name": "Going to Town",
  663. "desc": "That's where the food is."
  664. },
  665. {
  666. "name": "Going to Town, II: Revelations",
  667. "desc": "That's where the food is, again."
  668. },
  669. {
  670. "name": "Going to Town 0: Origins",
  671. "desc": "That's where the food was."
  672. },
  673. {
  674. "name": "Going to Town III: Revengeance",
  675. "desc": "Look, it's just how nature works. Food gets ate."
  676. },
  677. {
  678. "name": "Going to Town IV: Endgame",
  679. "desc": "Food IS something one considers when eating the universe."
  680. }
  681. ],
  682. "city": [
  683. {
  684. "name": "Gridlock",
  685. "desc": "Keeps people within arm's reach."
  686. },
  687. {
  688. "name": "Skyscrapers",
  689. "desc": "Corn on the cob? Corn on the cob."
  690. },
  691. {
  692. "name": "Protest March",
  693. "desc": "\"We have rights!\" chants the crowd. Unfortunately, they also have calories."
  694. },
  695. {
  696. "name": "Urban Sprawl",
  697. "desc": "What a lovely spread of Hors d'oeuvres!"
  698. },
  699. {
  700. "name": "Sim City",
  701. "desc": "You wouldn't download a city."
  702. }
  703. ],
  704. "metro": [
  705. {
  706. "name": "Suburbia",
  707. "desc": "As far as the eye can see!"
  708. },
  709. {
  710. "name": "Mass Transit",
  711. "desc": "Mass transit? Ass transit."
  712. },
  713. {
  714. "name": "Slackened Building Codes",
  715. "desc": "Who cares about things over 'overcrowding'?"
  716. },
  717. {
  718. "name": "Over-Ground Subway",
  719. "desc": "Putting the subway above-ground makes it a *lot* easier to feed on."
  720. },
  721. {
  722. "name": "No Building Codes",
  723. "desc": "Just cram people inside."
  724. }
  725. ],
  726. "county": [
  727. {
  728. "name": "County Roads",
  729. "desc": "Eh, close enough."
  730. },
  731. {
  732. "name": "Redistricting",
  733. "desc": "Optimize your snacking excursions."
  734. },
  735. {
  736. "name": "Peoplesheds",
  737. "desc": "Like watersheds, but, you know, people."
  738. },
  739. {
  740. "name": "Economic Stimulus",
  741. "desc": "Just kidding! It's just an excuse to devour more people."
  742. },
  743. {
  744. "name": "Giant Pile of People",
  745. "desc": "Literally no pretenses anymore. You're just eating big piles of people."
  746. }
  747. ],
  748. "state": [
  749. {
  750. "name": "States' Rights",
  751. "desc": "...to feed you lots and lots of people."
  752. },
  753. {
  754. "name": "Interstate Commerce",
  755. "desc": "Exports: People. Imports: Not people."
  756. },
  757. {
  758. "name": "Gerrymandering",
  759. "desc": "Unethical? Yes. Illegal? Maybe. Delicious? Absolutely!"
  760. },
  761. {
  762. "name": "State of Hunger",
  763. "desc": "It's a regional emergency! Feed the poor beast!"
  764. },
  765. {
  766. "name": "Arcologies",
  767. "desc": "Just put everyone in one building. One big building."
  768. }
  769. ],
  770. "country": [
  771. {
  772. "name": "Country Roads",
  773. "desc": "Take me hooooooome / to the plaaaaaace / where GULP."
  774. },
  775. {
  776. "name": "Election Mawnth",
  777. "desc": "Get out the vote! Get in the monster!"
  778. },
  779. {
  780. "name": "Voretime Economy",
  781. "desc": "Better than a wartime economy."
  782. },
  783. {
  784. "name": "Two-Party Stomach",
  785. "desc": "We take the parties, and we put them in the stomach. Truly bipartisan!"
  786. },
  787. {
  788. "name": "Civil Vore",
  789. "desc": "I ran out of puns."
  790. },
  791. ],
  792. "continent": [
  793. {
  794. "name": "Continental Drift",
  795. "desc": "Drifting right into your mouth."
  796. },
  797. {
  798. "name": "Queso",
  799. "desc": "To go with the continent chips."
  800. },
  801. {
  802. "name": "More Queso",
  803. "desc": "To go with the queso and the continent chips."
  804. },
  805. {
  806. "name": "Pangaea",
  807. "desc": "It's like a BIG corn chip."
  808. },
  809. {
  810. "name": "Extra Dip",
  811. "desc": "MORE."
  812. }
  813. ],
  814. "planet": [
  815. {
  816. "name": "Flat Earth Rebuttal",
  817. "desc": "A flat earth wouldn't have the chewy center."
  818. },
  819. {
  820. "name": "Extra Quarters",
  821. "desc": "To put in the gumball machine."
  822. },
  823. {
  824. "name": "Earth-Like Planets",
  825. "desc": "They're a *lot* easier to eat than the gas giants."
  826. },
  827. {
  828. "name": "Ringworlds",
  829. "desc": "They're artificial, yes, but they're very nutritious."
  830. },
  831. {
  832. "name": "BFG",
  833. "desc": "The Big Fucking Gumball"
  834. }
  835. ],
  836. "solar-system": [
  837. {
  838. "name": "Sol Survivor",
  839. "desc": "Just kidding! Sol didn't survive."
  840. },
  841. {
  842. "name": "Solar Snacks",
  843. "desc": "Betcha' can't just eat one."
  844. },
  845. {
  846. "name": "Orbital Plain",
  847. "desc": "Sometimes you just want the vanilla flavor."
  848. },
  849. {
  850. "name": "Comet Cruncher",
  851. "desc": "A refreshing icy treat."
  852. },
  853. {
  854. "name": "Vorrery",
  855. "desc": "Orrery. Vorrery. Heh."
  856. }
  857. ],
  858. "galaxy": [
  859. {
  860. "name": "Galactic Hitman",
  861. "desc": "You're basically a hitman, right? You're taking people out."
  862. },
  863. {
  864. "name": "Mass Effect",
  865. "desc": "All of the mass you're eating is gonna have an effect on your waistline."
  866. },
  867. {
  868. "name": "Star Vores",
  869. "desc": "Munch."
  870. },
  871. {
  872. "name": "Star Citizens",
  873. "desc": "I'm sure we'll get to eat them eventually."
  874. },
  875. {
  876. "name": "Good Old Galaxies",
  877. "desc": "There are some great gems out there."
  878. }
  879. ],
  880. "universe": [
  881. {
  882. "name": "Universal Healthcare",
  883. "desc": "Gotta keep everyone in peak condition, right?"
  884. },
  885. {
  886. "name": "Big Crunch",
  887. "desc": "A heckin cromch."
  888. },
  889. {
  890. "name": "Bigger Cosmological Constant",
  891. "desc": "I don't know what this does, but it sure makes things tastier!"
  892. },
  893. {
  894. "name": "Big Bang 2",
  895. "desc": "If the big bang was so good..."
  896. },
  897. {
  898. "name": "Spacetime Salad",
  899. "desc": "Don't forget the quantum salt!"
  900. }
  901. ],
  902. "multiverse": [
  903. {
  904. "name": "Theory of Everything",
  905. "desc": "My theory: everything is edible."
  906. },
  907. {
  908. "name": "Extradimensional Fork",
  909. "desc": "To eat the multiverses with, duh."
  910. },
  911. {
  912. "name": "Multi-Multiverses",
  913. "desc": "Eh, why not?"
  914. },
  915. {
  916. "name": "More Food",
  917. "desc": "We're running out of ideas here."
  918. },
  919. {
  920. "name": "Gorge 2",
  921. "desc": "Coming Soon™"
  922. }
  923. ],
  924. }
  925. let prodAllUpgradeText = [
  926. {
  927. "name": "Sloth Metabolism",
  928. "desc": "Burn those calories. Eventually."
  929. },
  930. {
  931. "name": "Decent Metabolism",
  932. "desc": "Picking up the pace."
  933. },
  934. {
  935. "name": "Perky Metabolism",
  936. "desc": "Sweat a little."
  937. },
  938. {
  939. "name": "Quick Metabolism",
  940. "desc": "Burn those calories."
  941. },
  942. {
  943. "name": "Speedy Metabolism",
  944. "desc": "More prey, more power."
  945. },
  946. {
  947. "name": "Fast Metabolism",
  948. "desc": "You're a furnace. Fueled by people."
  949. },
  950. {
  951. "name": "Powerful Metabolism",
  952. "desc": "Digest them all."
  953. },
  954. {
  955. "name": "Unbelievable Metabolism",
  956. "desc": "Digest them all and more."
  957. },
  958. {
  959. "name": "Supernatural Metabolism",
  960. "desc": "Digest everything."
  961. },
  962. {
  963. "name": "Godly Metabolism",
  964. "desc": "Digest."
  965. }
  966. ]
  967. const clickUpgradeText = [
  968. {
  969. "name": "Grabby Hands",
  970. "desc": "Gathers prey, opens rooftops"
  971. },
  972. {
  973. "name": "Long Tongue",
  974. "desc": "Catches stragglers, tastes architecture"
  975. },
  976. {
  977. "name": "Sharp Eyes",
  978. "desc": "Spots snacks, probably unblinking"
  979. },
  980. {
  981. "name": "Sensitive Nose",
  982. "desc": "Sniffs meals, savors scents"
  983. },
  984. {
  985. "name": "Sensitive Ears",
  986. "desc": "Hears screams, finds leftovers"
  987. },
  988. {
  989. "name": "Greedy Hands",
  990. "desc": "Hoards prey, no leftovers"
  991. },
  992. {
  993. "name": "Nimble Tongue",
  994. "desc": "Snares snacks, without escape"
  995. },
  996. {
  997. "name": "Eagle Eyes",
  998. "desc": "Scans streets, always keen"
  999. },
  1000. {
  1001. "name": "Keen Nose",
  1002. "desc": "Finds prey, never fooled"
  1003. },
  1004. {
  1005. "name": "Perfect Ears",
  1006. "desc": "Senses scuttles, won't relent"
  1007. },
  1008. ]
  1009. const helperUpgradeText = {
  1010. "anthro": {
  1011. "micro": [
  1012. {
  1013. "name": "Gatherers",
  1014. "desc": "Why bother chasing them, really?"
  1015. },
  1016. {
  1017. "name": "Servants",
  1018. "desc": "Why bother walking anywhere, really?"
  1019. },
  1020. ]
  1021. }
  1022. }
  1023. const clickVictimUpgradeText = {
  1024. "anthro": {
  1025. "name": "Same-Size Prey",
  1026. "desc": "Devour an anthro with every click"
  1027. },
  1028. "car": {
  1029. "name": "Car Crusher",
  1030. "desc": "Consume a car with every click"
  1031. },
  1032. "bus": {
  1033. "name": "Bus Buffet",
  1034. "desc": "Swallow an entire bus with every click"
  1035. },
  1036. "house": {
  1037. "name": "Homewrecker",
  1038. "desc": "Eat a home with every click"
  1039. },
  1040. "apartment": {
  1041. "name": "Rent-Seeker",
  1042. "desc": "Guzzle an apartment with every click"
  1043. },
  1044. "block": {
  1045. "name": "Block Breaker",
  1046. "desc": "Gulp an entire block with every click"
  1047. },
  1048. "town": {
  1049. "name": "Town Terrorizer",
  1050. "desc": "Bolt down a whole town with every click"
  1051. },
  1052. "city": {
  1053. "name": "City Cafe",
  1054. "desc": "Feast on an entire city with every click"
  1055. },
  1056. "metro": {
  1057. "name": "Metro Muncher",
  1058. "desc": "Polish off a metropolis with every click"
  1059. },
  1060. "county": {
  1061. "name": "County Glurk",
  1062. "desc": "Ingest an entire county with every click"
  1063. },
  1064. "state": {
  1065. "name": "Stomached State",
  1066. "desc": "Gobble an entire state with every click"
  1067. },
  1068. "country": {
  1069. "name": "Country Chow",
  1070. "desc": "Erase a country with every click"
  1071. },
  1072. "continent": {
  1073. "name": "Continental Drift",
  1074. "desc": "Chow down on a continent with every click"
  1075. },
  1076. "planet": {
  1077. "name": "Popcorn Planets",
  1078. "desc": "Ingest a planet whole with every click"
  1079. },
  1080. "solar-system": {
  1081. "name": "Solar Snacks",
  1082. "desc": "Dine on whole solar systems with every click"
  1083. },
  1084. "galaxy": {
  1085. "name": "Galactic Center",
  1086. "desc": "Dispatch a galaxy with every click"
  1087. },
  1088. "universe": {
  1089. "name": "Universal Predator",
  1090. "desc": "Digest a universe with every click"
  1091. },
  1092. "multiverse": {
  1093. "name": "Omniscience",
  1094. "desc": "Gorge on the multiverse"
  1095. }
  1096. };
  1097. const powerupFreqUpgradeText = [
  1098. {
  1099. name: "All-You-Can-Eat",
  1100. desc: "Pour on the powerups.",
  1101. },
  1102. {
  1103. name: "Buffet",
  1104. desc: "Chow down on more and more.",
  1105. },
  1106. {
  1107. name: "Bottomless Bowl",
  1108. desc: "Eat up!",
  1109. },
  1110. {
  1111. name: "Endless Edibles",
  1112. desc: "For every one you eat, two more appear.",
  1113. },
  1114. {
  1115. name: "UNLIMITED BREADSTICKS",
  1116. desc: "UNLIMITED BREADSTICKS",
  1117. }
  1118. ]
  1119. // to avoid yoinking stuff from global variables directly...
  1120. // state.ownedUpgrades == ownedUpgrades
  1121. // state.resources == resources
  1122. // state.currentProductivity == currentProductivity
  1123. // state.belongings == belongings
  1124. const news = [
  1125. {
  1126. condition: state => {
  1127. return true;
  1128. },
  1129. lines: [
  1130. state => "This is news.",
  1131. state => "This is also news.",
  1132. state => "SPORTS!"
  1133. ]
  1134. }
  1135. ]
  1136. function createNews() {
  1137. createNewsFoodAmount();
  1138. createNewsFoodRate();
  1139. createNewsBuildingCount();
  1140. }
  1141. function createNewsFoodAmount() {
  1142. }
  1143. function createNewsFoodRate() {
  1144. let counter = 0;
  1145. for (let set of newsFoodRateText) {
  1146. const factor = counter;
  1147. news.push({
  1148. condition: state => {
  1149. return state.currentProductivity.food >= 5*Math.pow(10, factor) &&
  1150. state.currentProductivity.food < 5*Math.pow(10, (factor+1))
  1151. },
  1152. lines: set
  1153. });
  1154. counter += 1;
  1155. };
  1156. }
  1157. function createNewsBuildingCount() {
  1158. Object.entries(newsBuildingCountText).forEach(([key, sets]) => {
  1159. for (let [i, set] of sets.entries()) {
  1160. const conditions = [];
  1161. conditions.push(state => state.belongings[key].count >= newsBuildingCountCutoffs[i]);
  1162. news.push({
  1163. condition: state => conditions.every(cond => cond(state)),
  1164. lines: set
  1165. })
  1166. }
  1167. });
  1168. }
  1169. const newsBuildingCountCutoffs = [
  1170. 1,
  1171. 25,
  1172. 50,
  1173. 100
  1174. ]
  1175. const newsFoodRateText = [
  1176. [
  1177. state => "Your neighbors are complaining about the noise",
  1178. state => "You are a very hungry caterpillar"
  1179. ],
  1180. [
  1181. state => "You ate your neighbors",
  1182. state => "Your former neighbors' neighbors are complaining about the noise"
  1183. ],
  1184. [
  1185. state => "You no longer have any neighbors"
  1186. ]
  1187. ]
  1188. const newsBuildingCountText = {
  1189. micro: [
  1190. [
  1191. state => "Micro-only diet: fad or fact? Our experts weigh in."
  1192. ],
  1193. [
  1194. state => "\"I don't have a problem,\" says macro eating " + showBuilding("micro") + " per second",
  1195. state => "\"Isn't it weird how macros eat so many micros?\" asked confused citizen. \"Like, doesn't that mean they're double micros?\""
  1196. ],
  1197. [
  1198. state => "Local macro celebrated for cleaning up the \"unending tide\" of micros"
  1199. ],
  1200. [
  1201. state => "That's a lot of micros."
  1202. ]
  1203. ],
  1204. anthro: [
  1205. [
  1206. state => "\"Nobody liked those guys anyway\" - few people concerned about " + macroDesc.name + "'s newly-acquired taste for people"
  1207. ],
  1208. [
  1209. state => "#FeedThe" + capitalize(macroDesc.species) + " is trending on Twitter."
  1210. ]
  1211. ],
  1212. }
  1213. const powerups = {
  1214. "instant-food": {
  1215. name: "Free Food",
  1216. description: "Tasty!",
  1217. icon: "fa-drumstick-bite",
  1218. prereqs: state => true,
  1219. effect: state => state.resources.food += state.currentProductivity.food * 60,
  1220. popup: (self, e) => {
  1221. clickPopup("GULP!", "gulp", [e.clientX, e.clientY]);
  1222. clickPopup("+60 seconds of food", "food", [e.clientX, e.clientY]);
  1223. }
  1224. },
  1225. "double": {
  1226. name: "Double Dip",
  1227. description: "Doubled productivity!",
  1228. icon: "fa-cogs",
  1229. duration: 10000,
  1230. prereqs: state => true,
  1231. effect: state => state.currentProductivity.food *= 2,
  1232. popup: (self, e) => {
  1233. clickPopup("VROOM!", "gulp", [e.clientX, e.clientY]);
  1234. }
  1235. },
  1236. "click": {
  1237. name: "Chaos Click",
  1238. description: "Ten times the clicking!",
  1239. icon: "fa-hand-pointer",
  1240. duration: 10000,
  1241. prereqs: state => true,
  1242. effect: state => state.clickPowers.clickMultiplier *= 10,
  1243. popup: (self, e) => clickPopup("CLICK TIME!!", "gulp", [e.clientX, e.clientY])
  1244. }
  1245. }
  1246. function createFreeBuildingPowerups() {
  1247. const prefix = "free-";
  1248. Object.entries(freeBuildingPowerupText).forEach(([building, text]) => {
  1249. const key = prefix + building;
  1250. powerups[key] = {
  1251. name: text.name,
  1252. description: text.desc,
  1253. icon: buildings[building].icon,
  1254. prereqs: state => state.belongings[building].count > 0 && state.belongings[building].count < 100,
  1255. effect: state => state.belongings[building].count += 1,
  1256. popup: (self, e) => clickPopup("+1 " + buildings[building].name, "food", [e.clientX, e.clientY])
  1257. }
  1258. });
  1259. }
  1260. const freeBuildingPowerupText = {
  1261. car: {
  1262. name: "Free Car",
  1263. desc: "It's FREE!"
  1264. },
  1265. bus: {
  1266. name: "Deserted Bus",
  1267. desc: "Just kidding. It's full of people."
  1268. }
  1269. }
  1270. deepFreeze(prodUpgradeText);
  1271. deepFreeze(prodAllUpgradeText);
  1272. deepFreeze(clickUpgradeText);
  1273. deepFreeze(helperUpgradeText);
  1274. deepFreeze(clickVictimUpgradeText);
  1275. deepFreeze(powerupFreqUpgradeText);