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

Scurrius #5731

Merged
merged 7 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"murmurhash": "^2.0.1",
"node-cron": "^3.0.3",
"node-fetch": "^2.6.7",
"oldschooljs": "^2.5.0",
"oldschooljs": "^2.5.1",
"p-queue": "^6.6.2",
"piscina": "^4.3.2",
"random-js": "^2.1.0",
Expand Down
26 changes: 26 additions & 0 deletions src/lib/combat_achievements/easy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { warmGear } from '../data/filterables';
import { SkillsEnum } from '../skilling/types';
import { Requirements } from '../structures/Requirements';
import getOSItem from '../util/getOSItem';
import resolveItems from '../util/resolveItems';
import { isCertainMonsterTrip } from './caUtils';
import { type CombatAchievement } from './combatAchievements';

Expand Down Expand Up @@ -413,5 +414,30 @@ export const easyCombatAchievements: CombatAchievement[] = [
[Monsters.Wyrm.id]: 1
}
})
},
{
id: 34,
name: 'Sit Rat',
type: 'restriction',
monster: 'Scurrius',
desc: 'Finish off Scurrius with a ratbane weapon.',
rng: {
chancePerKill: 1,
hasChance: (data, user) =>
isCertainMonsterTrip(Monsters.Scurrius.id)(data) &&
[resolveItems(['Bone mace', 'Bone staff', 'Bone shortbow'])].some(i => user.hasEquipped(i))
}
},
{
id: 35,
name: 'Scurrius Novice',
type: 'kill_count',
monster: 'Scurrius',
desc: 'Kill Scurrius once.',
requirements: new Requirements().add({
kcRequirement: {
[Monsters.Scurrius.id]: 1
}
})
}
];
34 changes: 34 additions & 0 deletions src/lib/combat_achievements/medium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,5 +491,39 @@ export const mediumCombatAchievements: CombatAchievement[] = [
wintertodt: 10
}
})
},
{
id: 141,
name: 'Scurrius Champion',
type: 'kill_count',
monster: 'Scurrius',
desc: 'Kill Scurrius 10 times.',
requirements: new Requirements().add({
kcRequirement: {
[Monsters.Scurrius.id]: 10
}
})
},
{
id: 142,
name: 'Perfect Scurrius',
type: 'perfection',
monster: 'Scurrius',
desc: 'Kill Scurrius in a private instance without taking damage from the following attacks: Tail Swipe and Falling Bricks. Pray correctly against the following attacks: Flying Fur and Bolts of Electricity.',
rng: {
chancePerKill: 10,
hasChance: isCertainMonsterTrip(Monsters.Scurrius.id)
}
},
{
id: 143,
name: 'Efficient Pest Control',
type: 'mechanical',
monster: 'Scurrius',
desc: "Kill 6 Giant Rats within Scurrius' lair in 3 seconds.",
rng: {
chancePerKill: 10,
hasChance: isCertainMonsterTrip(Monsters.Scurrius.id)
}
}
];
6 changes: 6 additions & 0 deletions src/lib/data/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@
items: scorpiaCL,
fmtProg: kcProg(Monsters.Scorpia)
},
Scurrius: {
alias: Monsters.Scurrius.aliases,
allItems: Monsters.Scurrius.allItems,
items: resolveItems(['Scurry', "Scurrius' spine"]),
fmtProg: kcProg(Monsters.Scurrius)
},
Skotizo: {
alias: Monsters.Skotizo.aliases,
allItems: Monsters.Skotizo.allItems,
Expand Down Expand Up @@ -907,7 +913,7 @@
'Monkey Backpacks': {
alias: ['monkey', 'monkey bps', 'backpacks'],
kcActivity: {
Default: async (_, __, u) => u.lapsScores[6] || 0

Check warning on line 916 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required

Check warning on line 916 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required
},
items: monkeyBackpacksCL,
isActivity: true
Expand Down Expand Up @@ -1080,7 +1086,7 @@
Creatables: {
counts: false,
items: Createables.filter(i => i.noCl !== true)
.map(i => new Bank(i.outputItems).items().map(i => i[0].id))

Check warning on line 1089 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'i' is already declared in the upper scope on line 1089 column 11

Check warning on line 1089 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'i' is already declared in the upper scope on line 1089 column 11
.flat()
},
Leagues: {
Expand Down Expand Up @@ -1146,7 +1152,7 @@
)
.flat(100),
...Object.values(Monsters)
.map(m => (m && m.allItems ? m.allItems : []))

Check warning on line 1155 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected any value in conditional. An explicit comparison or type cast is required

Check warning on line 1155 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected any value in conditional. An explicit comparison or type cast is required

Check warning on line 1155 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected any value in conditional. An explicit comparison or type cast is required

Check warning on line 1155 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected any value in conditional. An explicit comparison or type cast is required
.flat(100)
]);

