farming-weight 0.7.1 → 0.7.2

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 (134) hide show
  1. package/dist/classes/farmingaccessory.d.ts +10 -10
  2. package/dist/classes/farmingaccessory.js +50 -50
  3. package/dist/classes/farmingarmor.d.ts +41 -38
  4. package/dist/classes/farmingarmor.js +202 -207
  5. package/dist/classes/farmingequipment.d.ts +17 -17
  6. package/dist/classes/farmingequipment.js +105 -109
  7. package/dist/classes/farmingpet.d.ts +14 -14
  8. package/dist/classes/farmingpet.js +91 -90
  9. package/dist/classes/farmingtool.d.ts +34 -34
  10. package/dist/classes/farmingtool.js +192 -202
  11. package/dist/classes/item.d.ts +18 -18
  12. package/dist/classes/item.js +11 -11
  13. package/dist/classes/lotusgear.d.ts +17 -17
  14. package/dist/classes/lotusgear.js +103 -107
  15. package/dist/classes/player.d.ts +58 -55
  16. package/dist/classes/player.js +215 -228
  17. package/dist/classes/weightcalc.d.ts +56 -52
  18. package/dist/classes/weightcalc.js +185 -190
  19. package/dist/classes/weightcalc.test.js +102 -102
  20. package/dist/constants/accessories.d.ts +6 -6
  21. package/dist/constants/accessories.js +51 -51
  22. package/dist/constants/armor.d.ts +30 -30
  23. package/dist/constants/armor.js +699 -699
  24. package/dist/constants/enchants.d.ts +1 -1
  25. package/dist/constants/enchants.js +56 -56
  26. package/dist/constants/enchants.js.map +1 -1
  27. package/dist/constants/equipment.d.ts +20 -20
  28. package/dist/constants/equipment.js +116 -116
  29. package/dist/constants/gems.d.ts +2 -2
  30. package/dist/constants/gems.js +8 -8
  31. package/dist/constants/items.d.ts +8 -8
  32. package/dist/constants/items.js +14 -14
  33. package/dist/constants/lotus.d.ts +20 -20
  34. package/dist/constants/lotus.js +106 -106
  35. package/dist/constants/pets.d.ts +38 -38
  36. package/dist/constants/pets.js +253 -253
  37. package/dist/constants/reforges.d.ts +1 -1
  38. package/dist/constants/reforges.js +1 -1
  39. package/dist/constants/reforges.js.map +1 -1
  40. package/dist/constants/specific.d.ts +1 -1
  41. package/dist/constants/specific.js +6 -6
  42. package/dist/constants/stats.d.ts +1 -1
  43. package/dist/constants/tempfortune.js +14 -14
  44. package/dist/constants/tempfortune.js.map +1 -1
  45. package/dist/constants/tools.d.ts +7 -7
  46. package/dist/constants/tools.js +456 -456
  47. package/dist/constants/upgrades.d.ts +6 -6
  48. package/dist/crops/special.js +1 -1
  49. package/dist/crops/special.js.map +1 -1
  50. package/dist/fortune/farmingaccessory.d.ts +1 -1
  51. package/dist/fortune/farmingaccessory.js +1 -1
  52. package/dist/fortune/farmingaccessory.js.map +1 -1
  53. package/dist/fortune/farmingarmor.d.ts +4 -3
  54. package/dist/fortune/farmingarmor.js +28 -17
  55. package/dist/fortune/farmingarmor.js.map +1 -1
  56. package/dist/fortune/farmingequipment.d.ts +3 -3
  57. package/dist/fortune/farmingequipment.js +5 -5
  58. package/dist/fortune/farmingequipment.js.map +1 -1
  59. package/dist/fortune/farmingpet.d.ts +3 -3
  60. package/dist/fortune/farmingpet.js +2 -2
  61. package/dist/fortune/farmingpet.js.map +1 -1
  62. package/dist/fortune/farmingtool.d.ts +2 -2
  63. package/dist/fortune/farmingtool.js +4 -4
  64. package/dist/fortune/farmingtool.js.map +1 -1
  65. package/dist/fortune/upgradable.d.ts +35 -33
  66. package/dist/fortune/upgradable.js +1 -1
  67. package/dist/fortune/upgradeable.d.ts +6 -6
  68. package/dist/fortune/upgradeable.js +3 -3
  69. package/dist/fortune/upgradeable.js.map +1 -1
  70. package/dist/items/accessories.d.ts +1 -1
  71. package/dist/items/accessories.js +3 -3
  72. package/dist/items/accessories.js.map +1 -1
  73. package/dist/items/armor.d.ts +2 -2
  74. package/dist/items/armor.js +2 -2
  75. package/dist/items/armor.js.map +1 -1
  76. package/dist/items/equipment.js +8 -8
  77. package/dist/items/equipment.js.map +1 -1
  78. package/dist/items/pets.d.ts +2 -2
  79. package/dist/items/pets.js +15 -15
  80. package/dist/items/pets.js.map +1 -1
  81. package/dist/items/tools.d.ts +1 -1
  82. package/dist/items/tools.js +15 -15
  83. package/dist/items/tools.js.map +1 -1
  84. package/dist/player/index.js +1 -1
  85. package/dist/player/player.d.ts +1 -1
  86. package/dist/player/player.js +9 -9
  87. package/dist/player/player.js.map +1 -1
  88. package/dist/player/playeroptions.d.ts +10 -10
  89. package/dist/player.d.ts +21 -21
  90. package/dist/player.js +26 -26
  91. package/dist/ratecalc.d.ts +16 -14
  92. package/dist/ratecalc.js +148 -145
  93. package/dist/tool.js +3 -3
  94. package/dist/upgrades/progress.d.ts +2 -2
  95. package/dist/upgrades/progress.js +3 -3
  96. package/dist/upgrades/progress.js.map +1 -1
  97. package/dist/upgrades/sources/accessorysources.d.ts +2 -2
  98. package/dist/upgrades/sources/accessorysources.js +10 -8
  99. package/dist/upgrades/sources/accessorysources.js.map +1 -1
  100. package/dist/upgrades/sources/armorsetsources.d.ts +2 -2
  101. package/dist/upgrades/sources/armorsetsources.js +12 -11
  102. package/dist/upgrades/sources/armorsetsources.js.map +1 -1
  103. package/dist/upgrades/sources/cropsources.d.ts +3 -3
  104. package/dist/upgrades/sources/cropsources.js +22 -22
  105. package/dist/upgrades/sources/cropsources.js.map +1 -1
  106. package/dist/upgrades/sources/gearsources.d.ts +3 -3
  107. package/dist/upgrades/sources/gearsources.js +18 -19
  108. package/dist/upgrades/sources/gearsources.js.map +1 -1
  109. package/dist/upgrades/sources/generalsources.d.ts +2 -2
  110. package/dist/upgrades/sources/generalsources.js +18 -16
  111. package/dist/upgrades/sources/generalsources.js.map +1 -1
  112. package/dist/upgrades/sources/toolsources.d.ts +5 -5
  113. package/dist/upgrades/sources/toolsources.js +24 -23
  114. package/dist/upgrades/sources/toolsources.js.map +1 -1
  115. package/dist/upgrades/upgrades.d.ts +4 -4
  116. package/dist/upgrades/upgrades.js +19 -19
  117. package/dist/upgrades/upgrades.js.map +1 -1
  118. package/dist/util/enchants.d.ts +3 -3
  119. package/dist/util/enchants.js +1 -1
  120. package/dist/util/enchants.js.map +1 -1
  121. package/dist/util/garden.d.ts +2 -2
  122. package/dist/util/garden.js +6 -7
  123. package/dist/util/garden.js.map +1 -1
  124. package/dist/util/gems.d.ts +2 -2
  125. package/dist/util/gems.js +24 -14
  126. package/dist/util/gems.js.map +1 -1
  127. package/dist/util/pests.js +1 -1
  128. package/dist/util/pests.js.map +1 -1
  129. package/dist/util/pests.test.js +27 -25
  130. package/dist/util/ratecalc.js +2 -2
  131. package/dist/util/ratecalc.js.map +1 -1
  132. package/dist/util/skyblocktime.js +1 -1
  133. package/dist/util/skyblocktime.js.map +1 -1
  134. package/package.json +36 -48
