farming-weight 0.1.2 → 0.1.4
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/README.md +23 -2
- package/{lib → dist}/constants/crops.d.ts +1 -0
- package/{lib → dist}/constants/crops.js +6 -3
- package/dist/constants/crops.js.map +1 -0
- package/{lib → dist}/constants/items.js +1 -0
- package/dist/constants/items.js.map +1 -0
- package/dist/constants/specialcrops.d.ts +24 -0
- package/dist/constants/specialcrops.js +41 -0
- package/dist/constants/specialcrops.js.map +1 -0
- package/dist/constants/weight.d.ts +13 -0
- package/{lib → dist}/constants/weight.js +24 -1
- package/dist/constants/weight.js.map +1 -0
- package/{lib → dist}/crops/melon.js +1 -0
- package/dist/crops/melon.js.map +1 -0
- package/{lib → dist}/crops/pumpkin.js +1 -0
- package/dist/crops/pumpkin.js.map +1 -0
- package/dist/crops/special.d.ts +6 -0
- package/dist/crops/special.js +17 -0
- package/dist/crops/special.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/{lib → dist}/player.js +1 -0
- package/dist/player.js.map +1 -0
- package/dist/ratecalc.d.ts +31 -0
- package/dist/ratecalc.js +154 -0
- package/dist/ratecalc.js.map +1 -0
- package/dist/tool.d.ts +1 -0
- package/{lib → dist}/tool.js +2 -0
- package/dist/tool.js.map +1 -0
- package/dist/util/jacob.d.ts +16 -0
- package/dist/util/jacob.js +32 -0
- package/dist/util/jacob.js.map +1 -0
- package/dist/util/names.d.ts +2 -0
- package/dist/util/names.js +22 -0
- package/dist/util/names.js.map +1 -0
- package/dist/weight/weightcalc.d.ts +50 -0
- package/dist/weight/weightcalc.js +168 -0
- package/dist/weight/weightcalc.js.map +1 -0
- package/package.json +4 -4
- package/lib/constants/weight.d.ts +0 -2
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -10
- package/lib/ratecalc.d.ts +0 -13
- package/lib/ratecalc.js +0 -64
- package/lib/tool.d.ts +0 -0
- /package/{lib → dist}/constants/items.d.ts +0 -0
- /package/{lib → dist}/crops/melon.d.ts +0 -0
- /package/{lib → dist}/crops/pumpkin.d.ts +0 -0
- /package/{lib → dist}/player.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Tools
|
|
2
|
-
NPM package for Farming Weight and fortune calculations
|
|
2
|
+
NPM package for Farming Weight and fortune calculations in Hypixel SkyBlock.
|
|
3
|
+
|
|
4
|
+
Created specifically for the [EliteWebsite](https://github.com/EliteFarmers/Website) and [EliteBot](https://github.com/EliteFarmers/Bot) projects, but can be used for any project, as long as some credit is given per the license.
|
|
3
5
|
|
|
4
6
|
## Installation
|
|
5
7
|
```bash
|
|
@@ -7,5 +9,24 @@ npm install farming-weight
|
|
|
7
9
|
```
|
|
8
10
|
|
|
9
11
|
## Usage
|
|
12
|
+
|
|
13
|
+
**This is a new package that's changing rapidly, there aren't any comprehensive docs at this time**
|
|
14
|
+
|
|
10
15
|
```js
|
|
11
|
-
import {
|
|
16
|
+
import { CreateFarmingWeightCalculator } from 'farming-weight';
|
|
17
|
+
|
|
18
|
+
const member = // Get SkyBlock member from elsewhere
|
|
19
|
+
|
|
20
|
+
const calculator = CreateFarmingWeightCalculator({
|
|
21
|
+
collection: member.collection,
|
|
22
|
+
farmingXp: member.experience_skill_farming,
|
|
23
|
+
levelCapUpgrade: member.jacob2?.perks?.farming_level_cap,
|
|
24
|
+
anitaBonusFarmingFortuneLevel?: member.jacob2?.perks?.anita_bonus_farming_fortune_level,
|
|
25
|
+
minions: member.crafted_generators, // You should also include minions crafted from other members on the same profile
|
|
26
|
+
contests: member.jacob2?.contests,
|
|
27
|
+
}).setEarnedGoldMedals(earnedGoldMedals) // Can pass in some values instead of calculating them (you can exclude contests if you do this)
|
|
28
|
+
|
|
29
|
+
const weight = calculator.getWeightInfo();
|
|
30
|
+
|
|
31
|
+
console.log(weight.totalWeight); // 10000.53 (or whatever the total weight is)
|
|
32
|
+
```
|
|
@@ -20,6 +20,7 @@ exports.CROP_INFO = {
|
|
|
20
20
|
name: 'Cactus',
|
|
21
21
|
npc: 3,
|
|
22
22
|
drops: 2,
|
|
23
|
+
breaks: 2,
|
|
23
24
|
},
|
|
24
25
|
[Crop.Carrot]: {
|
|
25
26
|
name: 'Carrot',
|
|
@@ -58,8 +59,9 @@ exports.CROP_INFO = {
|
|
|
58
59
|
},
|
|
59
60
|
[Crop.SugarCane]: {
|
|
60
61
|
name: 'Sugar Cane',
|
|
61
|
-
npc:
|
|
62
|
-
drops:
|
|
62
|
+
npc: 4,
|
|
63
|
+
drops: 2,
|
|
64
|
+
breaks: 2,
|
|
63
65
|
},
|
|
64
66
|
[Crop.Wheat]: {
|
|
65
67
|
name: 'Wheat',
|
|
@@ -76,7 +78,7 @@ exports.CROP_INFO = {
|
|
|
76
78
|
exports.MAX_CROP_FORTUNE = {
|
|
77
79
|
[Crop.Cactus]: 1575,
|
|
78
80
|
[Crop.Carrot]: 1784,
|
|
79
|
-
[Crop.CocoaBeans]: 1584,
|
|
81
|
+
[Crop.CocoaBeans]: 1584.5,
|
|
80
82
|
[Crop.Melon]: 1567.8,
|
|
81
83
|
[Crop.Mushroom]: 1603,
|
|
82
84
|
[Crop.NetherWart]: 1772,
|
|
@@ -86,3 +88,4 @@ exports.MAX_CROP_FORTUNE = {
|
|
|
86
88
|
[Crop.Wheat]: 1772,
|
|
87
89
|
[Crop.Seeds]: 1772, // Not a crop, same as wheat
|
|
88
90
|
};
|
|
91
|
+
//# sourceMappingURL=crops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crops.js","sourceRoot":"","sources":["../../src/constants/crops.ts"],"names":[],"mappings":";;;AAAA,IAAY,IAYX;AAZD,WAAY,IAAI;IACf,yBAAiB,CAAA;IACjB,8BAAsB,CAAA;IACtB,iCAAyB,CAAA;IACzB,uBAAe,CAAA;IACf,wCAAgC,CAAA;IAChC,mCAA2B,CAAA;IAC3B,8BAAs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AE,CAAC;KACT;IACD,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;KACR;IACD,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,GAAG;KACV;CACD,CAAC;AAEF,8CAA8C;AACjC,QAAA,gBAAgB,GAAyB;IACrD,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI;IACnB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI;IACnB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM;IACzB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM;IACpB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI;IACrB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI;IACvB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI;IACnB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM;IACtB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI;IACtB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI;IAClB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,4BAA4B;CAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../src/constants/items.ts"],"names":[],"mappings":";;;AAAA,IAAY,MASX;AATD,WAAY,MAAM;IACjB,2BAAiB,CAAA;IACjB,+BAAqB,CAAA;IACrB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,iCAAuB,CAAA;IACvB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;AAClB,CAAC,EATW,MAAM,sBAAN,MAAM,QASjB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Crop } from './crops';
|
|
2
|
+
export declare enum SpecialCrop {
|
|
3
|
+
Cropie = "Cropie",
|
|
4
|
+
Squash = "Squash",
|
|
5
|
+
Fermento = "Fermento"
|
|
6
|
+
}
|
|
7
|
+
export declare const SPECIAL_CROP_INFO: {
|
|
8
|
+
Cropie: {
|
|
9
|
+
name: string;
|
|
10
|
+
npc: number;
|
|
11
|
+
rates: number[];
|
|
12
|
+
};
|
|
13
|
+
Squash: {
|
|
14
|
+
name: string;
|
|
15
|
+
npc: number;
|
|
16
|
+
rates: number[];
|
|
17
|
+
};
|
|
18
|
+
Fermento: {
|
|
19
|
+
name: string;
|
|
20
|
+
npc: number;
|
|
21
|
+
rates: number[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const MATCHING_SPECIAL_CROP: Record<Crop, SpecialCrop>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MATCHING_SPECIAL_CROP = exports.SPECIAL_CROP_INFO = exports.SpecialCrop = void 0;
|
|
4
|
+
const crops_1 = require("./crops");
|
|
5
|
+
var SpecialCrop;
|
|
6
|
+
(function (SpecialCrop) {
|
|
7
|
+
SpecialCrop["Cropie"] = "Cropie";
|
|
8
|
+
SpecialCrop["Squash"] = "Squash";
|
|
9
|
+
SpecialCrop["Fermento"] = "Fermento";
|
|
10
|
+
})(SpecialCrop || (exports.SpecialCrop = SpecialCrop = {}));
|
|
11
|
+
exports.SPECIAL_CROP_INFO = {
|
|
12
|
+
[SpecialCrop.Cropie]: {
|
|
13
|
+
name: 'Cropie',
|
|
14
|
+
npc: 25_000,
|
|
15
|
+
rates: [0.0003, 0.0003, 0.0004, 0.0005],
|
|
16
|
+
},
|
|
17
|
+
[SpecialCrop.Squash]: {
|
|
18
|
+
name: 'Squash',
|
|
19
|
+
npc: 75_000,
|
|
20
|
+
rates: [0.0001, 0.0001, 0.0002, 0.0003],
|
|
21
|
+
},
|
|
22
|
+
[SpecialCrop.Fermento]: {
|
|
23
|
+
name: 'Fermento',
|
|
24
|
+
npc: 250_000,
|
|
25
|
+
rates: [0.00005, 0.00005, 0.00006, 0.00007],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
exports.MATCHING_SPECIAL_CROP = {
|
|
29
|
+
[crops_1.Crop.Wheat]: SpecialCrop.Cropie,
|
|
30
|
+
[crops_1.Crop.Carrot]: SpecialCrop.Cropie,
|
|
31
|
+
[crops_1.Crop.Potato]: SpecialCrop.Cropie,
|
|
32
|
+
[crops_1.Crop.CocoaBeans]: SpecialCrop.Squash,
|
|
33
|
+
[crops_1.Crop.Melon]: SpecialCrop.Squash,
|
|
34
|
+
[crops_1.Crop.Pumpkin]: SpecialCrop.Squash,
|
|
35
|
+
[crops_1.Crop.Cactus]: SpecialCrop.Fermento,
|
|
36
|
+
[crops_1.Crop.Mushroom]: SpecialCrop.Fermento,
|
|
37
|
+
[crops_1.Crop.NetherWart]: SpecialCrop.Fermento,
|
|
38
|
+
[crops_1.Crop.SugarCane]: SpecialCrop.Fermento,
|
|
39
|
+
[crops_1.Crop.Seeds]: SpecialCrop.Fermento,
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=specialcrops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specialcrops.js","sourceRoot":"","sources":["../../src/constants/specialcrops.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;AACtB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAEY,QAAA,iBAAiB,GAAG;IAChC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KACvC;IACD,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KACvC;IACD,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;QACvB,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,OAAO;QACZ,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;KAC3C;CACD,CAAC;AAEW,QAAA,qBAAqB,GAA8B;IAC/D,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM;IAChC,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM;IACjC,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM;IAEjC,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM;IACrC,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM;IAChC,CAAC,YAAI,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM;IAElC,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ;IACnC,CAAC,YAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ;IACrC,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,QAAQ;IACvC,CAAC,YAAI,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,QAAQ;IACtC,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,QAAQ;CAClC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Crop } from './crops';
|
|
2
|
+
export declare const CROP_WEIGHT: Record<Crop, number>;
|
|
3
|
+
export declare const TIER_12_MINIONS: readonly string[];
|
|
4
|
+
export declare const BONUS_WEIGHT: {
|
|
5
|
+
readonly Farming60Bonus: 250;
|
|
6
|
+
readonly Farming50Bonus: 100;
|
|
7
|
+
readonly AnitaBuffBonusMultiplier: 2;
|
|
8
|
+
readonly MaxMedalsCounted: 1000;
|
|
9
|
+
readonly GoldMedalRewardInterval: 50;
|
|
10
|
+
readonly WeightPerGoldMedal: 0.5;
|
|
11
|
+
readonly MinionRewardTier: 12;
|
|
12
|
+
readonly MinionRewardWeight: 5;
|
|
13
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CROP_WEIGHT = void 0;
|
|
3
|
+
exports.BONUS_WEIGHT = exports.TIER_12_MINIONS = exports.CROP_WEIGHT = void 0;
|
|
4
4
|
const crops_1 = require("./crops");
|
|
5
5
|
// https://api.elitebot.dev/weights
|
|
6
6
|
exports.CROP_WEIGHT = {
|
|
@@ -16,3 +16,26 @@ exports.CROP_WEIGHT = {
|
|
|
16
16
|
[crops_1.Crop.Wheat]: 100_000,
|
|
17
17
|
[crops_1.Crop.Seeds]: 0, // Byproduct of wheat farming, not counted
|
|
18
18
|
};
|
|
19
|
+
exports.TIER_12_MINIONS = [
|
|
20
|
+
'WHEAT_12',
|
|
21
|
+
'CARROT_12',
|
|
22
|
+
'POTATO_12',
|
|
23
|
+
'PUMPKIN_12',
|
|
24
|
+
'MELON_12',
|
|
25
|
+
'MUSHROOM_12',
|
|
26
|
+
'COCOA_12',
|
|
27
|
+
'CACTUS_12',
|
|
28
|
+
'SUGAR_CANE_12',
|
|
29
|
+
'NETHER_WARTS_12',
|
|
30
|
+
];
|
|
31
|
+
exports.BONUS_WEIGHT = {
|
|
32
|
+
Farming60Bonus: 250,
|
|
33
|
+
Farming50Bonus: 100,
|
|
34
|
+
AnitaBuffBonusMultiplier: 2,
|
|
35
|
+
MaxMedalsCounted: 1000,
|
|
36
|
+
GoldMedalRewardInterval: 50,
|
|
37
|
+
WeightPerGoldMedal: 0.5,
|
|
38
|
+
MinionRewardTier: 12,
|
|
39
|
+
MinionRewardWeight: 5,
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=weight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weight.js","sourceRoot":"","sources":["../../src/constants/weight.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,mCAAmC;AACtB,QAAA,WAAW,GAAyB;IAChD,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,UAAU;IACzB,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,UAAU;IACzB,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,UAAU;IAC7B,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,UAAU;IACxB,CAAC,YAAI,CAAC,QAAQ,CAAC,EAAE,SAAS;IAC1B,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,OAAO;IAC1B,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,OAAO;IACtB,CAAC,YAAI,CAAC,OAAO,CAAC,EAAE,SAAS;IACzB,CAAC,YAAI,CAAC,SAAS,CAAC,EAAE,OAAO;IACzB,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,OAAO;IACrB,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,0CAA0C;CAC3D,CAAC;AAEW,QAAA,eAAe,GAAsB;IACjD,UAAU;IACV,WAAW;IACX,WAAW;IACX,YAAY;IACZ,UAAU;IACV,aAAa;IACb,UAAU;IACV,WAAW;IACX,eAAe;IACf,iBAAiB;CACR,CAAC;AAEE,QAAA,YAAY,GAAG;IAC3B,cAAc,EAAE,GAAG;IACnB,cAAc,EAAE,GAAG;IACnB,wBAAwB,EAAE,CAAC;IAC3B,gBAAgB,EAAE,IAAI;IACtB,uBAAuB,EAAE,EAAE;IAC3B,kBAAkB,EAAE,GAAG;IACvB,gBAAgB,EAAE,EAAE;IACpB,kBAAkB,EAAE,CAAC;CACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"melon.js","sourceRoot":"","sources":["../../src/crops/melon.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG;IAC1B,CAAC,EAAE;QACF;YACC,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG,GAAG,MAAM;SACpB;QACD;YACC,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE,GAAG,MAAM;SACnB;QACD;YACC,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,GAAG,MAAM;SAClB;QACD;YACC,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,CAAC,GAAG,MAAM;SAClB;KACD;CACD,CAAC;AAEF,SAAgB,cAAc,CAAC,YAAoB,EAAE,QAAW,CAAC;IAChE,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE;QAC1D,KAAK,IAAI,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;KACvC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AARD,wCAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pumpkin.js","sourceRoot":"","sources":["../../src/crops/pumpkin.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IAC5B,CAAC,EAAE;QACF;YACC,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE,GAAG,MAAM;SACnB;QACD;YACC,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE,GAAG,MAAM;SACnB;QACD;YACC,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,CAAC,GAAG,MAAM;SAClB;QACD;YACC,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,GAAG,MAAM;SAClB;KACD;CACD,CAAC;AAEF,SAAgB,gBAAgB,CAAC,YAAoB,EAAE,QAAW,CAAC;IAClE,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;QAC5D,KAAK,IAAI,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;KACvC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AARD,4CAQC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculateAverageSpecialCrops = void 0;
|
|
4
|
+
const specialcrops_1 = require("../constants/specialcrops");
|
|
5
|
+
function CalculateAverageSpecialCrops(blocksBroken, crop, armor) {
|
|
6
|
+
const type = specialcrops_1.MATCHING_SPECIAL_CROP[crop];
|
|
7
|
+
const { rates, npc } = specialcrops_1.SPECIAL_CROP_INFO[type];
|
|
8
|
+
const chance = rates[armor - 1] ?? 0;
|
|
9
|
+
const amount = blocksBroken * chance;
|
|
10
|
+
return {
|
|
11
|
+
type,
|
|
12
|
+
amount: amount,
|
|
13
|
+
npc: npc * amount,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.CalculateAverageSpecialCrops = CalculateAverageSpecialCrops;
|
|
17
|
+
//# sourceMappingURL=special.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"special.js","sourceRoot":"","sources":["../../src/crops/special.ts"],"names":[],"mappings":";;;AACA,4DAAqF;AAErF,SAAgB,4BAA4B,CAAC,YAAoB,EAAE,IAAU,EAAE,KAAoB;IAClG,MAAM,IAAI,GAAG,oCAAqB,CAAC,IAAI,CAAC,CAAC;IAEzC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,gCAAiB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IAErC,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,GAAG,GAAG,MAAM;KACjB,CAAC;AACH,CAAC;AAZD,oEAYC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalculateExpectedDrops, CalculateAverageDrops, GetCropInfo, GetNPCProfit, CalculateDetailedAverageDrops, CalculateDetailedDrops } from './ratecalc';
|
|
2
|
+
import { CropInfo, Crop, MAX_CROP_FORTUNE } from './constants/crops';
|
|
3
|
+
import { CropDisplayName } from './util/names';
|
|
4
|
+
import { CreateFarmingWeightCalculator } from './weight/weightcalc';
|
|
5
|
+
import { FormatJacobContests, CalculateJacobContestMedal } from './util/jacob';
|
|
6
|
+
export { CalculateExpectedDrops, CalculateAverageDrops, CalculateDetailedAverageDrops, CalculateDetailedDrops, GetCropInfo, CropInfo, Crop, MAX_CROP_FORTUNE, CropDisplayName, GetNPCProfit, CreateFarmingWeightCalculator, FormatJacobContests, CalculateJacobContestMedal, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculateJacobContestMedal = exports.FormatJacobContests = exports.CreateFarmingWeightCalculator = exports.GetNPCProfit = exports.CropDisplayName = exports.MAX_CROP_FORTUNE = exports.Crop = exports.GetCropInfo = exports.CalculateDetailedDrops = exports.CalculateDetailedAverageDrops = exports.CalculateAverageDrops = exports.CalculateExpectedDrops = void 0;
|
|
4
|
+
const ratecalc_1 = require("./ratecalc");
|
|
5
|
+
Object.defineProperty(exports, "CalculateExpectedDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateExpectedDrops; } });
|
|
6
|
+
Object.defineProperty(exports, "CalculateAverageDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateAverageDrops; } });
|
|
7
|
+
Object.defineProperty(exports, "GetCropInfo", { enumerable: true, get: function () { return ratecalc_1.GetCropInfo; } });
|
|
8
|
+
Object.defineProperty(exports, "GetNPCProfit", { enumerable: true, get: function () { return ratecalc_1.GetNPCProfit; } });
|
|
9
|
+
Object.defineProperty(exports, "CalculateDetailedAverageDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateDetailedAverageDrops; } });
|
|
10
|
+
Object.defineProperty(exports, "CalculateDetailedDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateDetailedDrops; } });
|
|
11
|
+
const crops_1 = require("./constants/crops");
|
|
12
|
+
Object.defineProperty(exports, "Crop", { enumerable: true, get: function () { return crops_1.Crop; } });
|
|
13
|
+
Object.defineProperty(exports, "MAX_CROP_FORTUNE", { enumerable: true, get: function () { return crops_1.MAX_CROP_FORTUNE; } });
|
|
14
|
+
const names_1 = require("./util/names");
|
|
15
|
+
Object.defineProperty(exports, "CropDisplayName", { enumerable: true, get: function () { return names_1.CropDisplayName; } });
|
|
16
|
+
const weightcalc_1 = require("./weight/weightcalc");
|
|
17
|
+
Object.defineProperty(exports, "CreateFarmingWeightCalculator", { enumerable: true, get: function () { return weightcalc_1.CreateFarmingWeightCalculator; } });
|
|
18
|
+
const jacob_1 = require("./util/jacob");
|
|
19
|
+
Object.defineProperty(exports, "FormatJacobContests", { enumerable: true, get: function () { return jacob_1.FormatJacobContests; } });
|
|
20
|
+
Object.defineProperty(exports, "CalculateJacobContestMedal", { enumerable: true, get: function () { return jacob_1.CalculateJacobContestMedal; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAOoB;AAOnB,uGAbA,iCAAsB,OAaA;AACtB,sGAbA,gCAAqB,OAaA;AAGrB,4FAfA,sBAAW,OAeA;AAKX,6FAnBA,uBAAY,OAmBA;AAPZ,8GAXA,wCAA6B,OAWA;AAC7B,uGAXA,iCAAsB,OAWA;AATvB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CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,OAAO,CAAC;IAChB,CAAC;CACD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Crop, CropInfo } from './constants/crops';
|
|
2
|
+
interface CalculateDropsOptions {
|
|
3
|
+
farmingFortune?: number;
|
|
4
|
+
blocksBroken: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function CalculateAverageDrops(options: CalculateDropsOptions): Record<Crop, number>;
|
|
7
|
+
interface CalculateDetailedDropsOptions extends CalculateDropsOptions {
|
|
8
|
+
bountiful: boolean;
|
|
9
|
+
mooshroom: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface DetailedDrops {
|
|
12
|
+
collection: number;
|
|
13
|
+
npcCoins: number;
|
|
14
|
+
fortune: number;
|
|
15
|
+
coinSources: Record<string, number>;
|
|
16
|
+
otherCollection: Record<string, number>;
|
|
17
|
+
}
|
|
18
|
+
export declare function CalculateDetailedAverageDrops(options: CalculateDetailedDropsOptions): Record<Crop, DetailedDrops>;
|
|
19
|
+
interface CalculateExpectedDropsOptions extends CalculateDropsOptions {
|
|
20
|
+
blocksBroken: number;
|
|
21
|
+
crop: Crop;
|
|
22
|
+
}
|
|
23
|
+
interface CalculateCropDetailedDropsOptions extends CalculateDetailedDropsOptions {
|
|
24
|
+
blocksBroken: number;
|
|
25
|
+
crop: Crop;
|
|
26
|
+
}
|
|
27
|
+
export declare function CalculateExpectedDrops(options: CalculateExpectedDropsOptions): number;
|
|
28
|
+
export declare function CalculateDetailedDrops(options: CalculateCropDetailedDropsOptions): DetailedDrops;
|
|
29
|
+
export declare function GetNPCProfit(crop: Crop, amount: number): number;
|
|
30
|
+
export declare function GetCropInfo(crop: Crop): CropInfo;
|
|
31
|
+
export {};
|
package/dist/ratecalc.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCropInfo = exports.GetNPCProfit = exports.CalculateDetailedDrops = exports.CalculateExpectedDrops = exports.CalculateDetailedAverageDrops = exports.CalculateAverageDrops = void 0;
|
|
4
|
+
const crops_1 = require("./constants/crops");
|
|
5
|
+
const melon_1 = require("./crops/melon");
|
|
6
|
+
const pumpkin_1 = require("./crops/pumpkin");
|
|
7
|
+
const special_1 = require("./crops/special");
|
|
8
|
+
const crops = [
|
|
9
|
+
crops_1.Crop.Cactus,
|
|
10
|
+
crops_1.Crop.Carrot,
|
|
11
|
+
crops_1.Crop.CocoaBeans,
|
|
12
|
+
crops_1.Crop.Melon,
|
|
13
|
+
crops_1.Crop.Mushroom,
|
|
14
|
+
crops_1.Crop.NetherWart,
|
|
15
|
+
crops_1.Crop.Potato,
|
|
16
|
+
crops_1.Crop.Pumpkin,
|
|
17
|
+
crops_1.Crop.SugarCane,
|
|
18
|
+
crops_1.Crop.Wheat,
|
|
19
|
+
crops_1.Crop.Seeds,
|
|
20
|
+
];
|
|
21
|
+
function CalculateAverageDrops(options) {
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const crop of crops) {
|
|
24
|
+
result[crop] = CalculateExpectedDrops({
|
|
25
|
+
crop: crop,
|
|
26
|
+
...options,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
exports.CalculateAverageDrops = CalculateAverageDrops;
|
|
32
|
+
function CalculateDetailedAverageDrops(options) {
|
|
33
|
+
const result = {};
|
|
34
|
+
for (const crop of crops) {
|
|
35
|
+
result[crop] = CalculateDetailedDrops({
|
|
36
|
+
crop: crop,
|
|
37
|
+
...options,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const wheat = result[crops_1.Crop.Wheat];
|
|
41
|
+
const seeds = result[crops_1.Crop.Seeds];
|
|
42
|
+
wheat.otherCollection['Seeds'] = seeds.collection;
|
|
43
|
+
wheat.coinSources['Seeds'] = seeds.collection * crops_1.CROP_INFO[crops_1.Crop.Seeds].npc;
|
|
44
|
+
if (options.bountiful) {
|
|
45
|
+
wheat.coinSources['Bountiful (Seeds)'] = seeds.coinSources['Bountiful'] ?? 0;
|
|
46
|
+
}
|
|
47
|
+
wheat.npcCoins = Object.values(wheat.coinSources).reduce((a, b) => a + b, 0);
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
exports.CalculateDetailedAverageDrops = CalculateDetailedAverageDrops;
|
|
51
|
+
function CalculateExpectedDrops(options) {
|
|
52
|
+
const { farmingFortune, blocksBroken, crop } = options;
|
|
53
|
+
const fortune = farmingFortune ?? crops_1.MAX_CROP_FORTUNE[crop] ?? 0;
|
|
54
|
+
if (fortune <= 0 || blocksBroken < 0)
|
|
55
|
+
return 0;
|
|
56
|
+
const { drops } = GetCropInfo(crop);
|
|
57
|
+
if (!drops)
|
|
58
|
+
return 0;
|
|
59
|
+
const baseDrops = blocksBroken * drops * (fortune * 0.01);
|
|
60
|
+
switch (crop) {
|
|
61
|
+
case crops_1.Crop.Cactus:
|
|
62
|
+
case crops_1.Crop.Wheat:
|
|
63
|
+
case crops_1.Crop.Mushroom:
|
|
64
|
+
case crops_1.Crop.SugarCane:
|
|
65
|
+
return Math.round(baseDrops);
|
|
66
|
+
case crops_1.Crop.Carrot:
|
|
67
|
+
case crops_1.Crop.CocoaBeans:
|
|
68
|
+
case crops_1.Crop.NetherWart:
|
|
69
|
+
case crops_1.Crop.Potato:
|
|
70
|
+
case crops_1.Crop.Seeds:
|
|
71
|
+
return Math.round(baseDrops - blocksBroken); // Replenish takes away one drop per block broken
|
|
72
|
+
case crops_1.Crop.Pumpkin:
|
|
73
|
+
return Math.round(baseDrops + (0, pumpkin_1.PumpkinPerkBonus)(blocksBroken));
|
|
74
|
+
case crops_1.Crop.Melon:
|
|
75
|
+
return Math.round(baseDrops + (0, melon_1.MelonPerkBonus)(blocksBroken));
|
|
76
|
+
default:
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.CalculateExpectedDrops = CalculateExpectedDrops;
|
|
81
|
+
function CalculateDetailedDrops(options) {
|
|
82
|
+
const result = {
|
|
83
|
+
collection: 0,
|
|
84
|
+
npcCoins: 0,
|
|
85
|
+
fortune: 0,
|
|
86
|
+
coinSources: {},
|
|
87
|
+
otherCollection: {},
|
|
88
|
+
};
|
|
89
|
+
const { farmingFortune, blocksBroken, crop, bountiful } = options;
|
|
90
|
+
let fortune = farmingFortune ?? crops_1.MAX_CROP_FORTUNE[crop] ?? 0;
|
|
91
|
+
if (fortune <= 0 || blocksBroken < 0)
|
|
92
|
+
return result;
|
|
93
|
+
if (!bountiful && !farmingFortune) {
|
|
94
|
+
fortune += 5;
|
|
95
|
+
}
|
|
96
|
+
result.fortune = fortune;
|
|
97
|
+
const { drops, npc, breaks = 1 } = GetCropInfo(crop);
|
|
98
|
+
if (!drops)
|
|
99
|
+
return result;
|
|
100
|
+
const baseDrops = blocksBroken * drops * (fortune * 0.01);
|
|
101
|
+
// Coin sources
|
|
102
|
+
result.coinSources['Collection'] = Math.round(baseDrops * npc);
|
|
103
|
+
if (bountiful) {
|
|
104
|
+
result.coinSources['Bountiful'] = Math.round(baseDrops * 0.2);
|
|
105
|
+
}
|
|
106
|
+
if (options.mooshroom) {
|
|
107
|
+
result.coinSources['Mooshroom'] = Math.round(blocksBroken * breaks * crops_1.CROP_INFO[crops_1.Crop.Mushroom].npc);
|
|
108
|
+
result.otherCollection['Mushroom'] = Math.round(blocksBroken * breaks);
|
|
109
|
+
}
|
|
110
|
+
const specialCrops = (0, special_1.CalculateAverageSpecialCrops)(blocksBroken, crop, 4);
|
|
111
|
+
result.otherCollection[specialCrops.type] = Math.round(specialCrops.amount);
|
|
112
|
+
result.coinSources[specialCrops.type] = Math.round(specialCrops.npc);
|
|
113
|
+
let extraDrops = 0;
|
|
114
|
+
switch (crop) {
|
|
115
|
+
case crops_1.Crop.Cactus:
|
|
116
|
+
case crops_1.Crop.Wheat:
|
|
117
|
+
case crops_1.Crop.Mushroom:
|
|
118
|
+
case crops_1.Crop.SugarCane:
|
|
119
|
+
result.collection = Math.round(baseDrops);
|
|
120
|
+
break;
|
|
121
|
+
case crops_1.Crop.Carrot:
|
|
122
|
+
case crops_1.Crop.CocoaBeans:
|
|
123
|
+
case crops_1.Crop.NetherWart:
|
|
124
|
+
case crops_1.Crop.Potato:
|
|
125
|
+
case crops_1.Crop.Seeds:
|
|
126
|
+
result.collection = Math.round(baseDrops - blocksBroken); // Replenish takes away one drop per block broken
|
|
127
|
+
break;
|
|
128
|
+
case crops_1.Crop.Pumpkin:
|
|
129
|
+
extraDrops = Math.round((0, pumpkin_1.PumpkinPerkBonus)(blocksBroken));
|
|
130
|
+
result.coinSources['Dicer RNG'] = Math.round(extraDrops * npc);
|
|
131
|
+
result.collection = Math.round(baseDrops + extraDrops);
|
|
132
|
+
break;
|
|
133
|
+
case crops_1.Crop.Melon:
|
|
134
|
+
extraDrops = Math.round((0, melon_1.MelonPerkBonus)(blocksBroken));
|
|
135
|
+
result.coinSources['Dicer RNG'] = Math.round(extraDrops * npc);
|
|
136
|
+
result.collection = Math.round(baseDrops + extraDrops);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
result.npcCoins = Object.values(result.coinSources).reduce((a, b) => a + b, 0);
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
exports.CalculateDetailedDrops = CalculateDetailedDrops;
|
|
143
|
+
function GetNPCProfit(crop, amount) {
|
|
144
|
+
const { npc } = GetCropInfo(crop);
|
|
145
|
+
if (!npc)
|
|
146
|
+
return 0;
|
|
147
|
+
return npc * amount;
|
|
148
|
+
}
|
|
149
|
+
exports.GetNPCProfit = GetNPCProfit;
|
|
150
|
+
function GetCropInfo(crop) {
|
|
151
|
+
return crops_1.CROP_INFO[crop] ?? {};
|
|
152
|
+
}
|
|
153
|
+
exports.GetCropInfo = GetCropInfo;
|
|
154
|
+
//# sourceMappingURL=ratec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,OAAO,CAAC,CAAC;IACnB,OAAO,GAAG,GAAG,MAAM,CAAC;AACrB,CAAC;AAJD,oCAIC;AAED,SAAgB,WAAW,CAAC,IAAU;IACrC,OAAO,iBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC;AAFD,kCAEC"}
|
package/dist/tool.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/{lib → dist}/tool.js
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// import { Crop } from "./constants/crops";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
// export function CreateTool(options: ToolOptions) {
|
|
4
5
|
// return new FarmingTool(options);
|
|
5
6
|
// }
|
|
@@ -14,3 +15,4 @@
|
|
|
14
15
|
// declare crop: Crop;
|
|
15
16
|
// constructor(options: ToolOptions) {}
|
|
16
17
|
// }
|
|
18
|
+
//# sourceMappingURL=tool.js.map
|
package/dist/tool.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":";AAAA,4CAA4C;;AAE5C,qDAAqD;AACrD,oCAAoC;AACpC,IAAI;AAEJ,8CAA8C;AAE9C,0BAA0B;AAC1B,eAAe;AACf,uBAAuB;AACvB,mBAAmB;AACnB,6CAA6C;AAC7C,IAAI;AAEJ,6CAA6C;AAC7C,uBAAuB;AAEvB,wCAAwC;AAExC,IAAI"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type JacobContestMedal = 'bronze' | 'silver' | 'gold';
|
|
2
|
+
export interface RawJacobContest {
|
|
3
|
+
collected: number;
|
|
4
|
+
claimed_rewards?: boolean;
|
|
5
|
+
claimed_position?: number;
|
|
6
|
+
claimed_participants?: number;
|
|
7
|
+
claimed_medal?: JacobContestMedal;
|
|
8
|
+
}
|
|
9
|
+
export interface JacobContest {
|
|
10
|
+
collected: number;
|
|
11
|
+
position?: number;
|
|
12
|
+
participants?: number;
|
|
13
|
+
medal?: JacobContestMedal;
|
|
14
|
+
}
|
|
15
|
+
export declare function FormatJacobContests(contests: RawJacobContest[]): JacobContest[];
|
|
16
|
+
export declare function CalculateJacobContestMedal(contest: RawJacobContest): JacobContestMedal | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculateJacobContestMedal = exports.FormatJacobContests = void 0;
|
|
4
|
+
function FormatJacobContests(contests) {
|
|
5
|
+
return contests.map((contest) => {
|
|
6
|
+
return {
|
|
7
|
+
collected: contest.collected,
|
|
8
|
+
position: contest.claimed_position,
|
|
9
|
+
participants: contest.claimed_participants,
|
|
10
|
+
medal: CalculateJacobContestMedal(contest),
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.FormatJacobContests = FormatJacobContests;
|
|
15
|
+
function CalculateJacobContestMedal(contest) {
|
|
16
|
+
if (contest.claimed_medal) {
|
|
17
|
+
return contest.claimed_medal;
|
|
18
|
+
}
|
|
19
|
+
const { claimed_position: position, claimed_participants: participants } = contest;
|
|
20
|
+
if (position === undefined || participants === undefined) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (position <= participants * 0.05 + 1)
|
|
24
|
+
return 'gold';
|
|
25
|
+
if (position <= participants * 0.25 + 1)
|
|
26
|
+
return 'silver';
|
|
27
|
+
if (position <= participants * 0.6 + 1)
|
|
28
|
+
return 'bronze';
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
exports.CalculateJacobContestMedal = CalculateJacobContestMedal;
|
|
32
|
+
//# sourceMappingURL=jacob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jacob.js","sourceRoot":"","sources":["../../src/util/jacob.ts"],"names":[],"mappings":";;;AAiBA,SAAgB,mBAAmB,CAAC,QAA2B;IAC9D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/B,OAAO;YACN,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,QAAQ,EAAE,OAAO,CAAC,gBAAgB;YAClC,YAAY,EAAE,OAAO,CAAC,oBAAoB;YAC1C,KAAK,EAAE,0BAA0B,CAAC,OAAO,CAAC;SAC1C,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AATD,kDASC;AAED,SAAgB,0BAA0B,CAAC,OAAwB;IAClE,IAAI,OAAO,CAAC,aAAa,EAAE;QAC1B,OAAO,OAAO,CAAC,aAAa,CAAC;KAC7B;IAED,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAEnF,IAAI,QAAQ,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE;QACzD,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,QAAQ,IAAI,YAAY,GAAG,IAAI,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IACvD,IAAI,QAAQ,IAAI,YAAY,GAAG,IAAI,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzD,IAAI,QAAQ,IAAI,YAAY,GAAG,GAAG,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IAExD,OAAO,SAAS,CAAC;AAClB,CAAC;AAhBD,gEAgBC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CropDisplayName = void 0;
|
|
4
|
+
const crops_1 = require("../constants/crops");
|
|
5
|
+
const CROP_DISPLAY_NAMES = {
|
|
6
|
+
[crops_1.Crop.Cactus]: 'Cactus',
|
|
7
|
+
[crops_1.Crop.Carrot]: 'Carrot',
|
|
8
|
+
[crops_1.Crop.CocoaBeans]: 'Cocoa Beans',
|
|
9
|
+
[crops_1.Crop.Melon]: 'Melon',
|
|
10
|
+
[crops_1.Crop.Mushroom]: 'Mushroom',
|
|
11
|
+
[crops_1.Crop.NetherWart]: 'Nether Wart',
|
|
12
|
+
[crops_1.Crop.Potato]: 'Potato',
|
|
13
|
+
[crops_1.Crop.Pumpkin]: 'Pumpkin',
|
|
14
|
+
[crops_1.Crop.SugarCane]: 'Sugar Cane',
|
|
15
|
+
[crops_1.Crop.Wheat]: 'Wheat',
|
|
16
|
+
[crops_1.Crop.Seeds]: 'Seeds',
|
|
17
|
+
};
|
|
18
|
+
function CropDisplayName(crop) {
|
|
19
|
+
return CROP_DISPLAY_NAMES[crop] ?? 'Unknown Crop';
|
|
20
|
+
}
|
|
21
|
+
exports.CropDisplayName = CropDisplayName;
|
|
22
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../src/util/names.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAE1C,MAAM,kBAAkB,GAAyB;IAChD,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,QAAQ;IACvB,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,QAAQ;IACvB,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,aAAa;IAChC,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,OAAO;IACrB,CAAC,YAAI,CAAC,QAAQ,CAAC,EAAE,UAAU;IAC3B,CAAC,YAAI,CAAC,UAAU,CAAC,EAAE,aAAa;IAChC,CAAC,YAAI,CAAC,MAAM,CAAC,EAAE,QAAQ;IACvB,CAAC,YAAI,CAAC,OAAO,CAAC,EAAE,SAAS;IACzB,CAAC,YAAI,CAAC,SAAS,CAAC,EAAE,YAAY;IAC9B,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,OAAO;IACrB,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,OAAO;CACrB,CAAC;AAEF,SAAgB,eAAe,CAAC,IAAU;IACzC,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC;AACnD,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Crop } from '../constants/crops';
|
|
2
|
+
export declare function CreateFarmingWeightCalculator(info?: FarmingWeightInfo): FarmingWeight;
|
|
3
|
+
interface FarmingWeightInfo {
|
|
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';
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
declare class FarmingWeight {
|
|
17
|
+
collection: Record<Crop, number>;
|
|
18
|
+
levelCapUpgrade: number;
|
|
19
|
+
farmingXp: number;
|
|
20
|
+
anitaBonusFarmingFortuneLevel: number;
|
|
21
|
+
tier12MinionCount: number;
|
|
22
|
+
earnedGoldMedals: number;
|
|
23
|
+
cropWeights: Record<Crop, number>;
|
|
24
|
+
bonusSources: Record<string, number>;
|
|
25
|
+
constructor(info?: FarmingWeightInfo);
|
|
26
|
+
/**
|
|
27
|
+
* Expectes a dictionary of collections and amounts with the default Hypixel SkyBlock IDs
|
|
28
|
+
* @param {Record<string, number>} collections
|
|
29
|
+
* @returns {FarmingWeight}
|
|
30
|
+
*/
|
|
31
|
+
setCropsFromCollections(collections: Record<string, number>): FarmingWeight;
|
|
32
|
+
setCrop: (crop: Crop, collection: number) => this;
|
|
33
|
+
setLevelCap: (levelCap: number) => this;
|
|
34
|
+
setFarmingXp: (farmingXp: number) => this;
|
|
35
|
+
setAnitaBonusLevel: (anitaBonusFarmingFortuneLevel: number) => this;
|
|
36
|
+
addMinions: (minions: string[]) => this;
|
|
37
|
+
setEarnedGoldMedals: (count: number) => this;
|
|
38
|
+
setTier12MinionCount: (count: number) => this;
|
|
39
|
+
setContests: (contests: FarmingWeightInfo['contests']) => this;
|
|
40
|
+
getWeightInfo: () => {
|
|
41
|
+
totalWeight: number;
|
|
42
|
+
bonusWeight: number;
|
|
43
|
+
cropWeight: number;
|
|
44
|
+
bonusSources: Record<string, number>;
|
|
45
|
+
};
|
|
46
|
+
getBonusWeights: () => Record<string, number>;
|
|
47
|
+
getCropWeights: () => Record<Crop, number>;
|
|
48
|
+
getCropWeight: (crop: Crop) => void;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateFarmingWeightCalculator = void 0;
|
|
4
|
+
const crops_1 = require("../constants/crops");
|
|
5
|
+
const weight_1 = require("../constants/weight");
|
|
6
|
+
function CreateFarmingWeightCalculator(info) {
|
|
7
|
+
return new FarmingWeight(info);
|
|
8
|
+
}
|
|
9
|
+
exports.CreateFarmingWeightCalculator = CreateFarmingWeightCalculator;
|
|
10
|
+
const crops = [
|
|
11
|
+
crops_1.Crop.Cactus,
|
|
12
|
+
crops_1.Crop.Carrot,
|
|
13
|
+
crops_1.Crop.CocoaBeans,
|
|
14
|
+
crops_1.Crop.Melon,
|
|
15
|
+
crops_1.Crop.Mushroom,
|
|
16
|
+
crops_1.Crop.NetherWart,
|
|
17
|
+
crops_1.Crop.Potato,
|
|
18
|
+
crops_1.Crop.Pumpkin,
|
|
19
|
+
crops_1.Crop.SugarCane,
|
|
20
|
+
crops_1.Crop.Wheat,
|
|
21
|
+
];
|
|
22
|
+
class FarmingWeight {
|
|
23
|
+
constructor(info) {
|
|
24
|
+
this.collection = {};
|
|
25
|
+
this.levelCapUpgrade = info?.levelCapUpgrade ?? 0;
|
|
26
|
+
this.anitaBonusFarmingFortuneLevel = info?.anitaBonusFarmingFortuneLevel ?? 0;
|
|
27
|
+
this.farmingXp = info?.farmingXp ?? 0;
|
|
28
|
+
this.earnedGoldMedals = 0;
|
|
29
|
+
this.tier12MinionCount = 0;
|
|
30
|
+
this.setCropsFromCollections(info?.collection ?? {});
|
|
31
|
+
this.addMinions(info?.minions ?? []);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Expectes a dictionary of collections and amounts with the default Hypixel SkyBlock IDs
|
|
35
|
+
* @param {Record<string, number>} collections
|
|
36
|
+
* @returns {FarmingWeight}
|
|
37
|
+
*/
|
|
38
|
+
setCropsFromCollections(collections) {
|
|
39
|
+
for (const crop of crops) {
|
|
40
|
+
this.collection[crop] = collections[crop] ?? 0;
|
|
41
|
+
}
|
|
42
|
+
this.getCropWeights();
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
setCrop = (crop, collection) => {
|
|
46
|
+
this.collection[crop] = collection;
|
|
47
|
+
this.getCropWeights();
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
setLevelCap = (levelCap) => {
|
|
51
|
+
this.levelCapUpgrade = levelCap;
|
|
52
|
+
return this;
|
|
53
|
+
};
|
|
54
|
+
setFarmingXp = (farmingXp) => {
|
|
55
|
+
this.farmingXp = farmingXp;
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
setAnitaBonusLevel = (anitaBonusFarmingFortuneLevel) => {
|
|
59
|
+
this.anitaBonusFarmingFortuneLevel = anitaBonusFarmingFortuneLevel;
|
|
60
|
+
return this;
|
|
61
|
+
};
|
|
62
|
+
addMinions = (minions) => {
|
|
63
|
+
for (const minion of minions) {
|
|
64
|
+
if (!minion.endsWith('_12'))
|
|
65
|
+
continue;
|
|
66
|
+
if (!weight_1.TIER_12_MINIONS.includes(minion))
|
|
67
|
+
continue;
|
|
68
|
+
this.tier12MinionCount++;
|
|
69
|
+
}
|
|
70
|
+
return this;
|
|
71
|
+
};
|
|
72
|
+
setEarnedGoldMedals = (count) => {
|
|
73
|
+
this.earnedGoldMedals = count;
|
|
74
|
+
return this;
|
|
75
|
+
};
|
|
76
|
+
setTier12MinionCount = (count) => {
|
|
77
|
+
this.tier12MinionCount = count;
|
|
78
|
+
return this;
|
|
79
|
+
};
|
|
80
|
+
setContests = (contests) => {
|
|
81
|
+
if (!contests?.length)
|
|
82
|
+
return this;
|
|
83
|
+
for (const contest of contests) {
|
|
84
|
+
if (contest.claimed_medal === 'gold') {
|
|
85
|
+
this.earnedGoldMedals++;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const position = contest.claimed_position;
|
|
89
|
+
const participants = contest.claimed_participants;
|
|
90
|
+
if (position === undefined || participants === undefined)
|
|
91
|
+
continue;
|
|
92
|
+
if (position <= participants * 0.05 + 1) {
|
|
93
|
+
this.earnedGoldMedals++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return this;
|
|
97
|
+
};
|
|
98
|
+
getWeightInfo = () => {
|
|
99
|
+
const bonus = this.getBonusWeights();
|
|
100
|
+
const crops = this.getCropWeights();
|
|
101
|
+
const bonusTotal = Object.values(bonus).reduce((a, b) => a + b, 0);
|
|
102
|
+
const cropTotal = Object.values(crops).reduce((a, b) => a + b, 0);
|
|
103
|
+
return {
|
|
104
|
+
totalWeight: bonusTotal + cropTotal,
|
|
105
|
+
bonusWeight: bonusTotal,
|
|
106
|
+
cropWeight: cropTotal,
|
|
107
|
+
bonusSources: bonus,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
getBonusWeights = () => {
|
|
111
|
+
if (this.farmingXp >= 111_672_425 && this.levelCapUpgrade >= 10) {
|
|
112
|
+
// Farming 60 bonus
|
|
113
|
+
this.bonusSources['Farming 60'] = weight_1.BONUS_WEIGHT.Farming60Bonus;
|
|
114
|
+
}
|
|
115
|
+
else if (this.farmingXp >= 55_172_425) {
|
|
116
|
+
// Farming 50 bonus
|
|
117
|
+
this.bonusSources['Farming 50'] = weight_1.BONUS_WEIGHT.Farming50Bonus;
|
|
118
|
+
}
|
|
119
|
+
// Tier 12 minion bonus
|
|
120
|
+
if (this.tier12MinionCount > 0) {
|
|
121
|
+
this.bonusSources['Tier 12 Minions'] = this.tier12MinionCount * weight_1.BONUS_WEIGHT.MinionRewardWeight;
|
|
122
|
+
}
|
|
123
|
+
// Anita bonus
|
|
124
|
+
if (this.anitaBonusFarmingFortuneLevel > 0) {
|
|
125
|
+
this.bonusSources['Anita Bonus'] =
|
|
126
|
+
this.anitaBonusFarmingFortuneLevel * weight_1.BONUS_WEIGHT.AnitaBuffBonusMultiplier;
|
|
127
|
+
}
|
|
128
|
+
if (this.earnedGoldMedals > weight_1.BONUS_WEIGHT.MaxMedalsCounted) {
|
|
129
|
+
this.bonusSources['Gold Medals'] = Math.floor(weight_1.BONUS_WEIGHT.WeightPerGoldMedal * weight_1.BONUS_WEIGHT.MaxMedalsCounted);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
const rewardCount = Math.floor((this.earnedGoldMedals / 50) * 50);
|
|
133
|
+
if (rewardCount > 0) {
|
|
134
|
+
this.bonusSources['Gold Medals'] = Math.floor(weight_1.BONUS_WEIGHT.WeightPerGoldMedal * rewardCount);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return this.bonusSources;
|
|
138
|
+
};
|
|
139
|
+
getCropWeights = () => {
|
|
140
|
+
const cropWeight = {};
|
|
141
|
+
let totalWeight = 0;
|
|
142
|
+
let doubleBreakWeight = 0;
|
|
143
|
+
for (const crop of crops) {
|
|
144
|
+
const collected = this.collection[crop] ?? 0;
|
|
145
|
+
const weight = collected / weight_1.CROP_WEIGHT[crop];
|
|
146
|
+
totalWeight += weight;
|
|
147
|
+
if (crop === crops_1.Crop.Cactus || crop === crops_1.Crop.SugarCane) {
|
|
148
|
+
doubleBreakWeight += weight;
|
|
149
|
+
}
|
|
150
|
+
cropWeight[crop] = weight;
|
|
151
|
+
}
|
|
152
|
+
// Mushroom is a special case, it needs to be calculated dynamically based on the
|
|
153
|
+
// ratio between the farmed crops that give two mushrooms per break with cow pet
|
|
154
|
+
// and the farmed crops that give one mushroom per break with cow pet
|
|
155
|
+
const mushroomCollection = this.collection[crops_1.Crop.Mushroom] ?? 0;
|
|
156
|
+
const mushroomWeightNumber = weight_1.CROP_WEIGHT[crops_1.Crop.Mushroom];
|
|
157
|
+
const doubleBreakRatio = doubleBreakWeight / totalWeight;
|
|
158
|
+
const normalCropRatio = (totalWeight - doubleBreakWeight) / totalWeight;
|
|
159
|
+
const mushroomWeight = doubleBreakRatio * (mushroomCollection / (mushroomWeightNumber * 2)) +
|
|
160
|
+
normalCropRatio * (mushroomCollection / mushroomWeightNumber);
|
|
161
|
+
cropWeight[crops_1.Crop.Mushroom] = mushroomWeight;
|
|
162
|
+
return cropWeight;
|
|
163
|
+
};
|
|
164
|
+
getCropWeight = (crop) => {
|
|
165
|
+
weight_1.CROP_WEIGHT[crop];
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=weightcalc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weightcalc.js","sourceRoot":"","sources":["../../src/weight/weightcalc.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAC1C,gDAAiF;AAEjF,SAAgB,6BAA6B,CAAC,IAAwB;IACrE,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAFD,sEAEC;AAED,MAAM,KAAK,GAAG;IACb,YAAI,CAAC,MAAM;IACX,YAAI,CAAC,MAAM;IACX,YAAI,CAAC,UAAU;IACf,YAAI,CAAC,KAAK;IACV,YAAI,CAAC,QAAQ;IACb,YAAI,CAAC,UAAU;IACf,YAAI,CAAC,MAAM;IACX,YAAI,CAAC,OAAO;IACZ,YAAI,CAAC,SAAS;IACd,YAAI,CAAC,KAAK;CACV,CAAC;AAgBF,MAAM,aAAa;IAUlB,YAAY,IAAwB;QACnC,IAAI,CAAC,UAAU,GAAG,EAA0B,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG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Q,CAAC,IAAI,CAAC,CAAC;QAC/D,MAAM,oBAAoB,GAAG,oBAAW,CAAC,YAAI,CAAC,QAAQ,CAAC,CAAC;QAExD,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,WAAW,CAAC;QACzD,MAAM,eAAe,GAAG,CAAC,WAAW,GAAG,iBAAiB,CAAC,GAAG,WAAW,CAAC;QAExE,MAAM,cAAc,GACnB,gBAAgB,GAAG,CAAC,kBAAkB,GAAG,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC;YACpE,eAAe,GAAG,CAAC,kBAAkB,GAAG,oBAAoB,CAAC,CAAC;QAE/D,UAAU,CAAC,YAAI,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC;QAE3C,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;IAEF,aAAa,GAAG,CAAC,IAAU,EAAE,EAAE;QAC9B,oBAAW,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "farming-weight",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Tools for calculating farming weight and fortune in Hypixel Skyblock",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "git+https://github.com/EliteFarmers/Tools.git"
|
|
24
24
|
},
|
|
25
|
-
"files": [ "
|
|
25
|
+
"files": [ "dist/**/*" ],
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/EliteFarmers/Tools/issues"
|
|
28
28
|
},
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_CROP_FORTUNE = exports.Crop = exports.GetCropInfo = exports.CalculateAverageDrops = exports.CalculateExpectedDrops = void 0;
|
|
4
|
-
const ratecalc_1 = require("./ratecalc");
|
|
5
|
-
Object.defineProperty(exports, "CalculateExpectedDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateExpectedDrops; } });
|
|
6
|
-
Object.defineProperty(exports, "CalculateAverageDrops", { enumerable: true, get: function () { return ratecalc_1.CalculateAverageDrops; } });
|
|
7
|
-
Object.defineProperty(exports, "GetCropInfo", { enumerable: true, get: function () { return ratecalc_1.GetCropInfo; } });
|
|
8
|
-
const crops_1 = require("./constants/crops");
|
|
9
|
-
Object.defineProperty(exports, "Crop", { enumerable: true, get: function () { return crops_1.Crop; } });
|
|
10
|
-
Object.defineProperty(exports, "MAX_CROP_FORTUNE", { enumerable: true, get: function () { return crops_1.MAX_CROP_FORTUNE; } });
|
package/lib/ratecalc.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Crop, CropInfo } from './constants/crops';
|
|
2
|
-
interface CalculateDropsOptions {
|
|
3
|
-
farmingFortune?: number;
|
|
4
|
-
blocksBroken: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function CalculateAverageDrops(options: CalculateDropsOptions): Record<Crop, number>;
|
|
7
|
-
interface CalculateExpectedDropsOptions extends CalculateDropsOptions {
|
|
8
|
-
blocksBroken: number;
|
|
9
|
-
crop: Crop;
|
|
10
|
-
}
|
|
11
|
-
export declare function CalculateExpectedDrops(options: CalculateExpectedDropsOptions): number;
|
|
12
|
-
export declare function GetCropInfo(crop: Crop): CropInfo;
|
|
13
|
-
export {};
|
package/lib/ratecalc.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetCropInfo = exports.CalculateExpectedDrops = exports.CalculateAverageDrops = void 0;
|
|
4
|
-
const crops_1 = require("./constants/crops");
|
|
5
|
-
const melon_1 = require("./crops/melon");
|
|
6
|
-
const pumpkin_1 = require("./crops/pumpkin");
|
|
7
|
-
function CalculateAverageDrops(options) {
|
|
8
|
-
const { farmingFortune, blocksBroken } = options;
|
|
9
|
-
const result = {
|
|
10
|
-
[crops_1.Crop.Cactus]: 0,
|
|
11
|
-
[crops_1.Crop.Carrot]: 0,
|
|
12
|
-
[crops_1.Crop.CocoaBeans]: 0,
|
|
13
|
-
[crops_1.Crop.Melon]: 0,
|
|
14
|
-
[crops_1.Crop.Mushroom]: 0,
|
|
15
|
-
[crops_1.Crop.NetherWart]: 0,
|
|
16
|
-
[crops_1.Crop.Potato]: 0,
|
|
17
|
-
[crops_1.Crop.Pumpkin]: 0,
|
|
18
|
-
[crops_1.Crop.SugarCane]: 0,
|
|
19
|
-
[crops_1.Crop.Wheat]: 0,
|
|
20
|
-
[crops_1.Crop.Seeds]: 0,
|
|
21
|
-
};
|
|
22
|
-
for (const crop of Object.keys(result)) {
|
|
23
|
-
result[crop] = CalculateExpectedDrops({
|
|
24
|
-
farmingFortune,
|
|
25
|
-
crop: crop,
|
|
26
|
-
blocksBroken,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
exports.CalculateAverageDrops = CalculateAverageDrops;
|
|
32
|
-
function CalculateExpectedDrops(options) {
|
|
33
|
-
const { farmingFortune, blocksBroken, crop } = options;
|
|
34
|
-
const fortune = farmingFortune ?? crops_1.MAX_CROP_FORTUNE[crop] ?? 0;
|
|
35
|
-
if (fortune <= 0 || blocksBroken < 0)
|
|
36
|
-
return 0;
|
|
37
|
-
const { drops } = GetCropInfo(crop);
|
|
38
|
-
if (!drops)
|
|
39
|
-
return 0;
|
|
40
|
-
const normal = blocksBroken * drops * (fortune * 0.1);
|
|
41
|
-
switch (crop) {
|
|
42
|
-
case crops_1.Crop.Cactus:
|
|
43
|
-
case crops_1.Crop.Carrot:
|
|
44
|
-
case crops_1.Crop.CocoaBeans:
|
|
45
|
-
case crops_1.Crop.Mushroom:
|
|
46
|
-
case crops_1.Crop.NetherWart:
|
|
47
|
-
case crops_1.Crop.Potato:
|
|
48
|
-
case crops_1.Crop.SugarCane:
|
|
49
|
-
case crops_1.Crop.Wheat:
|
|
50
|
-
case crops_1.Crop.Seeds:
|
|
51
|
-
return normal;
|
|
52
|
-
case crops_1.Crop.Pumpkin:
|
|
53
|
-
return normal + (0, pumpkin_1.PumpkinPerkBonus)(blocksBroken);
|
|
54
|
-
case crops_1.Crop.Melon:
|
|
55
|
-
return normal + (0, melon_1.MelonPerkBonus)(blocksBroken);
|
|
56
|
-
default:
|
|
57
|
-
return 0;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.CalculateExpectedDrops = CalculateExpectedDrops;
|
|
61
|
-
function GetCropInfo(crop) {
|
|
62
|
-
return crops_1.CROP_INFO[crop] ?? {};
|
|
63
|
-
}
|
|
64
|
-
exports.GetCropInfo = GetCropInfo;
|
package/lib/tool.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|