cookie clicker but bigger
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

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