@@ -1,206 +1,196 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.FarmingTool = void 0;
4
- const enchants_1 = require("../constants/enchants");
5
- const reforges_1 = require("../constants/reforges");
6
- const tools_1 = require("../constants/tools");
7
- const gems_1 = require("../util/gems");
8
- const itemstats_1 = require("../util/itemstats");
9
- const lore_1 = require("../util/lore");
4
+ const ENCHANTS_1 = require('../constants/enchants');
5
+ const REFORGES_1 = require('../constants/reforges');
6
+ const TOOLS_1 = require('../constants/tools');
7
+ const GEMS_1 = require('../util/gems');
8
+ const ITEMSTATS_1 = require('../util/itemstats');
9
+ const LORE_1 = require('../util/lore');
10
10
  class FarmingTool {
11
- get name() {
12
- return this.colorPrefix + (this.reforge?.name ?? '') + ' ' + this.itemname;
13
- }
14
- constructor(item, options) {
15
- this.rebuildTool(item, options);
16
- }
17
- setOptions(options) {
18
- this.options = options;
19
- this.fortune = this.getFortune();
20
- }
21
- rebuildTool(item, options) {
22
- this.options = options;
23
- this.item = item;
24
- const tool = tools_1.FARMING_TOOLS[item.skyblockId];
25
- if (!tool) {
26
- throw new Error(`Unknown farming tool: ${item.name} (${item.skyblockId})`);
27
- }
28
- this.tool = tool;
29
- this.crop = tool.crop;
30
- if (item.lore) {
31
- this.rarity = (0, itemstats_1.getRarityFromLore)(item.lore);
32
- }
33
- this.counter = this.getCounter();
34
- this.cultivating = this.getCultivating() ?? 0;
35
- this.logCounter = 0;
36
- this.collAnalysis = 0;
37
- this.setReforge(item.attributes?.modifier ?? '');
38
- this.farmingForDummies = +(this.item.attributes?.farming_for_dummies_count ?? 0);
39
- this.recombobulated = this.item.attributes?.rarity_upgrades === '1';
40
- this.fortune = this.getFortune();
41
- if (this.reforge?.name && item.name) {
42
- const [prefix, name] = item.name.split(this.reforge.name);
43
- this.colorPrefix = prefix ?? '';
44
- this.itemname = name?.trim() ?? '';
45
- }
46
- else {
47
- this.colorPrefix = '';
48
- this.itemname = item.name ?? '';
49
- }
50
- }
51
- setReforge(reforgeId) {
52
- this.reforge = reforges_1.REFORGES[reforgeId] ?? undefined;
53
- this.reforgeStats = this.reforge?.tiers?.[this.rarity];
54
- }
55
- changeReforgeTo(reforgeId) {
56
- this.setReforge(reforgeId);
57
- this.fortune = this.getFortune();
58
- }
59
- changeFarmedCropsTo(crops) {
60
- if (this.tool.type !== tools_1.FarmingToolType.MathematicalHoe)
61
- return;
62
- const digits = Math.floor(crops).toString().length - 4;
63
- if (this.logCounter > 0) {
64
- this.logCounter = digits * 16;
65
- }
66
- if (this.collAnalysis > 0) {
67
- this.collAnalysis = digits * 8;
68
- }
69
- this.fortune = this.getFortune();
70
- }
71
- getFortune() {
72
- this.fortuneBreakdown = {};
73
- let sum = 0;
74
- // Base fortune
75
- const base = this.tool.baseStats?.[reforges_1.Stat.FarmingFortune] ?? 0;
76
- if (base > 0) {
77
- this.fortuneBreakdown['Tool Bonus'] = base;
78
- sum += base;
79
- }
80
- // Tool rarity stats
81
- const baseRarity = this.recombobulated ? (0, itemstats_1.previousRarity)(this.rarity) : this.rarity;
82
- const rarityStats = this.tool.stats?.[baseRarity]?.[reforges_1.Stat.FarmingFortune] ?? 0;
83
- if (rarityStats > 0) {
84
- this.fortuneBreakdown['Tool Stats'] = rarityStats;
85
- sum += rarityStats;
86
- }
87
- // Reforge stats
88
- const reforge = this.reforgeStats?.stats?.[reforges_1.Stat.FarmingFortune] ?? 0;
89
- if (reforge > 0) {
90
- this.fortuneBreakdown[this.reforge?.name ?? 'Reforge'] = reforge;
91
- sum += reforge;
92
- }
93
- // Farming for Dummies
94
- if (this.farmingForDummies > 0) {
95
- this.fortuneBreakdown['Farming for Dummies'] = this.farmingForDummies;
96
- sum += this.farmingForDummies;
97
- }
98
- // Collection analysis and digit bonuses
99
- if (this.tool.type === tools_1.FarmingToolType.MathematicalHoe) {
100
- this.getFarmingAbilityFortune(this);
101
- if (this.logCounter > 0) {
102
- this.fortuneBreakdown['Logarithmic Counter'] = this.logCounter;
103
- sum += this.logCounter;
104
- }
105
- if (this.collAnalysis > 0) {
106
- this.fortuneBreakdown['Collection Analysis'] = this.collAnalysis;
107
- sum += this.collAnalysis;
108
- }
109
- }
110
- // Gems
111
- const peridot = (0, gems_1.getPeridotFortune)(this.rarity, this.item);
112
- if (peridot > 0) {
113
- this.fortuneBreakdown['Peridot Gems'] = peridot;
114
- sum += peridot;
115
- }
116
- // Enchantments
117
- const enchantments = Object.entries(this.item.enchantments ?? {});
118
- for (const [enchant, level] of enchantments) {
119
- if (!level)
120
- continue;
121
- if (enchant in enchants_1.TURBO_ENCHANTS) {
122
- const matchingCrop = enchants_1.TURBO_ENCHANTS[enchant];
123
- if (!matchingCrop || matchingCrop !== this.crop)
124
- continue;
125
- const gain = enchants_1.TURBO_ENCHANT_FORTUNE * level;
126
- this.fortuneBreakdown['Turbo'] = gain;
127
- sum += gain;
128
- continue;
129
- }
130
- const enchantment = enchants_1.FARMING_ENCHANTS[enchant];
131
- if (!enchantment || !level)
132
- continue;
133
- const fortune = enchantment.levels?.[level]?.[reforges_1.Stat.FarmingFortune] ?? 0;
134
- if (fortune > 0) {
135
- this.fortuneBreakdown[enchantment.name] = fortune;
136
- sum += fortune;
137
- }
138
- }
139
- const milestone = this.options?.milestones?.[this.crop] ?? 0;
140
- if (milestone && 'dedication' in (this.item.enchantments ?? {})) {
141
- const level = this.item.enchantments?.dedication;
142
- const enchantment = enchants_1.FARMING_ENCHANTS.dedication;
143
- if (level && enchantment) {
144
- const multiplier = enchantment.multipliedLevels?.[level]?.[reforges_1.Stat.FarmingFortune] ?? 0;
145
- if (multiplier > 0 && !isNaN(milestone)) {
146
- this.fortuneBreakdown[enchantment.name] = multiplier * milestone;
147
- sum += multiplier * milestone;
148
- }
149
- }
150
- }
151
- this.fortune = sum;
152
- return sum;
153
- }
154
- getCounter() {
155
- const counter = +(this.item?.attributes?.mined_crops ?? 0);
156
- return counter && !isNaN(counter) ? counter : undefined;
157
- }
158
- getCultivating() {
159
- const cultivating = +(this.item?.attributes?.farmed_cultivating ?? 0);
160
- return cultivating && !isNaN(cultivating) ? cultivating : undefined;
161
- }
162
- getCultivatingLevel() {
163
- return this.item.enchantments?.cultivating ?? 0;
164
- }
165
- get farmed() {
166
- return this.counter ?? this.cultivating ?? 0;
167
- }
168
- isUsed() {
169
- if (this.farmed > 0)
170
- return true;
171
- if (this.getCultivatingLevel() > 0)
172
- return true;
173
- return false;
174
- }
175
- isMissingDedication() {
176
- return this.item?.enchantments?.dedication && (this.options?.milestones?.[this.crop] ?? 0) <= 0;
177
- }
178
- getFarmingAbilityFortune(tool) {
179
- const regex = /§7You have §6\+(\d+)☘/g;
180
- for (const line of tool.item.lore ?? []) {
181
- const found = (0, lore_1.extractNumberFromLine)(line, regex) ?? 0;
182
- if (!found)
183
- continue;
184
- if (!this.logCounter) {
185
- this.logCounter = found;
186
- }
187
- else if (!this.collAnalysis) {
188
- this.collAnalysis = found;
189
- }
190
- }
191
- return this.logCounter + this.collAnalysis;
192
- }
193
- static isValid(item) {
194
- if (item instanceof FarmingTool)
195
- return true;
196
- return tools_1.FARMING_TOOLS[item.skyblockId] !== undefined;
197
- }
198
- static fromArray(items, options) {
199
- return items
200
- .filter((item) => FarmingTool.isValid(item))
201
- .map((item) => new FarmingTool(item, options))
202
- .sort((a, b) => b.fortune - a.fortune);
203
- }
11
+ get name() {
12
+ return this.colorPrefix + (this.reforge?.name ?? '') + ' ' + this.itemname;
13
+ }
14
+ constructor(item, options) {
15
+ this.rebuildTool(item, options);
16
+ }
17
+ setOptions(options) {
18
+ this.options = options;
19
+ this.fortune = this.getFortune();
20
+ }
21
+ rebuildTool(item, options) {
22
+ this.options = options;
23
+ this.item = item;
24
+ const TOOL = TOOLS_1.FARMING_TOOLS[item.skyblockId];
25
+ if (!TOOL) {
26
+ throw new Error(`Unknown farming tool: ${item.name} (${item.skyblockId})`);
27
+ }
28
+ this.tool = TOOL;
29
+ this.crop = TOOL.crop;
30
+ if (item.lore) {
31
+ this.rarity = (0, ITEMSTATS_1.getRarityFromLore)(item.lore);
32
+ }
33
+ this.counter = this.getCounter();
34
+ this.cultivating = this.getCultivating() ?? 0;
35
+ this.logCounter = 0;
36
+ this.collAnalysis = 0;
37
+ this.setReforge(item.attributes?.modifier ?? '');
38
+ this.farmingForDummies = +(this.item.attributes?.farming_for_dummies_count ?? 0);
39
+ this.recombobulated = this.item.attributes?.rarity_upgrades === '1';
40
+ this.fortune = this.getFortune();
41
+ if (this.reforge?.name && item.name) {
42
+ const [PREFIX, NAME] = item.name.split(this.reforge.name);
43
+ this.colorPrefix = PREFIX ?? '';
44
+ this.itemname = NAME?.trim() ?? '';
45
+ } else {
46
+ this.colorPrefix = '';
47
+ this.itemname = item.name ?? '';
48
+ }
49
+ }
50
+ setReforge(reforgeId) {
51
+ this.reforge = REFORGES_1.REFORGES[reforgeId] ?? undefined;
52
+ this.reforgeStats = this.reforge?.tiers?.[this.rarity];
53
+ }
54
+ changeReforgeTo(reforgeId) {
55
+ this.setReforge(reforgeId);
56
+ this.fortune = this.getFortune();
57
+ }
58
+ changeFarmedCropsTo(crops) {
59
+ if (this.tool.type !== TOOLS_1.FarmingToolType.MathematicalHoe) return;
60
+ const DIGITS = Math.floor(crops).toString().length - 4;
61
+ if (this.logCounter > 0) {
62
+ this.logCounter = DIGITS * 16;
63
+ }
64
+ if (this.collAnalysis > 0) {
65
+ this.collAnalysis = DIGITS * 8;
66
+ }
67
+ this.fortune = this.getFortune();
68
+ }
69
+ getFortune() {
70
+ this.fortuneBreakdown = {};
71
+ let SUM = 0;
72
+ // Base fortune
73
+ const BASE = this.tool.baseStats?.[REFORGES_1.Stat.FarmingFortune] ?? 0;
74
+ if (BASE > 0) {
75
+ this.fortuneBreakdown['Tool Bonus'] = BASE;
76
+ SUM += BASE;
77
+ }
78
+ // Tool rarity stats
79
+ const BASE_RARITY = this.recombobulated ? (0, ITEMSTATS_1.previousRarity)(this.rarity) : this.rarity;
80
+ const RARITY_STATS = this.tool.stats?.[BASE_RARITY]?.[REFORGES_1.Stat.FarmingFortune] ?? 0;
81
+ if (RARITY_STATS > 0) {
82
+ this.fortuneBreakdown['Tool Stats'] = RARITY_STATS;
83
+ SUM += RARITY_STATS;
84
+ }
85
+ // Reforge stats
86
+ const REFORGE = this.reforgeStats?.stats?.[REFORGES_1.Stat.FarmingFortune] ?? 0;
87
+ if (REFORGE > 0) {
88
+ this.fortuneBreakdown[this.reforge?.name ?? 'Reforge'] = REFORGE;
89
+ SUM += REFORGE;
90
+ }
91
+ // Farming for Dummies
92
+ if (this.farmingForDummies > 0) {
93
+ this.fortuneBreakdown['Farming for Dummies'] = this.farmingForDummies;
94
+ SUM += this.farmingForDummies;
95
+ }
96
+ // Collection analysis and digit bonuses
97
+ if (this.tool.type === TOOLS_1.FarmingToolType.MathematicalHoe) {
98
+ this.getFarmingAbilityFortune(this);
99
+ if (this.logCounter > 0) {
100
+ this.fortuneBreakdown['Logarithmic Counter'] = this.logCounter;
101
+ SUM += this.logCounter;
102
+ }
103
+ if (this.collAnalysis > 0) {
104
+ this.fortuneBreakdown['Collection Analysis'] = this.collAnalysis;
105
+ SUM += this.collAnalysis;
106
+ }
107
+ }
108
+ // Gems
109
+ const PERIDOT = (0, GEMS_1.getPeridotFortune)(this.rarity, this.item);
110
+ if (PERIDOT > 0) {
111
+ this.fortuneBreakdown['Peridot Gems'] = PERIDOT;
112
+ SUM += PERIDOT;
113
+ }
114
+ // Enchantments
115
+ const ENCHANTMENTS = Object.entries(this.item.enchantments ?? {});
116
+ for (const [ENCHANT, LEVEL] of ENCHANTMENTS) {
117
+ if (!LEVEL) continue;
118
+ if (ENCHANT in ENCHANTS_1.TURBO_ENCHANTS) {
119
+ const MATCHING_CROP = ENCHANTS_1.TURBO_ENCHANTS[ENCHANT];
120
+ if (!MATCHING_CROP || MATCHING_CROP !== this.crop) continue;
121
+ const GAIN = ENCHANTS_1.TURBO_ENCHANT_FORTUNE * LEVEL;
122
+ this.fortuneBreakdown['Turbo'] = GAIN;
123
+ SUM += GAIN;
124
+ continue;
125
+ }
126
+ const ENCHANTMENT = ENCHANTS_1.FARMING_ENCHANTS[ENCHANT];
127
+ if (!ENCHANTMENT || !LEVEL) continue;
128
+ const FORTUNE = ENCHANTMENT.levels?.[LEVEL]?.[REFORGES_1.Stat.FarmingFortune] ?? 0;
129
+ if (FORTUNE > 0) {
130
+ this.fortuneBreakdown[ENCHANTMENT.name] = FORTUNE;
131
+ SUM += FORTUNE;
132
+ }
133
+ }
134
+ const MILESTONE = this.options?.milestones?.[this.crop] ?? 0;
135
+ if (MILESTONE && 'dedication' in (this.item.enchantments ?? {})) {
136
+ const LEVEL = this.item.enchantments?.dedication;
137
+ const ENCHANTMENT = ENCHANTS_1.FARMING_ENCHANTS.dedication;
138
+ if (LEVEL && ENCHANTMENT) {
139
+ const MULTIPLIER = ENCHANTMENT.multipliedLevels?.[LEVEL]?.[REFORGES_1.Stat.FarmingFortune] ?? 0;
140
+ if (MULTIPLIER > 0 && !isNaN(MILESTONE)) {
141
+ this.fortuneBreakdown[ENCHANTMENT.name] = MULTIPLIER * MILESTONE;
142
+ SUM += MULTIPLIER * MILESTONE;
143
+ }
144
+ }
145
+ }
146
+ this.fortune = SUM;
147
+ return SUM;
148
+ }
149
+ getCounter() {
150
+ const COUNTER = +(this.item?.attributes?.mined_crops ?? 0);
151
+ return COUNTER && !isNaN(COUNTER) ? COUNTER : undefined;
152
+ }
153
+ getCultivating() {
154
+ const CULTIVATING = +(this.item?.attributes?.farmed_cultivating ?? 0);
155
+ return CULTIVATING && !isNaN(CULTIVATING) ? CULTIVATING : undefined;
156
+ }
157
+ getCultivatingLevel() {
158
+ return this.item.enchantments?.cultivating ?? 0;
159
+ }
160
+ get farmed() {
161
+ return this.counter ?? this.cultivating ?? 0;
162
+ }
163
+ isUsed() {
164
+ if (this.farmed > 0) return true;
165
+ if (this.getCultivatingLevel() > 0) return true;
166
+ return false;
167
+ }
168
+ isMissingDedication() {
169
+ return this.item?.enchantments?.dedication && (this.options?.milestones?.[this.crop] ?? 0) <= 0;
170
+ }
171
+ getFarmingAbilityFortune(tool) {
172
+ const REGEX = /§7You have §6\+(\d+)☘/g;
173
+ for (const LINE of tool.item.lore ?? []) {
174
+ const FOUND = (0, LORE_1.extractNumberFromLine)(LINE, REGEX) ?? 0;
175
+ if (!FOUND) continue;
176
+ if (!this.logCounter) {
177
+ this.logCounter = FOUND;
178
+ } else if (!this.collAnalysis) {
179
+ this.collAnalysis = FOUND;
180
+ }
181
+ }
182
+ return this.logCounter + this.collAnalysis;
183
+ }
184
+ static isValid(item) {
185
+ if (item instanceof FarmingTool) return true;
186
+ return TOOLS_1.FARMING_TOOLS[item.skyblockId] !== undefined;
187
+ }
188
+ static fromArray(items, options) {
189
+ return items
190
+ .filter((item) => FarmingTool.isValid(item))
191
+ .map((item) => new FarmingTool(item, options))
192
+ .sort((a, b) => b.fortune - a.fortune);
193
+ }
204
194
  }
205
195
  exports.FarmingTool = FarmingTool;
206
- //# sourceMappingURL=farmingtool.js.map
196
+ //# sourceMappingURL=farmingtool.js.map
@@ -1,22 +1,22 @@
1
1
  export interface EliteItemDto {
2
- id?: number | null;
3
- count?: number | null;
4
- skyblockId?: string | null;
5
- uuid?: string | null;
6
- name?: string | null;
7
- lore?: string[] | null;
8
- enchantments?: {
9
- [key: string]: number | null;
10
- } | null;
11
- attributes?: {
12
- [key: string]: string | null;
13
- } | null;
14
- gems?: Record<string, string> | null;
2
+ id?: number | null;
3
+ count?: number | null;
4
+ skyblockId?: string | null;
5
+ uuid?: string | null;
6
+ name?: string | null;
7
+ lore?: string[] | null;
8
+ enchantments?: {
9
+ [key: string]: number | null;
10
+ } | null;
11
+ attributes?: {
12
+ [key: string]: string | null;
13
+ } | null;
14
+ gems?: Record<string, string> | null;
15
15
  }
16
16
  export declare enum GemRarity {
17
- Rough = "ROUGH",
18
- Flawed = "FLAWED",
19
- Fine = "FINE",
20
- Flawless = "FLAWLESS",
21
- Perfect = "PERFECT"
17
+ Rough = 'ROUGH',
18
+ Flawed = 'FLAWED',
19
+ Fine = 'FINE',
20
+ Flawless = 'FLAWLESS',
21
+ Perfect = 'PERFECT',
22
22
  }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.GemRarity = void 0;
