cookie clicker but bigger
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

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