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

[Ellipsis] Improve Readability in Turael's Trials Activity #5894

Closed
wants to merge 10 commits into from
Closed
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
93 changes: 0 additions & 93 deletions prisma/robochimp.prisma

This file was deleted.

25 changes: 0 additions & 25 deletions src/lib/data/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,17 +1257,6 @@ export const allCollectionLogs: ICollection = {
Camdozaal: {
items: camdozaalCL
},
"Champion's Challenge": {
alias: ['champion', 'champion scrolls', 'champion scroll', 'scroll', 'scrolls'],
items: championsChallengeCL,
isActivity: true,
fmtProg: mgProg('champions_challenge')
},
'Chaos Druids': {
allItems: Monsters.ElderChaosDruid.allItems,
kcActivity: Monsters.ElderChaosDruid.name,
items: chaosDruisCL
},
'Chompy Birds': {
alias: ['chompy', 'bgc', 'big chompy hunting', 'ch', 'chompyhunting', 'chompyhunt'],
kcActivity: 'BigChompyBirdHunting',
Expand Down Expand Up @@ -1397,20 +1386,6 @@ export const allCollectionLogs: ICollection = {
alias: ['pet', 'pets'],
items: allPetsCL
},
Camdozaal: {
items: camdozaalCL
},
'Chompy Birds': {
alias: ['chompy', 'bgc', 'big chompy hunting', 'ch', 'chompyhunting', 'chompyhunt'],
kcActivity: 'BigChompyBirdHunting',
items: chompyBirdsCL
},
'Creature Creation': {
items: creatureCreationCL
},
'Fossil Island Notes': {
items: fossilIslandNotesCL
},
'Random Events': {
alias: ['random'],
items: randomEventsCL
Expand Down
2 changes: 1 addition & 1 deletion src/lib/invention/groups/Metals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const Metals: DisassemblySourceGroup = {
{ item: i('Rune dart tip'), lvl: 9 },
{ item: i('Dragon dart tip'), lvl: 80, flags: new Set(['orikalkum']) }
],
parts: { strong: 10, plated: 10, heavy: 10, metallic: 70 }
parts: { strong: 10, plated: 20, heavy: 10, metallic: 60 }
};
30 changes: 20 additions & 10 deletions src/tasks/minions/agilityActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,16 @@ export const agilityTask: MinionTask = {
const [hasArdyElite] = await userhasDiaryTier(user, ArdougneDiary.elite);
const hasDiaryBonus = hasArdyElite && course.name === 'Ardougne Rooftop Course';

const messages: string[] = [];
const petMessages: string[] = [];

const portentResult = await chargePortentIfHasCharges({
user,
portentID: PortentID.GracefulPortent,
charges: minutes
});

const { successfulLaps, loot, xpReceived, lapsFailed, portentXP } = calculateAgilityResult({
const { successfulLaps, loot, xpReceived, lapsFailed, portentXP, boosts } = calculateAgilityResult({
quantity,
course,
agilityLevel: currentLevel,
Expand Down Expand Up @@ -218,7 +221,7 @@ export const agilityTask: MinionTask = {
if (currentLapCount < monkey.lapsRequired) break;
if (!user.hasEquippedOrInBank(monkey.id)) {
loot.add(monkey.id);
str += `\nYou received the ${monkey.name} monkey backpack!`;
messages.push(`You received the ${monkey.name} monkey backpack!`);
}
}
}
Expand All @@ -235,8 +238,9 @@ export const agilityTask: MinionTask = {
for (let i = 0; i < minutes; i++) {
if (roll(scruffyDroprate)) {
loot.add('Scruffy');
str +=
"\n\n<:scruffy:749945071146762301> As you jump off the rooftop in Varrock, a stray dog covered in flies approaches you. You decide to adopt the dog, and name him 'Scruffy'.";
petMessages.push(
"<:scruffy:749945071146762301> As you jump off the rooftop in Varrock, a stray dog covered in flies approaches you. You decide to adopt the dog, and name him 'Scruffy'."
);
break;
}
}
Expand All @@ -246,8 +250,9 @@ export const agilityTask: MinionTask = {
for (let i = 0; i < minutes; i++) {
if (roll(1600)) {
loot.add('Harry');
str +=
'\n\n<:harry:749945071104819292> As you jump across a rooftop, you notice a monkey perched on the roof - which has escaped from the Ardougne Zoo! You decide to adopt the monkey, and call him Harry.';
petMessages.push(
'<:harry:749945071104819292> As you jump across a rooftop, you notice a monkey perched on the roof - which has escaped from the Ardougne Zoo! You decide to adopt the monkey, and call him Harry.'
);
break;
}
}
Expand All @@ -258,8 +263,9 @@ export const agilityTask: MinionTask = {
for (let i = 0; i < minutes; i++) {
if (roll(dropRate)) {
loot.add('Skipper');
str +=
"\n\n<:skipper:755853421801766912> As you finish the Penguin agility course, a lone penguin asks if you'd like to hire it as your accountant, you accept.";
petMessages.push(
"<:skipper:755853421801766912> As you finish the Penguin agility course, a lone penguin asks if you'd like to hire it as your accountant, you accept."
);
break;
}
}
Expand All @@ -276,15 +282,15 @@ export const agilityTask: MinionTask = {
shardQty *= 2;
}
loot.add(item.id, shardQty);
str += `\nYou received **${shardQty}x ${item.name}**`;
messages.push(`You received **${shardQty}x ${item.name}**`);
}
}
}
// Roll for pet
const { petDropRate } = skillingPetDropRate(user, SkillsEnum.Agility, course.petChance);
if (roll(petDropRate / quantity)) {
loot.add('Giant squirrel');
str += "\nYou have a funny feeling you're being followed...";
petMessages.push("You have a funny feeling you're being followed...");
}

await transactItems({
Expand All @@ -293,6 +299,10 @@ export const agilityTask: MinionTask = {
itemsToAdd: loot
});

for (const msgs of [boosts, messages, petMessages]) {
if (msgs.length > 0) str += `\n\n${msgs.join('\n')}`;
}

handleTripFinish(user, channelID, str, undefined, data, loot);
}
};
21 changes: 15 additions & 6 deletions src/tasks/minions/bso/turaelsTrialsActivity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Bank } from 'oldschooljs';

import { TuraelsTrialsMethod } from '../../../lib/bso/turaelsTrials';
import { incrementMinigameScore } from '../../../lib/settings/settings';
import { XPBank } from '../../../lib/structures/Banks';
import { TuraelsTrialsOptions } from '../../../lib/types/minions';
import { handleTripFinish } from '../../../lib/util/handleTripFinish';
Expand All @@ -11,10 +12,10 @@ export function calculateTuraelsTrialsResult({ quantity, method }: { quantity: n
const xpBank = new XPBank().add('slayer', 36_009 * quantity);

if (method === 'melee') {
const meleeXP = Math.floor((89_000 * quantity) / 3);
xpBank.add('attack', meleeXP);
xpBank.add('strength', meleeXP);
xpBank.add('defence', meleeXP);
const meleeXP = Math.floor((89_000 * quantity) / 3);
xpBank.add('attack', meleeXP);
xpBank.add('strength', meleeXP);
xpBank.add('defence', meleeXP);
} else if (method === 'range') {
xpBank.add('ranged', 89_000 * quantity);
} else {
Expand All @@ -37,6 +38,10 @@ export const turaelsTrialsTask: MinionTask = {

const result = calculateTuraelsTrialsResult({ quantity, method });

const { newScore } = await incrementMinigameScore(userID, 'turaels_trials', quantity);

const name = 'Turaels Trials';

await user.addItemsToBank({ items: result.loot, collectionLog: true });
await trackClientBankStats('turaels_trials_loot_bank', result.loot);
await userStatsBankUpdate(user.id, 'turaels_trials_loot_bank', result.loot);
Expand All @@ -51,10 +56,14 @@ export const turaelsTrialsTask: MinionTask = {
return handleTripFinish(
user,
channelID,
`${user}, your minion finished slaying ${quantity}x superiors in Turaels Trials. ${xpResults.join(', ')}`,
`${user}, your minion finished slaying ${quantity}x superiors in ${name}.
**Your ${name} KC is now ${newScore}**.

${xpResults.join(', ')}
`,
undefined,
data,
result.loot
);
}
};
};
6 changes: 0 additions & 6 deletions tests/unit/snapshots/clsnapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,16 @@ BSO Birthday 2022 (4)
BSO Birthday 2023 (5)
Callisto and Artio (6)
Camdozaal (10)
Camdozaal (10)
Capes (189)
Castle Wars (44)
Celestara (4)
Cerberus (7)
Chamber's of Xeric (23)
Champion's Challenge (11)
Champion's Challenge (11)
Chaos Druids (3)
Chaos Druids (3)
Chaos Elemental (3)
Chaos Fanatic (3)
Chompy Birds (19)
Chompy Birds (19)
Christmas 2021 (27)
Christmas 2022 (15)
Christmas 2023 (15)
Expand All @@ -46,7 +42,6 @@ Crafting (175)
Crazy archaeologist (3)
Creatables (750)
Creature Creation (7)
Creature Creation (7)
Custom Pets (47)
Custom Pets (Discontinued) (20)
Cyclopes (8)
Expand Down Expand Up @@ -76,7 +71,6 @@ Fist of Guthix (6)
Fletching (145)
Forestry (23)
Fossil Island Notes (10)
Fossil Island Notes (10)
General Graardor (8)
Giant Mole (3)
Giants' Foundry (9)
Expand Down