cookie clicker but bigger
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

363 行
6.6 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. }
  132. const upgrades = {
  133. "micro-prod-1": {
  134. "name": "Bigger Micros",
  135. "desc": "A macro micro? Certainly more filling.",
  136. "cost": {
  137. "food": buildings.micro.cost * 10
  138. },
  139. "effects": [
  140. {
  141. "type": "prod",
  142. "target": "micro",
  143. "amount": 2,
  144. }
  145. ],
  146. "prereqs": {
  147. "buildings": {
  148. "micro": 1
  149. }
  150. }
  151. },
  152. "micro-prod-2": {
  153. "name": "Beefy Micros",
  154. "desc": "25% more protein, 10% fewer carbs.",
  155. "cost": {
  156. "food": buildings.micro.cost * 50
  157. },
  158. "effects": [
  159. {
  160. "type": "prod",
  161. "target": "micro",
  162. "amount": 2.25,
  163. }
  164. ],
  165. "prereqs": {
  166. "buildings": {
  167. "micro": 5
  168. },
  169. "upgrades": [
  170. "micro-prod-1"
  171. ]
  172. }
  173. },
  174. "anthro-prod-1": {
  175. "name": "Willing Prey",
  176. "desc": "Why bother chasing it down?",
  177. "cost": {
  178. "food": buildings.anthro.cost * 5
  179. },
  180. "effects": [
  181. {
  182. "type": "prod",
  183. "target": "anthro",
  184. "amount": 2,
  185. }
  186. ],
  187. "prereqs": {
  188. "buildings": {
  189. "anthro": 1
  190. }
  191. }
  192. },
  193. "anthro-prod-2": {
  194. "name": "Mesmerized Prey",
  195. "desc": "Why bother walking over to it?",
  196. "cost": {
  197. "food": buildings.anthro.cost * 50
  198. },
  199. "effects": [
  200. {
  201. "type": "prod",
  202. "target": "anthro",
  203. "amount": 2.25,
  204. }
  205. ],
  206. "prereqs": {
  207. "buildings": {
  208. "anthro": 10
  209. },
  210. "upgrades": [
  211. "anthro-prod-1"
  212. ]
  213. }
  214. },
  215. "prod-1": {
  216. "name": "Sloth Metabolism",
  217. "desc": "Burn those calories. Eventually.",
  218. "cost": {
  219. "food": 5e2
  220. },
  221. "effects": [
  222. {
  223. "type": "prod-all",
  224. "amount": 1.05
  225. }
  226. ],
  227. "prereqs": {
  228. "productivity": {
  229. "food": 1e1
  230. }
  231. },
  232. },
  233. "prod-2": {
  234. "name": "Decent Metabolism",
  235. "desc": "Picking up the pace.",
  236. "cost": {
  237. "food": 5e3
  238. },
  239. "effects": [
  240. {
  241. "type": "prod-all",
  242. "amount": 1.05
  243. }
  244. ],
  245. "prereqs": {
  246. "productivity": {
  247. "food": 1e2
  248. },
  249. "upgrades": [
  250. "prod-1"
  251. ]
  252. },
  253. },
  254. "prod-3": {
  255. "name": "Perky Metabolism",
  256. "desc": "Sweat a little.",
  257. "cost": {
  258. "food": 5e4
  259. },
  260. "effects": [
  261. {
  262. "type": "prod-all",
  263. "amount": 1.05
  264. }
  265. ],
  266. "prereqs": {
  267. "productivity": {
  268. "food": 1e3
  269. },
  270. "upgrades": [
  271. "prod-2"
  272. ]
  273. },
  274. },
  275. "prod-4": {
  276. "name": "Quick Metabolism",
  277. "desc": "Burn those calories.",
  278. "cost": {
  279. "food": 5e5
  280. },
  281. "effects": [
  282. {
  283. "type": "prod-all",
  284. "amount": 1.05
  285. }
  286. ],
  287. "prereqs": {
  288. "productivity": {
  289. "food": 1e4
  290. },
  291. "upgrades": [
  292. "prod-3"
  293. ]
  294. },
  295. },
  296. "prod-5": {
  297. "name": "Speedy Metabolism",
  298. "desc": "More prey, more power.",
  299. "cost": {
  300. "food": 5e6
  301. },
  302. "effects": [
  303. {
  304. "type": "prod-all",
  305. "amount": 1.05
  306. }
  307. ],
  308. "prereqs": {
  309. "productivity": {
  310. "food": 1e5
  311. },
  312. "upgrades": [
  313. "prod-4"
  314. ]
  315. },
  316. },
  317. "prod-6": {
  318. "name": "Fast Metabolism",
  319. "desc": "You're a furnace.",
  320. "cost": {
  321. "food": 5e7
  322. },
  323. "effects": [
  324. {
  325. "type": "prod-all",
  326. "amount": 1.05
  327. }
  328. ],
  329. "prereqs": {
  330. "productivity": {
  331. "food": 1e6
  332. },
  333. "upgrades": [
  334. "prod-5"
  335. ]
  336. },
  337. },
  338. "prod-7": {
  339. "name": "Powerful Metabolism",
  340. "desc": "Digest them all.",
  341. "cost": {
  342. "food": 5e8
  343. },
  344. "effects": [
  345. {
  346. "type": "prod-all",
  347. "amount": 1.05
  348. }
  349. ],
  350. "prereqs": {
  351. "productivity": {
  352. "food": 1e7
  353. },
  354. "upgrades": [
  355. "prod-6"
  356. ]
  357. },
  358. },
  359. }