farming-weight 0.7.0 → 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/personalbests.d.ts +1 -1
- package/dist/constants/personalbests.js +11 -11
- package/dist/constants/personalbests.js.map +1 -1
- package/dist/constants/pests.d.ts +1 -1
- package/dist/constants/pests.js +77 -84
- package/dist/constants/pests.js.map +1 -1
- 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/constants/weight.js +9 -9
- package/dist/constants/weight.js.map +1 -1
- 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
|
@@ -1,197 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.createFarmingWeightCalculator = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
const CROPS_1 = require('../constants/crops');
|
|
5
|
+
const WEIGHT_1 = require('../constants/weight');
|
|
6
|
+
const JACOB_1 = require('../util/jacob');
|
|
7
|
+
const PESTS_1 = require('../util/pests');
|
|
8
8
|
function createFarmingWeightCalculator(info) {
|
|
9
|
-
|
|
9
|
+
return new FarmingWeight(info);
|
|
10
10
|
}
|
|
11
11
|
exports.createFarmingWeightCalculator = createFarmingWeightCalculator;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const CROPS = [
|
|
13
|
+
CROPS_1.Crop.Cactus,
|
|
14
|
+
CROPS_1.Crop.Carrot,
|
|
15
|
+
CROPS_1.Crop.CocoaBeans,
|
|
16
|
+
CROPS_1.Crop.Melon,
|
|
17
|
+
CROPS_1.Crop.Mushroom,
|
|
18
|
+
CROPS_1.Crop.NetherWart,
|
|
19
|
+
CROPS_1.Crop.Potato,
|
|
20
|
+
CROPS_1.Crop.Pumpkin,
|
|
21
|
+
CROPS_1.Crop.SugarCane,
|
|
22
|
+
CROPS_1.Crop.Wheat,
|
|
23
23
|
];
|
|
24
24
|
class FarmingWeight {
|
|
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
|
-
return this;
|
|
192
|
-
};
|
|
193
|
-
getCropWeight = (crop) => {
|
|
194
|
-
weight_1.CROP_WEIGHT[crop];
|
|
195
|
-
};
|
|
25
|
+
info;
|
|
26
|
+
constructor(info) {
|
|
27
|
+
this.info = info;
|
|
28
|
+
this.collection = {};
|
|
29
|
+
this.levelCapUpgrade = info?.levelCapUpgrade ?? 0;
|
|
30
|
+
this.anitaBonusFarmingFortuneLevel = info?.anitaBonusFarmingFortuneLevel ?? 0;
|
|
31
|
+
this.farmingXp = info?.farmingXp ?? 0;
|
|
32
|
+
this.earnedMedals = { diamond: 0, platinum: 0, gold: 0 };
|
|
33
|
+
this.tier12MinionCount = 0;
|
|
34
|
+
this.bonusSources = {};
|
|
35
|
+
this.uncountedCrops = {};
|
|
36
|
+
this.setContests(info?.contests ?? []);
|
|
37
|
+
this.calcUncountedCrops(info?.pests ?? {});
|
|
38
|
+
this.setCropsFromCollections(info?.collection ?? {});
|
|
39
|
+
this.addMinions(info?.minions ?? []);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Expectes a dictionary of collections and amounts with the default Hypixel SkyBlock IDs
|
|
43
|
+
* @param {Record<string, number>} collections
|
|
44
|
+
* @returns {FarmingWeight}
|
|
45
|
+
*/
|
|
46
|
+
setCropsFromCollections(collections) {
|
|
47
|
+
for (const CROP of CROPS) {
|
|
48
|
+
this.collection[CROP] = collections[CROP] ?? 0;
|
|
49
|
+
}
|
|
50
|
+
this.getCropWeights();
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
setCrop = (crop, collection) => {
|
|
54
|
+
this.collection[crop] = collection;
|
|
55
|
+
this.getCropWeights();
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
setLevelCap = (levelCap) => {
|
|
59
|
+
this.levelCapUpgrade = levelCap;
|
|
60
|
+
return this;
|
|
61
|
+
};
|
|
62
|
+
setFarmingXp = (farmingXp) => {
|
|
63
|
+
this.farmingXp = farmingXp;
|
|
64
|
+
return this;
|
|
65
|
+
};
|
|
66
|
+
setAnitaBonusLevel = (anitaBonusFarmingFortuneLevel) => {
|
|
67
|
+
this.anitaBonusFarmingFortuneLevel = anitaBonusFarmingFortuneLevel;
|
|
68
|
+
return this;
|
|
69
|
+
};
|
|
70
|
+
addMinions = (minions) => {
|
|
71
|
+
for (const MINION of minions) {
|
|
72
|
+
if (!MINION.endsWith('_12')) continue;
|
|
73
|
+
if (!WEIGHT_1.TIER_12_MINIONS.includes(MINION)) continue;
|
|
74
|
+
this.tier12MinionCount++;
|
|
75
|
+
}
|
|
76
|
+
return this;
|
|
77
|
+
};
|
|
78
|
+
setEarnedMedals = ({ diamond, platinum, gold }) => {
|
|
79
|
+
this.earnedMedals = {
|
|
80
|
+
diamond: diamond ?? this.earnedMedals.diamond,
|
|
81
|
+
platinum: platinum ?? this.earnedMedals.platinum,
|
|
82
|
+
gold: gold ?? this.earnedMedals.gold,
|
|
83
|
+
};
|
|
84
|
+
return this;
|
|
85
|
+
};
|
|
86
|
+
setTier12MinionCount = (count) => {
|
|
87
|
+
this.tier12MinionCount = count;
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
setContests = (contests) => {
|
|
91
|
+
if (!contests?.length) return this;
|
|
92
|
+
for (const CONTEST of contests) {
|
|
93
|
+
const MEDAL = (0, JACOB_1.calculateJacobContestMedal)(CONTEST);
|
|
94
|
+
if (!MEDAL) continue;
|
|
95
|
+
if (MEDAL === 'diamond') {
|
|
96
|
+
this.earnedMedals.diamond++;
|
|
97
|
+
} else if (MEDAL === 'platinum') {
|
|
98
|
+
this.earnedMedals.platinum++;
|
|
99
|
+
} else if (MEDAL === 'gold') {
|
|
100
|
+
this.earnedMedals.gold++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
this.getBonusWeights();
|
|
104
|
+
return this;
|
|
105
|
+
};
|
|
106
|
+
getWeightInfo = () => {
|
|
107
|
+
const BONUS = this.getBonusWeights();
|
|
108
|
+
const crops = this.getCropWeights();
|
|
109
|
+
const BONUS_TOTAL = Object.values(BONUS).reduce((a, b) => a + b, 0);
|
|
110
|
+
const CROP_TOTAL = Object.values(crops).reduce((a, b) => a + b, 0);
|
|
111
|
+
return {
|
|
112
|
+
totalWeight: BONUS_TOTAL + CROP_TOTAL,
|
|
113
|
+
bonusWeight: BONUS_TOTAL,
|
|
114
|
+
cropWeight: CROP_TOTAL,
|
|
115
|
+
bonusSources: BONUS,
|
|
116
|
+
uncountedCrops: this.uncountedCrops,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
getBonusWeights = () => {
|
|
120
|
+
this.bonusSources = {};
|
|
121
|
+
if (this.farmingXp >= 111_672_425 && this.levelCapUpgrade >= 10) {
|
|
122
|
+
// Farming 60 bonus
|
|
123
|
+
this.bonusSources['Farming 60'] = WEIGHT_1.BONUS_WEIGHT.Farming60Bonus;
|
|
124
|
+
} else if (this.farmingXp >= 55_172_425) {
|
|
125
|
+
// Farming 50 bonus
|
|
126
|
+
this.bonusSources['Farming 50'] = WEIGHT_1.BONUS_WEIGHT.Farming50Bonus;
|
|
127
|
+
}
|
|
128
|
+
// Tier 12 minion bonus
|
|
129
|
+
if (this.tier12MinionCount > 0) {
|
|
130
|
+
this.bonusSources['Tier 12 Minions'] = this.tier12MinionCount * WEIGHT_1.BONUS_WEIGHT.MinionRewardWeight;
|
|
131
|
+
}
|
|
132
|
+
// Anita bonus
|
|
133
|
+
if (this.anitaBonusFarmingFortuneLevel > 0) {
|
|
134
|
+
this.bonusSources['Anita Bonus'] =
|
|
135
|
+
this.anitaBonusFarmingFortuneLevel * WEIGHT_1.BONUS_WEIGHT.AnitaBuffBonusMultiplier;
|
|
136
|
+
}
|
|
137
|
+
const MAX_MEDALS = WEIGHT_1.BONUS_WEIGHT.MaxMedalsCounted;
|
|
138
|
+
if (this.earnedMedals.diamond >= MAX_MEDALS) {
|
|
139
|
+
this.bonusSources['Contest Medals'] =
|
|
140
|
+
WEIGHT_1.BONUS_WEIGHT.WeightPerDiamondMedal * WEIGHT_1.BONUS_WEIGHT.MaxMedalsCounted;
|
|
141
|
+
} else {
|
|
142
|
+
const DIAMOND = this.earnedMedals.diamond;
|
|
143
|
+
const PLATINUM = Math.min(MAX_MEDALS - DIAMOND, this.earnedMedals.platinum);
|
|
144
|
+
const GOLD = Math.min(MAX_MEDALS - DIAMOND - PLATINUM, this.earnedMedals.gold);
|
|
145
|
+
const MEDALS =
|
|
146
|
+
DIAMOND * WEIGHT_1.BONUS_WEIGHT.WeightPerDiamondMedal +
|
|
147
|
+
PLATINUM * WEIGHT_1.BONUS_WEIGHT.WeightPerPlatinumMedal +
|
|
148
|
+
GOLD * WEIGHT_1.BONUS_WEIGHT.WeightPerGoldMedal;
|
|
149
|
+
this.bonusSources['Contest Medals'] = MEDALS;
|
|
150
|
+
}
|
|
151
|
+
return this.bonusSources;
|
|
152
|
+
};
|
|
153
|
+
getCropWeights = () => {
|
|
154
|
+
const CROP_WEIGHT = {};
|
|
155
|
+
let TOTAL_WEIGHT = 0;
|
|
156
|
+
let DOUBLE_BREAK_WEIGHT = 0;
|
|
157
|
+
for (const CROP of CROPS) {
|
|
158
|
+
let COLLECTED = this.collection[CROP] ?? 0;
|
|
159
|
+
// Subtract uncounted crops
|
|
160
|
+
if (this.uncountedCrops[CROP]) {
|
|
161
|
+
COLLECTED = Math.max(0, COLLECTED - (this.uncountedCrops[CROP] ?? 0));
|
|
162
|
+
}
|
|
163
|
+
const WEIGHT = COLLECTED / WEIGHT_1.CROP_WEIGHT[CROP];
|
|
164
|
+
TOTAL_WEIGHT += WEIGHT;
|
|
165
|
+
if (CROP === CROPS_1.Crop.Cactus || CROP === CROPS_1.Crop.SugarCane) {
|
|
166
|
+
DOUBLE_BREAK_WEIGHT += WEIGHT;
|
|
167
|
+
}
|
|
168
|
+
CROP_WEIGHT[CROP] = WEIGHT;
|
|
169
|
+
}
|
|
170
|
+
// Mushroom is a special case, it needs to be calculated dynamically based on the
|
|
171
|
+
// ratio between the farmed crops that give two mushrooms per break with cow pet
|
|
172
|
+
// and the farmed crops that give one mushroom per break with cow pet
|
|
173
|
+
const MUSHROOM_COLLECTION = this.collection[CROPS_1.Crop.Mushroom] ?? 0;
|
|
174
|
+
const MUSHROOM_WEIGHT_NUMBER = WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Mushroom];
|
|
175
|
+
const DOUBLE_BREAK_RATIO = DOUBLE_BREAK_WEIGHT / TOTAL_WEIGHT;
|
|
176
|
+
const NORMAL_CROP_RATIO = (TOTAL_WEIGHT - DOUBLE_BREAK_WEIGHT) / TOTAL_WEIGHT;
|
|
177
|
+
const MUSHROOM_WEIGHT =
|
|
178
|
+
DOUBLE_BREAK_RATIO * (MUSHROOM_COLLECTION / (MUSHROOM_WEIGHT_NUMBER * 2)) +
|
|
179
|
+
NORMAL_CROP_RATIO * (MUSHROOM_COLLECTION / MUSHROOM_WEIGHT_NUMBER);
|
|
180
|
+
CROP_WEIGHT[CROPS_1.Crop.Mushroom] = MUSHROOM_WEIGHT;
|
|
181
|
+
return CROP_WEIGHT;
|
|
182
|
+
};
|
|
183
|
+
calcUncountedCrops = (bestiary) => {
|
|
184
|
+
this.uncountedCrops = (0, PESTS_1.uncountedCropsFromPests)(bestiary);
|
|
185
|
+
this.getCropWeights();
|
|
186
|
+
return this;
|
|
187
|
+
};
|
|
188
|
+
getCropWeight = (crop) => {
|
|
189
|
+
WEIGHT_1.CROP_WEIGHT[crop];
|
|
190
|
+
};
|
|
196
191
|
}
|
|
197
|
-
//# sourceMappingURL=weightcalc.js.map
|
|
192
|
+
//# sourceMappingURL=weightcalc.js.map
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
const VITEST_1 = require('vitest');
|
|
4
|
+
const WEIGHTCALC_1 = require('./weightcalc');
|
|
5
|
+
const CROPS_1 = require('../constants/crops');
|
|
6
|
+
const WEIGHT_1 = require('../constants/weight');
|
|
7
|
+
const PESTS_1 = require('../util/pests');
|
|
8
|
+
const CROPS = {
|
|
9
|
+
[CROPS_1.Crop.Cactus]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Cactus] * 50,
|
|
10
|
+
[CROPS_1.Crop.Carrot]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Carrot] * 10,
|
|
11
|
+
[CROPS_1.Crop.CocoaBeans]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.CocoaBeans] * 10,
|
|
12
|
+
[CROPS_1.Crop.Melon]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Melon] * 10,
|
|
13
|
+
[CROPS_1.Crop.NetherWart]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.NetherWart] * 10,
|
|
14
|
+
[CROPS_1.Crop.Potato]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Potato] * 10,
|
|
15
|
+
[CROPS_1.Crop.Pumpkin]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Pumpkin] * 10,
|
|
16
|
+
[CROPS_1.Crop.SugarCane]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.SugarCane] * 50,
|
|
17
|
+
[CROPS_1.Crop.Wheat]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Wheat] * 10,
|
|
18
18
|
};
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const PESTS = {
|
|
20
|
+
pest_fly_1: 150,
|
|
21
|
+
pest_beetle_1: 86,
|
|
22
22
|
};
|
|
23
|
-
(0,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
(0, VITEST_1.test)('Basic weight calculation', () => {
|
|
24
|
+
const WEIGHT = (0, WEIGHTCALC_1.createFarmingWeightCalculator)({
|
|
25
|
+
collection: CROPS,
|
|
26
|
+
});
|
|
27
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().totalWeight).toBeCloseTo(170);
|
|
28
28
|
});
|
|
29
|
-
(0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
(0, VITEST_1.test)('Mushroom weight calculation', () => {
|
|
30
|
+
const WEIGHT = (0, WEIGHTCALC_1.createFarmingWeightCalculator)({
|
|
31
|
+
collection: {
|
|
32
|
+
...CROPS,
|
|
33
|
+
[CROPS_1.Crop.Mushroom]: WEIGHT_1.CROP_WEIGHT[CROPS_1.Crop.Mushroom] * 13.74,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().totalWeight).toBeCloseTo(180);
|
|
37
37
|
});
|
|
38
|
-
(0,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
(0, VITEST_1.test)('Pest debuff weight calculation', () => {
|
|
39
|
+
const WEIGHT = (0, WEIGHTCALC_1.createFarmingWeightCalculator)({
|
|
40
|
+
collection: CROPS,
|
|
41
|
+
pests: PESTS,
|
|
42
|
+
});
|
|
43
|
+
const UNCOUNTED = (0, PESTS_1.uncountedCropsFromPests)(PESTS);
|
|
44
|
+
const UNCOUNTED_WHEAT = UNCOUNTED[CROPS_1.Crop.Wheat] ?? 0;
|
|
45
|
+
const UNCOUNTED_WART = UNCOUNTED[CROPS_1.Crop.NetherWart] ?? 0;
|
|
46
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().uncountedCrops[CROPS_1.Crop.Wheat]).toBeCloseTo(UNCOUNTED_WHEAT);
|
|
47
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().uncountedCrops[CROPS_1.Crop.NetherWart]).toBeCloseTo(UNCOUNTED_WART);
|
|
48
|
+
const WEIGHT_EXPECTED = (0, WEIGHTCALC_1.createFarmingWeightCalculator)({
|
|
49
|
+
collection: {
|
|
50
|
+
...CROPS,
|
|
51
|
+
[CROPS_1.Crop.Wheat]: CROPS[CROPS_1.Crop.Wheat] - UNCOUNTED_WHEAT,
|
|
52
|
+
[CROPS_1.Crop.NetherWart]: CROPS[CROPS_1.Crop.NetherWart] - UNCOUNTED_WART,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().cropWeight).toBeCloseTo(WEIGHT_EXPECTED.getWeightInfo().cropWeight);
|
|
56
56
|
});
|
|
57
|
-
(0,
|
|
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
|
-
|
|
57
|
+
(0, VITEST_1.test)('Full weight calculation', () => {
|
|
58
|
+
const crops = {
|
|
59
|
+
[CROPS_1.Crop.Cactus]: 1219395,
|
|
60
|
+
[CROPS_1.Crop.Carrot]: 14238991,
|
|
61
|
+
[CROPS_1.Crop.CocoaBeans]: 901826,
|
|
62
|
+
[CROPS_1.Crop.Melon]: 5041491,
|
|
63
|
+
[CROPS_1.Crop.Mushroom]: 9063168,
|
|
64
|
+
[CROPS_1.Crop.NetherWart]: 897212645,
|
|
65
|
+
[CROPS_1.Crop.Potato]: 171017100,
|
|
66
|
+
[CROPS_1.Crop.Pumpkin]: 1496477,
|
|
67
|
+
[CROPS_1.Crop.SugarCane]: 15509429,
|
|
68
|
+
[CROPS_1.Crop.Wheat]: 21996256,
|
|
69
|
+
};
|
|
70
|
+
const pests = {
|
|
71
|
+
pest_fly_1: 222,
|
|
72
|
+
pest_rat_1: 40,
|
|
73
|
+
pest_mite_1: 43,
|
|
74
|
+
pest_moth_1: 40,
|
|
75
|
+
pest_slug_1: 34,
|
|
76
|
+
pest_worm_1: 32,
|
|
77
|
+
pest_beetle_1: 265,
|
|
78
|
+
pest_locust_1: 41,
|
|
79
|
+
pest_cricket_1: 36,
|
|
80
|
+
pest_mosquito_1: 41,
|
|
81
|
+
};
|
|
82
|
+
const MINIONS = [
|
|
83
|
+
'WHEAT_11',
|
|
84
|
+
'CARROT_11',
|
|
85
|
+
'POTATO_12',
|
|
86
|
+
'PUMPKIN_12',
|
|
87
|
+
'MELON_12',
|
|
88
|
+
'MUSHROOM_12',
|
|
89
|
+
'COCOA_11',
|
|
90
|
+
'CACTUS_11',
|
|
91
|
+
'SUGAR_CANE_12',
|
|
92
|
+
'NETHER_WARTS_12',
|
|
93
|
+
];
|
|
94
|
+
const WEIGHT = (0, WEIGHTCALC_1.createFarmingWeightCalculator)({
|
|
95
|
+
collection: crops,
|
|
96
|
+
pests: pests,
|
|
97
|
+
farmingXp: 286958923.31966937,
|
|
98
|
+
levelCapUpgrade: 10,
|
|
99
|
+
anitaBonusFarmingFortuneLevel: 15,
|
|
100
|
+
minions: MINIONS,
|
|
101
|
+
}).setEarnedMedals({
|
|
102
|
+
diamond: 246,
|
|
103
|
+
platinum: 75,
|
|
104
|
+
gold: 99,
|
|
105
|
+
});
|
|
106
|
+
(0, VITEST_1.expect)(WEIGHT.getWeightInfo().totalWeight).toBeCloseTo(5176.617);
|
|
107
107
|
});
|
|
108
|
-
//# sourceMappingURL=weightcalc.test.js.map
|
|
108
|
+
//# sourceMappingURL=weightcalc.test.js.map
|
|
@@ -3,11 +3,11 @@ import { Crop } from './crops';
|
|
|
3
3
|
import { Rarity } from './reforges';
|
|
4
4
|
import { Skill } from './skills';
|
|
5
5
|
export interface FarmingAccessoryInfo extends UpgradeableInfo {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
name: string;
|
|
7
|
+
wiki: string;
|
|
8
|
+
family?: string;
|
|
9
|
+
maxRarity: Rarity;
|
|
10
|
+
crops?: Crop[];
|
|
11
|
+
skillReq?: Partial<Record<Skill, number>>;
|
|
12
12
|
}
|
|
13
13
|
export declare const FARMING_ACCESSORIES_INFO: Partial<Record<string, FarmingAccessoryInfo>>;
|