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.
 
 
 
 

394 line
7.4 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": 1e3,
  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": 1e4,
  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": 1e5,
  41. "prod": 1e3/1.4
  42. },
  43. "apartment": {
  44. "name": "Apartment",
  45. "plural": "Apartments",
  46. "desc": "More snacks, less packaging.",
  47. "cost": 1e6,
  48. "prod": 1e4/1.5
  49. },
  50. "block": {
  51. "name": "Block",
  52. "plural": "Blocks",
  53. "desc": "A whole pile of buildings.",
  54. "cost": 1e7,
  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": 1e8,
  62. "prod": 1e6/1.7
  63. },
  64. "city": {
  65. "name": "City",
  66. "plural": "Cities",
  67. "desc": "Please no sitty on our city.",
  68. "cost": 1e9,
  69. "prod": 1e7/1.8
  70. },
  71. "metro": {
  72. "name": "Metropolis",
  73. "plural": "Metropolises",
  74. "desc": "A big ol' city. Tasty, too.",
  75. "cost": 1e10,
  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": 1e11,
  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": 1e12,
  90. "prod": 1e10/2.1
  91. },
  92. "country": {
  93. "name": "Country",
  94. "plural": "Countries",
  95. "desc": "One nation, under paw.",
  96. "cost": 1e13,
  97. "prod": 1e11/2.2
  98. },
  99. "continent": {
  100. "name": "Continent",
  101. "plural": "Continents",
  102. "desc": "Earth-shattering appetite!",
  103. "cost": 1e14,
  104. "prod": 1e12/2.3
  105. },
  106. "planet": {
  107. "name": "Planet",
  108. "plural": "Planets",
  109. "desc": "Earth appetite!",
  110. "cost": 1e15,
  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. const upgrades = {
  141. "micro-prod-1": {
  142. "name": "Bigger Micros",
  143. "desc": "A macro micro? Certainly more filling.",
  144. "cost": {
  145. "food": buildings.micro.cost * 10
  146. },
  147. "effects": [
  148. {
  149. "type": "prod",
  150. "target": "micro",
  151. "amount": 2,
  152. }
  153. ],
  154. "prereqs": {
  155. "buildings": {
  156. "micro": 1
  157. }
  158. }
  159. },
  160. "micro-prod-2": {
  161. "name": "Beefy Micros",
  162. "desc": "25% more protein, 10% fewer carbs.",
  163. "cost": {
  164. "food": buildings.micro.cost * 50
  165. },
  166. "effects": [
  167. {
  168. "type": "prod",
  169. "target": "micro",
  170. "amount": 2.25,
  171. }
  172. ],
  173. "prereqs": {
  174. "buildings": {
  175. "micro": 5
  176. },
  177. "upgrades": [
  178. "micro-prod-1"
  179. ]
  180. }
  181. },
  182. "anthro-prod-1": {
  183. "name": "Willing Prey",
  184. "desc": "Why bother chasing it down?",
  185. "cost": {
  186. "food": buildings.anthro.cost * 5
  187. },
  188. "effects": [
  189. {
  190. "type": "prod",
  191. "target": "anthro",
  192. "amount": 2,
  193. }
  194. ],
  195. "prereqs": {
  196. "buildings": {
  197. "anthro": 1
  198. }
  199. }
  200. },
  201. "anthro-prod-2": {
  202. "name": "Mesmerized Prey",
  203. "desc": "Why bother walking over to it?",
  204. "cost": {
  205. "food": buildings.anthro.cost * 50
  206. },
  207. "effects": [
  208. {
  209. "type": "prod",
  210. "target": "anthro",
  211. "amount": 2.25,
  212. }
  213. ],
  214. "prereqs": {
  215. "buildings": {
  216. "anthro": 10
  217. },
  218. "upgrades": [
  219. "anthro-prod-1"
  220. ]
  221. }
  222. },
  223. "anthro-help-micro-1": {
  224. "name": "Servants",
  225. "desc": "Why bother walking anywhere, really?",
  226. "cost": {
  227. "food": buildings.anthro.cost * 25 + buildings.micro.cost * 50
  228. },
  229. "effects": [
  230. {
  231. "type": "helper",
  232. "helper": "anthro",
  233. "helped": "micro",
  234. "amount": 0.01
  235. }
  236. ],
  237. "prereqs": {
  238. "buildings": {
  239. "anthro": 10
  240. },
  241. "upgrades": [
  242. "anthro-prod-1"
  243. ]
  244. }
  245. },
  246. "prod-1": {
  247. "name": "Sloth Metabolism",
  248. "desc": "Burn those calories. Eventually.",
  249. "cost": {
  250. "food": 5e2
  251. },
  252. "effects": [
  253. {
  254. "type": "prod-all",
  255. "amount": 1.05
  256. }
  257. ],
  258. "prereqs": {
  259. "productivity": {
  260. "food": 1e1
  261. }
  262. },
  263. },
  264. "prod-2": {
  265. "name": "Decent Metabolism",
  266. "desc": "Picking up the pace.",
  267. "cost": {
  268. "food": 5e3
  269. },
  270. "effects": [
  271. {
  272. "type": "prod-all",
  273. "amount": 1.05
  274. }
  275. ],
  276. "prereqs": {
  277. "productivity": {
  278. "food": 1e2
  279. },
  280. "upgrades": [
  281. "prod-1"
  282. ]
  283. },
  284. },
  285. "prod-3": {
  286. "name": "Perky Metabolism",
  287. "desc": "Sweat a little.",
  288. "cost": {
  289. "food": 5e4
  290. },
  291. "effects": [
  292. {
  293. "type": "prod-all",
  294. "amount": 1.05
  295. }
  296. ],
  297. "prereqs": {
  298. "productivity": {
  299. "food": 1e3
  300. },
  301. "upgrades": [
  302. "prod-2"
  303. ]
  304. },
  305. },
  306. "prod-4": {
  307. "name": "Quick Metabolism",
  308. "desc": "Burn those calories.",
  309. "cost": {
  310. "food": 5e5
  311. },
  312. "effects": [
  313. {
  314. "type": "prod-all",
  315. "amount": 1.05
  316. }
  317. ],
  318. "prereqs": {
  319. "productivity": {
  320. "food": 1e4
  321. },
  322. "upgrades": [
  323. "prod-3"
  324. ]
  325. },
  326. },
  327. "prod-5": {
  328. "name": "Speedy Metabolism",
  329. "desc": "More prey, more power.",
  330. "cost": {
  331. "food": 5e6
  332. },
  333. "effects": [
  334. {
  335. "type": "prod-all",
  336. "amount": 1.05
  337. }
  338. ],
  339. "prereqs": {
  340. "productivity": {
  341. "food": 1e5
  342. },
  343. "upgrades": [
  344. "prod-4"
  345. ]
  346. },
  347. },
  348. "prod-6": {
  349. "name": "Fast Metabolism",
  350. "desc": "You're a furnace.",
  351. "cost": {
  352. "food": 5e7
  353. },
  354. "effects": [
  355. {
  356. "type": "prod-all",
  357. "amount": 1.05
  358. }
  359. ],
  360. "prereqs": {
  361. "productivity": {
  362. "food": 1e6
  363. },
  364. "upgrades": [
  365. "prod-5"
  366. ]
  367. },
  368. },
  369. "prod-7": {
  370. "name": "Powerful Metabolism",
  371. "desc": "Digest them all.",
  372. "cost": {
  373. "food": 5e8
  374. },
  375. "effects": [
  376. {
  377. "type": "prod-all",
  378. "amount": 1.05
  379. }
  380. ],
  381. "prereqs": {
  382. "productivity": {
  383. "food": 1e7
  384. },
  385. "upgrades": [
  386. "prod-6"
  387. ]
  388. },
  389. },
  390. }