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

Scroll of cleansing saves 10% of herblore Secondaries #5806

Open
wants to merge 10 commits into
base: bso
Choose a base branch
from

Conversation

Felris
Copy link
Contributor

@Felris Felris commented Mar 28, 2024

Description:

Scroll of Cleansing was added with dungeoneering 3 years ago, and was never given a use. This use isn't too OP, but makes it do something a little useful at least. Scroll of cleansing saves 10% of secondaries for /mix command. Also added a /data to track how much the scroll has saved.

Changes:

src/mahoji/commands/mix.ts - Add a check for scroll of cleansing, and if found removes 10%(rounded down) of secondaries (using the secondaries filterable). Then updates cleansing_scroll_bank, and appends a short message saying the scroll of cleansing saved ingredients.

prisma/schema.prisma, src/lib/structures/MUserStats.ts - Added cleansing_scroll_bank

src/mahoji/lib/abstracted_commands/statCommand.ts - added /data command to view cleansing_scroll_bank

Other checks:

  • I have tested all my changes thoroughly.

src/mahoji/commands/mix.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@gc gc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also just go through the BSO-specific herblore things and see if theres any situations this would be OP or shouldnt apply.

finalCost.remove(item.id, saved);
const savedBank = new Bank();
savedBank.add(item.id, saved);
userStatsBankUpdate(user.id, 'cleansing_scroll_bank', savedBank);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably unsound (prone to overwriting updates due to not awaiting), and you should do it with just 1 call.

Possibly like:

const savedBank = new Bank();
for (const item of items) {
const savings = new Bank();
cost.remove(savings);
savedBank.add(savings);
}
await userStatsBankUpdate(user.id, 'cleansing_scroll_bank', savedBank);

Comment on lines +190 to +192
if (hasScroll) {
str += ' Your scroll of cleansing enables you to save 10% of your secondaries.';
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably just put this in the boosts array. We're moving away from the str += because its hard to keep track of formatting them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants