libram 0.6.7 → 0.6.8
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/Clan.js +1 -1
- package/dist/challengePaths/2015/CommunityService.d.ts +32 -33
- package/dist/challengePaths/2015/CommunityService.js +109 -107
- package/dist/challengePaths/index.d.ts +1 -1
- package/dist/challengePaths/index.js +1 -1
- package/dist/diet/index.js +1 -1
- package/dist/mood.d.ts +1 -1
- package/dist/mood.js +5 -3
- package/dist/resources/2020/RetroCape.d.ts +48 -0
- package/dist/resources/2020/RetroCape.js +111 -0
- package/dist/resources/2022/CombatLoversLocket.js +1 -1
- package/dist/resources/index.d.ts +2 -1
- package/dist/resources/index.js +2 -1
- package/package.json +1 -1
package/dist/Clan.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { Requirement } from "../../maximize";
|
|
2
|
-
|
|
3
|
-
* A log of the predicted turns, actual turns, and duration of each CS test performed.
|
|
4
|
-
*/
|
|
5
|
-
export declare const log: {
|
|
6
|
-
[index: string]: {
|
|
7
|
-
predictedTurns: number;
|
|
8
|
-
turnCost: number;
|
|
9
|
-
seconds: number;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
declare class Test {
|
|
2
|
+
export default class CommunityService {
|
|
13
3
|
private choice;
|
|
14
4
|
private property;
|
|
15
5
|
private predictor;
|
|
@@ -21,7 +11,7 @@ declare class Test {
|
|
|
21
11
|
* @param predictor A function that returns an estimate for the number of turns that the test will take given your character's current state.
|
|
22
12
|
* @param maximizeRequirements A Requirement object, if applicable, that aligns with the things needed to maximize for this particular test.
|
|
23
13
|
*/
|
|
24
|
-
constructor(
|
|
14
|
+
private constructor();
|
|
25
15
|
/**
|
|
26
16
|
* @returns The id number of the test, used primarily in runChoice.
|
|
27
17
|
*/
|
|
@@ -54,33 +44,42 @@ declare class Test {
|
|
|
54
44
|
do(): boolean;
|
|
55
45
|
/**
|
|
56
46
|
* Wrapper function that prepares for a test and then completes it, adding time and turn details to the log.
|
|
57
|
-
* @param prepare A function that does all necessary preparations for this CS test, including choosing your outfit.
|
|
47
|
+
* @param prepare A function that does all necessary preparations for this CS test, including choosing your outfit. Optionally returns the number of turns you expect to spend preparing for the test.
|
|
58
48
|
* @param beCertain Whether we should check council.php instead of mafia to determine whether the test is complete.
|
|
59
49
|
* @param maxTurns We will run the test iff the predicted turns is less than or equal to this parameter.
|
|
60
|
-
* @returns
|
|
50
|
+
* @returns "completed", "failed", or "already completed".
|
|
61
51
|
*/
|
|
62
|
-
run(prepare: () => void, beCertain?: boolean, maxTurns?: number):
|
|
52
|
+
run(prepare: () => void | number, beCertain?: boolean, maxTurns?: number): "completed" | "failed" | "already completed";
|
|
63
53
|
/**
|
|
64
54
|
* Checks council.php to verify that a test is complete; more reliable than isDone, but requires an additional pagehit.
|
|
65
55
|
* @returns Whether council.php suggests that the test is complete.
|
|
66
56
|
*/
|
|
67
57
|
verifyIsDone(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* A log of the predicted turns, actual turns, and duration of each CS test performed.
|
|
60
|
+
*/
|
|
61
|
+
static log: {
|
|
62
|
+
[index: string]: {
|
|
63
|
+
predictedTurns: number;
|
|
64
|
+
turnCost: number;
|
|
65
|
+
seconds: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Prints turncount and time details of the test in question.
|
|
70
|
+
* @param colour The colour (or color) you'd like the log to be printed in.
|
|
71
|
+
*/
|
|
72
|
+
static printLog(colour?: string): void;
|
|
73
|
+
static HP: CommunityService;
|
|
74
|
+
static Muscle: CommunityService;
|
|
75
|
+
static Mysticality: CommunityService;
|
|
76
|
+
static Moxie: CommunityService;
|
|
77
|
+
static FamiliarWeight: CommunityService;
|
|
78
|
+
static WeaponDamage: CommunityService;
|
|
79
|
+
static SpellDamage: CommunityService;
|
|
80
|
+
static Noncombat: CommunityService;
|
|
81
|
+
static BoozeDrop: CommunityService;
|
|
82
|
+
static HotRes: CommunityService;
|
|
83
|
+
static CoilWire: CommunityService;
|
|
84
|
+
static donate: () => void;
|
|
68
85
|
}
|
|
69
|
-
export declare const HP: Test;
|
|
70
|
-
export declare const Muscle: Test;
|
|
71
|
-
export declare const Mysticality: Test;
|
|
72
|
-
export declare const Moxie: Test;
|
|
73
|
-
export declare const FamiliarWeight: Test;
|
|
74
|
-
export declare const WeaponDamage: Test;
|
|
75
|
-
export declare const SpellDamage: Test;
|
|
76
|
-
export declare const Noncombat: Test;
|
|
77
|
-
export declare const BoozeDrop: Test;
|
|
78
|
-
export declare const HotRes: Test;
|
|
79
|
-
export declare const CoilWire: Test;
|
|
80
|
-
/**
|
|
81
|
-
* Prints turncount and time details of the test in question.
|
|
82
|
-
* @param colour The colour (or color) you'd like the log to be printed in.
|
|
83
|
-
*/
|
|
84
|
-
export declare function printLog(colour?: string): void;
|
|
85
|
-
export declare const donate: () => void;
|
|
86
|
-
export {};
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { equippedItem, familiarWeight, getPower, haveEquipped, myBasestat, myBuffedstat, myFamiliar,
|
|
1
|
+
import { equippedItem, familiarWeight, getPower, haveEquipped, myBasestat, myBuffedstat, myFamiliar, myMaxhp, myThrall, myTurncount, numericModifier, print, runChoice, toSlot, visitUrl, weightAdjustment, } from "kolmafia";
|
|
2
2
|
import { have } from "../../lib";
|
|
3
3
|
import { Requirement } from "../../maximize";
|
|
4
4
|
import { get as getModifier } from "../../modifier";
|
|
5
5
|
import { get } from "../../property";
|
|
6
|
-
import { MummingTrunk
|
|
6
|
+
import { MummingTrunk } from "../../resources";
|
|
7
7
|
import { $effect, $familiar, $item, $items, $slot, $stat, $thrall, } from "../../template-string";
|
|
8
8
|
import { sum } from "../../utils";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const thralls = new Map([
|
|
10
|
+
[$stat `muscle`, $thrall `Elbow Macaroni`],
|
|
11
|
+
[$stat `moxie`, $thrall `Penne Dreadful`],
|
|
12
|
+
]);
|
|
13
|
+
const statCommunityServicePredictor = (stat) => {
|
|
14
|
+
return () => 60 -
|
|
15
|
+
Math.floor((1 / 30) *
|
|
16
|
+
(myBuffedstat(stat) -
|
|
17
|
+
myBasestat(thralls.get(stat) === myThrall() ? $stat `mysticality` : stat)));
|
|
18
|
+
};
|
|
19
|
+
export default class CommunityService {
|
|
14
20
|
choice;
|
|
15
21
|
property;
|
|
16
22
|
predictor;
|
|
@@ -22,7 +28,7 @@ class Test {
|
|
|
22
28
|
* @param predictor A function that returns an estimate for the number of turns that the test will take given your character's current state.
|
|
23
29
|
* @param maximizeRequirements A Requirement object, if applicable, that aligns with the things needed to maximize for this particular test.
|
|
24
30
|
*/
|
|
25
|
-
constructor(id, property, predictor, maximizeRequirements
|
|
31
|
+
constructor(id, property, predictor, maximizeRequirements) {
|
|
26
32
|
this.choice = id;
|
|
27
33
|
this.property = property;
|
|
28
34
|
this.predictor = predictor;
|
|
@@ -71,42 +77,45 @@ class Test {
|
|
|
71
77
|
* @returns Whether mafia believes the test is complete at the end of this function.
|
|
72
78
|
*/
|
|
73
79
|
do() {
|
|
80
|
+
if (get("csServicesPerformed").trim().length === 0)
|
|
81
|
+
visitUrl("council.php");
|
|
74
82
|
visitUrl("council.php");
|
|
75
83
|
runChoice(this.choice);
|
|
76
84
|
return this.isDone();
|
|
77
85
|
}
|
|
78
86
|
/**
|
|
79
87
|
* Wrapper function that prepares for a test and then completes it, adding time and turn details to the log.
|
|
80
|
-
* @param prepare A function that does all necessary preparations for this CS test, including choosing your outfit.
|
|
88
|
+
* @param prepare A function that does all necessary preparations for this CS test, including choosing your outfit. Optionally returns the number of turns you expect to spend preparing for the test.
|
|
81
89
|
* @param beCertain Whether we should check council.php instead of mafia to determine whether the test is complete.
|
|
82
90
|
* @param maxTurns We will run the test iff the predicted turns is less than or equal to this parameter.
|
|
83
|
-
* @returns
|
|
91
|
+
* @returns "completed", "failed", or "already completed".
|
|
84
92
|
*/
|
|
85
93
|
run(prepare, beCertain = false, maxTurns = Infinity) {
|
|
86
94
|
const finishedFunction = () => beCertain ? this.verifyIsDone() : this.isDone();
|
|
87
95
|
if (finishedFunction())
|
|
88
|
-
return
|
|
96
|
+
return "already completed";
|
|
89
97
|
const startTime = Date.now();
|
|
90
98
|
const startTurns = myTurncount();
|
|
99
|
+
let additionalTurns;
|
|
91
100
|
try {
|
|
92
|
-
prepare();
|
|
101
|
+
additionalTurns = prepare() ?? 0;
|
|
93
102
|
}
|
|
94
103
|
catch {
|
|
95
|
-
return
|
|
104
|
+
return "failed";
|
|
96
105
|
}
|
|
97
106
|
const prediction = this.predictor();
|
|
98
107
|
if (prediction <= maxTurns) {
|
|
99
108
|
this.do();
|
|
100
109
|
}
|
|
101
110
|
if (finishedFunction()) {
|
|
102
|
-
log[this.property] = {
|
|
103
|
-
predictedTurns: prediction,
|
|
111
|
+
CommunityService.log[this.property] = {
|
|
112
|
+
predictedTurns: prediction + additionalTurns,
|
|
104
113
|
turnCost: myTurncount() - startTurns,
|
|
105
114
|
seconds: (Date.now() - startTime) / 1000,
|
|
106
115
|
};
|
|
107
|
-
return
|
|
116
|
+
return "completed";
|
|
108
117
|
}
|
|
109
|
-
return
|
|
118
|
+
return "failed";
|
|
110
119
|
}
|
|
111
120
|
/**
|
|
112
121
|
* Checks council.php to verify that a test is complete; more reliable than isDone, but requires an additional pagehit.
|
|
@@ -115,95 +124,88 @@ class Test {
|
|
|
115
124
|
verifyIsDone() {
|
|
116
125
|
return !visitUrl("council.php").includes(`<input type=hidden name=option value=${this.choice}>`);
|
|
117
126
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export const WeaponDamage = new Test(6, "Reduce Gazelle Population", () => {
|
|
135
|
-
const weaponPower = getPower(equippedItem($slot `weapon`));
|
|
136
|
-
const offhandPower = toSlot(equippedItem($slot `off-hand`)) === $slot `weapon`
|
|
137
|
-
? getPower(equippedItem($slot `off-hand`))
|
|
138
|
-
: 0;
|
|
139
|
-
const familiarPower = toSlot(equippedItem($slot `familiar`)) === $slot `weapon`
|
|
140
|
-
? getPower(equippedItem($slot `familiar`))
|
|
141
|
-
: 0;
|
|
142
|
-
const songDamage = SongBoom.song() === "These Fists Were Made for Punchin'" ? myLevel() : 0;
|
|
143
|
-
// mafia does not currently count swagger
|
|
144
|
-
const multiplier = have($effect `Bow-Legged Swagger`) ? 2 : 1;
|
|
145
|
-
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
146
|
-
return (60 -
|
|
147
|
-
Math.floor((multiplier *
|
|
148
|
-
(getModifier("Weapon Damage") -
|
|
149
|
-
0.15 * (weaponPower + offhandPower + familiarPower) -
|
|
150
|
-
songDamage)) /
|
|
151
|
-
50 +
|
|
152
|
-
0.001) -
|
|
153
|
-
Math.floor((multiplier * getModifier("Weapon Damage Percent")) / 50 + 0.001));
|
|
154
|
-
}, new Requirement(["Weapon Damage", "Weapon Damage Percent"], {}));
|
|
155
|
-
export const SpellDamage = new Test(7, "Make Sausage", () => {
|
|
156
|
-
const dragonfishDamage = myFamiliar() === $familiar `Magic Dragonfish`
|
|
157
|
-
? numericModifier($familiar `Magic Dragonfish`, "Spell Damage Percent", familiarWeight($familiar `Magic Dragonfish`) + weightAdjustment(), $item `none`)
|
|
158
|
-
: 0;
|
|
159
|
-
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
160
|
-
return (60 -
|
|
161
|
-
Math.floor(getModifier("Spell Damage") / 50 + 0.001) -
|
|
162
|
-
Math.floor((getModifier("Spell Damage Percent") - dragonfishDamage) / 50 + 0.001));
|
|
163
|
-
}, new Requirement(["Spell Damage", "Spell Damage Percent"], {}));
|
|
164
|
-
export const Noncombat = new Test(8, "Be a Living Statue", () => {
|
|
165
|
-
const noncombatRate = -1 * getModifier("Combat Rate");
|
|
166
|
-
const unsoftcappedRate = noncombatRate > 25 ? 25 + (noncombatRate - 25) * 5 : noncombatRate;
|
|
167
|
-
return 60 - 3 * Math.floor(unsoftcappedRate / 5);
|
|
168
|
-
}, new Requirement(["-combat"], {}));
|
|
169
|
-
export const BoozeDrop = new Test(9, "Make Margaritas", () => {
|
|
170
|
-
const mummingCostume = MummingTrunk.currentCostumes().get(myFamiliar());
|
|
171
|
-
const mummingBuff = mummingCostume && mummingCostume[0] === "Item Drop"
|
|
172
|
-
? mummingCostume[1]
|
|
173
|
-
: 0;
|
|
174
|
-
const familiarItemDrop = numericModifier(myFamiliar(), "Item Drop", familiarWeight(myFamiliar()) + weightAdjustment(), equippedItem($slot `familiar`)) +
|
|
175
|
-
mummingBuff -
|
|
176
|
-
numericModifier(equippedItem($slot `familiar`), "Item Drop");
|
|
177
|
-
const familiarBoozeDrop = numericModifier(myFamiliar(), "Booze Drop", familiarWeight(myFamiliar()) + weightAdjustment(), equippedItem($slot `familiar`)) - numericModifier(equippedItem($slot `familiar`), "Booze Drop");
|
|
178
|
-
//Champagne doubling does NOT count for CS, so we undouble
|
|
179
|
-
const multiplier = haveEquipped($item `broken champagne bottle`) &&
|
|
180
|
-
get("garbageChampagneCharge") > 0
|
|
181
|
-
? 0.5
|
|
182
|
-
: 1;
|
|
183
|
-
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
184
|
-
return (60 -
|
|
185
|
-
multiplier *
|
|
186
|
-
Math.floor((getModifier("Item Drop") - familiarItemDrop) / 30 + 0.001) -
|
|
187
|
-
Math.floor((getModifier("Booze Drop") - familiarBoozeDrop) / 15 + 0.001));
|
|
188
|
-
}, new Requirement(["Item Drop", "2 Booze Drop"], {
|
|
189
|
-
preventEquip: $items `broken champagne bottle`,
|
|
190
|
-
}));
|
|
191
|
-
export const HotRes = new Test(10, "Clean Steam Tunnels", () => 60 - getModifier("Hot Resistance"), new Requirement(["Hot Resistance"], {}));
|
|
192
|
-
export const CoilWire = new Test(11, "Coil Wire", () => 60, null);
|
|
193
|
-
/**
|
|
194
|
-
* Prints turncount and time details of the test in question.
|
|
195
|
-
* @param colour The colour (or color) you'd like the log to be printed in.
|
|
196
|
-
*/
|
|
197
|
-
export function printLog(colour = "blue") {
|
|
198
|
-
const logEntries = Object.entries(log);
|
|
199
|
-
for (const [testName, testEntry] of logEntries) {
|
|
200
|
-
const { predictedTurns, turnCost, seconds } = testEntry;
|
|
201
|
-
print(`We predicted the ${testName} test would take ${predictedTurns} turns, ${predictedTurns === turnCost ? "and" : "but"} it took ${turnCost} turns`, colour);
|
|
202
|
-
print(`${testName} took ${seconds} seconds`, colour);
|
|
127
|
+
/**
|
|
128
|
+
* A log of the predicted turns, actual turns, and duration of each CS test performed.
|
|
129
|
+
*/
|
|
130
|
+
static log = {};
|
|
131
|
+
/**
|
|
132
|
+
* Prints turncount and time details of the test in question.
|
|
133
|
+
* @param colour The colour (or color) you'd like the log to be printed in.
|
|
134
|
+
*/
|
|
135
|
+
static printLog(colour = "blue") {
|
|
136
|
+
const logEntries = Object.entries(CommunityService.log);
|
|
137
|
+
for (const [testName, testEntry] of logEntries) {
|
|
138
|
+
const { predictedTurns, turnCost, seconds } = testEntry;
|
|
139
|
+
print(`We predicted the ${testName} test would take ${predictedTurns} turns, ${predictedTurns === turnCost ? "and" : "but"} it took ${turnCost} turns`, colour);
|
|
140
|
+
print(`${testName} took ${seconds} seconds`, colour);
|
|
141
|
+
}
|
|
142
|
+
print(`All together, you have spent ${sum(logEntries, ([, testEntry]) => testEntry.seconds)} seconds during this Community Service run`, colour);
|
|
203
143
|
}
|
|
204
|
-
|
|
144
|
+
// Below, we have the tests themselves.
|
|
145
|
+
static HP = new CommunityService(1, "Donate Blood", () => 60 - Math.floor((myMaxhp() - myBuffedstat($stat `muscle`) - 3) / 30), new Requirement(["HP"], {}));
|
|
146
|
+
static Muscle = new CommunityService(2, "Feed The Children", statCommunityServicePredictor($stat `Muscle`), new Requirement(["Muscle"], {}));
|
|
147
|
+
static Mysticality = new CommunityService(3, "Build Playground Mazes", statCommunityServicePredictor($stat `Mysticality`), new Requirement(["Mysticality"], {}));
|
|
148
|
+
static Moxie = new CommunityService(4, "Feed Conspirators", statCommunityServicePredictor($stat `Moxie`), new Requirement(["Moxie"], {}));
|
|
149
|
+
static FamiliarWeight = new CommunityService(5, "Breed More Collies", () => 60 - Math.floor((familiarWeight(myFamiliar()) + weightAdjustment()) / 5), new Requirement(["Familiar Weight"], {}));
|
|
150
|
+
static WeaponDamage = new CommunityService(6, "Reduce Gazelle Population", () => {
|
|
151
|
+
const weaponPower = getPower(equippedItem($slot `weapon`));
|
|
152
|
+
const offhandPower = toSlot(equippedItem($slot `off-hand`)) === $slot `weapon`
|
|
153
|
+
? getPower(equippedItem($slot `off-hand`))
|
|
154
|
+
: 0;
|
|
155
|
+
const familiarPower = toSlot(equippedItem($slot `familiar`)) === $slot `weapon`
|
|
156
|
+
? getPower(equippedItem($slot `familiar`))
|
|
157
|
+
: 0;
|
|
158
|
+
// mafia does not currently count swagger
|
|
159
|
+
const multiplier = have($effect `Bow-Legged Swagger`) ? 2 : 1;
|
|
160
|
+
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
161
|
+
return (60 -
|
|
162
|
+
Math.floor((multiplier *
|
|
163
|
+
(getModifier("Weapon Damage") -
|
|
164
|
+
0.15 * (weaponPower + offhandPower + familiarPower))) /
|
|
165
|
+
50 +
|
|
166
|
+
0.001) -
|
|
167
|
+
Math.floor((multiplier * getModifier("Weapon Damage Percent")) / 50 + 0.001));
|
|
168
|
+
}, new Requirement(["Weapon Damage", "Weapon Damage Percent"], {}));
|
|
169
|
+
static SpellDamage = new CommunityService(7, "Make Sausage", () => {
|
|
170
|
+
const dragonfishDamage = myFamiliar() === $familiar `Magic Dragonfish`
|
|
171
|
+
? numericModifier($familiar `Magic Dragonfish`, "Spell Damage Percent", familiarWeight($familiar `Magic Dragonfish`) + weightAdjustment(), $item `none`)
|
|
172
|
+
: 0;
|
|
173
|
+
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
174
|
+
return (60 -
|
|
175
|
+
Math.floor(getModifier("Spell Damage") / 50 + 0.001) -
|
|
176
|
+
Math.floor((getModifier("Spell Damage Percent") - dragonfishDamage) / 50 + 0.001));
|
|
177
|
+
}, new Requirement(["Spell Damage", "Spell Damage Percent"], {}));
|
|
178
|
+
static Noncombat = new CommunityService(8, "Be a Living Statue", () => {
|
|
179
|
+
const noncombatRate = -1 * getModifier("Combat Rate");
|
|
180
|
+
const unsoftcappedRate = noncombatRate > 25 ? 25 + (noncombatRate - 25) * 5 : noncombatRate;
|
|
181
|
+
return 60 - 3 * Math.floor(unsoftcappedRate / 5);
|
|
182
|
+
}, new Requirement(["-combat"], {}));
|
|
183
|
+
static BoozeDrop = new CommunityService(9, "Make Margaritas", () => {
|
|
184
|
+
const mummingCostume = MummingTrunk.currentCostumes().get(myFamiliar());
|
|
185
|
+
const mummingBuff = mummingCostume && mummingCostume[0] === "Item Drop"
|
|
186
|
+
? mummingCostume[1]
|
|
187
|
+
: 0;
|
|
188
|
+
const familiarItemDrop = numericModifier(myFamiliar(), "Item Drop", familiarWeight(myFamiliar()) + weightAdjustment(), equippedItem($slot `familiar`)) +
|
|
189
|
+
mummingBuff -
|
|
190
|
+
numericModifier(equippedItem($slot `familiar`), "Item Drop");
|
|
191
|
+
const familiarBoozeDrop = numericModifier(myFamiliar(), "Booze Drop", familiarWeight(myFamiliar()) + weightAdjustment(), equippedItem($slot `familiar`)) - numericModifier(equippedItem($slot `familiar`), "Booze Drop");
|
|
192
|
+
// Champagne doubling does NOT count for CS, so we undouble
|
|
193
|
+
const multiplier = haveEquipped($item `broken champagne bottle`) &&
|
|
194
|
+
get("garbageChampagneCharge") > 0
|
|
195
|
+
? 0.5
|
|
196
|
+
: 1;
|
|
197
|
+
// We add 0.001 because the floor function sometimes introduces weird rounding errors
|
|
198
|
+
return (60 -
|
|
199
|
+
Math.floor((multiplier * (getModifier("Item Drop") - familiarItemDrop)) / 30 +
|
|
200
|
+
0.001) -
|
|
201
|
+
Math.floor((getModifier("Booze Drop") - familiarBoozeDrop) / 15 + 0.001));
|
|
202
|
+
}, new Requirement(["Item Drop", "2 Booze Drop"], {
|
|
203
|
+
preventEquip: $items `broken champagne bottle`,
|
|
204
|
+
}));
|
|
205
|
+
static HotRes = new CommunityService(10, "Clean Steam Tunnels", () => 60 - getModifier("Hot Resistance"), new Requirement(["Hot Resistance"], {}));
|
|
206
|
+
static CoilWire = new CommunityService(11, "Coil Wire", () => 60, new Requirement([], {}));
|
|
207
|
+
static donate = () => {
|
|
208
|
+
visitUrl("council.php");
|
|
209
|
+
visitUrl("choice.php?whichchoice=1089&option=30");
|
|
210
|
+
};
|
|
205
211
|
}
|
|
206
|
-
export const donate = () => {
|
|
207
|
-
visitUrl("council.php");
|
|
208
|
-
visitUrl("choice.php?whichchoice=1089&option=30");
|
|
209
|
-
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import CommunityService from "./2015/CommunityService";
|
|
2
2
|
export { CommunityService };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import CommunityService from "./2015/CommunityService";
|
|
2
2
|
export { CommunityService };
|
package/dist/diet/index.js
CHANGED
|
@@ -46,7 +46,7 @@ function expectedAdventures(item, modifiers) {
|
|
|
46
46
|
if (itemType(item) === "food" && modifiers.mayoflex)
|
|
47
47
|
adventures++;
|
|
48
48
|
if (itemType(item) === "food" && modifiers.seasoning)
|
|
49
|
-
adventures
|
|
49
|
+
adventures += 0.5;
|
|
50
50
|
return adventures;
|
|
51
51
|
}) / interpolated.length);
|
|
52
52
|
}
|
package/dist/mood.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class OscusSoda extends MpSource {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class MagicalSausages extends MpSource {
|
|
18
18
|
static instance: MagicalSausages;
|
|
19
|
-
usesRemaining(): number
|
|
19
|
+
usesRemaining(): number;
|
|
20
20
|
availableMpMin(): number;
|
|
21
21
|
execute(): void;
|
|
22
22
|
}
|
package/dist/mood.js
CHANGED
|
@@ -34,10 +34,12 @@ export class OscusSoda extends MpSource {
|
|
|
34
34
|
export class MagicalSausages extends MpSource {
|
|
35
35
|
static instance = new MagicalSausages();
|
|
36
36
|
usesRemaining() {
|
|
37
|
-
return
|
|
37
|
+
return have($item `Kramco Sausage-o-Matic™`)
|
|
38
|
+
? 23 - get("_sausagesEaten")
|
|
39
|
+
: 0;
|
|
38
40
|
}
|
|
39
41
|
availableMpMin() {
|
|
40
|
-
const maxSausages = Math.min(
|
|
42
|
+
const maxSausages = Math.min(this.usesRemaining(), itemAmount($item `magical sausage`) +
|
|
41
43
|
itemAmount($item `magical sausage casing`));
|
|
42
44
|
return Math.min(myMaxmp(), 999) * maxSausages;
|
|
43
45
|
}
|
|
@@ -45,7 +47,7 @@ export class MagicalSausages extends MpSource {
|
|
|
45
47
|
const mpSpaceAvailable = myMaxmp() - myMp();
|
|
46
48
|
if (mpSpaceAvailable < 700)
|
|
47
49
|
return;
|
|
48
|
-
const maxSausages = Math.min(
|
|
50
|
+
const maxSausages = Math.min(this.usesRemaining(), itemAmount($item `magical sausage`) +
|
|
49
51
|
itemAmount($item `magical sausage casing`), Math.floor((myMaxmp() - myMp()) / Math.min(myMaxmp() - myMp(), 999)));
|
|
50
52
|
retrieveItem(maxSausages, $item `magical sausage`);
|
|
51
53
|
eat(maxSausages, $item `magical sausage`);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Skill } from "kolmafia";
|
|
2
|
+
import { Modifiers } from "../../modifier";
|
|
3
|
+
export declare const item: import("kolmafia").Item;
|
|
4
|
+
/**
|
|
5
|
+
* Determines whether you have() the Retro Cape.
|
|
6
|
+
* @returns Whether you have the Retro Cape available.
|
|
7
|
+
*/
|
|
8
|
+
export declare function have(): boolean;
|
|
9
|
+
declare const Heroes: {
|
|
10
|
+
vampire: {
|
|
11
|
+
"Muscle Percent": number;
|
|
12
|
+
"Maximum HP": number;
|
|
13
|
+
};
|
|
14
|
+
heck: {
|
|
15
|
+
"Mysticality Percent": number;
|
|
16
|
+
"Maximum MP": number;
|
|
17
|
+
};
|
|
18
|
+
robot: {
|
|
19
|
+
"Moxie Percent": number;
|
|
20
|
+
"Maximum HP": number;
|
|
21
|
+
"Maximum MP": number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
declare type Hero = keyof typeof Heroes;
|
|
25
|
+
declare type Mode = "hold" | "thrill" | "kiss" | "kill";
|
|
26
|
+
export declare const currentHero: () => "vampire" | "heck" | "robot";
|
|
27
|
+
export declare const currentMode: () => Mode;
|
|
28
|
+
/**
|
|
29
|
+
* Tunes retro cape to a given setting
|
|
30
|
+
* @param hero The Superhero to set it to
|
|
31
|
+
* @param mode The washing instructions to set it to
|
|
32
|
+
* @returns Whether we successfully tuned the Retro Cape.
|
|
33
|
+
*/
|
|
34
|
+
export declare function set(hero: Hero, mode: Mode): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the expected Modifiers of the Retro Cape for a particular setting
|
|
37
|
+
* @param hero The Superhero setting
|
|
38
|
+
* @param mode The washing instructions setting
|
|
39
|
+
* @returns A Modifiers object describing the Retro Cape were it to be tuned to that setting.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getModifier(hero?: "vampire" | "heck" | "robot", mode?: Mode): Modifiers;
|
|
42
|
+
/**
|
|
43
|
+
* Tunes the Retro Cape to allow it to grant a particular skill.
|
|
44
|
+
* @param skill The skill to tune the Retro Cape to.
|
|
45
|
+
* @returns Whether we successfully tuned the cape.
|
|
46
|
+
*/
|
|
47
|
+
export declare function tuneToSkill(skill: Skill): boolean;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { cliExecute } from "kolmafia";
|
|
2
|
+
import { have as haveItem } from "../../lib";
|
|
3
|
+
import { get } from "../../property";
|
|
4
|
+
import { $item, $skill } from "../../template-string";
|
|
5
|
+
export const item = $item `unwrapped knock-off retro superhero cape`;
|
|
6
|
+
/**
|
|
7
|
+
* Determines whether you have() the Retro Cape.
|
|
8
|
+
* @returns Whether you have the Retro Cape available.
|
|
9
|
+
*/
|
|
10
|
+
export function have() {
|
|
11
|
+
return haveItem(item);
|
|
12
|
+
}
|
|
13
|
+
const Heroes = {
|
|
14
|
+
vampire: {
|
|
15
|
+
"Muscle Percent": 30,
|
|
16
|
+
"Maximum HP": 50,
|
|
17
|
+
},
|
|
18
|
+
heck: {
|
|
19
|
+
"Mysticality Percent": 30,
|
|
20
|
+
"Maximum MP": 50,
|
|
21
|
+
},
|
|
22
|
+
robot: {
|
|
23
|
+
"Moxie Percent": 30,
|
|
24
|
+
"Maximum HP": 25,
|
|
25
|
+
"Maximum MP": 25,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const currentHero = () => get("retroCapeSuperhero");
|
|
29
|
+
export const currentMode = () => get("retroCapeWashingInstructions");
|
|
30
|
+
const modeMap = new Map([
|
|
31
|
+
[
|
|
32
|
+
["vampire", "hold"],
|
|
33
|
+
{
|
|
34
|
+
"Hot Resistance": 3,
|
|
35
|
+
"Cold Resistance": 3,
|
|
36
|
+
"Stench Resistance": 3,
|
|
37
|
+
"Spooky Resistance": 3,
|
|
38
|
+
"Sleaze Resistance": 3,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
["vampire", "thrill"],
|
|
43
|
+
{
|
|
44
|
+
"Muscle Experience": 3,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
["vampire", "kiss"],
|
|
49
|
+
{
|
|
50
|
+
Skill: $skill `Smooch of the Daywalker`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
["vampire", "kill"],
|
|
55
|
+
{
|
|
56
|
+
Skill: $skill `Slay the Dead`,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
[["heck", "thrill"], { "Mysticality Experience": 3 }],
|
|
60
|
+
[["heck", "kiss"], { Skill: $skill `Unleash the Devil's Kiss` }],
|
|
61
|
+
[["robot", "hold"], { Skill: $skill `Deploy Robo-Handcuffs` }],
|
|
62
|
+
[["robot", "thrill"], { "Moxie Experience": 3 }],
|
|
63
|
+
[["robot", "kiss"], { Skill: $skill `Blow a Robo-Kiss` }],
|
|
64
|
+
[["robot", "kill"], { Skill: $skill `Precision Shot` }],
|
|
65
|
+
]);
|
|
66
|
+
/**
|
|
67
|
+
* Tunes retro cape to a given setting
|
|
68
|
+
* @param hero The Superhero to set it to
|
|
69
|
+
* @param mode The washing instructions to set it to
|
|
70
|
+
* @returns Whether we successfully tuned the Retro Cape.
|
|
71
|
+
*/
|
|
72
|
+
export function set(hero, mode) {
|
|
73
|
+
if (!have())
|
|
74
|
+
return false;
|
|
75
|
+
if (currentHero() === hero && currentMode() === mode)
|
|
76
|
+
return true;
|
|
77
|
+
cliExecute(`retrocape ${hero} ${mode}`);
|
|
78
|
+
return currentHero() === hero && currentMode() === mode;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the expected Modifiers of the Retro Cape for a particular setting
|
|
82
|
+
* @param hero The Superhero setting
|
|
83
|
+
* @param mode The washing instructions setting
|
|
84
|
+
* @returns A Modifiers object describing the Retro Cape were it to be tuned to that setting.
|
|
85
|
+
*/
|
|
86
|
+
export function getModifier(hero = currentHero(), mode = currentMode()) {
|
|
87
|
+
return {
|
|
88
|
+
...Heroes[hero],
|
|
89
|
+
...(modeMap.get([hero, mode]) ?? {}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const skills = new Map([
|
|
93
|
+
[$skill `Smooch of the Daywalker`, ["vampire", "kiss"]],
|
|
94
|
+
[$skill `Slay the Dead`, ["vampire", "kill"]],
|
|
95
|
+
[$skill `Unleash the Devil's Kiss`, ["heck", "kiss"]],
|
|
96
|
+
[$skill `Deploy Robo-Handcuffs`, ["robot", "hold"]],
|
|
97
|
+
[$skill `Blow a Robo-Kiss`, ["robot", "kiss"]],
|
|
98
|
+
[$skill `Precision Shot`, ["robot", "kill"]],
|
|
99
|
+
]);
|
|
100
|
+
/**
|
|
101
|
+
* Tunes the Retro Cape to allow it to grant a particular skill.
|
|
102
|
+
* @param skill The skill to tune the Retro Cape to.
|
|
103
|
+
* @returns Whether we successfully tuned the cape.
|
|
104
|
+
*/
|
|
105
|
+
export function tuneToSkill(skill) {
|
|
106
|
+
const setting = skills.get(skill);
|
|
107
|
+
if (!setting || !have())
|
|
108
|
+
return false;
|
|
109
|
+
set(...setting);
|
|
110
|
+
return [currentHero(), currentMode()].every((element, index) => element === setting[index]);
|
|
111
|
+
}
|
|
@@ -43,7 +43,7 @@ export function reminiscesLeft() {
|
|
|
43
43
|
* @returns An array consisting of the Monsters reminisced today.
|
|
44
44
|
*/
|
|
45
45
|
export function monstersReminisced() {
|
|
46
|
-
return parseLocketProperty().map((id) => toMonster(
|
|
46
|
+
return parseLocketProperty().map((id) => toMonster(id));
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Fight a Monster using the Combat Lover's Locket
|
|
@@ -20,9 +20,10 @@ import * as SongBoom from "./2018/SongBoom";
|
|
|
20
20
|
import * as BeachComb from "./2019/BeachComb";
|
|
21
21
|
import * as Snapper from "./2019/Snapper";
|
|
22
22
|
import * as Guzzlr from "./2020/Guzzlr";
|
|
23
|
+
import * as RetroCape from "./2020/RetroCape";
|
|
23
24
|
import * as CrystalBall from "./2021/CrystalBall";
|
|
24
25
|
import * as DaylightShavings from "./2021/DaylightShavings";
|
|
25
26
|
import * as CombatLoversLocket from "./2022/CombatLoversLocket";
|
|
26
|
-
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CombatLoversLocket, CrownOfThrones, CrystalBall, DaylightShavings, DNALab, FloristFriar, Guzzlr, Latte, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, Snapper, SongBoom, SourceTerminal, SpookyPutty, StompingBoots, TunnelOfLove, WinterGarden, Witchess, };
|
|
27
|
+
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CombatLoversLocket, CrownOfThrones, CrystalBall, DaylightShavings, DNALab, FloristFriar, Guzzlr, Latte, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, RetroCape, Snapper, SongBoom, SourceTerminal, SpookyPutty, StompingBoots, TunnelOfLove, WinterGarden, Witchess, };
|
|
27
28
|
export * from "./putty-likes";
|
|
28
29
|
export * from "./LibramSummon";
|
package/dist/resources/index.js
CHANGED
|
@@ -20,9 +20,10 @@ import * as SongBoom from "./2018/SongBoom";
|
|
|
20
20
|
import * as BeachComb from "./2019/BeachComb";
|
|
21
21
|
import * as Snapper from "./2019/Snapper";
|
|
22
22
|
import * as Guzzlr from "./2020/Guzzlr";
|
|
23
|
+
import * as RetroCape from "./2020/RetroCape";
|
|
23
24
|
import * as CrystalBall from "./2021/CrystalBall";
|
|
24
25
|
import * as DaylightShavings from "./2021/DaylightShavings";
|
|
25
26
|
import * as CombatLoversLocket from "./2022/CombatLoversLocket";
|
|
26
|
-
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CombatLoversLocket, CrownOfThrones, CrystalBall, DaylightShavings, DNALab, FloristFriar, Guzzlr, Latte, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, Snapper, SongBoom, SourceTerminal, SpookyPutty, StompingBoots, TunnelOfLove, WinterGarden, Witchess, };
|
|
27
|
+
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CombatLoversLocket, CrownOfThrones, CrystalBall, DaylightShavings, DNALab, FloristFriar, Guzzlr, Latte, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, RetroCape, Snapper, SongBoom, SourceTerminal, SpookyPutty, StompingBoots, TunnelOfLove, WinterGarden, Witchess, };
|
|
27
28
|
export * from "./putty-likes";
|
|
28
29
|
export * from "./LibramSummon";
|