cookie clicker but bigger
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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