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ů.
 
 
 
 

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