Skip to content

Commit

Permalink
Merge branch 'master' into tob_elites
Browse files Browse the repository at this point in the history
  • Loading branch information
gc authored Aug 21, 2024
2 parents edf8bd6 + 10ed978 commit 862815d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const Roles = {
TopMinigamer: DISCORD_SETTINGS.Roles?.TopMinigamer ?? '832798997033779220',
TopClueHunter: DISCORD_SETTINGS.Roles?.TopClueHunter ?? '839135887467610123',
TopSlayer: DISCORD_SETTINGS.Roles?.TopSlayer ?? '856080958247010324',
TopFarmer: DISCORD_SETTINGS.Roles?.TopFarmer ?? '894194027363205150',
TopGlobalCL: '1072426869028294747'
};

Expand Down Expand Up @@ -346,7 +347,8 @@ export const BadgesEnum = {
TopMinigame: 11,
SotWTrophy: 12,
Slayer: 13,
TopGiveawayer: 14
TopGiveawayer: 14,
Farmer: 15
} as const;

export const badges: { [key: number]: string } = {
Expand All @@ -364,7 +366,8 @@ export const badges: { [key: number]: string } = {
[BadgesEnum.TopMinigame]: Emoji.MinigameIcon,
[BadgesEnum.SotWTrophy]: Emoji.SOTWTrophy,
[BadgesEnum.Slayer]: Emoji.Slayer,
[BadgesEnum.TopGiveawayer]: Emoji.SantaHat
[BadgesEnum.TopGiveawayer]: Emoji.SantaHat,
[BadgesEnum.Farmer]: Emoji.Farming
};

export const MAX_XP = 200_000_000;
Expand Down
8 changes: 4 additions & 4 deletions src/lib/data/creatables/shadesOfMorton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ export const shadesOfMortonCreatables: Createable[] = [
name: 'Steel coffin',
inputItems: new Bank({
'Steel locks': 1,
'Bronze coffin': 1
'Broken coffin': 1
}),
outputItems: new Bank({ 'Steel coffin': 1 })
},
{
name: 'Black coffin',
inputItems: new Bank({
'Black locks': 1,
'Steel coffin': 1
'Broken coffin': 1
}),
outputItems: new Bank({ 'Black coffin': 1 })
},
{
name: 'Silver coffin',
inputItems: new Bank({
'Silver locks': 1,
'Black coffin': 1
'Broken coffin': 1
}),
outputItems: new Bank({ 'Silver coffin': 1 })
},
{
name: 'Gold coffin',
inputItems: new Bank({
'Gold locks': 1,
'Silver coffin': 1
'Broken coffin': 1
}),
outputItems: new Bank({ 'Gold coffin': 1 })
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/rolesTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ LIMIT 2;`
for (const { id, desc } of res.flat()) {
results.push({
userID: id,
roleID: '894194027363205150',
roleID: Roles.TopFarmer,
reason: desc,
badge: BadgesEnum.Slayer
badge: BadgesEnum.Farmer
});
}
return results;
Expand Down
17 changes: 15 additions & 2 deletions src/mahoji/commands/minigames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import {
contractTiers,
mahoganyHomesBuildCommand,
mahoganyHomesBuyCommand,
mahoganyHomesBuyables
mahoganyHomesBuyables,
mahoganyHomesPointsCommand
} from '../lib/abstracted_commands/mahoganyHomesCommand';
import {
nightmareZoneShopCommand,
Expand Down Expand Up @@ -612,6 +613,11 @@ export const minigamesCommand: OSBMahojiCommand = {
max_value: 1000
}
]
},
{
name: 'points',
type: ApplicationCommandOptionType.Subcommand,
description: 'Mahogany Homes point balance.'
}
]
},
Expand Down Expand Up @@ -1073,7 +1079,11 @@ export const minigamesCommand: OSBMahojiCommand = {
buy?: { name: string };
points?: {};
};
mahogany_homes?: { start?: { tier?: number }; buy?: { name: string; quantity?: number } };
mahogany_homes?: {
start?: { tier?: number };
buy?: { name: string; quantity?: number };
points?: {};
};
tears_of_guthix?: { start?: {} };
pyramid_plunder?: { start?: {} };
rogues_den?: { start?: {} };
Expand Down Expand Up @@ -1279,6 +1289,9 @@ export const minigamesCommand: OSBMahojiCommand = {
if (options.mahogany_homes.start) {
return mahoganyHomesBuildCommand(user, channelID, options.mahogany_homes.start.tier);
}
if (options.mahogany_homes.points) {
return mahoganyHomesPointsCommand(user);
}
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/mahoji/lib/abstracted_commands/mahoganyHomesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ export async function mahoganyHomesBuyCommand(user: MUser, input = '', quantity?
return `Successfully purchased ${loot} for ${cost * quantity} Carpenter Points.`;
}

export async function mahoganyHomesPointsCommand(user: MUser) {
const balance = user.user.carpenter_points;
return `You have **${balance.toLocaleString()}** Mahogany Homes points.`;
}

export async function mahoganyHomesBuildCommand(user: MUser, channelID: string, tier?: number): CommandResponse {
if (user.minionIsBusy) return `${user.minionName} is currently busy.`;

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/snapshots/banksnapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22917,7 +22917,7 @@ exports[`OSB Creatables 1`] = `
"inputItems": Bank {
"bank": {
"25445": 1,
"25459": 1,
"25457": 1,
},
"frozen": false,
},
Expand All @@ -22934,7 +22934,7 @@ exports[`OSB Creatables 1`] = `
"inputItems": Bank {
"bank": {
"25448": 1,
"25461": 1,
"25457": 1,
},
"frozen": false,
},
Expand All @@ -22951,7 +22951,7 @@ exports[`OSB Creatables 1`] = `
"inputItems": Bank {
"bank": {
"25451": 1,
"25463": 1,
"25457": 1,
},
"frozen": false,
},
Expand All @@ -22968,7 +22968,7 @@ exports[`OSB Creatables 1`] = `
"inputItems": Bank {
"bank": {
"25454": 1,
"25465": 1,
"25457": 1,
},
"frozen": false,
},
Expand Down

0 comments on commit 862815d

Please sign in to comment.