4
- var GemRarity;
5
- (function (GemRarity) {
6
- GemRarity["Rough"] = "ROUGH";
7
- GemRarity["Flawed"] = "FLAWED";
8
- GemRarity["Fine"] = "FINE";
9
- GemRarity["Flawless"] = "FLAWLESS";
10
- GemRarity["Perfect"] = "PERFECT";
11
- })(GemRarity || (exports.GemRarity = GemRarity = {}));
12
- //# sourceMappingURL=item.js.map
4
+ var GEM_RARITY;
5
+ (function (gemRarity) {
6
+ gemRarity['Rough'] = 'ROUGH';
7
+ gemRarity['Flawed'] = 'FLAWED';
8
+ gemRarity['Fine'] = 'FINE';
9
+ gemRarity['Flawless'] = 'FLAWLESS';
10
+ gemRarity['Perfect'] = 'PERFECT';
11
+ })(GEM_RARITY || (exports.GemRarity = GEM_RARITY = {}));
12
+ //# sourceMappingURL=item.js.map
@@ -3,21 +3,21 @@ import { Rarity, Reforge, ReforgeTier } from '../constants/reforges';
3
3
  import { EliteItemDto } from './item';
4
4
  import { PlayerOptions } from './player';
5
5
  export declare class LotusGear {
6
- readonly item: EliteItemDto;
7
- readonly info: FarmingArmorInfo;
8
- get slot(): import("../constants/armor").GearSlot;
9
- readonly rarity: Rarity;
10
- readonly reforge: Reforge | undefined;
11
- readonly reforgeStats: ReforgeTier | undefined;
12
- readonly recombobulated: boolean;
13
- fortune: number;
14
- fortuneBreakdown: Record<string, number>;
15
- private options?;
16
- constructor(item: EliteItemDto, options?: PlayerOptions);
17
- setOptions(options: PlayerOptions): void;
18
- getFortune(): number;
19
- private getFortuneFromVisitors;
20
- private getPieceBonus;
21
- static isValid(item: EliteItemDto): boolean;
22
- static fromArray(items: EliteItemDto[], options?: PlayerOptions): LotusGear[];
6
+ readonly item: EliteItemDto;
7
+ readonly info: FarmingArmorInfo;
8
+ get slot(): import('../constants/armor').GearSlot;
9
+ readonly rarity: Rarity;
10
+ readonly reforge: Reforge | undefined;
11
+ readonly reforgeStats: ReforgeTier | undefined;
12
+ readonly recombobulated: boolean;
13
+ fortune: number;
14
+ fortuneBreakdown: Record<string, number>;
15
+ private options?;
16
+ constructor(item: EliteItemDto, options?: PlayerOptions);
17
+ setOptions(options: PlayerOptions): void;
18
+ getFortune(): number;
19
+ private getFortuneFromVisitors;
20
+ private getPieceBonus;
21
+ static isValid(item: EliteItemDto): boolean;
22
+ static fromArray(items: EliteItemDto[], options?: PlayerOptions): LotusGear[];
23
23
  }