@dchighs/dc-core 0.0.1

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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/dist/calculators/calculate-attack-damage.d.ts +17 -0
  3. package/dist/calculators/calculate-attack-damage.js +37 -0
  4. package/dist/calculators/calculate-dragon-feed-cost.d.ts +5 -0
  5. package/dist/calculators/calculate-dragon-feed-cost.js +20 -0
  6. package/dist/calculators/calculate-element-strengths.d.ts +1 -0
  7. package/dist/calculators/calculate-element-strengths.js +12 -0
  8. package/dist/calculators/calculate-element-weaknesses.d.ts +1 -0
  9. package/dist/calculators/calculate-element-weaknesses.js +12 -0
  10. package/dist/calculators/calculate-elements-strengths.d.ts +1 -0
  11. package/dist/calculators/calculate-elements-strengths.js +17 -0
  12. package/dist/calculators/calculate-orb-recall-gain.d.ts +5 -0
  13. package/dist/calculators/calculate-orb-recall-gain.js +24 -0
  14. package/dist/calculators/index.d.ts +7 -0
  15. package/dist/calculators/index.js +15 -0
  16. package/dist/enums/config-filter-item.d.ts +42 -0
  17. package/dist/enums/config-filter-item.js +46 -0
  18. package/dist/enums/config-language.d.ts +14 -0
  19. package/dist/enums/config-language.js +18 -0
  20. package/dist/enums/config-platform.d.ts +7 -0
  21. package/dist/enums/config-platform.js +11 -0
  22. package/dist/enums/dragon-category.d.ts +13 -0
  23. package/dist/enums/dragon-category.js +17 -0
  24. package/dist/enums/dragon-element.d.ts +24 -0
  25. package/dist/enums/dragon-element.js +28 -0
  26. package/dist/enums/dragon-phase.d.ts +6 -0
  27. package/dist/enums/dragon-phase.js +10 -0
  28. package/dist/enums/dragon-rank.d.ts +14 -0
  29. package/dist/enums/dragon-rank.js +18 -0
  30. package/dist/enums/dragon-rarity.d.ts +9 -0
  31. package/dist/enums/dragon-rarity.js +13 -0
  32. package/dist/enums/dragon-sprite-quality.d.ts +5 -0
  33. package/dist/enums/dragon-sprite-quality.js +9 -0
  34. package/dist/enums/index.d.ts +12 -0
  35. package/dist/enums/index.js +25 -0
  36. package/dist/enums/island-type.d.ts +10 -0
  37. package/dist/enums/island-type.js +14 -0
  38. package/dist/enums/static-file-url-platform-prefix.d.ts +7 -0
  39. package/dist/enums/static-file-url-platform-prefix.js +11 -0
  40. package/dist/enums/texture-compression-format.d.ts +7 -0
  41. package/dist/enums/texture-compression-format.js +11 -0
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.js +20 -0
  44. package/dist/settings/dragons.d.ts +132 -0
  45. package/dist/settings/dragons.js +157 -0
  46. package/dist/settings/elements.d.ts +135 -0
  47. package/dist/settings/elements.js +138 -0
  48. package/dist/settings/feed-costs.d.ts +4 -0
  49. package/dist/settings/feed-costs.js +285 -0
  50. package/dist/settings/index.d.ts +7 -0
  51. package/dist/settings/index.js +15 -0
  52. package/dist/settings/islands.d.ts +24 -0
  53. package/dist/settings/islands.js +27 -0
  54. package/dist/settings/orb-recall-return.d.ts +4 -0
  55. package/dist/settings/orb-recall-return.js +7 -0
  56. package/dist/settings/sounds.d.ts +3 -0
  57. package/dist/settings/sounds.js +6 -0
  58. package/dist/tools/get-music-name-from-tag.d.ts +1 -0
  59. package/dist/tools/get-music-name-from-tag.js +14 -0
  60. package/dist/tools/index.d.ts +9 -0
  61. package/dist/tools/index.js +19 -0
  62. package/dist/tools/validate-dragon-category.d.ts +4 -0
  63. package/dist/tools/validate-dragon-category.js +14 -0
  64. package/dist/tools/validate-dragon-level-compatibility-with-stars.d.ts +6 -0
  65. package/dist/tools/validate-dragon-level-compatibility-with-stars.js +40 -0
  66. package/dist/tools/validate-dragon-level.d.ts +4 -0
  67. package/dist/tools/validate-dragon-level.js +25 -0
  68. package/dist/tools/validate-dragon-rank.d.ts +4 -0
  69. package/dist/tools/validate-dragon-rank.js +14 -0
  70. package/dist/tools/validate-dragon-rarity.d.ts +5 -0
  71. package/dist/tools/validate-dragon-rarity.js +18 -0
  72. package/dist/tools/validate-dragon-stars.d.ts +4 -0
  73. package/dist/tools/validate-dragon-stars.js +25 -0
  74. package/dist/tools/validate-element-name.d.ts +4 -0
  75. package/dist/tools/validate-element-name.js +14 -0
  76. package/package.json +36 -0
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.feedCostSettings = void 0;
4
+ exports.feedCostSettings = [
5
+ {
6
+ part: 0,
7
+ total: 0
8
+ },
9
+ {
10
+ part: 5,
11
+ total: 20
12
+ },
13
+ {
14
+ part: 10,
15
+ total: 40
16
+ },
17
+ {
18
+ part: 20,
19
+ total: 80
20
+ },
21
+ {
22
+ part: 30,
23
+ total: 120
24
+ },
25
+ {
26
+ part: 35,
27
+ total: 140
28
+ },
29
+ {
30
+ part: 45,
31
+ total: 180
32
+ },
33
+ {
34
+ part: 50,
35
+ total: 200
36
+ },
37
+ {
38
+ part: 60,
39
+ total: 240
40
+ },
41
+ {
42
+ part: 65,
43
+ total: 260
44
+ },
45
+ {
46
+ part: 145,
47
+ total: 580
48
+ },
49
+ {
50
+ part: 230,
51
+ total: 920
52
+ },
53
+ {
54
+ part: 310,
55
+ total: 1240
56
+ },
57
+ {
58
+ part: 390,
59
+ total: 1560
60
+ },
61
+ {
62
+ part: 475,
63
+ total: 1900
64
+ },
65
+ {
66
+ part: 555,
67
+ total: 2220
68
+ },
69
+ {
70
+ part: 635,
71
+ total: 2540
72
+ },
73
+ {
74
+ part: 715,
75
+ total: 2860
76
+ },
77
+ {
78
+ part: 800,
79
+ total: 3200
80
+ },
81
+ {
82
+ part: 880,
83
+ total: 3520
84
+ },
85
+ {
86
+ part: 3190,
87
+ total: 12760
88
+ },
89
+ {
90
+ part: 5505,
91
+ total: 22020
92
+ },
93
+ {
94
+ part: 7815,
95
+ total: 31260
96
+ },
97
+ {
98
+ part: 10130,
99
+ total: 40520
100
+ },
101
+ {
102
+ part: 12440,
103
+ total: 49760
104
+ },
105
+ {
106
+ part: 14750,
107
+ total: 59000
108
+ },
109
+ {
110
+ part: 17065,
111
+ total: 68260
112
+ },
113
+ {
114
+ part: 19375,
115
+ total: 77500
116
+ },
117
+ {
118
+ part: 21690,
119
+ total: 86760
120
+ },
121
+ {
122
+ part: 24000,
123
+ total: 96000
124
+ },
125
+ {
126
+ part: 45600,
127
+ total: 182400
128
+ },
129
+ {
130
+ part: 67200,
131
+ total: 268800
132
+ },
133
+ {
134
+ part: 88800,
135
+ total: 355200
136
+ },
137
+ {
138
+ part: 110400,
139
+ total: 441600
140
+ },
141
+ {
142
+ part: 132000,
143
+ total: 528000
144
+ },
145
+ {
146
+ part: 153600,
147
+ total: 614400
148
+ },
149
+ {
150
+ part: 175200,
151
+ total: 700800
152
+ },
153
+ {
154
+ part: 196800,
155
+ total: 787200
156
+ },
157
+ {
158
+ part: 218400,
159
+ total: 873600
160
+ },
161
+ {
162
+ part: 240000,
163
+ total: 960000
164
+ },
165
+ {
166
+ part: 308160,
167
+ total: 1232640
168
+ },
169
+ {
170
+ part: 376320,
171
+ total: 1505280
172
+ },
173
+ {
174
+ part: 444480,
175
+ total: 1777920
176
+ },
177
+ {
178
+ part: 512640,
179
+ total: 2050560
180
+ },
181
+ {
182
+ part: 580800,
183
+ total: 2323200
184
+ },
185
+ {
186
+ part: 648960,
187
+ total: 2595840
188
+ },
189
+ {
190
+ part: 717120,
191
+ total: 2868480
192
+ },
193
+ {
194
+ part: 785280,
195
+ total: 3141120
196
+ },
197
+ {
198
+ part: 853440,
199
+ total: 3413760
200
+ },
201
+ {
202
+ part: 921600,
203
+ total: 3686400
204
+ },
205
+ {
206
+ part: 931200,
207
+ total: 3724800
208
+ },
209
+ {
210
+ part: 940800,
211
+ total: 3763200
212
+ },
213
+ {
214
+ part: 950400,
215
+ total: 3801600
216
+ },
217
+ {
218
+ part: 960000,
219
+ total: 3840000
220
+ },
221
+ {
222
+ part: 969600,
223
+ total: 3878400
224
+ },
225
+ {
226
+ part: 979200,
227
+ total: 3916800
228
+ },
229
+ {
230
+ part: 988800,
231
+ total: 3955200
232
+ },
233
+ {
234
+ part: 998400,
235
+ total: 3993600
236
+ },
237
+ {
238
+ part: 1008000,
239
+ total: 4032000
240
+ },
241
+ {
242
+ part: 1017600,
243
+ total: 4070400
244
+ },
245
+ {
246
+ part: 1027635,
247
+ total: 4110540
248
+ },
249
+ {
250
+ part: 1037670,
251
+ total: 4150680
252
+ },
253
+ {
254
+ part: 1047705,
255
+ total: 4190820
256
+ },
257
+ {
258
+ part: 1057740,
259
+ total: 4230960
260
+ },
261
+ {
262
+ part: 1067775,
263
+ total: 4271100
264
+ },
265
+ {
266
+ part: 1077810,
267
+ total: 4311240
268
+ },
269
+ {
270
+ part: 1087845,
271
+ total: 4351380
272
+ },
273
+ {
274
+ part: 1097880,
275
+ total: 4391520
276
+ },
277
+ {
278
+ part: 1107915,
279
+ total: 4431660
280
+ },
281
+ {
282
+ part: 1117952,
283
+ total: 4471808
284
+ }
285
+ ];
@@ -0,0 +1,7 @@
1
+ import { orbRecallReturnSettings } from "./orb-recall-return";
2
+ import { feedCostSettings } from "./feed-costs";
3
+ import { elementSettings } from "./elements";
4
+ import { islandSettings } from "./islands";
5
+ import { dragonSettings } from "./dragons";
6
+ import { soundSettings } from "./sounds";
7
+ export { orbRecallReturnSettings, feedCostSettings, elementSettings, islandSettings, dragonSettings, soundSettings };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.soundSettings = exports.dragonSettings = exports.islandSettings = exports.elementSettings = exports.feedCostSettings = exports.orbRecallReturnSettings = void 0;
4
+ const orb_recall_return_1 = require("./orb-recall-return");
5
+ Object.defineProperty(exports, "orbRecallReturnSettings", { enumerable: true, get: function () { return orb_recall_return_1.orbRecallReturnSettings; } });
6
+ const feed_costs_1 = require("./feed-costs");
7
+ Object.defineProperty(exports, "feedCostSettings", { enumerable: true, get: function () { return feed_costs_1.feedCostSettings; } });
8
+ const elements_1 = require("./elements");
9
+ Object.defineProperty(exports, "elementSettings", { enumerable: true, get: function () { return elements_1.elementSettings; } });
10
+ const islands_1 = require("./islands");
11
+ Object.defineProperty(exports, "islandSettings", { enumerable: true, get: function () { return islands_1.islandSettings; } });
12
+ const dragons_1 = require("./dragons");
13
+ Object.defineProperty(exports, "dragonSettings", { enumerable: true, get: function () { return dragons_1.dragonSettings; } });
14
+ const sounds_1 = require("./sounds");
15
+ Object.defineProperty(exports, "soundSettings", { enumerable: true, get: function () { return sounds_1.soundSettings; } });
@@ -0,0 +1,24 @@
1
+ import { IslandType } from "../enums/island-type";
2
+ export declare const islandSettings: {
3
+ fogIslands: {
4
+ type: IslandType;
5
+ };
6
+ gridIslands: {
7
+ type: IslandType;
8
+ };
9
+ mazeIslands: {
10
+ type: IslandType;
11
+ };
12
+ heroicRaces: {
13
+ type: IslandType;
14
+ };
15
+ runnerIslands: {
16
+ type: IslandType;
17
+ };
18
+ puzzleIslands: {
19
+ type: IslandType;
20
+ };
21
+ progressiveIslands: {
22
+ type: IslandType;
23
+ };
24
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.islandSettings = void 0;
4
+ const island_type_1 = require("../enums/island-type");
5
+ exports.islandSettings = {
6
+ fogIslands: {
7
+ type: island_type_1.IslandType.FogIslands
8
+ },
9
+ gridIslands: {
10
+ type: island_type_1.IslandType.GridIslands
11
+ },
12
+ mazeIslands: {
13
+ type: island_type_1.IslandType.MazeIslands
14
+ },
15
+ heroicRaces: {
16
+ type: island_type_1.IslandType.HeroicRaces
17
+ },
18
+ runnerIslands: {
19
+ type: island_type_1.IslandType.RunnerIslands
20
+ },
21
+ puzzleIslands: {
22
+ type: island_type_1.IslandType.PuzzleIslands
23
+ },
24
+ progressiveIslands: {
25
+ type: island_type_1.IslandType.ProgressiveIslands
26
+ }
27
+ };
@@ -0,0 +1,4 @@
1
+ export declare const orbRecallReturnSettings: {
2
+ perLevels: number[];
3
+ perStars: number[];
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.orbRecallReturnSettings = void 0;
4
+ exports.orbRecallReturnSettings = {
5
+ perLevels: [40, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2],
6
+ perStars: [120, 200, 320, 560, 800]
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare const soundSettings: {
2
+ musicKeyNames: string[];
3
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.soundSettings = void 0;
4
+ exports.soundSettings = {
5
+ musicKeyNames: ["107_audio_nw_maintheme", "150_dc_music_labyrinth_island_2015", "151_dc_music_labyrinth_battle_2015", "152_dc_christmas_music_2015", "166_dc_sun_island_music", "168_dc_moon_island_music", "196_dc_ninja_island_main", "197_dc_ninja_island_battle", "200_anniversary_island_music", "201_pirates_island_music", "202_pirates_island_battle_music", "203_journey_island_battle_music", "205_journey_island_part_02", "206_journey_island_part_03", "207_earth_travel_island_music", "207_heroic_race_music", "208_earth_travel_battle_music", "209_dc_jungle_island_music", "212_dc_music_atlantis_island", "213_dc_music_atlantis_battle", "214_dc_music_crazylab_island", "215_dc_music_crazylab_battle", "216_dc_summer_island_music", "217_dc_music_olympic_island", "218_dc_music_olympic_battle", "222_dc_amusument_park_island_music", "223_dc_amusument_park_battle_music", "224_dc_frankenstein_island", "225_dc_frankenstein_battle", "226_dc_dc_music_forest_battle", "227_dc_dc_music_forest_white", "232_dc_heroic_races_ocean_music", "233_dc_vampiric_island_music", "234_dc_vampiric_island_battle_music", "235_dc_heroic_races_winter_music", "236_dc_winter_tower_island_music", "247_dc_heroic_races_dark_realm_music", "248_dc_fairytale_island_music", "249_dc_fairytale_battle_music", "250_dc_heroic_races_elders_forest", "251_dc_stvalentine_island_music", "252_dc_stvalentine_battle_music", "257_dc_apocaypse_island_music", "264_dc_beautybeast_island_music", "265_dc_beautybeast_battle_music", "266_dc_boneyard_music", "267_dc_dc2056_island_music", "268_dc_dc2056_battle_music", "269_dc_heroic_races_spring", "270_dc_happyinferno_island_music", "271_dc_happyinferno_battle_music", "275_dc_music_got_island", "276_dc_music_got_island_battle", "281_dc_heroic_races_demonic_dojo", "283_dc_videogame_island_music", "284_dc_videogame_battle_music", "285_dc_summer_island_music", "286_dc_heroic_races_summer", "288_dc_music_dungeon_island", "289_dc_music_dungeon_battle", "291_dc_music_ragnarok_island", "292_dc_heroic_races_oni_forest", "293_dc_pvp_battle_theme_01", "296_dc_heroic_races_crystal", "297_dc_music_comic_island", "298_dc_music_comic_island_battle", "299_dc_heroic_races_factory", "300_dc_music_shadow_island", "301_dc_music_shadow_island_battle", "302_dc_heroic_races_galactic", "303_dc_heroic_races_frozen_lake", "304_dc_music_dragon_justice_island", "311_dc_music_illusion_island", "312_dc_music_illusion_island_battle", "363_dc_farm_island_music", "364_dc_farm_battle_music", "365_dc_burglar_island_music", "391_dc_music_blizzard_island", "392_dc_heroic_races_vortex", "393_dc_fire_and_ice_island_music_b", "394_dc_fire_and_ice_battle_music_b", "402_dc_music_snow_island", "403_dc_heroic_races_heaven", "406_dc_turbo_island_music", "407_dc_turbo_battle_music", "412_dc_music_oni_island", "413_dc_music_oni_island_battle", "414_dc_heroic_races_black_magic", "416_dc_watchtower_island_music", "418_dc_magic_castle_island_music", "419_dc_magic_castle_island_battle_music", "420_dc_neo_tokyo_island_music", "421_dc_heroic_races_pixel_art", "438_dc_dragon_wars_island", "439_dc_dragon_wars_island_battle", "440_dc_heroic_races_metagame", "443_dc_music_pyramid_island", "444_dc_pyramid_battle_music", "449_dc_team_races_atlas", "450_dc_music_ruined_tower_island", "451_dc_fae_island_music", "452_dc_fae_castle_music", "456_dc_team_races_yggdrassil", "457_dc_music_moon_elevator_tower_island", "459_dc_heroic_races_luxury_cruise", "460_dc_wasteland_rescue_island", "461_dc_wasteland_rescue_battle", "462_dc_funfair_island_music", "463_dc_music_funfair_battle_music", "476_dc_puzzle_island_music", "478_dc_chocolate_tower_island_music", "482_dc_heroic_races_dreamfields", "484_dc_hallomuertos_island_music", "485_dc_hallomuertos_battle_music", "486_dc_lost_temple_alliance_race_music", "487_dc_catacombs_island_music", "490_dc_divination_island_music", "491_dc_divination_battle_music", "492_dc_seasons_island_music", "493_dc_seasons_island_battle_music", "494_dc_weather_machine_island_music", "495_dc_heroic_races_christmas_party", "496_dc_color_splash_island_music", "497_dc_color_splash_battle_music", "498_dc_battleground_menu_music", "499_dc_battleground_battle_music_1", "501_dc_heroic_races_superheroes", "502_dc_galactic_mini_island_music", "503_dc_galactic_mini_battle_music", "504_dc_chinese_new_year_island_music", "505_dc_chinese_new_year_battle_music", "506_dc_valentine_puzzle_island_music", "507_dc_liberty_island_music", "508_dc_abyssal_island_music", "509_dc_abyssal_island_battle_music", "510_dc_carnaval_island_music", "514_dc_heroic_races_true_superheroes", "515_dc_sushi_puzzle_island_music", "517_dc_castle_town_island_music", "518_dc_castle_town_battle_music", "519_dc_heroic_races_eternity", "520_dc_chibi_puzzle_island_music", "521_dc_easter_fog_island_music", "522_dc_fast_food_island_music", "523_dc_fast_food_battle_music", "524_dc_cosmic_puzzle", "525_dc_heroic_races_the_fallen_music", "527_dc_tank_blitz_island_music", "528_dc_tank_blitz_battle_music", "529_dc_pet_island_music", "530_dc_pet_island_battle_music", "531_dc_party_planning_island", "532_dc_party_planning_island_battle", "533_dc_heroic_races_positivity", "536_dc_runner_island_menu_music", "537_dc_runner_island_level_music_01", "540_dc_search_puzzle_island_music", "541_dc_toy_tower_island_music", "549_dc_martial_arts_island_music", "557_dc_music_festival_island_music", "558_dc_music_festival_island_battle_music", "561_dc_heroic_races_pirates", "562_dc_fantasy_island_music", "563_dc_fantasy_island_battle_music", "564_dc_safari_puzzle_island_music", "566_dc_heroic_races_community", "567_dc_wild_animals_island_music", "568_dc_wild_animals_island_battle_music", "569_dc_mafia_island_music", "570_dc_heroic_races_halloween", "571_dc_seven_wonders_island_music", "572_dc_seven_wonders_island_battle_music", "577_dc_puzzle_knights_island_music", "578_dc_knights_paladins_island_music", "579_dc_knights_paladins_island_battle_music", "580_dc_heroic_races_cybernetic", "581_dc_aquatic_runner_island_menu_music", "582_dc_aquatic_runner_island_level_music", "583_dc_winter_runner_island_menu_music", "584_dc_winter_runner_island_level_music", "586_dc_xmas_19_island_music", "587_dc_xmas_19_island_battle_music", "588_dc_winter_island_music", "589_dc_winter_island_battle_music", "590_dc_heroic_races_frozen_cave", "591_dc_abyssal_fog_island_music", "600_dc_heroic_races_virago", "608_dc_music_maze_easter_map_loop", "609_dc_music_maze_easter_battle_loop", "610_dc_music_maze_gods_island_loop", "611_dc_music_puzzle_gods_island_loop", "612_dc_music_battle_gods_island_loop", "613_dc_music_maze_5_de_mayo_loop", "614_dc_music_battle_5_de_mayo_loop", "617_dc_music_battle_pass_mysterious_loop", "MAIN1.MP3", "MAIN2.MP3", "MAIN3.MP3", "New Text Document.txt", "dc_music_celestial_island_2015", "dc_music_garden_battle", "dc_music_garden_island", "dc_music_got_island_2015", "dc_music_halloween_battle_2015", "dc_music_halloween_island_2015", "dc_music_hollywood_island_battle", "dc_music_idol_island", "dc_music_ufo_island_2015", "dungeon_gridisland_background_music", "dungeon_gridisland_battle_music", "songcolisseum_b_2", "songcolisseum_c_1"]
6
+ };
@@ -0,0 +1 @@
1
+ export declare function getMusicKeyNameFromTag(tag: string): string | undefined;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMusicKeyNameFromTag = getMusicKeyNameFromTag;
4
+ const sounds_1 = require("../settings/sounds");
5
+ function getMusicKeyNameFromTag(tag) {
6
+ const tagInLowerCase = tag.toLowerCase();
7
+ const musicName1 = `dc_${tagInLowerCase}_island`;
8
+ const musicName2 = `_${tagInLowerCase}`;
9
+ for (const musicKeyName of sounds_1.soundSettings.musicKeyNames) {
10
+ if (musicKeyName.includes(musicName1) || musicKeyName.endsWith(musicName2)) {
11
+ return musicKeyName;
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ import { validateDragonLevelCompatibilityWithStars } from "./validate-dragon-level-compatibility-with-stars";
2
+ import { validateDragonCategory } from "./validate-dragon-category";
3
+ import { getMusicKeyNameFromTag } from "./get-music-name-from-tag";
4
+ import { validateDragonRarity } from "./validate-dragon-rarity";
5
+ import { validateDragonStars } from "./validate-dragon-stars";
6
+ import { validateElementName } from "./validate-element-name";
7
+ import { validateDragonLevel } from "./validate-dragon-level";
8
+ import { validateDragonRank } from "./validate-dragon-rank";
9
+ export { validateDragonLevelCompatibilityWithStars, validateDragonCategory, getMusicKeyNameFromTag, validateDragonRarity, validateDragonStars, validateElementName, validateDragonLevel, validateDragonRank, };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonRank = exports.validateDragonLevel = exports.validateElementName = exports.validateDragonStars = exports.validateDragonRarity = exports.getMusicKeyNameFromTag = exports.validateDragonCategory = exports.validateDragonLevelCompatibilityWithStars = void 0;
4
+ const validate_dragon_level_compatibility_with_stars_1 = require("./validate-dragon-level-compatibility-with-stars");
5
+ Object.defineProperty(exports, "validateDragonLevelCompatibilityWithStars", { enumerable: true, get: function () { return validate_dragon_level_compatibility_with_stars_1.validateDragonLevelCompatibilityWithStars; } });
6
+ const validate_dragon_category_1 = require("./validate-dragon-category");
7
+ Object.defineProperty(exports, "validateDragonCategory", { enumerable: true, get: function () { return validate_dragon_category_1.validateDragonCategory; } });
8
+ const get_music_name_from_tag_1 = require("./get-music-name-from-tag");
9
+ Object.defineProperty(exports, "getMusicKeyNameFromTag", { enumerable: true, get: function () { return get_music_name_from_tag_1.getMusicKeyNameFromTag; } });
10
+ const validate_dragon_rarity_1 = require("./validate-dragon-rarity");
11
+ Object.defineProperty(exports, "validateDragonRarity", { enumerable: true, get: function () { return validate_dragon_rarity_1.validateDragonRarity; } });
12
+ const validate_dragon_stars_1 = require("./validate-dragon-stars");
13
+ Object.defineProperty(exports, "validateDragonStars", { enumerable: true, get: function () { return validate_dragon_stars_1.validateDragonStars; } });
14
+ const validate_element_name_1 = require("./validate-element-name");
15
+ Object.defineProperty(exports, "validateElementName", { enumerable: true, get: function () { return validate_element_name_1.validateElementName; } });
16
+ const validate_dragon_level_1 = require("./validate-dragon-level");
17
+ Object.defineProperty(exports, "validateDragonLevel", { enumerable: true, get: function () { return validate_dragon_level_1.validateDragonLevel; } });
18
+ const validate_dragon_rank_1 = require("./validate-dragon-rank");
19
+ Object.defineProperty(exports, "validateDragonRank", { enumerable: true, get: function () { return validate_dragon_rank_1.validateDragonRank; } });
@@ -0,0 +1,4 @@
1
+ export type ValidateDragonLevelOptions = {
2
+ throwOnError?: boolean;
3
+ };
4
+ export declare function validateDragonCategory(category: number, { throwOnError }?: ValidateDragonLevelOptions): boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonCategory = validateDragonCategory;
4
+ const dragons_1 = require("../settings/dragons");
5
+ function validateDragonCategory(category, { throwOnError = false } = { throwOnError: false }) {
6
+ const dragonCategories = Object.values(dragons_1.dragonSettings.categories);
7
+ if (!dragonCategories.includes(category)) {
8
+ if (throwOnError) {
9
+ throw new Error(`Invalid dragon category: ${category}. Expected values: ${dragonCategories.join(", ")}`);
10
+ }
11
+ return false;
12
+ }
13
+ return true;
14
+ }
@@ -0,0 +1,6 @@
1
+ export type validateDragonLevelCompatibilityWithStarsOptions = {
2
+ level: number;
3
+ stars: number;
4
+ throwOnError?: boolean;
5
+ };
6
+ export declare function validateDragonLevelCompatibilityWithStars({ level, stars, throwOnError }: validateDragonLevelCompatibilityWithStarsOptions): boolean;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonLevelCompatibilityWithStars = validateDragonLevelCompatibilityWithStars;
4
+ const validate_dragon_level_1 = require("./validate-dragon-level");
5
+ const validate_dragon_stars_1 = require("./validate-dragon-stars");
6
+ const dragons_1 = require("../settings/dragons");
7
+ function validateDragonLevelCompatibilityWithStars({ level, stars, throwOnError = false }) {
8
+ (0, validate_dragon_level_1.validateDragonLevel)(level, { throwOnError: throwOnError });
9
+ (0, validate_dragon_stars_1.validateDragonStars)(stars, { throwOnError: throwOnError });
10
+ if (stars === 0) {
11
+ if (level > dragons_1.dragonSettings.levels.maximumWithoutEmpowerment) {
12
+ if (throwOnError) {
13
+ throw new Error(`Dragon level cannot be higher than ${dragons_1.dragonSettings.levels.maximumWithoutEmpowerment} when stars are 0.`);
14
+ }
15
+ return false;
16
+ }
17
+ return true;
18
+ }
19
+ if (stars > 0 && level < dragons_1.dragonSettings.levels.minimumToEmpower) {
20
+ if (throwOnError) {
21
+ throw new Error(`Dragon level must be higher than or equal to ${dragons_1.dragonSettings.levels.minimumToEmpower} when stars are not 0.`);
22
+ }
23
+ return false;
24
+ }
25
+ if (stars > dragons_1.dragonSettings.empowerment.stages.length) {
26
+ if (throwOnError) {
27
+ throw new Error("Dragon stars cannot be higher than the maximum number of empowerment stages.");
28
+ }
29
+ return false;
30
+ }
31
+ const stageIndex = stars - 1;
32
+ const dragonMaxLevel = dragons_1.dragonSettings.empowerment.stages[stageIndex].dragonMaximumLevel;
33
+ if (level > dragonMaxLevel) {
34
+ if (throwOnError) {
35
+ throw new Error(`Dragon level cannot be higher than ${dragonMaxLevel} when stars are ${stars}.`);
36
+ }
37
+ return false;
38
+ }
39
+ return true;
40
+ }
@@ -0,0 +1,4 @@
1
+ export type ValidateDragonLevelOptions = {
2
+ throwOnError: boolean;
3
+ };
4
+ export declare function validateDragonLevel(level: number, { throwOnError }?: ValidateDragonLevelOptions): boolean;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonLevel = validateDragonLevel;
4
+ const dragons_1 = require("../settings/dragons");
5
+ function validateDragonLevel(level, { throwOnError = false } = { throwOnError: false }) {
6
+ if (!Number.isInteger(level)) {
7
+ if (throwOnError) {
8
+ throw new Error("The dragon level must be an integer!");
9
+ }
10
+ return false;
11
+ }
12
+ if (level < dragons_1.dragonSettings.levels.minimum) {
13
+ if (throwOnError) {
14
+ throw new Error(`The dragon cannot have a level lower than ${dragons_1.dragonSettings.levels.minimum}!`);
15
+ }
16
+ return false;
17
+ }
18
+ if (level > dragons_1.dragonSettings.levels.maximum) {
19
+ if (throwOnError) {
20
+ throw new Error(`The dragon cannot have a level higher than ${dragons_1.dragonSettings.levels.maximum}!`);
21
+ }
22
+ return false;
23
+ }
24
+ return true;
25
+ }
@@ -0,0 +1,4 @@
1
+ export type ValidateDragonRankOptions = {
2
+ throwOnError?: boolean;
3
+ };
4
+ export declare function validateDragonRank(rank: number, { throwOnError }?: ValidateDragonRankOptions): boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonRank = validateDragonRank;
4
+ const dragons_1 = require("../settings/dragons");
5
+ function validateDragonRank(rank, { throwOnError = false } = { throwOnError: false }) {
6
+ const dragonRanks = Object.values(dragons_1.dragonSettings.ranks).map(dragonRank => dragonRank.index);
7
+ if (rank !== 0 && !dragonRanks.includes(rank)) {
8
+ if (throwOnError) {
9
+ throw new Error(`Invalid dragon rank. Available ranks: ${dragonRanks.join(", ")}`);
10
+ }
11
+ return false;
12
+ }
13
+ return true;
14
+ }
@@ -0,0 +1,5 @@
1
+ export type ValidateDragonRarityOptions = {
2
+ throwOnError?: boolean;
3
+ useLowerCase?: boolean;
4
+ };
5
+ export declare function validateDragonRarity(rarity: string, { throwOnError, useLowerCase }?: ValidateDragonRarityOptions): boolean;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonRarity = validateDragonRarity;
4
+ const dragons_1 = require("../settings/dragons");
5
+ function validateDragonRarity(rarity, { throwOnError = false, useLowerCase } = { throwOnError: false }) {
6
+ let dragonRarities = Object.values(dragons_1.dragonSettings.rarities);
7
+ if (useLowerCase) {
8
+ rarity = rarity.toLowerCase();
9
+ dragonRarities = dragonRarities.map(rarity => rarity.toLowerCase());
10
+ }
11
+ if (!dragonRarities.includes(rarity)) {
12
+ if (throwOnError) {
13
+ throw new Error(`Invalid dragon rarity: ${rarity}. Available rarities: ${dragonRarities.join(", ")}`);
14
+ }
15
+ return false;
16
+ }
17
+ return true;
18
+ }
@@ -0,0 +1,4 @@
1
+ export type ValidateDragonStarsOptions = {
2
+ throwOnError?: boolean;
3
+ };
4
+ export declare function validateDragonStars(stars: number, { throwOnError }?: ValidateDragonStarsOptions): boolean;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDragonStars = validateDragonStars;
4
+ const dragons_1 = require("../settings/dragons");
5
+ function validateDragonStars(stars, { throwOnError = false } = { throwOnError: false }) {
6
+ if (!Number.isInteger(stars)) {
7
+ if (throwOnError) {
8
+ throw new Error("The dragon stars must be an integer!");
9
+ }
10
+ return false;
11
+ }
12
+ if (stars < dragons_1.dragonSettings.empowerment.starts.minimum) {
13
+ if (throwOnError) {
14
+ throw new Error(`Dragon stars must be at least ${dragons_1.dragonSettings.empowerment.starts.minimum}!`);
15
+ }
16
+ return false;
17
+ }
18
+ if (stars > dragons_1.dragonSettings.empowerment.starts.maximum) {
19
+ if (throwOnError) {
20
+ throw new Error(`Dragon stars cannot exceed ${dragons_1.dragonSettings.empowerment.starts.maximum}!`);
21
+ }
22
+ return false;
23
+ }
24
+ return true;
25
+ }
@@ -0,0 +1,4 @@
1
+ export type ValidateElementOptions = {
2
+ throwOnError?: boolean;
3
+ };
4
+ export declare function validateElementName(elementName: string, { throwOnError }?: ValidateElementOptions): boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateElementName = validateElementName;
4
+ const elements_1 = require("../settings/elements");
5
+ function validateElementName(elementName, { throwOnError = false } = { throwOnError: false }) {
6
+ const elementNames = Object.keys(elements_1.elementSettings);
7
+ if (!elementNames.includes(elementName)) {
8
+ if (throwOnError) {
9
+ throw new Error(`Invalid element name: ${elementName}. Expected values: ${elementNames.join(", ")}`);
10
+ }
11
+ return false;
12
+ }
13
+ return true;
14
+ }