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

Fix materials used formatting on trip return #5779

Merged
merged 1 commit into from
Mar 15, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/lib/invention/MaterialBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class MaterialBank {
res.push(`${toTitleCase(type)}: ${qty.toLocaleString()}`);
}

return `${res.join('\n')}`;
return res.join(', ');
}

public values() {
Expand Down
3 changes: 2 additions & 1 deletion src/mahoji/commands/invention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
.filter(
i =>
allItemsThatCanBeDisassembledIDs.has(i[0].id) &&
(!value ? true : i[0].name.toLowerCase().includes(value.toLowerCase()))

Check warning on line 48 in src/mahoji/commands/invention.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 48 in src/mahoji/commands/invention.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 => {
const data = findDisassemblyGroup(i[0]);
Expand Down Expand Up @@ -95,7 +95,7 @@
required: true,
autocomplete: async value => {
return Inventions.filter(i =>
!value ? true : i.name.toLowerCase().includes(value.toLowerCase())

Check warning on line 98 in src/mahoji/commands/invention.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 98 in src/mahoji/commands/invention.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 @@ -151,7 +151,7 @@
required: true,
autocomplete: async value => {
return Inventions.filter(i =>
!value ? true : i.name.toLowerCase().includes(value.toLowerCase())

Check warning on line 154 in src/mahoji/commands/invention.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 154 in src/mahoji/commands/invention.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 }))
.sort((a, b) => a.name.localeCompare(b.name));
Expand All @@ -176,7 +176,7 @@
required: true,
autocomplete: async value => {
return DisassemblySourceGroups.filter(i =>
!value ? true : i.name.toLowerCase().includes(value.toLowerCase())

Check warning on line 179 in src/mahoji/commands/invention.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 179 in src/mahoji/commands/invention.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 @@ -215,7 +215,8 @@
return str;
}
if (options.materials) {
return { content: `You own:\n${user.materialsOwned()}`, ephemeral: true };
const materialsOwned = user.materialsOwned().toString().split(', ').join('\n');
return { content: `You own:\n${materialsOwned}`, ephemeral: true };
}

if (options.group) {
Expand Down Expand Up @@ -349,7 +350,7 @@
.join(', ')})
${group.items
.map(i => {
return `${Array.isArray(i.item) ? i.item.map(i => i.name).join(', ') : i.item.name} - ${Math.floor(

Check warning on line 353 in src/mahoji/commands/invention.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 352 column 9

Check warning on line 353 in src/mahoji/commands/invention.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 352 column 9
calcJunkChance(i.lvl, false)
)}% Junk Chance - Level/Weighting ${i.lvl}`;
})
Expand Down
10 changes: 5 additions & 5 deletions src/tasks/minions/monsterActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}

totalXP *= 5;
userStatsUpdate(user.id, () => ({

Check warning on line 74 in src/tasks/minions/monsterActivity.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 74 in src/tasks/minions/monsterActivity.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
bonecrusher_prayer_xp: {
increment: Math.floor(totalXP)
}
Expand All @@ -84,12 +84,12 @@
multiplier: false
});
messages.push(
`${xpStr} Prayer XP${
`${xpStr} Prayer XP ${
hasSuperior
? `(${inventionBoosts.superiorBonecrusher.xpBoostPercent}% more from Superior bonecrusher, ${
boostMsg ? `, ${boostMsg}` : ''
})`
: ''
? `+${inventionBoosts.superiorBonecrusher.xpBoostPercent}% more from Superior bonecrusher${
boostMsg ? ` (${boostMsg})` : ''
}`
: ' from Gorajan bonecrusher'
}`
);
}
Expand Down Expand Up @@ -121,8 +121,8 @@
}
}
loot.add(toAdd);
trackClientBankStats('portable_tanner_loot', toAdd);

Check warning on line 124 in src/tasks/minions/monsterActivity.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 124 in src/tasks/minions/monsterActivity.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
userStatsBankUpdate(user.id, 'portable_tanner_bank', toAdd);

Check warning on line 125 in src/tasks/minions/monsterActivity.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 125 in src/tasks/minions/monsterActivity.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
if (!triggered) return;
messages.push(`Portable Tanner turned the hides into leathers (${boostRes.messages})`);
}
Expand Down Expand Up @@ -152,8 +152,8 @@
duration: durationForCost
});
if (!boostRes.success) return false;
trackClientBankStats('clue_upgrader_loot', upgradedClues);

Check warning on line 155 in src/tasks/minions/monsterActivity.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 155 in src/tasks/minions/monsterActivity.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
userStatsBankUpdate(user.id, 'clue_upgrader_bank', upgradedClues);

Check warning on line 156 in src/tasks/minions/monsterActivity.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 156 in src/tasks/minions/monsterActivity.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
loot.add(upgradedClues);
assert(loot.has(removeBank));
loot.remove(removeBank);
Expand Down
Loading