Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2nd round of adding to Cyr's works in bank project #5758

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/fishingContest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ export async function catchFishAtLocation({ user, location }: { user: MUser; loc

const boosts: string[] = [];

if (user.hasEquipped('Ring of luck')) {
if (user.hasEquippedOrInBank('Ring of luck')) {
maxLength += 1;
boosts.push('+1cm max len for RoL');
}

if (user.hasEquipped('Crystal fishing rod')) {
if (user.hasEquippedOrInBank('Crystal fishing rod')) {
maxLength += 5;
boosts.push('+5cm max len for Crystal fishing rod');
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/skilling/skills/dung/dungDbFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function calcMaxFloorUserCanDo(user: MUser) {

export function calcUserGorajanShardChance(user: MUser) {
return calcGorajanShardChance({
hasMasterCape: user.hasEquipped('Dungeoneering master cape'),
hasMasterCape: user.hasEquippedOrInBank('Dungeoneering master cape'),
dungLevel: user.skillLevel(SkillsEnum.Dungeoneering),
hasRingOfLuck: user.hasEquipped('Ring of luck')
hasRingOfLuck: user.hasEquippedOrInBank('Ring of luck')
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/hunt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
if (
creature.name === 'Chimpchompa' &&
!Object.values(allGear).some(g =>
g.hasEquipped(monkeyTiers.map(i => i.greegrees.map(i => i.id)).flat(2), false)

Check warning on line 70 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'i' is already declared in the upper scope on line 70 column 34

Check warning on line 70 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 70 column 34
)
) {
return "You can't hunt Chimpchompa's! You need to be wearing a greegree.";
Expand Down Expand Up @@ -259,7 +259,7 @@
required: true,
autocomplete: async (value: string) => {
return creatures
.filter(i => (!value ? true : i.name.toLowerCase().includes(value.toLowerCase())))

Check warning on line 262 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required

Check warning on line 262 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required
.map(i => ({
name: i.name,
value: i.name
Expand Down Expand Up @@ -292,7 +292,7 @@
channelID
}: CommandRunOptions<{ name: string; quantity?: number; hunter_potion?: boolean; stamina_potions?: boolean }>) => {
const user = await mUserFetch(userID);
const creature = Hunter.Creatures.find(creature =>

Check warning on line 295 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'creature' is already declared in the upper scope on line 295 column 9

Check warning on line 295 in src/mahoji/commands/hunt.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'creature' is already declared in the upper scope on line 295 column 9
creature.aliases.some(
alias => stringMatches(alias, options.name) || stringMatches(alias.split(' ')[0], options.name)
)
Expand All @@ -306,7 +306,7 @@

const hunterInputArgs: Parameters<typeof calculateHunterInput>['0'] = {
creature,
hasHunterMasterCape: user.hasEquipped('Hunter master cape'),
hasHunterMasterCape: user.hasEquippedOrInBank('Hunter master cape'),
hasGraceful: userHasGracefulEquipped(user),
maxTripLength,
quantityInput: options.quantity,
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/runecraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'soul rune (zeah)',
...Runecraft.Tiaras.map(i => i.name)
]
.filter(name => (!value ? true : name.toLowerCase().includes(value.toLowerCase())))

Check warning on line 44 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required

Check warning on line 44 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required
.map(i => ({
name: toTitleCase(i),
value: i
Expand Down Expand Up @@ -140,7 +140,7 @@
tripLength /= 2;
boosts.push('2x from Obis (3x more essence)');
}
if (user.hasEquipped('Runecraft master cape')) {
if (user.hasEquippedOrInBank('Runecraft master cape')) {
tripLength /= 2;
boosts.push(`${Emoji.RunecraftMasterCape} 2x faster`);
}
Expand Down Expand Up @@ -225,7 +225,7 @@
(numEssenceOwned === 0 ||
quantity === 0 ||
numEssenceOwned < quantity ||
!essenceRequired ||

Check warning on line 228 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required

Check warning on line 228 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required
numEssenceOwned < essenceRequired)
) {
return "You don't have enough Pure Essence to craft these runes. You can acquire some through Mining, or purchasing from other players.";
Expand Down Expand Up @@ -339,7 +339,7 @@
if (!user.owns(totalCost)) return `You don't own: ${totalCost}.`;

await user.removeItemsFromBank(totalCost);
updateBankSetting('runecraft_cost', totalCost);

Check warning on line 342 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 342 in src/mahoji/commands/runecraft.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

await addSubTaskToActivityTask<RunecraftActivityTaskOptions>({
runeID: runeObj.id,
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/steal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
autocomplete: async (value: string, user: User) => {
const mUser = await mUserFetch(user.id);
const conLevel = mUser.skillLevel('thieving');
return stealables

Check warning on line 38 in src/mahoji/commands/steal.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required

Check warning on line 38 in src/mahoji/commands/steal.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required
.filter(i => (!value ? true : i.name.toLowerCase().includes(value.toLowerCase())))
.filter(c => c.level <= conLevel)
.map(i => ({
Expand Down Expand Up @@ -157,7 +157,7 @@
quantity,
user.hasEquipped(['Thieving cape', 'Thieving cape(t)']),
hasArdyHard,
user.hasEquippedOrInBank(["Thieves' armband"])
user.hasEquipped(["Thieves' armband"])
);

if (user.hasEquipped(['Thieving cape', 'Thieving cape(t)', 'Thieving master cape'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/lib/abstracted_commands/farmingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
return `Please come back when your crops have finished growing in ${formatDuration(patch.readyIn!)}!`;
}

const treeStr = !plant ? null : treeCheck(plant, currentWoodcuttingLevel, GP, patch.lastQuantity);

Check warning on line 69 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected object value in conditional. The condition is always true

Check warning on line 69 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected object value in conditional. The condition is always true
if (treeStr) return treeStr;

const timePerPatchTravel = Time.Second * plant.timePerPatchTravel;
Expand Down Expand Up @@ -221,7 +221,7 @@
duration *= 0.9;
}

if (user.hasEquipped('Ring of endurance')) {
if (user.hasEquippedOrInBank('Ring of endurance')) {
boostStr.push('10% time for Ring of Endurance');
duration *= 0.9;
}
Expand Down Expand Up @@ -285,7 +285,7 @@
if (user.owns(compostCost)) {
infoStr.push(`You are treating your patches with ${compostCost}.`);
cost.add(compostCost);
upgradeType = compostTier;

Check warning on line 288 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required

Check warning on line 288 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected string value in conditional. An explicit empty string check is required
}
}

Expand All @@ -297,7 +297,7 @@
if (!patchType.patchPlanted) {
infoStr.unshift(`${user.minionName} is now planting ${quantity}x ${plant.name}.`);
} else if (patchType.patchPlanted) {
if (user.hasEquippedOrInBank(['Magic secateurs'])) {

Check warning on line 300 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 300 in src/mahoji/lib/abstracted_commands/farmingCommand.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
boostStr.push('10% crop yield for Magic Secateurs');
}
if (user.hasEquippedOrInBank(['Farming cape'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function monkeyRumbleCommand(user: MUser, channelID: string): Comma
const boosts = [];

let fightDuration = Time.Minute * 9;
if (user.hasEquippedOrInBank('Strength master cape')) {
if (user.hasEquipped('Strength master cape')) {
fightDuration = reduceNumByPercent(fightDuration, 17);
boosts.push('17% faster fights for strength master cape');
}
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/lib/abstracted_commands/odsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function odsStartCommand(klasaUser: MUser, channelID: string) {

let waveTime = randomVariation(Time.Minute * 4, 10);

if (klasaUser.hasEquipped('Runecraft master cape')) {
if (klasaUser.hasEquippedOrInBank('Runecraft master cape')) {
waveTime /= 2;
boosts.push(`${Emoji.RunecraftMasterCape} 2x faster`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/minions/bso/fishingContestActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const fishingContestTask: MinionTask = {
});

const loot = new Bank();
let tackleBoxChance = user.hasEquipped('Fishing master cape') ? 2 : 3;
let tackleBoxChance = user.hasEquippedOrInBank('Fishing master cape') ? 2 : 3;
if (roll(tackleBoxChance)) {
for (const [tackleBox, fishLevel] of [
['Basic tackle box', 75],
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/minions/miningActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const miningTask: MinionTask = {
const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id);
const amountOfSpiritsToUse =
spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0;
const hasMiningMasterCape = user.hasEquipped('Mining master cape');
const hasMiningMasterCape = user.hasEquippedOrInBank('Mining master cape');
const portentResult =
amountOfSpiritsToUse > 0
? await chargePortentIfHasCharges({
Expand Down
Loading