Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TastyPumPum committed Nov 8, 2024
1 parent d8373b0 commit 2e8a51e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/types/minions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export interface SepulchreActivityTaskOptions extends MinigameActivityTaskOption
type: 'Sepulchre';
floors: number[];
fletch?: {
fletchable: Fletchable;
fletchableName: string;
fletchingQuantity: number;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/repeatStoredTrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ const tripHandlers = {
[activity_type_enum.Sepulchre]: {
commandName: 'minigames',
args: (data: SepulchreActivityTaskOptions) => {
const fletch = data.fletch?.fletchable ? data.fletch.fletchable.name : undefined;
const fletch = data.fletch?.fletchableName;
return { sepulchre: { start: { fletching: fletch } } };
}
},
Expand Down
7 changes: 4 additions & 3 deletions src/mahoji/lib/abstracted_commands/sepulchreCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function sepulchreCommand(user: MUser, channelID: string, fletching
}

if (!userHasGracefulEquipped(user)) {
return 'You need Graceful equipped in your Skilling setup to do the Hallowed Sepulchre.';
return 'You need Graceful equipped in any setup to do the Hallowed Sepulchre.';
}

let fletchingQuantity = 0;
Expand Down Expand Up @@ -62,6 +62,7 @@ export async function sepulchreCommand(user: MUser, channelID: string, fletching
const tripLength = maxLaps * lapLength;

let itemsNeeded: Bank | undefined;
const userBank = user.bankWithGP;
let sets = 'x';
let timeToFletchSingleItem = 0;

Expand Down Expand Up @@ -107,7 +108,7 @@ export async function sepulchreCommand(user: MUser, channelID: string, fletching
if (max < fletchingQuantity && max !== 0) fletchingQuantity = max;

itemsNeeded = fletchable.inputItems.clone().multiply(fletchingQuantity);
if (!user.bank.has(itemsNeeded.bank)) {
if (!userBank.has(itemsNeeded)) {
return `You don't have enough items. For ${fletchingQuantity}x ${fletchable.name}, you're missing **${itemsNeeded
.clone()
.remove(user.bank)}**.`;
Expand All @@ -124,7 +125,7 @@ export async function sepulchreCommand(user: MUser, channelID: string, fletching
type: 'Sepulchre',
channelID: channelID.toString(),
minigameID: 'sepulchre',
fletch: fletchable ? { fletchable, fletchingQuantity } : undefined
fletch: fletchable ? { fletchableName: fletchable.name, fletchingQuantity } : undefined
});

let str = `${user.minionName} is now doing ${maxLaps} laps of the Sepulchre, in each lap they are doing floors ${
Expand Down
10 changes: 8 additions & 2 deletions src/tasks/minions/minigames/sepulchreActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GrandHallowedCoffin } from 'oldschooljs/dist/simulation/misc/GrandHallo
import { trackLoot } from '../../../lib/lootTrack';
import { openCoffin, sepulchreFloors } from '../../../lib/minions/data/sepulchre';
import { incrementMinigameScore } from '../../../lib/settings/settings';
import { zeroTimeFletchables } from '../../../lib/skilling/skills/fletching/fletchables';
import { SkillsEnum } from '../../../lib/skilling/types';
import type { SepulchreActivityTaskOptions } from '../../../lib/types/minions';
import { roll } from '../../../lib/util';
Expand Down Expand Up @@ -49,7 +50,12 @@ export const sepulchreTask: MinionTask = {
const fletchingLoot = new Bank();

if (fletch) {
const fletchable = fletch.fletchable;
const fletchable = zeroTimeFletchables.find(item => item.name === fletch.fletchableName);

if (!fletchable) {
throw new Error(`Fletchable item ${fletch.fletchableName} not found.`);
}

fletchQuantity = fletch.fletchingQuantity;

if (fletchable.outputMultiple) {
Expand Down Expand Up @@ -123,7 +129,7 @@ export const sepulchreTask: MinionTask = {
itemsToAdd: fletchingLoot
});

str += `\nYou also finished fletching ${fletchQuantity}${sets} ${fletch.fletchable.name}, and received ${fletchingLoot}. ${fletchXpRes}.`;
str += `\nYou also finished fletching ${fletchQuantity}${sets} ${fletch.fletchableName}, and received ${fletchingLoot}. ${fletchXpRes}.`;
}

handleTripFinish(user, channelID, str, image.file.attachment, data, itemsAdded);
Expand Down

0 comments on commit 2e8a51e

Please sign in to comment.