Skip to content

Commit

Permalink
couple small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignose committed Apr 30, 2024
1 parent fdc6718 commit c3f066c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
31 changes: 16 additions & 15 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,16 @@ export function computeBoozeDrop(): number {
return Math.max(1, Math.floor(60 - (all + addWish) / 15));
}

const famJacksValue = have($familiar`Comma Chameleon`) && !have($skill`Summon Clip Art`) ? 21 : 0;
const greatWolfs = Math.min(2, computeWeaponDamage(false) - 1) + 2;
const famJacksValue = () =>
have($familiar`Comma Chameleon`) && !have($skill`Summon Clip Art`) ? 21 : 0;
const greatWolfs = () => Math.min(2, computeWeaponDamage(false) - 1) + 2;
const stickKnife =
myPrimestat() === $stat`muscle` ? Math.min(5, computeWeaponDamage(false) - 1) + 4 : 0;
const staff = have($skill`Spirit of Rigatoni`) ? 4 : 0;
const tobikoSoda = have($skill`Summon Alice's Army Cards`) ? 0 : 3;
const meteorite = Math.min(8, computeWeaponDamage(false) - 1) + 4;
const slippers = Math.min(4, 1 + ((-1 * computeCombatFrequency(false)) / 5) * 3);
const chlamys = Math.min(3, ((-1 * computeCombatFrequency(false)) / 5) * 3);
const staff = () => (have($skill`Spirit of Rigatoni`) ? 4 : 0);
const tobikoSoda = () => (have($skill`Summon Alice's Army Cards`) ? 0 : 3);
const meteorite = () => Math.min(8, computeWeaponDamage(false) - 1) + 4;
const slippers = () => Math.min(4, 1 + ((-1 * computeCombatFrequency(false)) / 5) * 3);
const chlamys = () => Math.min(3, ((-1 * computeCombatFrequency(false)) / 5) * 3);

