cookie clicker but bigger
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

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