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

[BSO] Grimy spirit weed now available, added subtext, cleans if toggled during harvest runs #5885

Open
wants to merge 4 commits into
base: bso
Choose a base branch
from
Open
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
11 changes: 3 additions & 8 deletions src/lib/bankImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,16 @@
[i('Mango seed'), 'mango'],
[i('Avocado seed'), 'avocado'],
[i('Lychee seed'), 'lychee'],
[i('Blood orange seed'), 'b.orange'],
[i('Spirit weed seed'), 'spirit.w'],
[i('Spirit weed'), 'spirit.w'],
[i('Grimy spirit weed'), 'spirit.w'],
[i('Advax berry seed'), 'advax'],
[i('Advax berry'), 'advax'],
[i('Divination Potion'), 'div'],
[i('Elder logs'), 'elder'],
[i('Elder logs'), 'Elder'],
[i('Clue scroll (grandmaster)'), 'grandmaster'],
[i('Reward casket (grandmaster)'), 'grandmaster'],
[i('Atomic energy'), 'atomic'],
[i('Fruity zygomite spores'), 'fruity'],
[i('Barky zygomite spores'), 'barky'],
[i('Herbal zygomite spores'), 'herbal'],
[i('Clue scroll (elder)'), 'elder'],
[i('Reward casket (elder)'), 'elder']
[i('Atomic energy'), 'Atomic']
]);

for (const energy of divinationEnergies) {
Expand Down Expand Up @@ -422,7 +417,7 @@
}
}

async getItemImage(itemID: number, user?: MUser): Promise<Image> {

Check warning on line 420 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'itemID' is already declared in the upper scope on line 24 column 8

Check warning on line 420 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'itemID' is already declared in the upper scope on line 24 column 8
if (user && user.user.icon_pack_id !== null) {
for (const pack of ItemIconPacks) {
if (pack.id === user.user.icon_pack_id) {
Expand Down Expand Up @@ -456,7 +451,7 @@
}
}

async fetchAndCacheImage(itemID: number) {

Check warning on line 454 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'itemID' is already declared in the upper scope on line 24 column 8

Check warning on line 454 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'itemID' is already declared in the upper scope on line 24 column 8
const imageBuffer = await fetch(`https://static.runelite.net/cache/item/icon/${itemID}.png`).then(result =>
result.buffer()
);
Expand Down Expand Up @@ -533,7 +528,7 @@
}

getBgAndSprite(bankBgId: number = 1, user?: MUser) {
let background = this.backgroundImages.find(i => i.id === bankBgId)!;

Check warning on line 531 in src/lib/bankImage.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 78 column 7

Check warning on line 531 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 78 column 7

const currentContract = user?.farmingContract();
const isFarmingContractReadyToHarvest = Boolean(
Expand All @@ -545,10 +540,10 @@

let backgroundImage = background.image!;
if (bankBgId === 29 && isFarmingContractReadyToHarvest) {
backgroundImage = this.alternateImages.find(i => i.bgId === 29)!.image;

Check warning on line 543 in src/lib/bankImage.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 78 column 7

Check warning on line 543 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 78 column 7
}
if (bankBgId === 30 && isFarmingContractReadyToHarvest) {
backgroundImage = this.alternateImages.find(i => i.bgId === 30)!.image;

Check warning on line 546 in src/lib/bankImage.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 78 column 7

Check warning on line 546 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 78 column 7
}

const hasBgSprite = Boolean(this.bgSpriteList[background.name.toLowerCase()]);
Expand Down Expand Up @@ -583,7 +578,7 @@

let xLoc = 0;
let yLoc = compact ? 5 : 0;
for (let i = 0; i < items.length; i++) {

Check warning on line 581 in src/lib/bankImage.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 78 column 7

Check warning on line 581 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 78 column 7
if (i % itemsPerRow === 0) yLoc += floor((itemSize + spacer / 2) * (compact ? 0.9 : 1.08)) + verticalSpacer;
// For some reason, it starts drawing at -2 so we compensate that
// Adds the border width
Expand Down Expand Up @@ -651,24 +646,24 @@
const group = findDisassemblyGroup(item);
const inventionLevel = user.skillLevel(SkillsEnum.Invention);
const xp = group && inventionLevel >= group.data.lvl && calcWholeDisXP(user, item, quantity);
if (xp) {

Check warning on line 649 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 649 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
bottomItemText = `${toKMB(xp)}XP`;
} else {
bottomItemText = 0;
}
} else if (mahojiFlags?.includes('show_weights') && weightings && weightings[item.id]) {

Check warning on line 654 in src/lib/bankImage.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 654 in src/lib/bankImage.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
bottomItemText = weightings[item.id];
} else if (mahojiFlags?.includes('show_market_price')) {
bottomItemText = marketPriceOrBotPrice(item.id) * quantity;
}

const forcedShortName = forcedShortNameMap.get(item.id);
if (forcedShortName && !bottomItemText) {

Check warning on line 661 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 661 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
ctx.font = '10px Smallest Pixel-7';
bottomItemText = forcedShortName.toUpperCase();
}

if (bottomItemText) {

Check warning on line 666 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 666 in src/lib/bankImage.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
let text =
typeof bottomItemText === 'number' ? toKMB(bottomItemText) : bottomItemText.toString().slice(0, 8);
ctx.fillStyle = 'black';
Expand Down
3 changes: 2 additions & 1 deletion src/lib/skilling/skills/farming/herbPlants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ const herbPlants: Plant[] = [
name: 'Spirit weed',
aliases: ['spirit weed', 'spirit weed seed'],
inputItems: new Bank({ 'Spirit weed seed': 1 }),
outputCrop: itemID('Spirit weed'),
outputCrop: itemID('Grimy spirit weed'),
cleanHerbCrop: itemID('Spirit weed'),
petChance: 98_364,
seedType: 'herb',
growthTime: 80,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/skilling/skills/herblore/mixables/grimy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const Grimy: Mixable[] = [
},
{
item: getOSItem('Spirit weed'),
aliases: ['grimy spirit weed'],
aliases: ['grimy spirit weed', 'spirit weed'],
level: 105,
xp: 25,
inputItems: new Bank({ 'Grimy spirit weed': 1 }),
Expand Down
Loading