cookie clicker but bigger
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

345 linhas
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": 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. "car-prod-1": {
  142. "name": "High Occupancy Vehicles",
  143. "desc": "Think of the environment! Think of the gigantic monster's hunger!",
  144. "cost": {
  145. "food": buildings.car.cost * 5
  146. },
  147. "effects": [
  148. {
  149. "type": "prod",
  150. "target": "car",
  151. "amount": 2,
  152. }
  153. ],
  154. "prereqs": {
  155. "buildings": {
  156. "car": 10
  157. },
  158. "upgrades": [
  159. "anthro-prod-1"
  160. ]
  161. }
  162. },
  163. "anthro-help-micro-1": {
  164. "name": "Servants",
  165. "desc": "Why bother walking anywhere, really?",
  166. "cost": {
  167. "food": buildings.anthro.cost * 25 + buildings.micro.cost * 50
  168. },
  169. "effects": [
  170. {
  171. "type": "helper",
  172. "helper": "anthro",
  173. "helped": "micro",
  174. "amount": 0.01
  175. }
  176. ],
  177. "prereqs": {
  178. "buildings": {
  179. "anthro": 10
  180. },
  181. "upgrades": [
  182. "anthro-prod-1"
  183. ]
  184. }
  185. }
  186. }
  187. function createTemplateUpgrades() {
  188. console.log("qwewq");
  189. createProdUpgrades();
  190. createProdAllUpgrades();
  191. }
  192. const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100];
  193. function createProdUpgrades() {
  194. for (const [key, value] of Object.entries(prodUpgradeText)) {
  195. let counter = 1;
  196. let prefix = key + "-prod-";
  197. for (let contents of value) {
  198. upgrades[prefix + counter] = {
  199. "name": contents.name,
  200. "desc": contents.desc,
  201. "cost": {
  202. "food": buildings[key].cost * 5 * Math.pow(10,counter - 1)
  203. },
  204. "effects": [
  205. {
  206. "type": "prod",
  207. "amount": 2 + (counter - 1) * 0.25,
  208. "target": key
  209. }
  210. ]
  211. };
  212. upgrades[prefix + counter]["prereqs"] = {};
  213. upgrades[prefix + counter]["prereqs"]["buildings"] = {};
  214. upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1];
  215. if (counter > 1) {
  216. upgrades[prefix + counter]["prereqs"]["upgrades"] = [
  217. prefix + (counter - 1)
  218. ];
  219. }
  220. counter += 1;
  221. }
  222. }
  223. }
  224. function createProdAllUpgrades() {
  225. let prefix = "prod-all-"
  226. let counter = 1;
  227. for (let contents of prodAllUpgradeText) {
  228. upgrades[prefix + counter] = {
  229. "name": contents.name,
  230. "desc": contents.desc,
  231. "cost": {
  232. "food": 5 * Math.pow(10, counter+1)
  233. },
  234. "effects": [
  235. {
  236. "type": "prod-all",
  237. "amount": 1.05
  238. }
  239. ],
  240. "prereqs": {
  241. "productivity": {
  242. "food": Math.pow(10, counter)
  243. }
  244. }
  245. };
  246. if (counter > 1) {
  247. upgrades[prefix + counter]["prereqs"].upgrades = [
  248. prefix + (counter - 1)
  249. ];
  250. }
  251. }
  252. }
  253. let prodUpgradeText = {
  254. "micro": [
  255. {
  256. "name": "Bigger Micros",
  257. "desc": "A macro micro? It's more filling, for sure.",
  258. },
  259. {
  260. "name": "Beefy Micros",
  261. "desc": "25% more protein, 10% fewer carbs."
  262. },
  263. {
  264. "name": "Delicious Micros",
  265. "desc": "Betcha' can't eat just one."
  266. },
  267. {
  268. "name": "Irresistable Micros",
  269. "desc": "Genetically engineered to be delectable."
  270. },
  271. {
  272. "name": "Exquisite Micros",
  273. "desc": "Dangerously delicious."
  274. }
  275. ],
  276. "anthro": [
  277. {
  278. "name": "Willing Prey",
  279. "desc": "Why bother chasing down your meal?"
  280. },
  281. {
  282. "name": "Fattened Prey",
  283. "desc": "9 calories per gram!"
  284. },
  285. {
  286. "name": "Mesmerized Prey",
  287. "desc": "Why bother walking to your meal?"
  288. },
  289. {
  290. "name": "Food-Safe Lubricant",
  291. "desc": "Ease them down your gullet with ease. Thanks, chemistry!"
  292. },
  293. {
  294. "name": "Mandatory Meal Training",
  295. "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%."
  296. }
  297. ],
  298. }
  299. let prodAllUpgradeText = [
  300. {
  301. "name": "Sloth Metabolism",
  302. "desc": "Burn those calories. Eventually."
  303. },
  304. {
  305. "name": "Decent Metabolism",
  306. "desc": "Picking up the pace."
  307. },
  308. {
  309. "name": "Perky Metabolism",
  310. "desc": "Sweat a little."
  311. },
  312. {
  313. "name": "Quick Metabolism",
  314. "desc": "Burn those calories."
  315. },
  316. {
  317. "name": "Speedy Metabolism",
  318. "desc": "More prey, more power."
  319. },
  320. {
  321. "name": "Fast Metabolism",
  322. "desc": "You're a furnace. Fueled by people."
  323. },
  324. {
  325. "name": "Powerful Metabolism",
  326. "desc": "Digest them all."
  327. }
  328. ]