type valuePull = {
item: Item;
Expand All @@ -530,43 +531,43 @@ type valuePull = {
export const pullValue: valuePull[] = [
{
item: $item`box of Familiar Jacks`,
value: famJacksValue,
value: famJacksValue(),
},
{
item: $item`Stick-Knife of Loathing`,
value: stickKnife,
},
{
item: $item`Staff of Simmering Hatred`,
value: staff,
value: staff(),
},
{
item: $item`Buddy Bjorn`,
value: 6.8,
},
{
item: $item`meteorite necklace`,
value: meteorite,
value: meteorite(),
},
{
item: $item`Great Wolf's beastly trousers`,
value: greatWolfs,
value: greatWolfs(),
},
{
item: $item`repaid diaper`,
value: 3,
},
{
item: $item`tobiko marble soda`,
value: tobikoSoda,
value: tobikoSoda(),
},
{
item: $item`chalk chlamys`,
value: chlamys,
value: chlamys(),
},
{
item: $item`Fuzzy Slippers of Hatred`,
value: slippers,
value: slippers(),
},
];

Expand Down Expand Up @@ -1363,7 +1364,7 @@ export function useLoathingIdol(): void {
);
}

export const haveLoathingIdol =
export const haveLoathingIdol = () =>
have($item`Loathing Idol Microphone`) ||
have($item`Loathing Idol Microphone (75% charged)`) ||
have($item`Loathing Idol Microphone (50% charged)`) ||
Expand Down
30 changes: 15 additions & 15 deletions src/tasks/leveling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ import {
Station,
} from "libram/dist/resources/2022/TrainSet";

const useCinch = args.savecinch < 100 - get("_cinchUsed");
const useCinch = () => args.savecinch < 100 - get("_cinchUsed");
const baseBoozes = $items`bottle of rum, boxed wine, bottle of gin, bottle of vodka, bottle of tequila, bottle of whiskey`;
const freeFightMonsters: Monster[] = $monsters`Witchess Bishop, Witchess King, Witchess Witch, sausage goblin, Eldritch Tentacle`;
const godLobsterChoice = have($item`God Lobster's Ring`) ? 2 : 3;
const godLobsterChoice = () => (have($item`God Lobster's Ring`) ? 2 : 3);
const godLobsterSave = computeCombatFrequency(false) === -95;

export function restoreMPEfficiently(): string {
Expand Down Expand Up @@ -1324,7 +1324,7 @@ export const LevelingQuest: Quest = {
Array.from(getBanishedMonsters().values()).includes($monster`fluffy bunny`)),
Macro.trySkill($skill`Recall Facts: Monster Habitats`)
)
.default(useCinch)
.default(useCinch())
),
outfit: baseOutfit,
post: (): void => {
Expand All @@ -1351,7 +1351,7 @@ export const LevelingQuest: Quest = {
myBasestat(myPrimestat()) >= 190, // no longer need to back up Witchess Kings
do: $location`The Dire Warren`,
combat: new CombatStrategy().macro(
Macro.trySkill($skill`Back-Up to your Last Enemy`).default(useCinch)
Macro.trySkill($skill`Back-Up to your Last Enemy`).default(useCinch())
),
outfit: () => ({
...baseOutfit(),
Expand Down Expand Up @@ -1390,7 +1390,7 @@ export const LevelingQuest: Quest = {
(haveFreeBanish() ||
Array.from(getBanishedMonsters().values()).includes($monster`fluffy bunny`)),
Macro.trySkill($skill`Recall Facts: Monster Habitats`)
).default(useCinch)
).default(useCinch())
),
post: (): void => {
sendAutumnaton();
Expand Down Expand Up @@ -1518,8 +1518,8 @@ export const LevelingQuest: Quest = {
!have($familiar`God Lobster`) ||
(get("_godLobsterFights") >= 2 && godLobsterSave),
do: () => visitUrl("main.php?fightgodlobster=1"),
combat: new CombatStrategy().macro(Macro.default(useCinch)),
choices: { 1310: godLobsterChoice }, // Get xp on last fight
combat: new CombatStrategy().macro(Macro.default(useCinch())),
choices: { 1310: godLobsterChoice() }, // Get xp on last fight
outfit: () => ({
...baseOutfit(),
famequip: $items`God Lobster's Ring, God Lobster's Scepter`,
Expand Down Expand Up @@ -1548,7 +1548,7 @@ export const LevelingQuest: Quest = {
sendAutumnaton();
sellMiscellaneousItems();
},
combat: new CombatStrategy().macro(Macro.default(useCinch)),
combat: new CombatStrategy().macro(Macro.default(useCinch())),
outfit: baseOutfit,
limit: { tries: 1 },
},
Expand All @@ -1573,7 +1573,7 @@ export const LevelingQuest: Quest = {
(haveFreeBanish() ||
Array.from(getBanishedMonsters().values()).includes($monster`fluffy bunny`)),
Macro.trySkill($skill`Recall Facts: Monster Habitats`)
).default(useCinch)
).default(useCinch())
),
outfit: baseOutfit,
post: (): void => {
Expand All @@ -1594,7 +1594,7 @@ export const LevelingQuest: Quest = {
},
completed: () => get("_machineTunnelsAdv") >= 5 || !have($familiar`Machine Elf`),
do: $location`The Deep Machine Tunnels`,
combat: new CombatStrategy().macro(Macro.default(useCinch)),
combat: new CombatStrategy().macro(Macro.default(useCinch())),
outfit: () => ({
...baseOutfit(),
familiar: $familiar`Machine Elf`,
Expand Down Expand Up @@ -1647,7 +1647,7 @@ export const LevelingQuest: Quest = {
.trySkill($skill`Feel Pride`)
.trySkill($skill`Cincho: Confetti Extravaganza`)
.trySkill($skill`Recall Facts: %phylum Circadian Rhythms`)
.default(useCinch)
.default(useCinch())
),
post: (): void => {
if (have($item`SMOOCH coffee cup`)) chew($item`SMOOCH coffee cup`, 1);
Expand Down Expand Up @@ -1701,7 +1701,7 @@ export const LevelingQuest: Quest = {
.trySkill($skill`Chest X-Ray`)
.trySkill($skill`Shattering Punch`)
.trySkill($skill`Gingerbread Mob Hit`)
.default(useCinch)
.default(useCinch())
),
post: (): void => {
if (have($item`SMOOCH coffee cup`)) chew($item`SMOOCH coffee cup`, 1);
Expand Down Expand Up @@ -1750,7 +1750,7 @@ export const LevelingQuest: Quest = {
args.witchess ||
args.skipking,
do: () => Witchess.fightPiece($monster`Witchess King`),
combat: new CombatStrategy().macro(Macro.default(useCinch)),
combat: new CombatStrategy().macro(Macro.default(useCinch())),
outfit: baseOutfit,
post: (): void => {
sendAutumnaton();
Expand Down Expand Up @@ -1861,7 +1861,7 @@ export const LevelingQuest: Quest = {
(haveFreeBanish() ||
Array.from(getBanishedMonsters().values()).includes($monster`fluffy bunny`)),
Macro.trySkill($skill`Recall Facts: Monster Habitats`)
).default(useCinch)
).default(useCinch())
),
outfit: baseOutfit,
post: (): void => {
Expand Down Expand Up @@ -1915,7 +1915,7 @@ export const LevelingQuest: Quest = {
.trySkill($skill`Chest X-Ray`)
.trySkill($skill`Shattering Punch`)
.trySkill($skill`Gingerbread Mob Hit`)
.default(useCinch)
.default(useCinch())
),
choices: {
1094: 5,
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/stat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const MoxieQuest: Quest = {
!have($item`2002 Mr. Store Catalog`) ||
CommunityService.Moxie.isDone(),
do: (): void => {
if (!haveLoathingIdol) {
if (!haveLoathingIdol()) {
buy($coinmaster`Mr. Store 2002`, 1, $item`Loathing Idol Microphone`);
}
withChoice(1505, 1, () => useLoathingIdol());
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/weapondamage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import {
import { args } from "../args";

const canesword = have($item`candy cane sword cane`);
const stickknife =
const stickknife = () =>
have($item`Stick-Knife of Loathing`) &&
(myPrimestat() === $stat`Muscle` || myClass() === $class`Pastamancer`);

Expand Down Expand Up @@ -296,7 +296,7 @@ export const WeaponDamageQuest: Quest = {
},
outfit: {
weapon: canesword ? $item`candy cane sword cane` : undefined,
offhand: stickknife ? $item`Stick-Knife of Loathing` : undefined,
offhand: stickknife() ? $item`Stick-Knife of Loathing` : undefined,
modifier: "weapon dmg, weapon dmg percent, switch disembodied hand, -switch left-hand man",
},
post: () => shrugAT(),
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2271,9 +2271,9 @@ levn@^0.4.1:
type-check "~0.4.0"

libram@^0.8.23:
version "0.8.26"
resolved "https://registry.yarnpkg.com/libram/-/libram-0.8.26.tgz#5c2b317c24d403f0ce1d4523209224f36feafb80"
integrity sha512-yScf3r+WaEr39jhLM10wlM9Kqic7WZEdAW8YcvKX4fBtpm5nxU3QBSSKK3wB047c2KESpZumiRXpnPdEickjbA==
version "0.8.27"
resolved "https://registry.yarnpkg.com/libram/-/libram-0.8.27.tgz#cd672fdc4e7455311e1605fb23fccdb2aaf9986a"
integrity sha512-Xw043wV31pTSGMOep163g+4zHX/R7iwKxjvntvPvA0CbcQQtNii/4YtqVwatUOqLHuze/fta1m5EKwkCbsU63w==
dependencies:
html-entities "^2.4.0"

Expand Down

0 comments on commit c3f066c

Please sign in to comment.