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.
 
 
 
 

1255 line
27 KiB

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