oldschoolgg / oldschoolbot

Old School Bot - A fanmade discord bot based on Old School RuneScape (OSRS)
https://www.oldschool.gg/
MIT License
139 stars 121 forks source link

Add “Stackable” Clues #5902

Open TizHub opened 1 month ago

TizHub commented 1 month ago

With clue juggling now being a big thing in game with 1 hour timers, allow us to receive multiple clues in one trip but don’t allow further clue drops until all clues in bank are completed.

It would be a nice balance between completely stackable clues and the current situation of getting one clue from a 40min trip.

pls thanks mango and/or Cyr and/or Pum

Lewis7777 commented 2 weeks ago

+1

TastyPumPum commented 2 days ago

hey @ellipsis-dev can you implement this?

ellipsis-dev[bot] commented 2 days ago
:rocket: This implementation plan was created by @ellipsis-dev

Tag me (@ellipsis-dev) in a comment with guidance if you want me to replan or to implement this plan.

Implementation Plan

Step 1: Update addSkillingClueToLoot

Path: src/lib/minions/functions/addSkillingClueToLoot.ts In src/lib/minions/functions/addSkillingClueToLoot.ts, modify addSkillingClueToLoot to allow multiple clues per trip by removing the single clue restriction. Ensure clue chance and other conditions are respected. Add a check to prevent further clue drops if clues exist in the bank.

Step 2: Update deduplicateClueScrolls

Path: src/lib/clues/clueUtils.ts In src/lib/clues/clueUtils.ts, update deduplicateClueScrolls to check for existing clues in the bank and prevent further clue drops if any are found. Ensure it handles multiple clues and does not add duplicates.

Step 3: Update transactItemsFromBank

Path: src/lib/util/transactItemsFromBank.ts In src/lib/util/transactItemsFromBank.ts, modify transactItemsFromBank to handle multiple clues and prevent duplicates. Ensure it checks for existing clues in the bank before adding new ones.

Step 4: Update test cases

Path: tests/unit/util.test.ts Update tests/unit/util.test.ts:

  1. Add test cases for deduplicateClueScrolls to handle multiple clues and prevent further drops if clues exist in the bank.
  2. Add test cases for transactItemsFromBank to handle clue drops and bank checks.
test('deduplicateClueScrolls', () => {
    const currentBank = new Bank().add('Clue scroll(easy)');
    const loot = new Bank().add('Clue scroll(easy)').add('Clue scroll(hard)', 10).add('Clue scroll(master)');
    expect(deduplicateClueScrolls({ loot, currentBank }).bank).toEqual(
        new Bank().add('Clue scroll(hard)').add('Clue scroll(master)').bank
    );

    const multipleCluesBank = new Bank().add('Clue scroll(easy)').add('Clue scroll(hard)');
    const multipleCluesLoot = new Bank().add('Clue scroll(easy)').add('Clue scroll(hard)').add('Clue scroll(master)');
    expect(deduplicateClueScrolls({ loot: multipleCluesLoot, currentBank: multipleCluesBank }).bank).toEqual(
        new Bank().add('Clue scroll(master)').bank
    );
});

// Add test cases for transactItemsFromBank

Questions? Check out our documentation. Leave :+1:/:-1: on this plan to give us feedback.

TastyPumPum commented 2 days ago

@ellipsis-dev can ensure the user can only get multiple from skilling trips and kill trips.

And ensure that the current system is in place from open command and gamble command (e.g. only allowed one)

ellipsis-dev[bot] commented 2 days ago
:rocket: This implementation plan was created by @ellipsis-dev

Tag me (@ellipsis-dev) in a comment with guidance if you want me to replan or to implement this plan.

Updated the entire plan.

Implementation Plan

Step 1: Allow Multiple Clues in addSkillingClueToLoot

Path: src/lib/minions/functions/addSkillingClueToLoot.ts In src/lib/minions/functions/addSkillingClueToLoot.ts, modify addSkillingClueToLoot to:

Step 2: Allow Multiple Clues in handleTripFinish

Path: src/lib/util/handleTripFinish.ts In src/lib/util/handleTripFinish.ts, modify handleTripFinish to:

Step 3: Update k command for clues

Path: src/mahoji/commands/k.ts In src/mahoji/commands/k.ts, modify the k command to:

Step 4: Update minionKillCommand

Path: src/mahoji/lib/abstracted_commands/minionKill.ts In src/mahoji/lib/abstracted_commands/minionKill.ts, modify minionKillCommand to:

Step 5: Restrict Clues in openCommand

Path: src/mahoji/lib/abstracted_commands/openCommand.ts In src/mahoji/lib/abstracted_commands/openCommand.ts, modify abstractedOpenCommand to allow only one clue at a time. Add a check to prevent further clue drops if clues exist in the bank.

Step 6: Restrict Clues in abstractedOpenUntilCommand

Path: src/mahoji/lib/abstracted_commands/openCommand.ts In src/mahoji/lib/abstracted_commands/openCommand.ts, modify abstractedOpenUntilCommand to allow only one clue at a time. Add a check to prevent further clue drops if clues exist in the bank.

Step 7: Restrict Clues in gambleCommand

Path: src/mahoji/commands/gamble.ts In src/mahoji/commands/gamble.ts, modify gambleCommand to allow only one clue at a time. Add a check to prevent further clue drops if clues exist in the bank.


Questions? Check out our documentation. Leave :+1:/:-1: on this plan to give us feedback.

TastyPumPum commented 2 days ago

@ellipsis-dev can you implement this plan into a PR