Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
DayV-git committed Nov 25, 2024
1 parent 1a8129f commit 408f4d1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/mahoji/commands/clue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,7 @@ export const clueCommand: OSBMahojiCommand = {
}
}
let quantity = clamp(user.bank.amount(clueTier.scrollID), 1, Math.floor(maxTripLength / timePerClue));

const duration = timePerClue * quantity;
const maxCanDo = Math.floor(maxTripLength / timePerClue);

if (duration > maxTripLength || quantity > maxCanDo) {
return `${user.minionName} can't go on Clue trips longer than ${formatDuration(
maxTripLength
)}, try a lower quantity. The highest amount you can do for ${clueTier.name} is ${maxCanDo}.`;
}

const response: Awaited<CommandResponse> = {};

let implingLootString = '';
Expand Down Expand Up @@ -412,6 +403,13 @@ export const clueCommand: OSBMahojiCommand = {
} from ${openedImplings}x ${clueImpling.name}s.`;
}

const duration = timePerClue * quantity;
if (duration > maxTripLength || quantity > maxCanDo) {
return `${user.minionName} can't go on Clue trips longer than ${formatDuration(
maxTripLength
)}, try a lower quantity. The highest amount you can do for ${clueTier.name} is ${maxCanDo}.`;
}

await addSubTaskToActivityTask<ClueActivityTaskOptions>({
ci: clueTier.id,
implingID: clueImpling ? clueImpling.id : undefined,
Expand Down

0 comments on commit 408f4d1

Please sign in to comment.