cookie clicker but bigger
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

1263 lignes
28 KiB

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