cookie clicker but bigger
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

1477 řádky
32 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, 25, 50, 75, 100];
  308. const prodUpgradeColors = ["#003f5c","#58508d","#bc5090","#ff6361","#ffa600"];
  309. function createProdUpgrades() {
  310. for (const [key, value] of Object.entries(prodUpgradeText)) {
  311. let counter = 1;
  312. let prefix = key + "-prod-";
  313. for (let contents of value) {
  314. upgrades[prefix + counter] = {
  315. "name": contents.name,
  316. "desc": contents.desc,
  317. "icon": [
  318. { icon: buildings[key].icon, color: prodUpgradeColors[counter] }
  319. ],
  320. "cost": {
  321. "food": buildings[key].cost.food * 5 * Math.pow(10, counter - 1)
  322. },
  323. "effects": [
  324. {
  325. "type": "prod",
  326. "amount": 2 + (counter - 1) * 0.25,
  327. "target": key
  328. }
  329. ]
  330. };
  331. upgrades[prefix + counter]["prereqs"] = {};
  332. upgrades[prefix + counter]["prereqs"]["buildings"] = {};
  333. upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1];
  334. if (counter > 1) {
  335. upgrades[prefix + counter]["prereqs"]["upgrades"] = [
  336. prefix + (counter - 1)
  337. ];
  338. }
  339. counter += 1;
  340. }
  341. }
  342. }
  343. function createProdAllUpgrades() {
  344. let prefix = "prod-all-"
  345. let counter = 1;
  346. for (let contents of prodAllUpgradeText) {
  347. upgrades[prefix + counter] = {
  348. "name": contents.name,
  349. "desc": contents.desc,
  350. "icon": "fa-cogs",
  351. "cost": {
  352. "food": 5 * Math.pow(10, counter + 1)
  353. },
  354. "effects": [
  355. {
  356. "type": "prod-all",
  357. "amount": 1.05
  358. }
  359. ],
  360. "prereqs": {
  361. "productivity": {
  362. "food": Math.pow(10, counter)
  363. }
  364. }
  365. };
  366. if (counter > 1) {
  367. upgrades[prefix + counter]["prereqs"].upgrades = [
  368. prefix + (counter - 1)
  369. ];
  370. }
  371. counter += 1;
  372. }
  373. }
  374. function createClickUpgrades() {
  375. let prefix = "prod-click-";
  376. let counter = 1;
  377. for (let contents of clickUpgradeText) {
  378. upgrades[prefix + counter] = {
  379. name: contents.name,
  380. desc: contents.desc,
  381. icon: "fa-hand-pointer",
  382. cost: {
  383. food: Math.pow(10, (counter * 2) + 1)
  384. },
  385. effects: [
  386. {
  387. type: "click",
  388. amount: 0.01
  389. }
  390. ],
  391. prereqs: {
  392. productivity: {
  393. food: Math.pow(10, counter)
  394. }
  395. }
  396. };
  397. if (counter > 1) {
  398. upgrades[prefix + counter]["prereqs"].upgrades = [
  399. prefix + (counter - 1)
  400. ];
  401. }
  402. counter += 1;
  403. }
  404. }
  405. function createHelperUpgrades() {
  406. const infix = "-help-";
  407. Object.entries(helperUpgradeText).forEach(([helper, helpees]) => {
  408. const prefix = helper;
  409. Object.entries(helpees).forEach(([helped, texts]) => {
  410. const suffix = helped;
  411. let counter = 1;
  412. for (let text of texts) {
  413. const key = prefix + infix + suffix + "-" + counter;
  414. upgrades[key] = {
  415. "name": text.name,
  416. "desc": text.desc,
  417. "icon": "fa-hand-holding",
  418. "cost": {
  419. "food": buildings[helper].cost.food * 25 * counter + buildings[helped].cost.food * 50 * counter
  420. },
  421. "effects": [
  422. {
  423. "type": "helper",
  424. "helper": helper,
  425. "helped": helped,
  426. "amount": 0.01 * counter
  427. }
  428. ],
  429. "prereqs": {
  430. "buildings": {
  431. },
  432. "upgrades": [
  433. helper + "-prod-1"
  434. ]
  435. }
  436. };
  437. upgrades[key]["prereqs"]["buildings"][helper] = 10 * counter;
  438. if (counter > 1) {
  439. upgrades[key]["prereqs"]["upgrades"].push(prefix + infix + suffix + "-" + (counter - 1))
  440. }
  441. counter += 1;
  442. }
  443. });
  444. });
  445. }
  446. function createClickVictimUpgrades() {
  447. const prefix = "click-";
  448. let counter = 1;
  449. let previous = "micro";
  450. Object.entries(clickVictimUpgradeText).forEach(([key, text]) => {
  451. upgrades[prefix + key] = {
  452. "name": text.name,
  453. "desc": text.desc,
  454. "icon": buildings[key].icon,
  455. "cost": {
  456. "food": 1000 * Math.pow(10, counter)
  457. },
  458. "effects": [
  459. {
  460. "type": "click-victim",
  461. "id": key
  462. }
  463. ],
  464. "prereqs": {
  465. "upgrades": [
  466. ]
  467. }
  468. };
  469. if (counter > 1) {
  470. upgrades[prefix + key].prereqs.upgrades.push(prefix + previous);
  471. }
  472. counter += 1;
  473. previous = key;
  474. });
  475. }
  476. function createPowerupFreqUpgrades() {
  477. const prefix = "powerup-freq-";
  478. let counter = 1;
  479. powerupFreqUpgradeText.forEach(text => {
  480. upgrades[prefix + counter] = {
  481. "name": text.name,
  482. "desc": text.desc,
  483. "icon": "fa-drumstick-bite",
  484. "cost": {
  485. "powerups": 5 * counter
  486. },
  487. "effects": [
  488. {
  489. "type": "powerup-freq",
  490. "id": prefix + counter,
  491. "amount": 0.75 + 0.03 * (counter - 1)
  492. }
  493. ],
  494. "prereqs": {
  495. "upgrades": [
  496. ],
  497. "stats": {
  498. "powerups": 1
  499. }
  500. }
  501. };
  502. if (counter > 1) {
  503. upgrades[prefix + counter].prereqs.upgrades.push(prefix + (counter - 1));
  504. }
  505. counter += 1;
  506. });
  507. }
  508. let prodUpgradeText = {
  509. "micro": [
  510. {
  511. "name": "Bigger Micros",
  512. "desc": "A macro micro? It's more filling, for sure.",
  513. },
  514. {
  515. "name": "Beefy Micros",
  516. "desc": "25% more protein, 10% fewer carbs."
  517. },
  518. {
  519. "name": "Delicious Micros",
  520. "desc": "Betcha' can't eat just one."
  521. },
  522. {
  523. "name": "Irresistable Micros",
  524. "desc": "Genetically engineered to be delectable."
  525. },
  526. {
  527. "name": "Exquisite Micros",
  528. "desc": "Dangerously delicious."
  529. }
  530. ],
  531. "anthro": [
  532. {
  533. "name": "Willing Prey",
  534. "desc": "Why bother chasing down your meal?"
  535. },
  536. {
  537. "name": "Fattened Prey",
  538. "desc": "9 calories per gram!"
  539. },
  540. {
  541. "name": "Mesmerized Prey",
  542. "desc": "Why bother walking to your meal?"
  543. },
  544. {
  545. "name": "Food-Safe Lubricant",
  546. "desc": "Ease them down your gullet with ease. Thanks, chemistry!"
  547. },
  548. {
  549. "name": "Mandatory Meal Training",
  550. "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%."
  551. }
  552. ],
  553. "car": [
  554. {
  555. "name": "HOV Lane",
  556. "desc": "Think of the environment! And of your impending digestion, I guess."
  557. },
  558. {
  559. "name": "Lightweight Frames",
  560. "desc": "Although crunchy, the shell around the snacks isn't very appetizing."
  561. },
  562. {
  563. "name": "Traffic Engineering",
  564. "desc": "Maximizing throughput into your gullet."
  565. },
  566. {
  567. "name": "Super Highways",
  568. "desc": "Six lanes! Fresh pavement! A ravenous maw!"
  569. },
  570. {
  571. "name": "Stacked Cars",
  572. "desc": "When we couldn't make the roads any wider, we tried stacking the cars higher."
  573. }
  574. ],
  575. "bus": [
  576. {
  577. "name": "Bus Passes",
  578. "desc": "Save on greenhouse emissions. Save your predator's effort. Everyone wins!"
  579. },
  580. {
  581. "name": "Double Deckers",
  582. "desc": "Stack 'em up! Slurp 'em down!"
  583. },
  584. {
  585. "name": "Articulated Buses",
  586. "desc": "The bend really helps them slip down your throat."
  587. },
  588. {
  589. "name": "Tour Buses",
  590. "desc": "People come from around the world to see your intestinal tract.",
  591. },
  592. {
  593. "name": "Double Double Deckers",
  594. "desc": "Hard to swallow, true, but filling nonetheless."
  595. }
  596. ],
  597. "house": [
  598. {
  599. "name": "Second Story",
  600. "desc": "Twice as many snacks, half as much chewing."
  601. },
  602. {
  603. "name": "Remodeling",
  604. "desc": "Strip out that icky asbestos."
  605. },
  606. {
  607. "name": "Smaller Yards",
  608. "desc": "Less wasted space. More wasted homes."
  609. },
  610. {
  611. "name": "House Parties",
  612. "desc": "More people! More party! More prey!"
  613. },
  614. {
  615. "name": "Suburbia",
  616. "desc": "It's like a buffet line!"
  617. }
  618. ],
  619. "apartment": [
  620. {
  621. "name": "Rent Subsidies",
  622. "desc": "Encourage high-density living. Enjoy the result."
  623. },
  624. {
  625. "name": "High-Rises",
  626. "desc": "These sure are some Tilted Towers..."
  627. },
  628. {
  629. "name": "Reverse Eviction",
  630. "desc": "Forcibly putting people IN your lunch!"
  631. },
  632. {
  633. "name": "Higher High-Rises",
  634. "desc": "Almost as tall as you! Almost."
  635. },
  636. {
  637. "name": "Vertical Beds",
  638. "desc": "You can fit way more people in a studio apartment with this one weird tip..."
  639. }
  640. ],
  641. "block": [
  642. {
  643. "name": "Street Sweepers",
  644. "desc": "Keeps the gunk off the sidewalk, and thus, off your tongue."
  645. },
  646. {
  647. "name": "Zoning Laws",
  648. "desc": "Mandatory prey-per-square-meter requirements."
  649. },
  650. {
  651. "name": "Alleyway Appetizers",
  652. "desc": "You can fit people *between* the buildings."
  653. },
  654. {
  655. "name": "Block Party",
  656. "desc": "Everyone's invited!"
  657. },
  658. {
  659. "name": "Vertical Blocks",
  660. "desc": "There's no reason you can't stack them on top of each other, right?"
  661. }
  662. ],
  663. "town": [
  664. {
  665. "name": "Going to Town",
  666. "desc": "That's where the food is."
  667. },
  668. {
  669. "name": "Going to Town, II: Revelations",
  670. "desc": "That's where the food is, again."
  671. },
  672. {
  673. "name": "Going to Town 0: Origins",
  674. "desc": "That's where the food was."
  675. },
  676. {
  677. "name": "Going to Town III: Revengeance",
  678. "desc": "Look, it's just how nature works. Food gets ate."
  679. },
  680. {
  681. "name": "Going to Town IV: Endgame",
  682. "desc": "Food IS something one considers when eating the universe."
  683. }
  684. ],
  685. "city": [
  686. {
  687. "name": "Gridlock",
  688. "desc": "Keeps people within arm's reach."
  689. },
  690. {
  691. "name": "Skyscrapers",
  692. "desc": "Corn on the cob? Corn on the cob."
  693. },
  694. {
  695. "name": "Protest March",
  696. "desc": "\"We have rights!\" chants the crowd. Unfortunately, they also have calories."
  697. },
  698. {
  699. "name": "Urban Sprawl",
  700. "desc": "What a lovely spread of Hors d'oeuvres!"
  701. },
  702. {
  703. "name": "Sim City",
  704. "desc": "You wouldn't download a city."
  705. }
  706. ],
  707. "metro": [
  708. {
  709. "name": "Suburbia",
  710. "desc": "As far as the eye can see!"
  711. },
  712. {
  713. "name": "Mass Transit",
  714. "desc": "Mass transit? Ass transit."
  715. },
  716. {
  717. "name": "Slackened Building Codes",
  718. "desc": "Who cares about things over 'overcrowding'?"
  719. },
  720. {
  721. "name": "Over-Ground Subway",
  722. "desc": "Putting the subway above-ground makes it a *lot* easier to feed on."
  723. },
  724. {
  725. "name": "No Building Codes",
  726. "desc": "Just cram people inside."
  727. }
  728. ],
  729. "county": [
  730. {
  731. "name": "County Roads",
  732. "desc": "Eh, close enough."
  733. },
  734. {
  735. "name": "Redistricting",
  736. "desc": "Optimize your snacking excursions."
  737. },
  738. {
  739. "name": "Peoplesheds",
  740. "desc": "Like watersheds, but, you know, people."
  741. },
  742. {
  743. "name": "Economic Stimulus",
  744. "desc": "Just kidding! It's just an excuse to devour more people."
  745. },
  746. {
  747. "name": "Giant Pile of People",
  748. "desc": "Literally no pretenses anymore. You're just eating big piles of people."
  749. }
  750. ],
  751. "state": [
  752. {
  753. "name": "States' Rights",
  754. "desc": "...to feed you lots and lots of people."
  755. },
  756. {
  757. "name": "Interstate Commerce",
  758. "desc": "Exports: People. Imports: Not people."
  759. },
  760. {
  761. "name": "Gerrymandering",
  762. "desc": "Unethical? Yes. Illegal? Maybe. Delicious? Absolutely!"
  763. },
  764. {
  765. "name": "State of Hunger",
  766. "desc": "It's a regional emergency! Feed the poor beast!"
  767. },
  768. {
  769. "name": "Arcologies",
  770. "desc": "Just put everyone in one building. One big building."
  771. }
  772. ],
  773. "country": [
  774. {
  775. "name": "Country Roads",
  776. "desc": "Take me hooooooome / to the plaaaaaace / where GULP."
  777. },
  778. {
  779. "name": "Election Mawnth",
  780. "desc": "Get out the vote! Get in the monster!"
  781. },
  782. {
  783. "name": "Voretime Economy",
  784. "desc": "Better than a wartime economy."
  785. },
  786. {
  787. "name": "Two-Party Stomach",
  788. "desc": "We take the parties, and we put them in the stomach. Truly bipartisan!"
  789. },
  790. {
  791. "name": "Civil Vore",
  792. "desc": "I ran out of puns."
  793. },
  794. ],
  795. "continent": [
  796. {
  797. "name": "Continental Drift",
  798. "desc": "Drifting right into your mouth."
  799. },
  800. {
  801. "name": "Queso",
  802. "desc": "To go with the continent chips."
  803. },
  804. {
  805. "name": "More Queso",
  806. "desc": "To go with the queso and the continent chips."
  807. },
  808. {
  809. "name": "Pangaea",
  810. "desc": "It's like a BIG corn chip."
  811. },
  812. {
  813. "name": "Extra Dip",
  814. "desc": "MORE."
  815. }
  816. ],
  817. "planet": [
  818. {
  819. "name": "Flat Earth Rebuttal",
  820. "desc": "A flat earth wouldn't have the chewy center."
  821. },
  822. {
  823. "name": "Extra Quarters",
  824. "desc": "To put in the gumball machine."
  825. },
  826. {
  827. "name": "Earth-Like Planets",
  828. "desc": "They're a *lot* easier to eat than the gas giants."
  829. },
  830. {
  831. "name": "Ringworlds",
  832. "desc": "They're artificial, yes, but they're very nutritious."
  833. },
  834. {
  835. "name": "BFG",
  836. "desc": "The Big Fucking Gumball"
  837. }
  838. ],
  839. "solar-system": [
  840. {
  841. "name": "Sol Survivor",
  842. "desc": "Just kidding! Sol didn't survive."
  843. },
  844. {
  845. "name": "Solar Snacks",
  846. "desc": "Betcha' can't just eat one."
  847. },
  848. {
  849. "name": "Orbital Plain",
  850. "desc": "Sometimes you just want the vanilla flavor."
  851. },
  852. {
  853. "name": "Comet Cruncher",
  854. "desc": "A refreshing icy treat."
  855. },
  856. {
  857. "name": "Vorrery",
  858. "desc": "Orrery. Vorrery. Heh."
  859. }
  860. ],
  861. "galaxy": [
  862. {
  863. "name": "Galactic Hitman",
  864. "desc": "You're basically a hitman, right? You're taking people out."
  865. },
  866. {
  867. "name": "Mass Effect",
  868. "desc": "All of the mass you're eating is gonna have an effect on your waistline."
  869. },
  870. {
  871. "name": "Star Vores",
  872. "desc": "Munch."
  873. },
  874. {
  875. "name": "Star Citizens",
  876. "desc": "I'm sure we'll get to eat them eventually."
  877. },
  878. {
  879. "name": "Good Old Galaxies",
  880. "desc": "There are some great gems out there."
  881. }
  882. ],
  883. "universe": [
  884. {
  885. "name": "Universal Healthcare",
  886. "desc": "Gotta keep everyone in peak condition, right?"
  887. },
  888. {
  889. "name": "Big Crunch",
  890. "desc": "A heckin cromch."
  891. },
  892. {
  893. "name": "Bigger Cosmological Constant",
  894. "desc": "I don't know what this does, but it sure makes things tastier!"
  895. },
  896. {
  897. "name": "Big Bang 2",
  898. "desc": "If the big bang was so good..."
  899. },
  900. {
  901. "name": "Spacetime Salad",
  902. "desc": "Don't forget the quantum salt!"
  903. }
  904. ],
  905. "multiverse": [
  906. {
  907. "name": "Theory of Everything",
  908. "desc": "My theory: everything is edible."
  909. },
  910. {
  911. "name": "Extradimensional Fork",
  912. "desc": "To eat the multiverses with, duh."
  913. },
  914. {
  915. "name": "Multi-Multiverses",
  916. "desc": "Eh, why not?"
  917. },
  918. {
  919. "name": "More Food",
  920. "desc": "We're running out of ideas here."
  921. },
  922. {
  923. "name": "Gorge 2",
  924. "desc": "Coming Soon™"
  925. }
  926. ],
  927. }
  928. let prodAllUpgradeText = [
  929. {
  930. "name": "Sloth Metabolism",
  931. "desc": "Burn those calories. Eventually."
  932. },
  933. {
  934. "name": "Decent Metabolism",
  935. "desc": "Picking up the pace."
  936. },
  937. {
  938. "name": "Perky Metabolism",
  939. "desc": "Sweat a little."
  940. },
  941. {
  942. "name": "Quick Metabolism",
  943. "desc": "Burn those calories."
  944. },
  945. {
  946. "name": "Speedy Metabolism",
  947. "desc": "More prey, more power."
  948. },
  949. {
  950. "name": "Fast Metabolism",
  951. "desc": "You're a furnace. Fueled by people."
  952. },
  953. {
  954. "name": "Powerful Metabolism",
  955. "desc": "Digest them all."
  956. },
  957. {
  958. "name": "Unbelievable Metabolism",
  959. "desc": "Digest them all and more."
  960. },
  961. {
  962. "name": "Supernatural Metabolism",
  963. "desc": "Digest everything."
  964. },
  965. {
  966. "name": "Godly Metabolism",
  967. "desc": "Digest."
  968. }
  969. ]
  970. const clickUpgradeText = [
  971. {
  972. "name": "Grabby Hands",
  973. "desc": "Gathers prey, opens rooftops"
  974. },
  975. {
  976. "name": "Long Tongue",
  977. "desc": "Catches stragglers, tastes architecture"
  978. },
  979. {
  980. "name": "Sharp Eyes",
  981. "desc": "Spots snacks, probably unblinking"
  982. },
  983. {
  984. "name": "Sensitive Nose",
  985. "desc": "Sniffs meals, savors scents"
  986. },
  987. {
  988. "name": "Sensitive Ears",
  989. "desc": "Hears screams, finds leftovers"
  990. },
  991. {
  992. "name": "Greedy Hands",
  993. "desc": "Hoards prey, no leftovers"
  994. },
  995. {
  996. "name": "Nimble Tongue",
  997. "desc": "Snares snacks, without escape"
  998. },
  999. {
  1000. "name": "Eagle Eyes",
  1001. "desc": "Scans streets, always keen"
  1002. },
  1003. {
  1004. "name": "Keen Nose",
  1005. "desc": "Finds prey, never fooled"
  1006. },
  1007. {
  1008. "name": "Perfect Ears",
  1009. "desc": "Senses scuttles, won't relent"
  1010. },
  1011. ]
  1012. const helperUpgradeText = {
  1013. "anthro": {
  1014. "micro": [
  1015. {
  1016. "name": "Gatherers",
  1017. "desc": "Why bother chasing them, really?"
  1018. },
  1019. {
  1020. "name": "Servants",
  1021. "desc": "Why bother walking anywhere, really?"
  1022. },
  1023. ]
  1024. }
  1025. }
  1026. const clickVictimUpgradeText = {
  1027. "anthro": {
  1028. "name": "Same-Size Prey",
  1029. "desc": "Devour an anthro with every click"
  1030. },
  1031. "car": {
  1032. "name": "Car Crusher",
  1033. "desc": "Consume a car with every click"
  1034. },
  1035. "bus": {
  1036. "name": "Bus Buffet",
  1037. "desc": "Swallow an entire bus with every click"
  1038. },
  1039. "house": {
  1040. "name": "Homewrecker",
  1041. "desc": "Eat a home with every click"
  1042. },
  1043. "apartment": {
  1044. "name": "Rent-Seeker",
  1045. "desc": "Guzzle an apartment with every click"
  1046. },
  1047. "block": {
  1048. "name": "Block Breaker",
  1049. "desc": "Gulp an entire block with every click"
  1050. },
  1051. "town": {
  1052. "name": "Town Terrorizer",
  1053. "desc": "Bolt down a whole town with every click"
  1054. },
  1055. "city": {
  1056. "name": "City Cafe",
  1057. "desc": "Feast on an entire city with every click"
  1058. },
  1059. "metro": {
  1060. "name": "Metro Muncher",
  1061. "desc": "Polish off a metropolis with every click"
  1062. },
  1063. "county": {
  1064. "name": "County Glurk",
  1065. "desc": "Ingest an entire county with every click"
  1066. },
  1067. "state": {
  1068. "name": "Stomached State",
  1069. "desc": "Gobble an entire state with every click"
  1070. },
  1071. "country": {
  1072. "name": "Country Chow",
  1073. "desc": "Erase a country with every click"
  1074. },
  1075. "continent": {
  1076. "name": "Continental Drift",
  1077. "desc": "Chow down on a continent with every click"
  1078. },
  1079. "planet": {
  1080. "name": "Popcorn Planets",
  1081. "desc": "Ingest a planet whole with every click"
  1082. },
  1083. "solar-system": {
  1084. "name": "Solar Snacks",
  1085. "desc": "Dine on whole solar systems with every click"
  1086. },
  1087. "galaxy": {
  1088. "name": "Galactic Center",
  1089. "desc": "Dispatch a galaxy with every click"
  1090. },
  1091. "universe": {
  1092. "name": "Universal Predator",
  1093. "desc": "Digest a universe with every click"
  1094. },
  1095. "multiverse": {
  1096. "name": "Omniscience",
  1097. "desc": "Gorge on the multiverse"
  1098. }
  1099. };
  1100. const powerupFreqUpgradeText = [
  1101. {
  1102. name: "All-You-Can-Eat",
  1103. desc: "Pour on the powerups.",
  1104. },
  1105. {
  1106. name: "Buffet",
  1107. desc: "Chow down on more and more.",
  1108. },
  1109. {
  1110. name: "Bottomless Bowl",
  1111. desc: "Eat up!",
  1112. },
  1113. {
  1114. name: "Endless Edibles",
  1115. desc: "For every one you eat, two more appear.",
  1116. },
  1117. {
  1118. name: "UNLIMITED BREADSTICKS",
  1119. desc: "UNLIMITED BREADSTICKS",
  1120. }
  1121. ]
  1122. // to avoid yoinking stuff from global variables directly...
  1123. // state.ownedUpgrades == ownedUpgrades
  1124. // state.resources == resources
  1125. // state.currentProductivity == currentProductivity
  1126. // state.belongings == belongings
  1127. const news = [
  1128. {
  1129. condition: state => {
  1130. return true;
  1131. },
  1132. lines: [
  1133. state => "This is news.",
  1134. state => "This is also news.",
  1135. state => "SPORTS!"
  1136. ]
  1137. }
  1138. ]
  1139. function createNews() {
  1140. createNewsFoodAmount();
  1141. createNewsFoodRate();
  1142. createNewsBuildingCount();
  1143. }
  1144. function createNewsFoodAmount() {
  1145. }
  1146. function createNewsFoodRate() {
  1147. let counter = 0;
  1148. for (let set of newsFoodRateText) {
  1149. const factor = counter;
  1150. let cond;
  1151. if (counter + 1 == newsFoodRateText.length) {
  1152. cond = state => {
  1153. return state.currentProductivity.food >= 5*Math.pow(10, factor)
  1154. }
  1155. } else {
  1156. cond = state => {
  1157. return state.currentProductivity.food >= 5*Math.pow(10, factor) &&
  1158. state.currentProductivity.food < 5*Math.pow(10, (factor+1))
  1159. }
  1160. }
  1161. news.push({
  1162. condition: cond,
  1163. lines: set
  1164. });
  1165. counter += 1;
  1166. };
  1167. }
  1168. function createNewsBuildingCount() {
  1169. Object.entries(newsBuildingCountText).forEach(([key, sets]) => {
  1170. for (let [i, set] of sets.entries()) {
  1171. const conditions = [];
  1172. conditions.push(state => state.belongings[key].count >= newsBuildingCountCutoffs[i]);
  1173. news.push({
  1174. condition: state => conditions.every(cond => cond(state)),
  1175. lines: set
  1176. })
  1177. }
  1178. });
  1179. }
  1180. const newsBuildingCountCutoffs = [
  1181. 1,
  1182. 25,
  1183. 50,
  1184. 100
  1185. ]
  1186. const newsFoodRateText = [
  1187. [
  1188. state => "Your neighbors are complaining about the noise",
  1189. state => "You are a very hungry caterpillar",
  1190. state => "You're hungry enough to eat an entire burger"
  1191. ],
  1192. [
  1193. state => "You ate your neighbors",
  1194. state => "Your former neighbors' neighbors are complaining about the noise",
  1195. state => "You're hungry enough to eat a whole turkey",
  1196. ],
  1197. [
  1198. state => "You no longer have any neighbors",
  1199. state => "You're hungry enough to eat a whole person"
  1200. ],
  1201. [
  1202. state => "You're hungry eonugh to eat a whole bunch of people"
  1203. ],
  1204. [
  1205. state => "You're hungry enough to eat a LOT of people"
  1206. ],
  1207. [
  1208. state => "You're very hungry"
  1209. ]
  1210. ]
  1211. const newsBuildingCountText = {
  1212. micro: [
  1213. [
  1214. state => "Micro-only diet: fad or fact? Our experts weigh in."
  1215. ],
  1216. [
  1217. state => "\"I don't have a problem,\" says macro eating " + showBuilding("micro") + " per second",
  1218. state => "\"Isn't it weird how macros eat so many micros?\" asked confused citizen. \"Like, doesn't that mean they're double micros?\""
  1219. ],
  1220. [
  1221. state => "Local macro celebrated for cleaning up the \"unending tide\" of micros"
  1222. ],
  1223. [
  1224. state => "That's a lot of micros."
  1225. ]
  1226. ],
  1227. anthro: [
  1228. [
  1229. state => "\"Nobody liked those guys anyway\" - few people concerned about " + macroDesc.name + "'s newly-acquired taste for people"
  1230. ],
  1231. [
  1232. state => "#FeedThe" + capitalize(macroDesc.species) + " is trending on Twitter."
  1233. ]
  1234. ],
  1235. car: [
  1236. [
  1237. state => "Car insurance premiums up " + (state.belongings.car.count * 3 + 12) + "%. Why? Our experts weigh in."
  1238. ]
  1239. ],
  1240. bus: [
  1241. [
  1242. state => "Macro craze fuels explosion in bus ridership."
  1243. ]
  1244. ],
  1245. house: [
  1246. [
  1247. state => "Property values skyrocket as the huge " + macroDesc.species + " starts munching on buildings."
  1248. ],
  1249. [
  1250. state => "\"Full House\" eclipsed by new sitcom, \"Full Of House\""
  1251. ]
  1252. ],
  1253. apartment: [
  1254. [
  1255. state => "Construction is booming thanks to the macro's thooming"
  1256. ]
  1257. ],
  1258. block: [
  1259. [
  1260. state => "BLOCK PARTY! WOOO!"
  1261. ]
  1262. ],
  1263. town: [
  1264. [
  1265. state => "Yes, we get it. " + macroDesc.name + " is going to town. Good one."
  1266. ]
  1267. ],
  1268. city: [
  1269. [
  1270. state => "Public opinion remains indifferent about consumption of whole cities - \"downtown was kind of ugly; someone had to take intiative,\" claims local citizen."
  1271. ]
  1272. ],
  1273. metro: [
  1274. [
  1275. state => "What is a metro? Why did " + macroDesc.name + " start eating them? Our experts weigh in."
  1276. ]
  1277. ],
  1278. county: [
  1279. [
  1280. state => "\"Obviously,\" says an unfazed governor, \"we didn't really need that many counties. No need to worry."
  1281. ]
  1282. ],
  1283. state: [
  1284. [
  1285. state => "State munch"
  1286. ]
  1287. ],
  1288. country: [
  1289. [
  1290. state => "Country munch"
  1291. ]
  1292. ],
  1293. continent: [
  1294. [
  1295. state => "Continent munch"
  1296. ]
  1297. ],
  1298. planet: [
  1299. [
  1300. state => "Planet munch"
  1301. ]
  1302. ],
  1303. "solar-system": [
  1304. [
  1305. state => "Solar system munch"
  1306. ]
  1307. ],
  1308. galaxy: [
  1309. [
  1310. state => "Galaxy munch"
  1311. ]
  1312. ],
  1313. universe: [
  1314. [
  1315. state => "Universe munch"
  1316. ]
  1317. ],
  1318. multiverse: [
  1319. [
  1320. state => "Multiverse munch"
  1321. ]
  1322. ],
  1323. }
  1324. const powerups = {
  1325. "instant-food": {
  1326. name: "Free Food",
  1327. description: "Tasty!",
  1328. icon: "fa-drumstick-bite",
  1329. prereqs: state => true,
  1330. effect: state => state.resources.food += state.currentProductivity.food * 60,
  1331. popup: (self, e) => {
  1332. clickPopup("GULP!", "gulp", [e.clientX, e.clientY]);
  1333. clickPopup("+60 seconds of food", "food", [e.clientX, e.clientY]);
  1334. }
  1335. },
  1336. "double": {
  1337. name: "Double Dip",
  1338. description: "Doubled productivity!",
  1339. icon: "fa-cogs",
  1340. duration: 10000,
  1341. prereqs: state => true,
  1342. effect: state => state.currentProductivity.food *= 2,
  1343. popup: (self, e) => {
  1344. clickPopup("VROOM!", "gulp", [e.clientX, e.clientY]);
  1345. }
  1346. },
  1347. "click": {
  1348. name: "Chaos Click",
  1349. description: "Ten times the clicking!",
  1350. icon: "fa-hand-pointer",
  1351. duration: 10000,
  1352. prereqs: state => true,
  1353. effect: state => state.clickPowers.clickMultiplier *= 10,
  1354. popup: (self, e) => clickPopup("CLICK TIME!!", "gulp", [e.clientX, e.clientY])
  1355. }
  1356. }
  1357. function createFreeBuildingPowerups() {
  1358. const prefix = "free-";
  1359. Object.entries(freeBuildingPowerupText).forEach(([building, text]) => {
  1360. const key = prefix + building;
  1361. powerups[key] = {
  1362. name: text.name,
  1363. description: text.desc,
  1364. icon: buildings[building].icon,
  1365. prereqs: state => state.belongings[building].count > 0 && state.belongings[building].count < 100,
  1366. effect: state => state.belongings[building].count += 1,
  1367. popup: (self, e) => clickPopup("+1 " + buildings[building].name, "food", [e.clientX, e.clientY])
  1368. }
  1369. });
  1370. }
  1371. const freeBuildingPowerupText = {
  1372. car: {
  1373. name: "Free Car",
  1374. desc: "It's FREE!"
  1375. },
  1376. bus: {
  1377. name: "Deserted Bus",
  1378. desc: "Just kidding. It's full of people."
  1379. }
  1380. }
  1381. const statTypes = {
  1382. powerups: {
  1383. name: "Powerups Clicked"
  1384. },
  1385. seconds: {
  1386. name: "Seconds Played"
  1387. },
  1388. clicks: {
  1389. name: "Clicks"
  1390. }
  1391. }
  1392. const options = {
  1393. name: {
  1394. name: "Your name",
  1395. type: "text",
  1396. set: value => macroDesc.name = value,
  1397. get: () => macroDesc.name
  1398. },
  1399. species: {
  1400. name: "Your species",
  1401. type: "text",
  1402. set: value => macroDesc.species = value,
  1403. get: () => macroDesc.species
  1404. }
  1405. }
  1406. deepFreeze(prodUpgradeText);
  1407. deepFreeze(prodAllUpgradeText);
  1408. deepFreeze(clickUpgradeText);
  1409. deepFreeze(helperUpgradeText);
  1410. deepFreeze(clickVictimUpgradeText);
  1411. deepFreeze(powerupFreqUpgradeText);