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.
 
 
 
 

372 line
8.2 KiB

  1. "use strict";
  2. const resourceTypes = {
  3. "food": {
  4. name: "Food"
  5. }
  6. }
  7. const buildings = {
  8. "micro": {
  9. "name": "Micro",
  10. "plural": "Micros",
  11. "desc": "A tasty, squirmy treat.",
  12. "cost": 1e1,
  13. "prod": 1e-1/1
  14. },
  15. "anthro": {
  16. "name": "Anthro",
  17. "plural": "Anthros",
  18. "desc": "Something more substantial to sate your hunger.",
  19. "cost": 1e2,
  20. "prod": 1e0/1.1
  21. },
  22. "car": {
  23. "name": "Car",
  24. "plural": "Cars",
  25. "desc": "Crunchy shell, tasty center.",
  26. "cost": 1.2e3,
  27. "prod": 1e1/1.2
  28. },
  29. "bus": {
  30. "name": "Bus",
  31. "plural": "Buses",
  32. "desc": "Probably the worst place to be when a macro is aroud.",
  33. "cost": 1.4e4,
  34. "prod": 1e2/1.3
  35. },
  36. "house": {
  37. "name": "House",
  38. "plural": "Houses",
  39. "desc": "Home sweet home - but it doesn't taste sweet?",
  40. "cost": 1.6e5,
  41. "prod": 1e3/1.4
  42. },
  43. "apartment": {
  44. "name": "Apartment",
  45. "plural": "Apartments",
  46. "desc": "More snacks, less packaging.",
  47. "cost": 1.8e6,
  48. "prod": 1e4/1.5
  49. },
  50. "block": {
  51. "name": "Block",
  52. "plural": "Blocks",
  53. "desc": "A whole pile of buildings.",
  54. "cost": 2e7,
  55. "prod": 1e5/1.6
  56. },
  57. "town": {
  58. "name": "Town",
  59. "plural": "Towns",
  60. "desc": "'Tourist trap' has never been this literal.",
  61. "cost": 2.2e8,
  62. "prod": 1e6/1.7
  63. },
  64. "city": {
  65. "name": "City",
  66. "plural": "Cities",
  67. "desc": "Please no sitty on our city.",
  68. "cost": 2.4e9,
  69. "prod": 1e7/1.8
  70. },
  71. "metro": {
  72. "name": "Metropolis",
  73. "plural": "Metropolises",
  74. "desc": "A big ol' city. Tasty, too.",
  75. "cost": 2.6e10,
  76. "prod": 1e8/1.9
  77. },
  78. "county": {
  79. "name": "County",
  80. "plural": "Counties",
  81. "desc": "Why salt the land when you can slurp it?",
  82. "cost": 2.8e11,
  83. "prod": 1e9/2
  84. },
  85. "state": {
  86. "name": "State",
  87. "plural": "States",
  88. "desc": "The United States is made up of...43 states - no, 42...",
  89. "cost": 3e12,
  90. "prod": 1e10/2.1
  91. },
  92. "country": {
  93. "name": "Country",
  94. "plural": "Countries",
  95. "desc": "One nation, under paw.",
  96. "cost": 3.2e13,
  97. "prod": 1e11/2.2
  98. },
  99. "continent": {
  100. "name": "Continent",
  101. "plural": "Continents",
  102. "desc": "Earth-shattering appetite!",
  103. "cost": 3.4e14,
  104. "prod": 1e12/2.3
  105. },
  106. "planet": {
  107. "name": "Planet",
  108. "plural": "Planets",
  109. "desc": "Earth appetite!",
  110. "cost": 3.6e15,
  111. "prod": 1e13/2.4
  112. }
  113. }
  114. const effect_types = {
  115. "prod": {
  116. "apply": function(effect, productivity) {
  117. return productivity * effect.amount;
  118. },
  119. "desc": function(effect) {
  120. return round(effect.amount, 2) + "x food production from " + buildings[effect.target].plural;
  121. }
  122. },
  123. "prod-all": {
  124. "apply": function(effect, productivity) {
  125. return productivity * effect.amount;
  126. },
  127. "desc": function(effect) {
  128. return round((effect.amount - 1) * 100) + "% increase to food production";
  129. }
  130. },
  131. "helper": {
  132. "apply": function(effect, productivity, helperCount) {
  133. return productivity * (1 + effect.amount * helperCount);
  134. },
  135. "desc": function(effect) {
  136. return "+" + round(effect.amount * 100) + "% food/sec from " + buildings[effect.helped].name + " for every " + buildings[effect.helper].name + " owned.";
  137. }
  138. }
  139. }
  140. let upgrades = {
  141. "anthro-help-micro-1": {
  142. "name": "Servants",
  143. "desc": "Why bother walking anywhere, really?",
  144. "cost": {
  145. "food": buildings.anthro.cost * 25 + buildings.micro.cost * 50
  146. },
  147. "effects": [
  148. {
  149. "type": "helper",
  150. "helper": "anthro",
  151. "helped": "micro",
  152. "amount": 0.01
  153. }
  154. ],
  155. "prereqs": {
  156. "buildings": {
  157. "anthro": 10
  158. },
  159. "upgrades": [
  160. "anthro-prod-1"
  161. ]
  162. }
  163. }
  164. }
  165. function createTemplateUpgrades() {
  166. console.log("qwewq");
  167. createProdUpgrades();
  168. createProdAllUpgrades();
  169. }
  170. const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100];
  171. function createProdUpgrades() {
  172. for (const [key, value] of Object.entries(prodUpgradeText)) {
  173. let counter = 1;
  174. let prefix = key + "-prod-";
  175. for (let contents of value) {
  176. upgrades[prefix + counter] = {
  177. "name": contents.name,
  178. "desc": contents.desc,
  179. "cost": {
  180. "food": buildings[key].cost * 5 * Math.pow(10,counter - 1)
  181. },
  182. "effects": [
  183. {
  184. "type": "prod",
  185. "amount": 2 + (counter - 1) * 0.25,
  186. "target": key
  187. }
  188. ]
  189. };
  190. upgrades[prefix + counter]["prereqs"] = {};
  191. upgrades[prefix + counter]["prereqs"]["buildings"] = {};
  192. upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1];
  193. if (counter > 1) {
  194. upgrades[prefix + counter]["prereqs"]["upgrades"] = [
  195. prefix + (counter - 1)
  196. ];
  197. }
  198. counter += 1;
  199. }
  200. }
  201. }
  202. function createProdAllUpgrades() {
  203. let prefix = "prod-all-"
  204. let counter = 1;
  205. for (let contents of prodAllUpgradeText) {
  206. upgrades[prefix + counter] = {
  207. "name": contents.name,
  208. "desc": contents.desc,
  209. "cost": {
  210. "food": 5 * Math.pow(10, counter+1)
  211. },
  212. "effects": [
  213. {
  214. "type": "prod-all",
  215. "amount": 1.05
  216. }
  217. ],
  218. "prereqs": {
  219. "productivity": {
  220. "food": Math.pow(10, counter)
  221. }
  222. }
  223. };
  224. if (counter > 1) {
  225. upgrades[prefix + counter]["prereqs"].upgrades = [
  226. prefix + (counter - 1)
  227. ];
  228. }
  229. counter += 1;
  230. }
  231. }
  232. let prodUpgradeText = {
  233. "micro": [
  234. {
  235. "name": "Bigger Micros",
  236. "desc": "A macro micro? It's more filling, for sure.",
  237. },
  238. {
  239. "name": "Beefy Micros",
  240. "desc": "25% more protein, 10% fewer carbs."
  241. },
  242. {
  243. "name": "Delicious Micros",
  244. "desc": "Betcha' can't eat just one."
  245. },
  246. {
  247. "name": "Irresistable Micros",
  248. "desc": "Genetically engineered to be delectable."
  249. },
  250. {
  251. "name": "Exquisite Micros",
  252. "desc": "Dangerously delicious."
  253. }
  254. ],
  255. "anthro": [
  256. {
  257. "name": "Willing Prey",
  258. "desc": "Why bother chasing down your meal?"
  259. },
  260. {
  261. "name": "Fattened Prey",
  262. "desc": "9 calories per gram!"
  263. },
  264. {
  265. "name": "Mesmerized Prey",
  266. "desc": "Why bother walking to your meal?"
  267. },
  268. {
  269. "name": "Food-Safe Lubricant",
  270. "desc": "Ease them down your gullet with ease. Thanks, chemistry!"
  271. },
  272. {
  273. "name": "Mandatory Meal Training",
  274. "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%."
  275. }
  276. ],
  277. "car": [
  278. {
  279. "name": "HOV Lane",
  280. "desc": "Think of the environment! And of your impending digestion, I guess."
  281. },
  282. {
  283. "name": "Lightweight Frames",
  284. "desc": "Although crunchy, the shell around the snacks isn't very appetizing."
  285. },
  286. {
  287. "name": "Traffic Engineering",
  288. "desc": "Maximizing throughput into your gullet."
  289. },
  290. {
  291. "name": "Super Highways",
  292. "desc": "Six lanes! Fresh pavement! A ravenous maw!"
  293. },
  294. {
  295. "name": "Stacked Cars",
  296. "desc": "When we couldn't make the roads any wider, we tried stacking the cars higher."
  297. }
  298. ],
  299. "bus": [
  300. {
  301. "name": "Bus Passes",
  302. "desc": "Save on greenhouse emissions. Save your predator's effort. Everyone wins!"
  303. },
  304. {
  305. "name": "Double Deckers",
  306. "desc": "Stack 'em up! Slurp 'em down!"
  307. },
  308. {
  309. "name": "Articulated Buses",
  310. "desc": "The bend really helps them slip down your throat."
  311. }
  312. ],
  313. "house": [
  314. {
  315. "name": "Remodeling",
  316. "desc": "Strip out that icky asbestos."
  317. },
  318. {
  319. "name": "Suburbia",
  320. "desc": "It's like a buffet line!"
  321. },
  322. ]
  323. }
  324. let prodAllUpgradeText = [
  325. {
  326. "name": "Sloth Metabolism",
  327. "desc": "Burn those calories. Eventually."
  328. },
  329. {
  330. "name": "Decent Metabolism",
  331. "desc": "Picking up the pace."
  332. },
  333. {
  334. "name": "Perky Metabolism",
  335. "desc": "Sweat a little."
  336. },
  337. {
  338. "name": "Quick Metabolism",
  339. "desc": "Burn those calories."
  340. },
  341. {
  342. "name": "Speedy Metabolism",
  343. "desc": "More prey, more power."
  344. },
  345. {
  346. "name": "Fast Metabolism",
  347. "desc": "You're a furnace. Fueled by people."
  348. },
  349. {
  350. "name": "Powerful Metabolism",
  351. "desc": "Digest them all."
  352. }
  353. ]