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.
- package/dist/classes/farmingaccessory.d.ts +10 -10
- package/dist/classes/farmingaccessory.js +50 -50
- package/dist/classes/farmingarmor.d.ts +41 -38
- package/dist/classes/farmingarmor.js +202 -207
- package/dist/classes/farmingequipment.d.ts +17 -17
- package/dist/classes/farmingequipment.js +105 -109
- package/dist/classes/farmingpet.d.ts +14 -14
- package/dist/classes/farmingpet.js +91 -90
- package/dist/classes/farmingtool.d.ts +34 -34
- package/dist/classes/farmingtool.js +192 -202
- package/dist/classes/item.d.ts +18 -18
- package/dist/classes/item.js +11 -11
- package/dist/classes/lotusgear.d.ts +17 -17
- package/dist/classes/lotusgear.js +103 -107
- package/dist/classes/player.d.ts +58 -55
- package/dist/classes/player.js +215 -228
- package/dist/classes/weightcalc.d.ts +56 -52
- package/dist/classes/weightcalc.js +185 -190
- package/dist/classes/weightcalc.test.js +102 -102
- package/dist/constants/accessories.d.ts +6 -6
- package/dist/constants/accessories.js +51 -51
- package/dist/constants/armor.d.ts +30 -30
- package/dist/constants/armor.js +699 -699
- package/dist/constants/enchants.d.ts +1 -1
- package/dist/constants/enchants.js +56 -56
- package/dist/constants/enchants.js.map +1 -1
- package/dist/constants/equipment.d.ts +20 -20
- package/dist/constants/equipment.js +116 -116
- package/dist/constants/gems.d.ts +2 -2
- package/dist/constants/gems.js +8 -8
- package/dist/constants/items.d.ts +8 -8
- package/dist/constants/items.js +14 -14
- package/dist/constants/lotus.d.ts +20 -20
- package/dist/constants/lotus.js +106 -106
- package/dist/constants/pets.d.ts +38 -38
- package/dist/constants/pets.js +253 -253
- package/dist/constants/reforges.d.ts +1 -1
- package/dist/constants/reforges.js +1 -1
- package/dist/constants/reforges.js.map +1 -1
- package/dist/constants/specific.d.ts +1 -1
- package/dist/constants/specific.js +6 -6
- package/dist/constants/stats.d.ts +1 -1
- package/dist/constants/tempfortune.js +14 -14
- package/dist/constants/tempfortune.js.map +1 -1
- package/dist/constants/tools.d.ts +7 -7
- package/dist/constants/tools.js +456 -456
- package/dist/constants/upgrades.d.ts +6 -6
- package/dist/crops/special.js +1 -1
- package/dist/crops/special.js.map +1 -1
- package/dist/fortune/farmingaccessory.d.ts +1 -1
- package/dist/fortune/farmingaccessory.js +1 -1
- package/dist/fortune/farmingaccessory.js.map +1 -1
- package/dist/fortune/farmingarmor.d.ts +4 -3
- package/dist/fortune/farmingarmor.js +28 -17
- package/dist/fortune/farmingarmor.js.map +1 -1
- package/dist/fortune/farmingequipment.d.ts +3 -3
- package/dist/fortune/farmingequipment.js +5 -5
- package/dist/fortune/farmingequipment.js.map +1 -1
- package/dist/fortune/farmingpet.d.ts +3 -3
- package/dist/fortune/farmingpet.js +2 -2
- package/dist/fortune/farmingpet.js.map +1 -1
- package/dist/fortune/farmingtool.d.ts +2 -2
- package/dist/fortune/farmingtool.js +4 -4
- package/dist/fortune/farmingtool.js.map +1 -1
- package/dist/fortune/upgradable.d.ts +35 -33
- package/dist/fortune/upgradable.js +1 -1
- package/dist/fortune/upgradeable.d.ts +6 -6
- package/dist/fortune/upgradeable.js +3 -3
- package/dist/fortune/upgradeable.js.map +1 -1
- package/dist/items/accessories.d.ts +1 -1
- package/dist/items/accessories.js +3 -3
- package/dist/items/accessories.js.map +1 -1
- package/dist/items/armor.d.ts +2 -2
- package/dist/items/armor.js +2 -2
- package/dist/items/armor.js.map +1 -1
- package/dist/items/equipment.js +8 -8
- package/dist/items/equipment.js.map +1 -1
- package/dist/items/pets.d.ts +2 -2
- package/dist/items/pets.js +15 -15
- package/dist/items/pets.js.map +1 -1
- package/dist/items/tools.d.ts +1 -1
- package/dist/items/tools.js +15 -15
- package/dist/items/tools.js.map +1 -1
- package/dist/player/index.js +1 -1
- package/dist/player/player.d.ts +1 -1
- package/dist/player/player.js +9 -9
- package/dist/player/player.js.map +1 -1
- package/dist/player/playeroptions.d.ts +10 -10
- package/dist/player.d.ts +21 -21
- package/dist/player.js +26 -26
- package/dist/ratecalc.d.ts +16 -14
- package/dist/ratecalc.js +148 -145
- package/dist/tool.js +3 -3
- package/dist/upgrades/progress.d.ts +2 -2
- package/dist/upgrades/progress.js +3 -3
- package/dist/upgrades/progress.js.map +1 -1
- package/dist/upgrades/sources/accessorysources.d.ts +2 -2
- package/dist/upgrades/sources/accessorysources.js +10 -8
- package/dist/upgrades/sources/accessorysources.js.map +1 -1
- package/dist/upgrades/sources/armorsetsources.d.ts +2 -2
- package/dist/upgrades/sources/armorsetsources.js +12 -11
- package/dist/upgrades/sources/armorsetsources.js.map +1 -1
- package/dist/upgrades/sources/cropsources.d.ts +3 -3
- package/dist/upgrades/sources/cropsources.js +22 -22
- package/dist/upgrades/sources/cropsources.js.map +1 -1
- package/dist/upgrades/sources/gearsources.d.ts +3 -3
- package/dist/upgrades/sources/gearsources.js +18 -19
- package/dist/upgrades/sources/gearsources.js.map +1 -1
- package/dist/upgrades/sources/generalsources.d.ts +2 -2
- package/dist/upgrades/sources/generalsources.js +18 -16
- package/dist/upgrades/sources/generalsources.js.map +1 -1
- package/dist/upgrades/sources/toolsources.d.ts +5 -5
- package/dist/upgrades/sources/toolsources.js +24 -23
- package/dist/upgrades/sources/toolsources.js.map +1 -1
- package/dist/upgrades/upgrades.d.ts +4 -4
- package/dist/upgrades/upgrades.js +19 -19
- package/dist/upgrades/upgrades.js.map +1 -1
- package/dist/util/enchants.d.ts +3 -3
- package/dist/util/enchants.js +1 -1
- package/dist/util/enchants.js.map +1 -1
- package/dist/util/garden.d.ts +2 -2
- package/dist/util/garden.js +6 -7
- package/dist/util/garden.js.map +1 -1
- package/dist/util/gems.d.ts +2 -2
- package/dist/util/gems.js +24 -14
- package/dist/util/gems.js.map +1 -1
- package/dist/util/pests.js +1 -1
- package/dist/util/pests.js.map +1 -1
- package/dist/util/pests.test.js +27 -25
- package/dist/util/ratecalc.js +2 -2
- package/dist/util/ratecalc.js.map +1 -1
- package/dist/util/skyblocktime.js +1 -1
- package/dist/util/skyblocktime.js.map +1 -1
- package/package.json +36 -48
package/dist/classes/player.js
CHANGED
|
@@ -1,235 +1,222 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.FarmingPlayer = exports.createFarmingPlayer = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
4
|
+
const CROPS_1 = require('../constants/crops');
|
|
5
|
+
const PERSONALBESTS_1 = require('../constants/personalbests');
|
|
6
|
+
const PESTS_1 = require('../util/pests');
|
|
7
|
+
const SPECIFIC_1 = require('../constants/specific');
|
|
8
|
+
const NAMES_1 = require('../util/names');
|
|
9
|
+
const FARMINGACCESSORY_1 = require('./farmingaccessory');
|
|
10
|
+
const FARMINGARMOR_1 = require('./farmingarmor');
|
|
11
|
+
const FARMINGPET_1 = require('./farmingpet');
|
|
12
|
+
const FARMINGTOOL_1 = require('./farmingtool');
|
|
13
|
+
const FARMINGEQUIPMENT_1 = require('./farmingequipment');
|
|
14
14
|
function createFarmingPlayer(options) {
|
|
15
|
-
|
|
15
|
+
return new FarmingPlayer(options);
|
|
16
16
|
}
|
|
17
17
|
exports.createFarmingPlayer = createFarmingPlayer;
|
|
18
18
|
class FarmingPlayer {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
// Extra Fortune
|
|
222
|
-
for (const extra of this.options.extraFortune ?? []) {
|
|
223
|
-
if (extra.crop !== crop)
|
|
224
|
-
continue;
|
|
225
|
-
breakdown[extra.name ?? 'Extra Fortune'] = extra.fortune;
|
|
226
|
-
sum += extra.fortune;
|
|
227
|
-
}
|
|
228
|
-
return {
|
|
229
|
-
fortune: sum,
|
|
230
|
-
breakdown,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
options.tools ??= [];
|
|
22
|
+
if (options.tools[0] instanceof FARMINGTOOL_1.FarmingTool) {
|
|
23
|
+
this.tools = options.tools;
|
|
24
|
+
for (const TOOL of this.tools) TOOL.setOptions(options);
|
|
25
|
+
} else {
|
|
26
|
+
this.tools = FARMINGTOOL_1.FarmingTool.fromArray(options.tools, options);
|
|
27
|
+
}
|
|
28
|
+
this.selectedTool = this.options.selectedTool ?? this.tools[0];
|
|
29
|
+
options.pets ??= [];
|
|
30
|
+
if (options.pets[0] instanceof FARMINGPET_1.FarmingPet) {
|
|
31
|
+
this.pets = options.pets.sort((a, b) => b.fortune - a.fortune);
|
|
32
|
+
for (const PET of this.pets) PET.setOptions(options);
|
|
33
|
+
} else {
|
|
34
|
+
this.pets = FARMINGPET_1.FarmingPet.fromArray(options.pets, options);
|
|
35
|
+
}
|
|
36
|
+
this.selectedPet = this.options.selectedPet;
|
|
37
|
+
options.armor ??= [];
|
|
38
|
+
if (options.armor instanceof FARMINGARMOR_1.ArmorSet) {
|
|
39
|
+
this.armorSet = options.armor;
|
|
40
|
+
this.armor = this.armorSet.pieces;
|
|
41
|
+
for (const A of this.armor) A.setOptions(options);
|
|
42
|
+
this.armorSet.getFortuneBreakdown(true);
|
|
43
|
+
} else if (options.armor[0] instanceof FARMINGARMOR_1.FarmingArmor) {
|
|
44
|
+
this.armor = options.armor.sort((a, b) => b.fortune - a.fortune);
|
|
45
|
+
for (const A of this.armor) A.setOptions(options);
|
|
46
|
+
this.armorSet = new FARMINGARMOR_1.ArmorSet(this.armor);
|
|
47
|
+
} else {
|
|
48
|
+
this.armor = FARMINGARMOR_1.FarmingArmor.fromArray(options.armor, options);
|
|
49
|
+
this.armorSet = new FARMINGARMOR_1.ArmorSet(this.armor);
|
|
50
|
+
}
|
|
51
|
+
options.equipment ??= [];
|
|
52
|
+
if (options.equipment[0] instanceof FARMINGEQUIPMENT_1.FarmingEquipment) {
|
|
53
|
+
this.equipment = options.equipment.sort((a, b) => b.fortune - a.fortune);
|
|
54
|
+
for (const E of this.equipment) E.setOptions(options);
|
|
55
|
+
} else {
|
|
56
|
+
this.equipment = FARMINGEQUIPMENT_1.FarmingEquipment.fromArray(options.equipment, options);
|
|
57
|
+
}
|
|
58
|
+
options.accessories ??= [];
|
|
59
|
+
if (options.accessories[0] instanceof FARMINGACCESSORY_1.FarmingAccessory) {
|
|
60
|
+
this.accessories = options.accessories.sort((a, b) => b.fortune - a.fortune);
|
|
61
|
+
} else {
|
|
62
|
+
this.accessories = FARMINGACCESSORY_1.FarmingAccessory.fromArray(options.accessories);
|
|
63
|
+
}
|
|
64
|
+
this.fortune = this.getGeneralFortune();
|
|
65
|
+
}
|
|
66
|
+
changeArmor(armor) {
|
|
67
|
+
this.armorSet = new FARMINGARMOR_1.ArmorSet(armor.sort((a, b) => b.fortune - a.fortune));
|
|
68
|
+
}
|
|
69
|
+
selectTool(tool) {
|
|
70
|
+
this.selectedTool = tool;
|
|
71
|
+
this.fortune = this.getGeneralFortune();
|
|
72
|
+
}
|
|
73
|
+
selectPet(pet) {
|
|
74
|
+
this.selectedPet = pet;
|
|
75
|
+
this.fortune = this.getGeneralFortune();
|
|
76
|
+
}
|
|
77
|
+
setStrength(strength) {
|
|
78
|
+
this.options.strength = strength;
|
|
79
|
+
for (const PET of this.pets) {
|
|
80
|
+
PET.fortune = PET.getFortune();
|
|
81
|
+
}
|
|
82
|
+
this.fortune = this.getGeneralFortune();
|
|
83
|
+
}
|
|
84
|
+
getGeneralFortune() {
|
|
85
|
+
let SUM = 0;
|
|
86
|
+
const BREAKDOWN = {};
|
|
87
|
+
// Plots
|
|
88
|
+
const PLOTS = SPECIFIC_1.FORTUNE_PER_PLOT * (this.options.plotsUnlocked ?? 0);
|
|
89
|
+
if (PLOTS > 0) {
|
|
90
|
+
BREAKDOWN['Unlocked Plots'] = PLOTS;
|
|
91
|
+
SUM += PLOTS;
|
|
92
|
+
}
|
|
93
|
+
// Farming Level
|
|
94
|
+
const LEVEL = SPECIFIC_1.FORTUNE_PER_FARMING_LEVEL * (this.options.farmingLevel ?? 0);
|
|
95
|
+
if (LEVEL > 0) {
|
|
96
|
+
BREAKDOWN['Farming Level'] = LEVEL;
|
|
97
|
+
SUM += LEVEL;
|
|
98
|
+
}
|
|
99
|
+
// Bestiary
|
|
100
|
+
if (this.options.bestiaryKills) {
|
|
101
|
+
const BESTIARY = (0, PESTS_1.fortuneFromPestBestiary)(this.options.bestiaryKills);
|
|
102
|
+
if (BESTIARY > 0) {
|
|
103
|
+
BREAKDOWN['Pest Bestiary'] = BESTIARY;
|
|
104
|
+
SUM += BESTIARY;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Armor Set
|
|
108
|
+
const ARMOR_SET = this.armorSet.fortune;
|
|
109
|
+
if (ARMOR_SET > 0) {
|
|
110
|
+
BREAKDOWN['Armor Set'] = ARMOR_SET;
|
|
111
|
+
SUM += ARMOR_SET;
|
|
112
|
+
}
|
|
113
|
+
// Lotus Gear
|
|
114
|
+
const EQUIPMENT = this.equipment.reduce((a, b) => a + b.fortune, 0);
|
|
115
|
+
if (EQUIPMENT > 0) {
|
|
116
|
+
BREAKDOWN['Equipment'] = EQUIPMENT;
|
|
117
|
+
SUM += EQUIPMENT;
|
|
118
|
+
}
|
|
119
|
+
// Anita Bonus
|
|
120
|
+
const ANITA_BONUS = (this.options.anitaBonus ?? 0) * SPECIFIC_1.FORTUNE_PER_ANITA_BONUS;
|
|
121
|
+
if (ANITA_BONUS > 0) {
|
|
122
|
+
BREAKDOWN['Anita Bonus Drops'] = ANITA_BONUS;
|
|
123
|
+
SUM += ANITA_BONUS;
|
|
124
|
+
}
|
|
125
|
+
// Community Center
|
|
126
|
+
const COMMUNITY_CENTER = (this.options.communityCenter ?? 0) * SPECIFIC_1.FORTUNE_PER_COMMUNITY_CENTER;
|
|
127
|
+
if (COMMUNITY_CENTER > 0) {
|
|
128
|
+
BREAKDOWN['Community Center'] = COMMUNITY_CENTER;
|
|
129
|
+
SUM += COMMUNITY_CENTER;
|
|
130
|
+
}
|
|
131
|
+
// Selected Pet
|
|
132
|
+
const PET = this.selectedPet;
|
|
133
|
+
if (PET && PET.fortune > 0) {
|
|
134
|
+
BREAKDOWN[PET.info.name ?? 'Selected Pet'] = PET.fortune;
|
|
135
|
+
SUM += PET.fortune;
|
|
136
|
+
}
|
|
137
|
+
// Accessories, only count highest fortune from each family
|
|
138
|
+
const FAMILIES = new Map();
|
|
139
|
+
for (const ACCESSORY of this.accessories.filter((a) => a.fortune > 0).sort((a, b) => b.fortune - a.fortune)) {
|
|
140
|
+
if (ACCESSORY.info.family) {
|
|
141
|
+
if (!FAMILIES.has(ACCESSORY.info.family)) {
|
|
142
|
+
FAMILIES.set(ACCESSORY.info.family, ACCESSORY);
|
|
143
|
+
} else {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
BREAKDOWN[ACCESSORY.item.name ?? ACCESSORY.item.skyblockId ?? 'Accessory [Error]'] = ACCESSORY.fortune;
|
|
148
|
+
SUM += ACCESSORY.fortune;
|
|
149
|
+
}
|
|
150
|
+
// Refined Truffles
|
|
151
|
+
const TRUFFLES = Math.min(5, this.options.refinedTruffles ?? 0);
|
|
152
|
+
if (TRUFFLES > 0) {
|
|
153
|
+
BREAKDOWN['Refined Truffles'] = TRUFFLES;
|
|
154
|
+
SUM += TRUFFLES;
|
|
155
|
+
}
|
|
156
|
+
// Extra Fortune
|
|
157
|
+
for (const EXTRA of this.options.extraFortune ?? []) {
|
|
158
|
+
if (EXTRA.crop) continue;
|
|
159
|
+
BREAKDOWN[EXTRA.name ?? 'Extra Fortune'] = EXTRA.fortune;
|
|
160
|
+
SUM += EXTRA.fortune;
|
|
161
|
+
}
|
|
162
|
+
this.breakdown = BREAKDOWN;
|
|
163
|
+
return SUM;
|
|
164
|
+
}
|
|
165
|
+
getCropFortune(crop, tool = this.selectedTool) {
|
|
166
|
+
if (tool) {
|
|
167
|
+
this.selectTool(tool);
|
|
168
|
+
}
|
|
169
|
+
let SUM = 0;
|
|
170
|
+
const BREAKDOWN = {};
|
|
171
|
+
// Crop upgrades
|
|
172
|
+
const UPGRADE = SPECIFIC_1.FORTUNE_PER_CROP_UPGRADE * (this.options.cropUpgrades?.[crop] ?? 0);
|
|
173
|
+
if (UPGRADE > 0) {
|
|
174
|
+
BREAKDOWN['Crop Upgrade'] = UPGRADE;
|
|
175
|
+
SUM += UPGRADE;
|
|
176
|
+
}
|
|
177
|
+
// Personal bests
|
|
178
|
+
const PERSONAL_BEST =
|
|
179
|
+
this.options.personalBests?.[(0, NAMES_1.getItemIdFromCrop)(crop)] ??
|
|
180
|
+
this.options.personalBests?.[(0, NAMES_1.getCropDisplayName)(crop).replace(/ /g, '')];
|
|
181
|
+
if (PERSONAL_BEST) {
|
|
182
|
+
const FORTUNE = (0, PERSONALBESTS_1.fortuneFromPersonalBestContest)(crop, PERSONAL_BEST);
|
|
183
|
+
if (FORTUNE > 0) {
|
|
184
|
+
BREAKDOWN['Personal Best'] = FORTUNE;
|
|
185
|
+
SUM += FORTUNE;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Tool
|
|
189
|
+
const TOOL_FORTUNE = this.selectedTool?.fortune ?? 0;
|
|
190
|
+
if (TOOL_FORTUNE > 0) {
|
|
191
|
+
BREAKDOWN['Selected Tool'] = TOOL_FORTUNE;
|
|
192
|
+
SUM += TOOL_FORTUNE;
|
|
193
|
+
}
|
|
194
|
+
// Accessories
|
|
195
|
+
//* There's only one accessory family for farming right now
|
|
196
|
+
const ACCESSORY = this.accessories.find((a) => a.info.crops && a.info.crops.includes(crop));
|
|
197
|
+
if (ACCESSORY && ACCESSORY.fortune > 0) {
|
|
198
|
+
BREAKDOWN[ACCESSORY.item.name ?? 'Accessories'] = ACCESSORY.fortune ?? 0;
|
|
199
|
+
SUM += ACCESSORY.fortune ?? 0;
|
|
200
|
+
}
|
|
201
|
+
// Exportable Crops
|
|
202
|
+
if (this.options.exportableCrops?.[crop]) {
|
|
203
|
+
const EXPORTABLE = this.options.exportableCrops[crop];
|
|
204
|
+
if (EXPORTABLE) {
|
|
205
|
+
BREAKDOWN['Exportable Crop'] = CROPS_1.EXPORTABLE_CROP_FORTUNE;
|
|
206
|
+
SUM += CROPS_1.EXPORTABLE_CROP_FORTUNE;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Extra Fortune
|
|
210
|
+
for (const EXTRA of this.options.extraFortune ?? []) {
|
|
211
|
+
if (EXTRA.crop !== crop) continue;
|
|
212
|
+
BREAKDOWN[EXTRA.name ?? 'Extra Fortune'] = EXTRA.fortune;
|
|
213
|
+
SUM += EXTRA.fortune;
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
fortune: SUM,
|
|
217
|
+
breakdown: BREAKDOWN,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
233
220
|
}
|
|
234
221
|
exports.FarmingPlayer = FarmingPlayer;
|
|
235
|
-
//# sourceMappingURL=player.js.map
|
|
222
|
+
//# sourceMappingURL=player.js.map
|
|
@@ -1,59 +1,63 @@
|
|
|
1
1
|
import { Crop } from '../constants/crops';
|
|
2
2
|
export declare function createFarmingWeightCalculator(info?: FarmingWeightInfo): FarmingWeight;
|
|
3
3
|
export interface FarmingWeightInfo {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
collection?: Record<string, number>;
|
|
5
|
+
farmingXp?: number;
|
|
6
|
+
levelCapUpgrade?: number;
|
|
7
|
+
anitaBonusFarmingFortuneLevel?: number;
|
|
8
|
+
minions?: string[];
|
|
9
|
+
contests?: {
|
|
10
|
+
collected: number;
|
|
11
|
+
claimed_position?: number;
|
|
12
|
+
claimed_participants?: number;
|
|
13
|
+
claimed_medal?: 'bronze' | 'silver' | 'gold' | 'platinum' | 'diamond' | string;
|
|
14
|
+
}[];
|
|
15
|
+
pests?: Record<string, number>;
|
|
16
16
|
}
|
|
17
17
|
declare class FarmingWeight {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
18
|
+
collection: Record<Crop, number>;
|
|
19
|
+
levelCapUpgrade: number;
|
|
20
|
+
farmingXp: number;
|
|
21
|
+
anitaBonusFarmingFortuneLevel: number;
|
|
22
|
+
tier12MinionCount: number;
|
|
23
|
+
earnedMedals: Record<'diamond' | 'platinum' | 'gold', number>;
|
|
24
|
+
cropWeights: Record<Crop, number>;
|
|
25
|
+
bonusSources: Record<string, number>;
|
|
26
|
+
uncountedCrops: Partial<Record<Crop, number>>;
|
|
27
|
+
readonly info?: FarmingWeightInfo;
|
|
28
|
+
constructor(info?: FarmingWeightInfo);
|
|
29
|
+
/**
|
|
30
|
+
* Expectes a dictionary of collections and amounts with the default Hypixel SkyBlock IDs
|
|
31
|
+
* @param {Record<string, number>} collections
|
|
32
|
+
* @returns {FarmingWeight}
|
|
33
|
+
*/
|
|
34
|
+
setCropsFromCollections(collections: Record<string, number>): FarmingWeight;
|
|
35
|
+
setCrop: (crop: Crop, collection: number) => this;
|
|
36
|
+
setLevelCap: (levelCap: number) => this;
|
|
37
|
+
setFarmingXp: (farmingXp: number) => this;
|
|
38
|
+
setAnitaBonusLevel: (anitaBonusFarmingFortuneLevel: number) => this;
|
|
39
|
+
addMinions: (minions: string[]) => this;
|
|
40
|
+
setEarnedMedals: ({
|
|
41
|
+
diamond,
|
|
42
|
+
platinum,
|
|
43
|
+
gold,
|
|
44
|
+
}: {
|
|
45
|
+
diamond?: number | undefined;
|
|
46
|
+
platinum?: number | undefined;
|
|
47
|
+
gold?: number | undefined;
|
|
48
|
+
}) => this;
|
|
49
|
+
setTier12MinionCount: (count: number) => this;
|
|
50
|
+
setContests: (contests: FarmingWeightInfo['contests']) => this;
|
|
51
|
+
getWeightInfo: () => {
|
|
52
|
+
totalWeight: number;
|
|
53
|
+
bonusWeight: number;
|
|
54
|
+
cropWeight: number;
|
|
55
|
+
bonusSources: Record<string, number>;
|
|
56
|
+
uncountedCrops: Partial<Record<Crop, number>>;
|
|
57
|
+
};
|
|
58
|
+
getBonusWeights: () => Record<string, number>;
|
|
59
|
+
getCropWeights: () => Record<Crop, number>;
|
|
60
|
+
calcUncountedCrops: (bestiary: Record<string, number>) => this;
|
|
61
|
+
getCropWeight: (crop: Crop) => void;
|
|
58
62
|
}
|
|
59
63
|
export {};
|