@rpg-engine/shared 0.11.9 → 0.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/dist/constants/date.constants.d.ts +3 -0
  2. package/dist/constants/date.constants.d.ts.map +1 -0
  3. package/dist/constants/date.constants.js +6 -0
  4. package/dist/constants/date.constants.js.map +1 -0
  5. package/dist/constants/dc.constants.d.ts +4 -0
  6. package/dist/constants/dc.constants.d.ts.map +1 -0
  7. package/dist/constants/dc.constants.js +9 -0
  8. package/dist/constants/dc.constants.js.map +1 -0
  9. package/dist/constants/npc.constants.d.ts +2 -0
  10. package/dist/constants/npc.constants.d.ts.map +1 -0
  11. package/dist/constants/npc.constants.js +5 -0
  12. package/dist/constants/npc.constants.js.map +1 -0
  13. package/dist/constants/skillProgression.constants.d.ts +23 -0
  14. package/dist/constants/skillProgression.constants.d.ts.map +1 -0
  15. package/dist/constants/skillProgression.constants.js +194 -0
  16. package/dist/constants/skillProgression.constants.js.map +1 -0
  17. package/dist/constants/skillProgression.constants.test.d.ts +2 -0
  18. package/dist/constants/skillProgression.constants.test.d.ts.map +1 -0
  19. package/dist/constants/skillProgression.constants.test.js +74 -0
  20. package/dist/constants/skillProgression.constants.test.js.map +1 -0
  21. package/dist/constants/socket.constants.d.ts +3 -0
  22. package/dist/constants/socket.constants.d.ts.map +1 -0
  23. package/dist/constants/socket.constants.js +7 -0
  24. package/dist/constants/socket.constants.js.map +1 -0
  25. package/dist/constants/world.constants.d.ts +11 -0
  26. package/dist/constants/world.constants.d.ts.map +1 -0
  27. package/dist/constants/world.constants.js +14 -0
  28. package/dist/constants/world.constants.js.map +1 -0
  29. package/dist/helpers/deviceHelpers.d.ts +3 -0
  30. package/dist/helpers/deviceHelpers.d.ts.map +1 -0
  31. package/dist/helpers/deviceHelpers.js +22 -0
  32. package/dist/helpers/deviceHelpers.js.map +1 -0
  33. package/dist/helpers/itemSlotHelper.d.ts +8 -0
  34. package/dist/helpers/itemSlotHelper.d.ts.map +1 -0
  35. package/dist/helpers/itemSlotHelper.js +28 -0
  36. package/dist/helpers/itemSlotHelper.js.map +1 -0
  37. package/dist/helpers/skillHelpers.d.ts +14 -0
  38. package/dist/helpers/skillHelpers.d.ts.map +1 -0
  39. package/dist/helpers/skillHelpers.js +127 -0
  40. package/dist/helpers/skillHelpers.js.map +1 -0
  41. package/dist/helpers/skillHelpers.test.d.ts +2 -0
  42. package/dist/helpers/skillHelpers.test.d.ts.map +1 -0
  43. package/dist/helpers/skillHelpers.test.js +169 -0
  44. package/dist/helpers/skillHelpers.test.js.map +1 -0
  45. package/dist/helpers/weightHelper.d.ts +2 -0
  46. package/dist/helpers/weightHelper.d.ts.map +1 -0
  47. package/dist/helpers/weightHelper.js +14 -0
  48. package/dist/helpers/weightHelper.js.map +1 -0
  49. package/dist/index.d.ts +78 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +108 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/libs/GridHelper.d.ts +12 -0
  54. package/dist/libs/GridHelper.d.ts.map +1 -0
  55. package/dist/libs/GridHelper.js +38 -0
  56. package/dist/libs/GridHelper.js.map +1 -0
  57. package/dist/libs/MathHelper.d.ts +17 -0
  58. package/dist/libs/MathHelper.d.ts.map +1 -0
  59. package/dist/libs/MathHelper.js +15 -0
  60. package/dist/libs/MathHelper.js.map +1 -0
  61. package/dist/libs/SocketHelper.d.ts +3 -0
  62. package/dist/libs/SocketHelper.d.ts.map +1 -0
  63. package/dist/libs/SocketHelper.js +15 -0
  64. package/dist/libs/SocketHelper.js.map +1 -0
  65. package/dist/libs/TextHelper.d.ts +8 -0
  66. package/dist/libs/TextHelper.d.ts.map +1 -0
  67. package/dist/libs/TextHelper.js +22 -0
  68. package/dist/libs/TextHelper.js.map +1 -0
  69. package/dist/libs/TypeHelper.d.ts +4 -0
  70. package/dist/libs/TypeHelper.d.ts.map +1 -0
  71. package/dist/libs/TypeHelper.js +17 -0
  72. package/dist/libs/TypeHelper.js.map +1 -0
  73. package/dist/translations/app-rate.lang.json +38 -0
  74. package/dist/translations/assets.lang.json +82 -0
  75. package/dist/translations/auth.lang.json +182 -0
  76. package/dist/translations/email.lang.json +70 -0
  77. package/dist/translations/error.lang.json +18 -0
  78. package/dist/translations/form.lang.json +94 -0
  79. package/dist/translations/global.lang.json +90 -0
  80. package/dist/translations/logs.lang.json +6 -0
  81. package/dist/translations/onboarding.lang.d.ts +11 -0
  82. package/dist/translations/onboarding.lang.d.ts.map +1 -0
  83. package/dist/translations/onboarding.lang.js +22 -0
  84. package/dist/translations/onboarding.lang.js.map +1 -0
  85. package/dist/translations/onboarding.lang.json +50 -0
  86. package/dist/translations/order.lang.json +90 -0
  87. package/dist/translations/search.lang.json +50 -0
  88. package/dist/translations/settings.lang.json +14 -0
  89. package/dist/translations/tabs.lang.json +22 -0
  90. package/dist/translations/users.lang.json +22 -0
  91. package/dist/translations/validation.lang.json +86 -0
  92. package/dist/types/animation.types.d.ts +71 -0
  93. package/dist/types/animation.types.d.ts.map +1 -0
  94. package/dist/types/animation.types.js +47 -0
  95. package/dist/types/animation.types.js.map +1 -0
  96. package/dist/types/api.types.d.ts +23 -0
  97. package/dist/types/api.types.d.ts.map +1 -0
  98. package/dist/types/api.types.js +22 -0
  99. package/dist/types/api.types.js.map +1 -0
  100. package/dist/types/archiveIndex.types.d.ts +59 -0
  101. package/dist/types/archiveIndex.types.d.ts.map +1 -0
  102. package/dist/types/archiveIndex.types.js +33 -0
  103. package/dist/types/archiveIndex.types.js.map +1 -0
  104. package/dist/types/asset.types.d.ts +7 -0
  105. package/dist/types/asset.types.d.ts.map +1 -0
  106. package/dist/types/asset.types.js +3 -0
  107. package/dist/types/asset.types.js.map +1 -0
  108. package/dist/types/attribution.types.d.ts +19 -0
  109. package/dist/types/attribution.types.d.ts.map +1 -0
  110. package/dist/types/attribution.types.js +3 -0
  111. package/dist/types/attribution.types.js.map +1 -0
  112. package/dist/types/auth.types.d.ts +32 -0
  113. package/dist/types/auth.types.d.ts.map +1 -0
  114. package/dist/types/auth.types.js +3 -0
  115. package/dist/types/auth.types.js.map +1 -0
  116. package/dist/types/battle.types.d.ts +65 -0
  117. package/dist/types/battle.types.d.ts.map +1 -0
  118. package/dist/types/battle.types.js +22 -0
  119. package/dist/types/battle.types.js.map +1 -0
  120. package/dist/types/buff.types.d.ts +52 -0
  121. package/dist/types/buff.types.d.ts.map +1 -0
  122. package/dist/types/buff.types.js +14 -0
  123. package/dist/types/buff.types.js.map +1 -0
  124. package/dist/types/character.types.d.ts +293 -0
  125. package/dist/types/character.types.d.ts.map +1 -0
  126. package/dist/types/character.types.js +73 -0
  127. package/dist/types/character.types.js.map +1 -0
  128. package/dist/types/characterCustomizationTypes.d.ts +13 -0
  129. package/dist/types/characterCustomizationTypes.d.ts.map +1 -0
  130. package/dist/types/characterCustomizationTypes.js +9 -0
  131. package/dist/types/characterCustomizationTypes.js.map +1 -0
  132. package/dist/types/characterSkin.types.d.ts +23 -0
  133. package/dist/types/characterSkin.types.d.ts.map +1 -0
  134. package/dist/types/characterSkin.types.js +9 -0
  135. package/dist/types/characterSkin.types.js.map +1 -0
  136. package/dist/types/chat.types.d.ts +117 -0
  137. package/dist/types/chat.types.d.ts.map +1 -0
  138. package/dist/types/chat.types.js +32 -0
  139. package/dist/types/chat.types.js.map +1 -0
  140. package/dist/types/dailyTasks.types.d.ts +281 -0
  141. package/dist/types/dailyTasks.types.d.ts.map +1 -0
  142. package/dist/types/dailyTasks.types.js +83 -0
  143. package/dist/types/dailyTasks.types.js.map +1 -0
  144. package/dist/types/dc.types.d.ts +190 -0
  145. package/dist/types/dc.types.d.ts.map +1 -0
  146. package/dist/types/dc.types.js +54 -0
  147. package/dist/types/dc.types.js.map +1 -0
  148. package/dist/types/depot.types.d.ts +19 -0
  149. package/dist/types/depot.types.d.ts.map +1 -0
  150. package/dist/types/depot.types.js +10 -0
  151. package/dist/types/depot.types.js.map +1 -0
  152. package/dist/types/device.types.d.ts +25 -0
  153. package/dist/types/device.types.d.ts.map +1 -0
  154. package/dist/types/device.types.js +8 -0
  155. package/dist/types/device.types.js.map +1 -0
  156. package/dist/types/displayText.types.d.ts +11 -0
  157. package/dist/types/displayText.types.d.ts.map +1 -0
  158. package/dist/types/displayText.types.js +8 -0
  159. package/dist/types/displayText.types.js.map +1 -0
  160. package/dist/types/entity.types.d.ts +31 -0
  161. package/dist/types/entity.types.d.ts.map +1 -0
  162. package/dist/types/entity.types.js +21 -0
  163. package/dist/types/entity.types.js.map +1 -0
  164. package/dist/types/env.types.d.ts +6 -0
  165. package/dist/types/env.types.d.ts.map +1 -0
  166. package/dist/types/env.types.js +10 -0
  167. package/dist/types/env.types.js.map +1 -0
  168. package/dist/types/equipment.types.d.ts +36 -0
  169. package/dist/types/equipment.types.d.ts.map +1 -0
  170. package/dist/types/equipment.types.js +19 -0
  171. package/dist/types/equipment.types.js.map +1 -0
  172. package/dist/types/friends.types.d.ts +23 -0
  173. package/dist/types/friends.types.d.ts.map +1 -0
  174. package/dist/types/friends.types.js +12 -0
  175. package/dist/types/friends.types.js.map +1 -0
  176. package/dist/types/gem.types.d.ts +25 -0
  177. package/dist/types/gem.types.d.ts.map +1 -0
  178. package/dist/types/gem.types.js +3 -0
  179. package/dist/types/gem.types.js.map +1 -0
  180. package/dist/types/googleOAuth.types.d.ts +60 -0
  181. package/dist/types/googleOAuth.types.d.ts.map +1 -0
  182. package/dist/types/googleOAuth.types.js +9 -0
  183. package/dist/types/googleOAuth.types.js.map +1 -0
  184. package/dist/types/guild.types.d.ts +166 -0
  185. package/dist/types/guild.types.d.ts.map +1 -0
  186. package/dist/types/guild.types.js +57 -0
  187. package/dist/types/guild.types.js.map +1 -0
  188. package/dist/types/inGameStore.types.d.ts +10 -0
  189. package/dist/types/inGameStore.types.d.ts.map +1 -0
  190. package/dist/types/inGameStore.types.js +9 -0
  191. package/dist/types/inGameStore.types.js.map +1 -0
  192. package/dist/types/informationCenter.types.d.ts +135 -0
  193. package/dist/types/informationCenter.types.d.ts.map +1 -0
  194. package/dist/types/informationCenter.types.js +64 -0
  195. package/dist/types/informationCenter.types.js.map +1 -0
  196. package/dist/types/inventory.types.d.ts +8 -0
  197. package/dist/types/inventory.types.d.ts.map +1 -0
  198. package/dist/types/inventory.types.js +3 -0
  199. package/dist/types/inventory.types.js.map +1 -0
  200. package/dist/types/item.types.d.ts +484 -0
  201. package/dist/types/item.types.d.ts.map +1 -0
  202. package/dist/types/item.types.js +173 -0
  203. package/dist/types/item.types.js.map +1 -0
  204. package/dist/types/itemContainer.types.d.ts +84 -0
  205. package/dist/types/itemContainer.types.d.ts.map +1 -0
  206. package/dist/types/itemContainer.types.js +12 -0
  207. package/dist/types/itemContainer.types.js.map +1 -0
  208. package/dist/types/leaderboard.types.d.ts +33 -0
  209. package/dist/types/leaderboard.types.d.ts.map +1 -0
  210. package/dist/types/leaderboard.types.js +10 -0
  211. package/dist/types/leaderboard.types.js.map +1 -0
  212. package/dist/types/loginStreak.types.d.ts +29 -0
  213. package/dist/types/loginStreak.types.d.ts.map +1 -0
  214. package/dist/types/loginStreak.types.js +9 -0
  215. package/dist/types/loginStreak.types.js.map +1 -0
  216. package/dist/types/macro.types.d.ts +9 -0
  217. package/dist/types/macro.types.d.ts.map +1 -0
  218. package/dist/types/macro.types.js +13 -0
  219. package/dist/types/macro.types.js.map +1 -0
  220. package/dist/types/maps.types.d.ts +112 -0
  221. package/dist/types/maps.types.d.ts.map +1 -0
  222. package/dist/types/maps.types.js +90 -0
  223. package/dist/types/maps.types.js.map +1 -0
  224. package/dist/types/marketplace.types.d.ts +317 -0
  225. package/dist/types/marketplace.types.d.ts.map +1 -0
  226. package/dist/types/marketplace.types.js +69 -0
  227. package/dist/types/marketplace.types.js.map +1 -0
  228. package/dist/types/notification.types.d.ts +20 -0
  229. package/dist/types/notification.types.d.ts.map +1 -0
  230. package/dist/types/notification.types.js +3 -0
  231. package/dist/types/notification.types.js.map +1 -0
  232. package/dist/types/npc.types.d.ts +182 -0
  233. package/dist/types/npc.types.d.ts.map +1 -0
  234. package/dist/types/npc.types.js +56 -0
  235. package/dist/types/npc.types.js.map +1 -0
  236. package/dist/types/pagination.types.d.ts +14 -0
  237. package/dist/types/pagination.types.d.ts.map +1 -0
  238. package/dist/types/pagination.types.js +3 -0
  239. package/dist/types/pagination.types.js.map +1 -0
  240. package/dist/types/party.types.d.ts +84 -0
  241. package/dist/types/party.types.d.ts.map +1 -0
  242. package/dist/types/party.types.js +55 -0
  243. package/dist/types/party.types.js.map +1 -0
  244. package/dist/types/payment.types.d.ts +201 -0
  245. package/dist/types/payment.types.d.ts.map +1 -0
  246. package/dist/types/payment.types.js +23 -0
  247. package/dist/types/payment.types.js.map +1 -0
  248. package/dist/types/places.types.d.ts +17 -0
  249. package/dist/types/places.types.d.ts.map +1 -0
  250. package/dist/types/places.types.js +10 -0
  251. package/dist/types/places.types.js.map +1 -0
  252. package/dist/types/preloadScene.types.d.ts +5 -0
  253. package/dist/types/preloadScene.types.d.ts.map +1 -0
  254. package/dist/types/preloadScene.types.js +8 -0
  255. package/dist/types/preloadScene.types.js.map +1 -0
  256. package/dist/types/premiumAccount.types.d.ts +8 -0
  257. package/dist/types/premiumAccount.types.d.ts.map +1 -0
  258. package/dist/types/premiumAccount.types.js +12 -0
  259. package/dist/types/premiumAccount.types.js.map +1 -0
  260. package/dist/types/proficiency.types.d.ts +17 -0
  261. package/dist/types/proficiency.types.d.ts.map +1 -0
  262. package/dist/types/proficiency.types.js +22 -0
  263. package/dist/types/proficiency.types.js.map +1 -0
  264. package/dist/types/purchase.types.d.ts +155 -0
  265. package/dist/types/purchase.types.d.ts.map +1 -0
  266. package/dist/types/purchase.types.js +82 -0
  267. package/dist/types/purchase.types.js.map +1 -0
  268. package/dist/types/quest.types.d.ts +100 -0
  269. package/dist/types/quest.types.d.ts.map +1 -0
  270. package/dist/types/quest.types.js +22 -0
  271. package/dist/types/quest.types.js.map +1 -0
  272. package/dist/types/raid.types.d.ts +7 -0
  273. package/dist/types/raid.types.d.ts.map +1 -0
  274. package/dist/types/raid.types.js +3 -0
  275. package/dist/types/raid.types.js.map +1 -0
  276. package/dist/types/resource.types.d.ts +6 -0
  277. package/dist/types/resource.types.d.ts.map +1 -0
  278. package/dist/types/resource.types.js +3 -0
  279. package/dist/types/resource.types.js.map +1 -0
  280. package/dist/types/scene.types.d.ts +9 -0
  281. package/dist/types/scene.types.d.ts.map +1 -0
  282. package/dist/types/scene.types.js +9 -0
  283. package/dist/types/scene.types.js.map +1 -0
  284. package/dist/types/shortcut.types.d.ts +12 -0
  285. package/dist/types/shortcut.types.d.ts.map +1 -0
  286. package/dist/types/shortcut.types.js +10 -0
  287. package/dist/types/shortcut.types.js.map +1 -0
  288. package/dist/types/simpleTutorial.types.d.ts +7 -0
  289. package/dist/types/simpleTutorial.types.d.ts.map +1 -0
  290. package/dist/types/simpleTutorial.types.js +8 -0
  291. package/dist/types/simpleTutorial.types.js.map +1 -0
  292. package/dist/types/skills.types.d.ts +161 -0
  293. package/dist/types/skills.types.d.ts.map +1 -0
  294. package/dist/types/skills.types.js +120 -0
  295. package/dist/types/skills.types.js.map +1 -0
  296. package/dist/types/socket.types.d.ts +19 -0
  297. package/dist/types/socket.types.d.ts.map +1 -0
  298. package/dist/types/socket.types.js +9 -0
  299. package/dist/types/socket.types.js.map +1 -0
  300. package/dist/types/spell.types.d.ts +180 -0
  301. package/dist/types/spell.types.d.ts.map +1 -0
  302. package/dist/types/spell.types.js +123 -0
  303. package/dist/types/spell.types.js.map +1 -0
  304. package/dist/types/store.types.d.ts +35 -0
  305. package/dist/types/store.types.d.ts.map +1 -0
  306. package/dist/types/store.types.js +9 -0
  307. package/dist/types/store.types.js.map +1 -0
  308. package/dist/types/tiled.types.d.ts +120 -0
  309. package/dist/types/tiled.types.d.ts.map +1 -0
  310. package/dist/types/tiled.types.js +8 -0
  311. package/dist/types/tiled.types.js.map +1 -0
  312. package/dist/types/trade.types.d.ts +66 -0
  313. package/dist/types/trade.types.d.ts.map +1 -0
  314. package/dist/types/trade.types.js +16 -0
  315. package/dist/types/trade.types.js.map +1 -0
  316. package/dist/types/translation.types.d.ts +6 -0
  317. package/dist/types/translation.types.d.ts.map +1 -0
  318. package/dist/types/translation.types.js +9 -0
  319. package/dist/types/translation.types.js.map +1 -0
  320. package/dist/types/ui.types.d.ts +9 -0
  321. package/dist/types/ui.types.d.ts.map +1 -0
  322. package/dist/types/ui.types.js +8 -0
  323. package/dist/types/ui.types.js.map +1 -0
  324. package/dist/types/uiHighlight.types.d.ts +36 -0
  325. package/dist/types/uiHighlight.types.d.ts.map +1 -0
  326. package/dist/types/uiHighlight.types.js +29 -0
  327. package/dist/types/uiHighlight.types.js.map +1 -0
  328. package/dist/types/useWith.types.d.ts +44 -0
  329. package/dist/types/useWith.types.d.ts.map +1 -0
  330. package/dist/types/useWith.types.js +13 -0
  331. package/dist/types/useWith.types.js.map +1 -0
  332. package/dist/types/user.types.d.ts +110 -0
  333. package/dist/types/user.types.d.ts.map +1 -0
  334. package/dist/types/user.types.js +39 -0
  335. package/dist/types/user.types.js.map +1 -0
  336. package/dist/types/validation.types.d.ts +10 -0
  337. package/dist/types/validation.types.d.ts.map +1 -0
  338. package/dist/types/validation.types.js +3 -0
  339. package/dist/types/validation.types.js.map +1 -0
  340. package/dist/types/view.types.d.ts +17 -0
  341. package/dist/types/view.types.d.ts.map +1 -0
  342. package/dist/types/view.types.js +8 -0
  343. package/dist/types/view.types.js.map +1 -0
  344. package/package.json +1 -1
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLevelFromSPTiered = exports.calculateSPToNextLevelTiered = exports.getSPForLevelTiered = exports.getSPForSingleLevelTiered = exports.getLevelFromSP = exports.calculateSPToNextLevelExponential = exports.getSPForLevelExponential = exports.getTokensToNextLevel = exports.calculateSPToNextLevel = exports.calculateXPToNextLevel = exports.getLevelFromXP = exports.getXPForLevel = exports.getSPForLevel = void 0;
4
+ const getSPForLevel = (level) => {
5
+ const totalSPOnLevel = Math.pow(level, 3) * 2.75;
6
+ return totalSPOnLevel;
7
+ };
8
+ exports.getSPForLevel = getSPForLevel;
9
+ const getXPForLevel = (level) => {
10
+ const totalXPOnLevel = Math.pow(level, 3) * 3;
11
+ return totalXPOnLevel;
12
+ };
13
+ exports.getXPForLevel = getXPForLevel;
14
+ const getLevelFromXP = (totalXP) => {
15
+ if (totalXP <= 0)
16
+ return 1;
17
+ const level = Math.cbrt(totalXP / 3);
18
+ if (!isFinite(level) || level < 1) {
19
+ return 1;
20
+ }
21
+ return Math.floor(level);
22
+ };
23
+ exports.getLevelFromXP = getLevelFromXP;
24
+ const calculateXPToNextLevel = (currentXP, level) => {
25
+ const xpToNextLevel = (0, exports.getXPForLevel)(level);
26
+ const xpToNextLevelDiff = xpToNextLevel - currentXP;
27
+ return xpToNextLevelDiff;
28
+ };
29
+ exports.calculateXPToNextLevel = calculateXPToNextLevel;
30
+ const calculateSPToNextLevel = (currentSP, level) => {
31
+ const spToNextLevel = (0, exports.getSPForLevel)(level);
32
+ const spToNextLevelDiff = spToNextLevel - currentSP;
33
+ return spToNextLevelDiff;
34
+ };
35
+ exports.calculateSPToNextLevel = calculateSPToNextLevel;
36
+ const getTokensToNextLevel = (elementalLevel, guildLevel) => {
37
+ const baseValue = 100;
38
+ const rate = 1.005;
39
+ const levelFactor = Math.pow(elementalLevel, 0.5);
40
+ const guildFactor = Math.pow(guildLevel, 0.3);
41
+ const tokens = baseValue * levelFactor * guildFactor;
42
+ return Math.floor(tokens * Math.pow(rate, elementalLevel - 1));
43
+ };
44
+ exports.getTokensToNextLevel = getTokensToNextLevel;
45
+ const skillProgression_constants_1 = require("../constants/skillProgression.constants");
46
+ const getSPForLevelExponential = (level, A, b, c) => {
47
+ if (level <= c)
48
+ return 0;
49
+ if (Math.abs(b - 1) < 0.0001) {
50
+ return A * (level - c);
51
+ }
52
+ const result = (A * (Math.pow(b, level - c) - 1)) / (b - 1);
53
+ return isFinite(result) && result >= 0 ? Math.round(result) : 0;
54
+ };
55
+ exports.getSPForLevelExponential = getSPForLevelExponential;
56
+ const calculateSPToNextLevelExponential = (currentSP, currentLevel, A, b, c) => {
57
+ const spForNextLevel = (0, exports.getSPForLevelExponential)(currentLevel + 1, A, b, c);
58
+ return Math.max(0, Math.round(spForNextLevel - currentSP));
59
+ };
60
+ exports.calculateSPToNextLevelExponential = calculateSPToNextLevelExponential;
61
+ const getLevelFromSP = (totalSP, A, b, c) => {
62
+ if (totalSP <= 0 || A <= 0 || b <= 0)
63
+ return Math.max(1, c);
64
+ if (Math.abs(b - 1) < 0.0001) {
65
+ return c + totalSP / A;
66
+ }
67
+ const inner = (totalSP * (b - 1)) / A + 1;
68
+ if (inner <= 0)
69
+ return Math.max(1, c);
70
+ const level = Math.log(inner) / Math.log(b) + c;
71
+ return isFinite(level) && level >= 0 ? level : Math.max(1, c);
72
+ };
73
+ exports.getLevelFromSP = getLevelFromSP;
74
+ const tieredSPCache = new Map();
75
+ const MAX_CACHE_SIZE = 10000;
76
+ const getSPForSingleLevelTiered = (level, A, baseAffinityB, c) => {
77
+ if (level < c)
78
+ return 0;
79
+ let sp = A;
80
+ for (let lvl = c; lvl < level; lvl++) {
81
+ sp *= (0, skillProgression_constants_1.getTieredB)(baseAffinityB, lvl + 1);
82
+ }
83
+ return isFinite(sp) && sp >= 0 ? Math.round(sp) : 0;
84
+ };
85
+ exports.getSPForSingleLevelTiered = getSPForSingleLevelTiered;
86
+ const getSPForLevelTiered = (targetLevel, A, baseAffinityB, c) => {
87
+ if (targetLevel <= c)
88
+ return 0;
89
+ const cacheKey = `${A}-${baseAffinityB}-${targetLevel}`;
90
+ const cached = tieredSPCache.get(cacheKey);
91
+ if (cached !== undefined)
92
+ return cached;
93
+ let totalSP = 0;
94
+ for (let level = c; level < targetLevel; level++) {
95
+ totalSP += (0, exports.getSPForSingleLevelTiered)(level, A, baseAffinityB, c);
96
+ }
97
+ if (tieredSPCache.size >= MAX_CACHE_SIZE) {
98
+ tieredSPCache.clear();
99
+ }
100
+ tieredSPCache.set(cacheKey, totalSP);
101
+ return totalSP;
102
+ };
103
+ exports.getSPForLevelTiered = getSPForLevelTiered;
104
+ const calculateSPToNextLevelTiered = (currentSP, currentLevel, A, baseAffinityB, c) => {
105
+ const spForNextLevel = (0, exports.getSPForLevelTiered)(currentLevel + 1, A, baseAffinityB, c);
106
+ return Math.max(0, Math.round(spForNextLevel - currentSP));
107
+ };
108
+ exports.calculateSPToNextLevelTiered = calculateSPToNextLevelTiered;
109
+ const getLevelFromSPTiered = (totalSP, A, baseAffinityB, c) => {
110
+ if (totalSP <= 0 || A <= 0)
111
+ return Math.max(1, c);
112
+ let low = c;
113
+ let high = 10000;
114
+ while (low < high) {
115
+ const mid = Math.floor((low + high + 1) / 2);
116
+ const spForMid = (0, exports.getSPForLevelTiered)(mid, A, baseAffinityB, c);
117
+ if (spForMid <= totalSP) {
118
+ low = mid;
119
+ }
120
+ else {
121
+ high = mid - 1;
122
+ }
123
+ }
124
+ return Math.max(c, low);
125
+ };
126
+ exports.getLevelFromSPTiered = getLevelFromSPTiered;
127
+ //# sourceMappingURL=skillHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillHelpers.js","sourceRoot":"","sources":["../../src/helpers/skillHelpers.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IACjD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;AAEK,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;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"],"names":[],"mappings":""}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const character_types_1 = require("../types/character.types");
4
+ const skillHelpers_1 = require("./skillHelpers");
5
+ const skillProgression_constants_1 = require("../constants/skillProgression.constants");
6
+ const A = 50;
7
+ const c = 1;
8
+ describe("skillHelpers - Exponential Progression Curve Verification", () => {
9
+ describe("Base exponential formula verification", () => {
10
+ const b = 1.035;
11
+ it("should grow exponentially - each level costs more than previous", () => {
12
+ let previousTotalSP = 0;
13
+ for (let level = 2; level <= 100; level++) {
14
+ const totalSP = (0, skillHelpers_1.getSPForLevelExponential)(level, A, b, c);
15
+ const incrementalCost = totalSP - previousTotalSP;
16
+ if (level > 2) {
17
+ const previousTotalSP2 = (0, skillHelpers_1.getSPForLevelExponential)(level - 1, A, b, c);
18
+ const previousIncrementalCost = previousTotalSP2 - (0, skillHelpers_1.getSPForLevelExponential)(level - 2, A, b, c);
19
+ const ratio = incrementalCost / previousIncrementalCost;
20
+ expect(ratio).toBeCloseTo(b, 1);
21
+ }
22
+ previousTotalSP = totalSP;
23
+ }
24
+ });
25
+ it("should correctly invert - SP to level roundtrip", () => {
26
+ for (let level = 2; level <= 50; level++) {
27
+ const sp = (0, skillHelpers_1.getSPForLevelExponential)(level, A, b, c);
28
+ const recoveredLevel = (0, skillHelpers_1.getLevelFromSP)(sp, A, b, c);
29
+ expect(Math.abs(recoveredLevel - level)).toBeLessThan(0.01);
30
+ }
31
+ });
32
+ it("should produce exponential growth - doubling level more than doubles SP", () => {
33
+ const sp10 = (0, skillHelpers_1.getSPForLevelExponential)(10, A, b, c);
34
+ const sp20 = (0, skillHelpers_1.getSPForLevelExponential)(20, A, b, c);
35
+ const sp40 = (0, skillHelpers_1.getSPForLevelExponential)(40, A, b, c);
36
+ expect(sp20 / sp10).toBeGreaterThan(2);
37
+ expect(sp40 / sp20).toBeGreaterThan(2);
38
+ });
39
+ });
40
+ describe("Tiered exponential functions", () => {
41
+ const b = 1.035;
42
+ it("should correctly invert - SP to level roundtrip (binary search)", () => {
43
+ for (let level = 2; level <= 50; level++) {
44
+ const sp = (0, skillHelpers_1.getSPForLevelTiered)(level, A, b, c);
45
+ const recoveredLevel = (0, skillHelpers_1.getLevelFromSPTiered)(sp, A, b, c);
46
+ expect(recoveredLevel).toBe(level);
47
+ }
48
+ });
49
+ it("should grow monotonically - higher levels always require more SP", () => {
50
+ let previousSP = 0;
51
+ for (let level = 2; level <= 100; level++) {
52
+ const sp = (0, skillHelpers_1.getSPForLevelTiered)(level, A, b, c);
53
+ expect(sp).toBeGreaterThan(previousSP);
54
+ previousSP = sp;
55
+ }
56
+ });
57
+ it("should handle large levels without overflow", () => {
58
+ const sp = (0, skillHelpers_1.getSPForLevelTiered)(1000, A, b, c);
59
+ expect(isFinite(sp)).toBe(true);
60
+ const level = (0, skillHelpers_1.getLevelFromSPTiered)(sp, A, b, c);
61
+ expect(level).toBe(1000);
62
+ });
63
+ });
64
+ });
65
+ describe("skillHelpers - Integration: Vocation Affinities + Skill Formulas", () => {
66
+ describe("Warrior sword progression vs Sorcerer sword progression", () => {
67
+ it("should require much less SP for Warrior than Sorcerer to reach same sword level", () => {
68
+ const warriorConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Warrior);
69
+ const sorcererConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Sorcerer);
70
+ const warriorB = (0, skillProgression_constants_1.getTieredB)(warriorConstants.b, 10);
71
+ const sorcererB = (0, skillProgression_constants_1.getTieredB)(sorcererConstants.b, 10);
72
+ expect(warriorB).toBeLessThan(sorcererB);
73
+ const warriorSP = (0, skillHelpers_1.getSPForLevelTiered)(30, A, warriorB, c);
74
+ const sorcererSP = (0, skillHelpers_1.getSPForLevelTiered)(30, A, sorcererB, c);
75
+ expect(sorcererSP / warriorSP).toBeGreaterThan(4);
76
+ });
77
+ it("should show exponential difference growing at higher levels", () => {
78
+ const warriorConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Warrior);
79
+ const sorcererConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Sorcerer);
80
+ const warriorB = (0, skillProgression_constants_1.getTieredB)(warriorConstants.b, 10);
81
+ const sorcererB = (0, skillProgression_constants_1.getTieredB)(sorcererConstants.b, 10);
82
+ const warriorSP10 = (0, skillHelpers_1.getSPForLevelTiered)(10, A, warriorB, c);
83
+ const sorcererSP10 = (0, skillHelpers_1.getSPForLevelTiered)(10, A, sorcererB, c);
84
+ const ratio10 = sorcererSP10 / warriorSP10;
85
+ const warriorSP30 = (0, skillHelpers_1.getSPForLevelTiered)(30, A, warriorB, c);
86
+ const sorcererSP30 = (0, skillHelpers_1.getSPForLevelTiered)(30, A, sorcererB, c);
87
+ const ratio30 = sorcererSP30 / warriorSP30;
88
+ expect(ratio30).toBeGreaterThan(ratio10);
89
+ });
90
+ });
91
+ describe("Sorcerer magic vs Warrior magic (reversed affinities)", () => {
92
+ it("should require much less SP for Sorcerer than Warrior for magic", () => {
93
+ const sorcererConstants = (0, skillProgression_constants_1.getSkillConstants)("magic", character_types_1.CharacterClass.Sorcerer);
94
+ const warriorConstants = (0, skillProgression_constants_1.getSkillConstants)("magic", character_types_1.CharacterClass.Warrior);
95
+ const sorcererB = (0, skillProgression_constants_1.getTieredB)(sorcererConstants.b, 10);
96
+ const warriorB = (0, skillProgression_constants_1.getTieredB)(warriorConstants.b, 10);
97
+ expect(sorcererB).toBeLessThan(warriorB);
98
+ const sorcererSP = (0, skillHelpers_1.getSPForLevelTiered)(20, A, sorcererB, c);
99
+ const warriorSP = (0, skillHelpers_1.getSPForLevelTiered)(20, A, warriorB, c);
100
+ expect(warriorSP / sorcererSP).toBeGreaterThan(2);
101
+ });
102
+ });
103
+ describe("All classes have equal crafting progression", () => {
104
+ it("should require same SP for all classes to reach mining level 20", () => {
105
+ const classes = [character_types_1.CharacterClass.Warrior, character_types_1.CharacterClass.Sorcerer, character_types_1.CharacterClass.Hunter];
106
+ const spValues = classes.map((cls) => {
107
+ const constants = (0, skillProgression_constants_1.getSkillConstants)("mining", cls);
108
+ const b = (0, skillProgression_constants_1.getTieredB)(constants.b, 10);
109
+ return (0, skillHelpers_1.getSPForLevelTiered)(20, A, b, c);
110
+ });
111
+ expect(spValues[0]).toBe(spValues[1]);
112
+ expect(spValues[1]).toBe(spValues[2]);
113
+ });
114
+ });
115
+ describe("Affinity tier progression difficulty", () => {
116
+ it("should show increasing difficulty: Specialty < Good < Average < Weak < Terrible < Awful", () => {
117
+ const affinities = [1.1, 1.2, 1.3, 1.4, 1.5, 1.8];
118
+ const spValues = affinities.map((affinityB) => {
119
+ const effectiveB = (0, skillProgression_constants_1.getTieredB)(affinityB, 10);
120
+ return (0, skillHelpers_1.getSPForLevelTiered)(20, A, effectiveB, c);
121
+ });
122
+ for (let i = 1; i < spValues.length; i++) {
123
+ expect(spValues[i]).toBeGreaterThan(spValues[i - 1]);
124
+ }
125
+ expect(spValues[5] / spValues[0]).toBeGreaterThan(4);
126
+ });
127
+ });
128
+ describe("Realistic progression times", () => {
129
+ it("should show Warrior reaches sword level 50 much faster than Sorcerer", () => {
130
+ const warriorConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Warrior);
131
+ const sorcererConstants = (0, skillProgression_constants_1.getSkillConstants)("sword", character_types_1.CharacterClass.Sorcerer);
132
+ const warriorB = (0, skillProgression_constants_1.getTieredB)(warriorConstants.b, 50);
133
+ const sorcererB = (0, skillProgression_constants_1.getTieredB)(sorcererConstants.b, 50);
134
+ const warriorSP = (0, skillHelpers_1.getSPForLevelTiered)(50, A, warriorB, c);
135
+ const sorcererSP = (0, skillHelpers_1.getSPForLevelTiered)(50, A, sorcererB, c);
136
+ console.log(`Warrior sword 50: ${warriorSP.toLocaleString()} SP`);
137
+ console.log(`Sorcerer sword 50: ${sorcererSP.toLocaleString()} SP`);
138
+ console.log(`Ratio: ${(sorcererSP / warriorSP).toFixed(2)}x`);
139
+ expect(sorcererSP / warriorSP).toBeGreaterThan(5);
140
+ });
141
+ });
142
+ });
143
+ describe("skillHelpers - Edge Cases", () => {
144
+ it("should handle level 1 correctly (0 SP required)", () => {
145
+ expect((0, skillHelpers_1.getSPForLevelTiered)(1, A, 1.035, c)).toBe(0);
146
+ expect((0, skillHelpers_1.getLevelFromSPTiered)(0, A, 1.035, c)).toBe(1);
147
+ });
148
+ it("should return 0 SP for first level up regardless of b-value", () => {
149
+ expect((0, skillHelpers_1.getSPForLevelTiered)(2, A, 1.1, c)).toBe(A);
150
+ expect((0, skillHelpers_1.getSPForLevelTiered)(2, A, 1.8, c)).toBe(A);
151
+ });
152
+ it("should handle invalid inputs gracefully", () => {
153
+ expect((0, skillHelpers_1.getLevelFromSPTiered)(-100, A, 1.035, c)).toBe(c);
154
+ expect((0, skillHelpers_1.getLevelFromSPTiered)(0, A, 1.035, c)).toBe(c);
155
+ expect((0, skillHelpers_1.getLevelFromSPTiered)(0, 0, 1.035, c)).toBe(c);
156
+ });
157
+ it("should maintain monotonicity - SP strictly increases with level", () => {
158
+ const bValues = [1.035, 1.1, 1.3, 1.5];
159
+ bValues.forEach((b) => {
160
+ let previousSP = 0;
161
+ for (let level = 2; level <= 100; level++) {
162
+ const sp = (0, skillHelpers_1.getSPForLevelTiered)(level, A, b, c);
163
+ expect(sp).toBeGreaterThan(previousSP);
164
+ previousSP = sp;
165
+ }
166
+ });
167
+ });
168
+ });
169
+ //# sourceMappingURL=skillHelpers.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillHelpers.test.js","sourceRoot":"","sources":["../../src/helpers/skillHelpers.test.ts"],"names":[],"mappings":";;AAAA,8DAA0D;AAC1D,iDAAqH;AACrH,wFAAwF;AAGxF,MAAM,CAAC,GAAG,EAAE,CAAC;AACb,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,QAAQ,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACzE,QAAQ,CAA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AAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAEvC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,IAAI,UAAU,GAAG,CAAC,CAAC;YACnB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC1C,MAAM,EAAE,GAAG,IAAA,kCAAmB,EAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC/C,MAAM,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;gBACvC,UAAU,GAAG,EAAE,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getSpeedMultiplierBasedOnWeightRatio: (ratio: number) => number;
2
+ //# sourceMappingURL=weightHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weightHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/weightHelper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,GAAI,OAAO,MAAM,KAAG,MAQpE,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSpeedMultiplierBasedOnWeightRatio = void 0;
4
+ const getSpeedMultiplierBasedOnWeightRatio = (ratio) => {
5
+ if (ratio <= 1)
6
+ return 1;
7
+ if (ratio > 1 && ratio <= 2)
8
+ return 0.8;
9
+ if (ratio > 2 && ratio <= 6)
10
+ return 0.6;
11
+ return 0.1;
12
+ };
13
+ exports.getSpeedMultiplierBasedOnWeightRatio = getSpeedMultiplierBasedOnWeightRatio;
14
+ //# sourceMappingURL=weightHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weightHelper.js","sourceRoot":"","sources":["../../src/helpers/weightHelper.ts"],"names":[],"mappings":";;;AAAO,MAAM,oCAAoC,GAAG,CAAC,KAAa,EAAU,EAAE;IAC5E,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAEzB,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAExC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAExC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AARW,QAAA,oCAAoC,wCAQ/C"}
@@ -0,0 +1,78 @@
1
+ export * from "./constants/date.constants";
2
+ export * from "./constants/dc.constants";
3
+ export * from "./constants/npc.constants";
4
+ export * from "./constants/skillProgression.constants";
5
+ export * from "./constants/socket.constants";
6
+ export * from "./constants/world.constants";
7
+ export * from "./helpers/deviceHelpers";
8
+ export * from "./helpers/itemSlotHelper";
9
+ export { calculateSPToNextLevel, calculateSPToNextLevelExponential, calculateSPToNextLevelTiered, calculateXPToNextLevel, getLevelFromSP, getLevelFromSPTiered, getLevelFromXP, getSPForLevel, getSPForLevelExponential, getSPForLevelTiered, getSPForSingleLevelTiered, getTokensToNextLevel, getXPForLevel, } from "./helpers/skillHelpers";
10
+ export * from "./helpers/weightHelper";
11
+ export * from "./libs/GridHelper";
12
+ export * from "./libs/MathHelper";
13
+ export * from "./libs/SocketHelper";
14
+ export * from "./libs/TextHelper";
15
+ export * from "./libs/TypeHelper";
16
+ export * from "./types/animation.types";
17
+ export * from "./types/api.types";
18
+ export * from "./types/archiveIndex.types";
19
+ export * from "./types/attribution.types";
20
+ export * from "./types/asset.types";
21
+ export * from "./types/auth.types";
22
+ export * from "./types/battle.types";
23
+ export * from "./types/buff.types";
24
+ export * from "./types/character.types";
25
+ export * from "./types/characterCustomizationTypes";
26
+ export * from "./types/characterSkin.types";
27
+ export * from "./types/chat.types";
28
+ export * from "./types/dailyTasks.types";
29
+ export * from "./types/dc.types";
30
+ export * from "./types/depot.types";
31
+ export * from "./types/device.types";
32
+ export * from "./types/displayText.types";
33
+ export * from "./types/entity.types";
34
+ export * from "./types/env.types";
35
+ export * from "./types/equipment.types";
36
+ export * from "./types/friends.types";
37
+ export * from "./types/gem.types";
38
+ export * from "./types/googleOAuth.types";
39
+ export * from "./types/guild.types";
40
+ export * from "./types/informationCenter.types";
41
+ export * from "./types/inGameStore.types";
42
+ export * from "./types/inventory.types";
43
+ export * from "./types/item.types";
44
+ export * from "./types/itemContainer.types";
45
+ export * from "./types/leaderboard.types";
46
+ export * from "./types/loginStreak.types";
47
+ export * from "./types/macro.types";
48
+ export * from "./types/maps.types";
49
+ export * from "./types/marketplace.types";
50
+ export * from "./types/notification.types";
51
+ export * from "./types/npc.types";
52
+ export * from "./types/pagination.types";
53
+ export * from "./types/party.types";
54
+ export * from "./types/payment.types";
55
+ export * from "./types/places.types";
56
+ export * from "./types/preloadScene.types";
57
+ export * from "./types/premiumAccount.types";
58
+ export * from "./types/proficiency.types";
59
+ export * from "./types/purchase.types";
60
+ export * from "./types/quest.types";
61
+ export * from "./types/resource.types";
62
+ export * from "./types/scene.types";
63
+ export * from "./types/shortcut.types";
64
+ export * from "./types/simpleTutorial.types";
65
+ export * from "./types/skills.types";
66
+ export * from "./types/socket.types";
67
+ export * from "./types/spell.types";
68
+ export * from "./types/store.types";
69
+ export * from "./types/tiled.types";
70
+ export * from "./types/trade.types";
71
+ export * from "./types/translation.types";
72
+ export * from "./types/ui.types";
73
+ export * from "./types/uiHighlight.types";
74
+ export * from "./types/user.types";
75
+ export * from "./types/useWith.types";
76
+ export * from "./types/validation.types";
77
+ export * from "./types/view.types";
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getXPForLevel = exports.getTokensToNextLevel = exports.getSPForSingleLevelTiered = exports.getSPForLevelTiered = exports.getSPForLevelExponential = exports.getSPForLevel = exports.getLevelFromXP = exports.getLevelFromSPTiered = exports.getLevelFromSP = exports.calculateXPToNextLevel = exports.calculateSPToNextLevelTiered = exports.calculateSPToNextLevelExponential = exports.calculateSPToNextLevel = void 0;
18
+ __exportStar(require("./constants/date.constants"), exports);
19
+ __exportStar(require("./constants/dc.constants"), exports);
20
+ __exportStar(require("./constants/npc.constants"), exports);
21
+ __exportStar(require("./constants/skillProgression.constants"), exports);
22
+ __exportStar(require("./constants/socket.constants"), exports);
23
+ __exportStar(require("./constants/world.constants"), exports);
24
+ __exportStar(require("./helpers/deviceHelpers"), exports);
25
+ __exportStar(require("./helpers/itemSlotHelper"), exports);
26
+ var skillHelpers_1 = require("./helpers/skillHelpers");
27
+ Object.defineProperty(exports, "calculateSPToNextLevel", { enumerable: true, get: function () { return skillHelpers_1.calculateSPToNextLevel; } });
28
+ Object.defineProperty(exports, "calculateSPToNextLevelExponential", { enumerable: true, get: function () { return skillHelpers_1.calculateSPToNextLevelExponential; } });
29
+ Object.defineProperty(exports, "calculateSPToNextLevelTiered", { enumerable: true, get: function () { return skillHelpers_1.calculateSPToNextLevelTiered; } });
30
+ Object.defineProperty(exports, "calculateXPToNextLevel", { enumerable: true, get: function () { return skillHelpers_1.calculateXPToNextLevel; } });
31
+ Object.defineProperty(exports, "getLevelFromSP", { enumerable: true, get: function () { return skillHelpers_1.getLevelFromSP; } });
32
+ Object.defineProperty(exports, "getLevelFromSPTiered", { enumerable: true, get: function () { return skillHelpers_1.getLevelFromSPTiered; } });
33
+ Object.defineProperty(exports, "getLevelFromXP", { enumerable: true, get: function () { return skillHelpers_1.getLevelFromXP; } });
34
+ Object.defineProperty(exports, "getSPForLevel", { enumerable: true, get: function () { return skillHelpers_1.getSPForLevel; } });
35
+ Object.defineProperty(exports, "getSPForLevelExponential", { enumerable: true, get: function () { return skillHelpers_1.getSPForLevelExponential; } });
36
+ Object.defineProperty(exports, "getSPForLevelTiered", { enumerable: true, get: function () { return skillHelpers_1.getSPForLevelTiered; } });
37
+ Object.defineProperty(exports, "getSPForSingleLevelTiered", { enumerable: true, get: function () { return skillHelpers_1.getSPForSingleLevelTiered; } });
38
+ Object.defineProperty(exports, "getTokensToNextLevel", { enumerable: true, get: function () { return skillHelpers_1.getTokensToNextLevel; } });
39
+ Object.defineProperty(exports, "getXPForLevel", { enumerable: true, get: function () { return skillHelpers_1.getXPForLevel; } });
40
+ __exportStar(require("./helpers/weightHelper"), exports);
41
+ __exportStar(require("./libs/GridHelper"), exports);
42
+ __exportStar(require("./libs/MathHelper"), exports);
43
+ __exportStar(require("./libs/SocketHelper"), exports);
44
+ __exportStar(require("./libs/TextHelper"), exports);
45
+ __exportStar(require("./libs/TypeHelper"), exports);
46
+ __exportStar(require("./types/animation.types"), exports);
47
+ __exportStar(require("./types/api.types"), exports);
48
+ __exportStar(require("./types/archiveIndex.types"), exports);
49
+ __exportStar(require("./types/attribution.types"), exports);
50
+ __exportStar(require("./types/asset.types"), exports);
51
+ __exportStar(require("./types/auth.types"), exports);
52
+ __exportStar(require("./types/battle.types"), exports);
53
+ __exportStar(require("./types/buff.types"), exports);
54
+ __exportStar(require("./types/character.types"), exports);
55
+ __exportStar(require("./types/characterCustomizationTypes"), exports);
56
+ __exportStar(require("./types/characterSkin.types"), exports);
57
+ __exportStar(require("./types/chat.types"), exports);
58
+ __exportStar(require("./types/dailyTasks.types"), exports);
59
+ __exportStar(require("./types/dc.types"), exports);
60
+ __exportStar(require("./types/depot.types"), exports);
61
+ __exportStar(require("./types/device.types"), exports);
62
+ __exportStar(require("./types/displayText.types"), exports);
63
+ __exportStar(require("./types/entity.types"), exports);
64
+ __exportStar(require("./types/env.types"), exports);
65
+ __exportStar(require("./types/equipment.types"), exports);
66
+ __exportStar(require("./types/friends.types"), exports);
67
+ __exportStar(require("./types/gem.types"), exports);
68
+ __exportStar(require("./types/googleOAuth.types"), exports);
69
+ __exportStar(require("./types/guild.types"), exports);
70
+ __exportStar(require("./types/informationCenter.types"), exports);
71
+ __exportStar(require("./types/inGameStore.types"), exports);
72
+ __exportStar(require("./types/inventory.types"), exports);
73
+ __exportStar(require("./types/item.types"), exports);
74
+ __exportStar(require("./types/itemContainer.types"), exports);
75
+ __exportStar(require("./types/leaderboard.types"), exports);
76
+ __exportStar(require("./types/loginStreak.types"), exports);
77
+ __exportStar(require("./types/macro.types"), exports);
78
+ __exportStar(require("./types/maps.types"), exports);
79
+ __exportStar(require("./types/marketplace.types"), exports);
80
+ __exportStar(require("./types/notification.types"), exports);
81
+ __exportStar(require("./types/npc.types"), exports);
82
+ __exportStar(require("./types/pagination.types"), exports);
83
+ __exportStar(require("./types/party.types"), exports);
84
+ __exportStar(require("./types/payment.types"), exports);
85
+ __exportStar(require("./types/places.types"), exports);
86
+ __exportStar(require("./types/preloadScene.types"), exports);
87
+ __exportStar(require("./types/premiumAccount.types"), exports);
88
+ __exportStar(require("./types/proficiency.types"), exports);
89
+ __exportStar(require("./types/purchase.types"), exports);
90
+ __exportStar(require("./types/quest.types"), exports);
91
+ __exportStar(require("./types/resource.types"), exports);
92
+ __exportStar(require("./types/scene.types"), exports);
93
+ __exportStar(require("./types/shortcut.types"), exports);
94
+ __exportStar(require("./types/simpleTutorial.types"), exports);
95
+ __exportStar(require("./types/skills.types"), exports);
96
+ __exportStar(require("./types/socket.types"), exports);
97
+ __exportStar(require("./types/spell.types"), exports);
98
+ __exportStar(require("./types/store.types"), exports);
99
+ __exportStar(require("./types/tiled.types"), exports);
100
+ __exportStar(require("./types/trade.types"), exports);
101
+ __exportStar(require("./types/translation.types"), exports);
102
+ __exportStar(require("./types/ui.types"), exports);
103
+ __exportStar(require("./types/uiHighlight.types"), exports);
104
+ __exportStar(require("./types/user.types"), exports);
105
+ __exportStar(require("./types/useWith.types"), exports);
106
+ __exportStar(require("./types/validation.types"), exports);
107
+ __exportStar(require("./types/view.types"), exports);
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,2DAAyC;AACzC,4DAA0C;AAC1C,yEAAuD;AACvD,+DAA6C;AAC7C,8DAA4C;AAC5C,0DAAwC;AACxC,2DAAyC;AACzC,uDAcgC;AAb9B,sHAAA,sBAAsB,OAAA;AACtB,iIAAA,iCAAiC,OAAA;AACjC,4HAAA,4BAA4B,OAAA;AAC5B,sHAAA,sBAAsB,OAAA;AACtB,8GAAA,cAAc,OAAA;AACd,oHAAA,oBAAoB,OAAA;AACpB,8GAAA,cAAc,OAAA;AACd,6GAAA,aAAa,OAAA;AACb,wHAAA,wBAAwB,OAAA;AACxB,mHAAA,mBAAmB,OAAA;AACnB,yHAAA,yBAAyB,OAAA;AACzB,oHAAA,oBAAoB,OAAA;AACpB,6GAAA,aAAa,OAAA;AAEf,yDAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,oDAAkC;AAClC,0DAAwC;AACxC,oDAAkC;AAClC,6DAA2C;AAC3C,4DAA0C;AAC1C,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,qDAAmC;AACnC,0DAAwC;AACxC,sEAAoD;AACpD,8DAA4C;AAC5C,qDAAmC;AACnC,2DAAyC;AACzC,mDAAiC;AACjC,sDAAoC;AACpC,uDAAqC;AACrC,4DAA0C;AAC1C,uDAAqC;AACrC,oDAAkC;AAClC,0DAAwC;AACxC,wDAAsC;AACtC,oDAAkC;AAClC,4DAA0C;AAC1C,sDAAoC;AACpC,kEAAgD;AAChD,4DAA0C;AAC1C,0DAAwC;AACxC,qDAAmC;AACnC,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,sDAAoC;AACpC,qDAAmC;AACnC,4DAA0C;AAC1C,6DAA2C;AAC3C,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,wDAAsC;AACtC,uDAAqC;AACrC,6DAA2C;AAC3C,+DAA6C;AAC7C,4DAA0C;AAC1C,yDAAuC;AACvC,sDAAoC;AACpC,yDAAuC;AACvC,sDAAoC;AACpC,yDAAuC;AACvC,+DAA6C;AAC7C,uDAAqC;AACrC,uDAAqC;AACrC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,4DAA0C;AAC1C,mDAAiC;AACjC,4DAA0C;AAC1C,qDAAmC;AACnC,wDAAsC;AACtC,2DAAyC;AACzC,qDAAmC"}
@@ -0,0 +1,12 @@
1
+ import { AnimationDirection } from "../types/animation.types";
2
+ export declare const ToGridX: (x: number) => number;
3
+ export declare const ToGridY: (y: number) => number;
4
+ export declare const FromGridX: (gridX: number) => number;
5
+ export declare const FromGridY: (gridY: number) => number;
6
+ interface INewCalculatedPosition {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export declare const calculateNewPositionXY: (x: number, y: number, moveToDirection: AnimationDirection) => INewCalculatedPosition;
11
+ export {};
12
+ //# sourceMappingURL=GridHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridHelper.d.ts","sourceRoot":"","sources":["../../src/libs/GridHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,KAAG,MAAoC,CAAC;AACzE,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,KAAG,MAAqC,CAAC;AAE1E,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,MAAwC,CAAC;AACnF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,MAAyC,CAAC;AAEpF,UAAU,sBAAsB;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,sBAAsB,GACjC,GAAG,MAAM,EACT,GAAG,MAAM,EACT,iBAAiB,kBAAkB,KAClC,sBAuBF,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateNewPositionXY = exports.FromGridY = exports.FromGridX = exports.ToGridY = exports.ToGridX = void 0;
4
+ const world_constants_1 = require("../constants/world.constants");
5
+ const ToGridX = (x) => Math.round(x / world_constants_1.GRID_WIDTH);
6
+ exports.ToGridX = ToGridX;
7
+ const ToGridY = (y) => Math.round(y / world_constants_1.GRID_HEIGHT);
8
+ exports.ToGridY = ToGridY;
9
+ const FromGridX = (gridX) => Math.round(gridX * world_constants_1.GRID_WIDTH);
10
+ exports.FromGridX = FromGridX;
11
+ const FromGridY = (gridY) => Math.round(gridY * world_constants_1.GRID_HEIGHT);
12
+ exports.FromGridY = FromGridY;
13
+ const calculateNewPositionXY = (x, y, moveToDirection) => {
14
+ switch (moveToDirection) {
15
+ case "down":
16
+ return {
17
+ x,
18
+ y: y + world_constants_1.GRID_HEIGHT,
19
+ };
20
+ case "up":
21
+ return {
22
+ x,
23
+ y: y - world_constants_1.GRID_HEIGHT,
24
+ };
25
+ case "left":
26
+ return {
27
+ x: x - world_constants_1.GRID_WIDTH,
28
+ y,
29
+ };
30
+ case "right":
31
+ return {
32
+ x: x + world_constants_1.GRID_WIDTH,
33
+ y,
34
+ };
35
+ }
36
+ };
37
+ exports.calculateNewPositionXY = calculateNewPositionXY;
38
+ //# sourceMappingURL=GridHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridHelper.js","sourceRoot":"","sources":["../../src/libs/GridHelper.ts"],"names":[],"mappings":";;;AAAA,kEAAuE;AAGhE,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,4BAAU,CAAC,CAAC;AAA5D,QAAA,OAAO,WAAqD;AAClE,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,6BAAW,CAAC,CAAC;AAA7D,QAAA,OAAO,WAAsD;AAEnE,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,4BAAU,CAAC,CAAC;AAAtE,QAAA,SAAS,aAA6D;AAC5E,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,6BAAW,CAAC,CAAC;AAAvE,QAAA,SAAS,aAA8D;AAO7E,MAAM,sBAAsB,GAAG,CACpC,CAAS,EACT,CAAS,EACT,eAAmC,EACX,EAAE;IAC1B,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,MAAM;YACT,OAAO;gBACL,CAAC;gBACD,CAAC,EAAE,CAAC,GAAG,6BAAW;aACnB,CAAC;QACJ,KAAK,IAAI;YACP,OAAO;gBACL,CAAC;gBACD,CAAC,EAAE,CAAC,GAAG,6BAAW;aACnB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,CAAC,EAAE,CAAC,GAAG,4BAAU;gBACjB,CAAC;aACF,CAAC;QACJ,KAAK,OAAO;YACV,OAAO;gBACL,CAAC,EAAE,CAAC,GAAG,4BAAU;gBACjB,CAAC;aACF,CAAC;IACN,CAAC;AACH,CAAC,CAAC;AA3BW,QAAA,sBAAsB,0BA2BjC"}