Expand Down Expand Up @@ -1275,7 +1281,7 @@

// get monsters
for (const monster of effectiveMonsters) {
categories.push(['Monsters', monster.name, monster.aliases ? monster.aliases.join(', ') : '']);

Check warning on line 1284 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected object value in conditional. The condition is always true

Check warning on line 1284 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected object value in conditional. The condition is always true
}
const normalTable = table([['Type', 'name: ', 'Alias'], ...[...categories, ...activities, ...roles]]);
return new AttachmentBuilder(Buffer.from(normalTable), { name: 'possible_logs.txt' });
Expand Down Expand Up @@ -1411,12 +1417,12 @@
let userKC: Record<string, number> | undefined = { Default: 0 };

// Defaults to the activity name
if (attributes.kcActivity) {

Check warning on line 1420 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 1420 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
if (typeof attributes.kcActivity === 'string') {
userKC.Default += (await user.getKCByName(attributes.kcActivity))[1];
} else {
for (const [type, value] of Object.entries(attributes.kcActivity)) {
if (!userKC[type]) userKC[type] = 0;

Check warning on line 1425 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required

Check warning on line 1425 in src/lib/data/Collections.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected number value in conditional. An explicit zero/NaN check is required
if (Array.isArray(value)) {
for (const name of value) {
userKC[type] += (await user.getKCByName(name))[1];
Expand Down
3 changes: 2 additions & 1 deletion src/lib/data/CollectionsExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,8 @@ export const allPetsCL = resolveItems([
'Wisp',
"Lil'viathan",
'Butch',
'Baron'
'Baron',
'Scurry'
]);
export const camdozaalCL = resolveItems([
'Barronite mace',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/data/creatablesTable.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Webweaver bow (u) │ 500,000x Coins, 1x Craw's bow (u), 1x Fangs of venenatis │ 1x Webweaver bow (u) │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Bone mace │ 1x Rune mace, 1x Scurrius' spine │ 1x Bone mace │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Bone shortbow │ 1x Yew shortbow, 1x Scurrius' spine │ 1x Bone shortbow │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Bone staff │ 1,000x Chaos rune, 1x Battlestaff, 1x Scurrius' spine │ 1x Bone staff │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Revert tanzanite fang │ 1x Tanzanite fang │ 20,000x Zulrah's scales │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Revert toxic blowpipe (empty) │ 1x Toxic blowpipe (empty) │ 20,000x Zulrah's scales │ 0 ║
Expand Down
24 changes: 24 additions & 0 deletions src/lib/data/createables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,30 @@ const Createables: Createable[] = [
'Webweaver bow (u) ': 1
})
},
{
name: 'Bone mace',
inputItems: new Bank().add('Rune mace').add("Scurrius' spine"),
outputItems: new Bank().add('Bone mace'),
requiredSkills: {
smithing: 35
}
},
{
name: 'Bone shortbow',
inputItems: new Bank().add('Yew shortbow').add("Scurrius' spine"),
outputItems: new Bank().add('Bone shortbow'),
requiredSkills: {
fletching: 35
}
},
{
name: 'Bone staff',
inputItems: new Bank().add('Battlestaff').add('Chaos rune', 1000).add("Scurrius' spine"),
outputItems: new Bank().add('Bone staff'),
requiredSkills: {
crafting: 35
}
},
...Reverteables,
...crystalTools,
...ornamentKits,
Expand Down
13 changes: 13 additions & 0 deletions src/lib/minions/data/killableMonsters/bosses/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,19 @@ const killableBosses: KillableMonster[] = [
messages.push('You got a Charged ice for killing the Phantom Muspah in under 3 minutes!');
},
healAmountNeeded: 150
},
{
id: Monsters.Scurrius.id,
name: Monsters.Scurrius.name,
aliases: Monsters.Scurrius.aliases,
timeToFinish: Time.Minute * 2,
table: Monsters.Scurrius,
notifyDrops: resolveItems(['Scurry']),
qpRequired: 0,
levelRequirements: {
prayer: 43
},
defaultAttackStyles: [SkillsEnum.Attack]
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/lib/slayer/slayerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { bossTasks } from './tasks/bossTasks';
import { AssignableSlayerTask, SlayerMaster } from './types';

export enum SlayerMasterEnum {

Check warning on line 23 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'SlayerMasterEnum' is already declared in the upper scope on line 23 column 13

Check warning on line 23 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'SlayerMasterEnum' is already declared in the upper scope on line 23 column 13
Reserved,
Turael,
Mazchna,
Expand All @@ -41,10 +41,10 @@
export function determineBoostChoice(params: DetermineBoostParams) {
let boostChoice = 'none';

if (params.method && params.method === 'none') {

Check warning on line 44 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 44 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return boostChoice;
}
if (params.method && params.method === 'chinning') {

Check warning on line 47 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required

Check warning on line 47 in src/lib/slayer/slayerUtil.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
boostChoice = 'chinning';
} else if (params.method && params.method === 'barrage') {
boostChoice = 'barrage';
Expand Down Expand Up @@ -283,7 +283,7 @@
}

const slayerMaster = slayerMasters.find(master => master.id === currentTask.slayer_master_id);
const assignedTask = slayerMaster!.tasks.find(m => m.monster.id === currentTask.monster_id)!;
const assignedTask = slayerMaster?.tasks.find(m => m.monster.id === currentTask.monster_id);

if (!assignedTask || !slayerMaster) {
logError(
Expand Down
3 changes: 2 additions & 1 deletion src/lib/slayer/tasks/turaelTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export const turaelTasks: AssignableSlayerTask[] = [
Monsters.DungeonRat.id,
Monsters.CryptRat.id,
Monsters.ZombieRat.id,
Monsters.BrineRat.id
Monsters.BrineRat.id,
Monsters.Scurrius.id
],
unlocked: true
},
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/commands/sacrifice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ describe('Sacrifice Command', async () => {
expect(result).toEqual(
`${Emoji.Incinerator} **Your Sacrifice Stats** ${Emoji.Incinerator}\n\n` +
`**Current Minion Icon:** ${Emoji.Minion}\n` +
'**Sacrificed Value:** 1,922 GP\n' +
'**Sacrificed Value:** 1,909 GP\n' +
'**Unique Items Sacrificed:** 2 items'
);
});

test('No items provided', async () => {
const result = await user.runCommand(sacrificeCommand, { items: 'aaaa' });
expect(result).toEqual('No items were provided.\nYour current sacrificed value is: 1,922 (1.92k)');
expect(result).toEqual('No items were provided.\nYour current sacrificed value is: 1,909 (1.91k)');
});

test('Successful', async () => {
await user.addItemsToBank({ items: new Bank().add('Trout').add('Coal', 10) });
const result = await user.runCommand(sacrificeCommand, { items: '1 trout, 10 coal' });
expect(result).toEqual(
'You sacrificed 10x Coal, 1x Trout, with a value of 1,922gp (1.92k). Your total amount sacrificed is now: 3,844. '
'You sacrificed 10x Coal, 1x Trout, with a value of 1,909gp (1.91k). Your total amount sacrificed is now: 3,818. '
);
const stats = await user.fetchStats({ sacrificed_bank: true });
expect(user.bank.equals(new Bank())).toBe(true);
expect(new Bank(stats.sacrificed_bank as ItemBank).equals(new Bank().add('Coal', 20).add('Trout', 2))).toBe(
true
);
expect(user.user.sacrificedValue).toEqual(BigInt(3844));
expect(user.user.sacrificedValue).toEqual(BigInt(3818));
const clientSettings = await mahojiClientSettingsFetch({ economyStats_sacrificedBank: true });
expect(
new Bank(clientSettings.economyStats_sacrificedBank as ItemBank).equals(
Expand All @@ -49,15 +49,15 @@ describe('Sacrifice Command', async () => {
await user.addItemsToBank({ items: new Bank().add('Trout').add('Cake') });
const res = await user.runCommand(sacrificeCommand, { items: '1 trout, 1 cake' });
expect(res).toEqual(
'You sacrificed 1x Trout, 1x Cake, with a value of 169gp (169). Your total amount sacrificed is now: 4,013. '
'You sacrificed 1x Trout, 1x Cake, with a value of 156gp (156). Your total amount sacrificed is now: 3,974. '
);
await user.sync();
expect(user.bank.equals(new Bank())).toBe(true);
const stats2 = await user.fetchStats({ sacrificed_bank: true });
expect(
new Bank(stats2.sacrificed_bank as ItemBank).equals(new Bank().add('Coal', 20).add('Trout', 3).add('Cake'))
).toBe(true);
expect(user.user.sacrificedValue).toEqual(BigInt(4013));
expect(user.user.sacrificedValue).toEqual(BigInt(3974));

const clientSettings2 = await mahojiClientSettingsFetch({ economyStats_sacrificedBank: true });
expect(
Expand Down
61 changes: 61 additions & 0 deletions tests/unit/snapshots/banksnapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8656,6 +8656,67 @@ exports[`OSB Creatables 1`] = `
"frozen": false,
},
},
{
"cantHaveItems": undefined,
"inputItems": Bank {
"bank": {
"1432": 1,
"28798": 1,
},
"frozen": false,
},
"name": "Bone mace",
"outputItems": Bank {
"bank": {
"28792": 1,
},
"frozen": false,
},
"requiredSkills": {
"smithing": 35,
},
},
{
"cantHaveItems": undefined,
"inputItems": Bank {
"bank": {
"28798": 1,
"857": 1,
},
"frozen": false,
},
"name": "Bone shortbow",
"outputItems": Bank {
"bank": {
"28794": 1,
},
"frozen": false,
},
"requiredSkills": {
"fletching": 35,
},
},
{
"cantHaveItems": undefined,
"inputItems": Bank {
"bank": {
"1391": 1,
"28798": 1,
"562": 1000,
},
"frozen": false,
},
"name": "Bone staff",
"outputItems": Bank {
"bank": {
"28796": 1,
},
"frozen": false,
},
"requiredSkills": {
"crafting": 35,
},
},
{
"cantHaveItems": undefined,
"inputItems": Bank {
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/snapshots/clsnapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`OSB Collection Log Groups/Categories 1`] = `
Achievement Diary (48)
Aerial Fishing (9)
Alchemical Hydra (11)
All Pets (56)
All Pets (57)
Barbarian Assault (11)
Barrows Chests (25)
Beginner Treasure Trails (16)
Expand All @@ -25,7 +25,7 @@ Chompy Birds (19)
Commander Zilyana (8)
Corporeal Beast (7)
Crazy archaeologist (3)
Creatables (643)
Creatables (646)
Creature Creation (7)
Cyclopes (8)
Dagannoth Kings (10)
Expand Down Expand Up @@ -79,6 +79,7 @@ Rogues' Den (5)
Rooftop Agility (7)
Sarachnis (4)
Scorpia (3)
Scurrius (2)
Shades of Mort'ton (14)
Shared Treasure Trail Rewards (49)
Shayzien Armour (25)
Expand Down Expand Up @@ -1279,6 +1280,8 @@ Saradomin's light
Scarred tablet
Scorpia's offspring
Scribbled note
Scurrius' spine
Scurry
Scythe of vitur (uncharged)
Seed box
Seercull
Expand Down
Loading
Loading