cookie clicker but bigger
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

1512 Zeilen
33 KiB

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