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

Enigmar boss - New Elder clue dropping boss! #5874

Open
wants to merge 6 commits into
base: bso
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions src/lib/MUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@

for (const setup of Object.values(this.gear)) {
for (const equipped of Object.values(setup)) {
if (equipped?.item) {

Check warning on line 426 in src/lib/MUser.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 426 in src/lib/MUser.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
bank.add(equipped.item, equipped.quantity);
}
}
Expand Down Expand Up @@ -645,10 +645,10 @@
}
const scales = Math.ceil((10 / 3) * dart[1]);
const rawBlowpipeData = this.blowpipe;
if (!this.allItemsOwned.has('Toxic blowpipe') || !rawBlowpipeData) {

Check warning on line 648 in src/lib/MUser.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 648 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected object value in conditional. The condition is always true
throw new UserError("You don't have a Toxic blowpipe.");
}
if (!rawBlowpipeData.dartID || !rawBlowpipeData.dartQuantity) {

Check warning on line 651 in src/lib/MUser.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 651 in src/lib/MUser.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
throw new UserError('You have no darts in your Toxic blowpipe.');
}
if (rawBlowpipeData.dartQuantity < dart[1]) {
Expand All @@ -658,7 +658,7 @@
)}s in your Toxic blowpipe, you need ${dart[1]}, but you have only ${rawBlowpipeData.dartQuantity}.`
);
}
if (!rawBlowpipeData.scales || rawBlowpipeData.scales < scales) {

Check warning on line 661 in src/lib/MUser.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 661 in src/lib/MUser.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
throw new UserError(
`You don't have enough Zulrah's scales in your Toxic blowpipe, you need ${scales} but you have only ${rawBlowpipeData.scales}.`
);
Expand Down Expand Up @@ -799,7 +799,7 @@

private buildPaintedItems(): Map<number, number> {
const rawPaintedItems = this.user.painted_items_tuple;
if (!rawPaintedItems) return new Map();

Check warning on line 802 in src/lib/MUser.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 802 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return new Map(rawPaintedItems as [number, number][]);
}

Expand All @@ -810,7 +810,7 @@

async getGodFavour(): Promise<GodFavourBank> {
let { god_favour_bank: currentFavour } = await this.fetchStats({ god_favour_bank: true });
if (!currentFavour) {

Check warning on line 813 in src/lib/MUser.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 813 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return {
Zamorak: 0,
Armadyl: 0,
Expand Down Expand Up @@ -851,11 +851,6 @@
};
}

ownedMaterials() {
const materialsOwnedBank = new MaterialBank(this.user.materials_owned as IMaterialBank);
return materialsOwnedBank;
}

async repairBrokenItems() {
await repairBrokenItemsFromUser(this);
await this.sync();
Expand All @@ -872,7 +867,7 @@
);
const track = mysteriousTrailTracks.find(i => i.id === trackID)!;
const step = track.steps[currentStepID - 1];
if (!step) {

Check warning on line 870 in src/lib/MUser.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 870 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected object value in conditional. The condition is always true
throw new Error(`No step for ${currentStepID} ${this.id}`);
}
return {
Expand Down Expand Up @@ -938,13 +933,13 @@
return resetBackground();
}
if (background.id === 1) return;
if (background.storeBitField && this.user.store_bitfield.includes(background.storeBitField)) {

Check warning on line 936 in src/lib/MUser.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 936 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return;
}
if (background.perkTierNeeded && this.perkTier() >= background.perkTierNeeded) {

Check warning on line 939 in src/lib/MUser.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 939 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return;
}
if (background.bitfield && this.bitfield.includes(background.bitfield)) {

Check warning on line 942 in src/lib/MUser.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 942 in src/lib/MUser.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected value in conditional. A boolean expression is required
return;
}
if (!background.storeBitField && !background.perkTierNeeded && !background.bitfield && !background.owners) {
Expand Down
44 changes: 44 additions & 0 deletions src/lib/customItems/customItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12468,3 +12468,47 @@ setCustomItem(
},
100_000
);

setCustomItem(73_200, 'Quantum transmuter', 'Coal', {
customItemData: {
cantDropFromMysteryBoxes: true,
isSuperUntradeable: true
}
});

setCustomItem(
73_201,
'Enigmatic orb',
'Coal',
{
customItemData: {
cantDropFromMysteryBoxes: true
},
highalch: 25_000_000
},
30_000_000
);

setCustomItem(
73_202,
"Mini 'mar",
'Herbi',
{
customItemData: {
cantDropFromMysteryBoxes: true
}
},
1_000_000
);

setCustomItem(
73_203,
'Enigma tokens',
'Coal',
{
customItemData: {
cantDropFromMysteryBoxes: true
}
},
10_000
);
7 changes: 7 additions & 0 deletions src/lib/data/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import {
dukeSucellusCL,
dungeoneeringCL,
emergedZukInfernoCL,
enigmarCL,
expertCapesCL,
fightCavesCL,
fishingContestCL,
Expand Down Expand Up @@ -691,6 +692,12 @@ export const allCollectionLogs: ICollection = {
items: venatrixCL,
fmtProg: kcProg(BSOMonsters.Venatrix.id)
},
Enigmar: {
alias: ['enigmar', 'enigma'],
allItems: BSOMonsters.Enigmar.table.allItems,
items: enigmarCL,
fmtProg: kcProg(BSOMonsters.Enigmar.id)
},
"Chamber's of Xeric": {
alias: ChambersOfXeric.aliases,
kcActivity: {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/data/CollectionsExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,8 @@ export const customPetsCL = resolveItems([
'Noom',
'Baby venatrix',
'Mini akumu',
'Octo'
'Octo',
"Mini 'mar"
]);

export const discontinuedCustomPetsCL = resolveItems([
Expand Down Expand Up @@ -2610,6 +2611,8 @@ export const queenBlackDragonCL = resolveItems([
export const akumuCL = resolveItems(['Mini akumu', 'Nightmarish ashes', 'Cursed onyx', 'Demon statuette']);
export const venatrixCL = resolveItems(['Baby venatrix', 'Venatrix eggs', 'Venatrix webbing', 'Spiders leg bottom']);

export const enigmarCL = resolveItems(['Enigmatic orb', "Mini 'mar"]);

export const customBossesDropsThatCantBeDroppedInMBs = [
...kingGoldemarCL,
...abyssalDragonCL,
Expand Down
52 changes: 52 additions & 0 deletions src/lib/data/creatables/bsoItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,58 @@ export const BsoCreateables: Createable[] = [
name: 'Clue scroll (elder)',
inputItems: new Bank().add('Elder scroll piece', 3),
outputItems: new Bank().add('Clue scroll (elder)')
},
{
name: 'Enigma tokens (Master clues)',
inputItems: new Bank().add('Clue scroll (master)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 8).freeze(),
materialCost: new MaterialBank().add('treasured', 400)
},
{
name: 'Enigma tokens (Elite clues)',
inputItems: new Bank().add('Clue scroll (elite)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 5).freeze(),
materialCost: new MaterialBank().add('treasured', 250)
},
{
name: 'Enigma tokens (Hard clues)',
inputItems: new Bank().add('Clue scroll (hard)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 3).freeze(),
materialCost: new MaterialBank().add('treasured', 150)
},
{
name: 'Enigma tokens (Medium clues)',
inputItems: new Bank().add('Clue scroll (medium)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 2).freeze(),
materialCost: new MaterialBank().add('treasured', 100)
},
{
name: 'Enigma tokens (Easy clues)',
inputItems: new Bank().add('Clue scroll (easy)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 1).freeze(),
materialCost: new MaterialBank().add('treasured', 50)
},
{
name: 'Enigma tokens (Beginner clues)',
inputItems: new Bank().add('Clue scroll (beginner)', 2).freeze(),
outputItems: new Bank().add('Enigma tokens', 1).freeze(),
materialCost: new MaterialBank().add('treasured', 50)
},
{
name: 'Enigma tokens (Grandmaster clues)',
inputItems: new Bank().add('Clue scroll (grandmaster)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 50).freeze()
},
{
name: 'Enigma tokens (Elder clues)',
inputItems: new Bank().add('Clue scroll (elder)', 1).freeze(),
outputItems: new Bank().add('Enigma tokens', 150).freeze()
},
{
name: 'Quantum transmuter',
inputItems: new Bank().add('Enigmatic orb').freeze(),
outputItems: new Bank().add('Quantum transmuter').freeze(),
materialCost: new MaterialBank().add('magic', 500).add('third-age', 10).add('organic', 1000)
}
];

Expand Down
9 changes: 9 additions & 0 deletions src/lib/data/creatablesTable.txt
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,15 @@
| Offhand spidergore rapier | 1x Offhand drygore rapier, 1x Spiders leg bottom | 1x Offhand spidergore rapier | 0 |
| Lumina (Materials) | 30x Elder rune | 1x Lumina | 0 |
| Clue scroll (elder) | 3x Elder scroll piece | 1x Clue scroll (elder) | 0 |
| Enigma tokens (Master clues) | 1x Clue scroll (master) | 8x Enigma token | 0 |
| Enigma tokens (Elite clues) | 1x Clue scroll (elite) | 5x Enigma token | 0 |
| Enigma tokens (Hard clues) | 1x Clue scroll (hard) | 3x Enigma token | 0 |
| Enigma tokens (Medium clues) | 1x Clue scroll (medium) | 2x Enigma token | 0 |
| Enigma tokens (Easy clues) | 1x Clue scroll (easy) | 1x Enigma token | 0 |
| Enigma tokens (Beginner clues) | 2x Clue scroll (beginner) | 1x Enigma token | 0 |
| Enigma tokens (Grandmaster clues) | 1x Clue scroll (grandmaster) | 50x Enigma token | 0 |
| Enigma tokens (Elder clues) | 1x Clue scroll (elder) | 150x Enigma token | 0 |
| Quantum transmuter | 1x Enigmatic orb | 1x Quantum transmuter | 0 |
| Lumina (Elder logs) | 30x Elder rune, 5x Elder logs | 1x Lumina | 0 |
| Lumina (Redwood logs) | 30x Elder rune, 10x Redwood logs | 1x Lumina | 0 |
| Lumina (Magic logs) | 30x Magic logs, 30x Elder rune | 1x Lumina | 0 |
Expand Down
2 changes: 2 additions & 0 deletions src/lib/data/itemAliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,5 @@ setItemAlias(25_922, 'Antique lamp (hard ca)');
setItemAlias(25_923, 'Antique lamp (elite ca)');
setItemAlias(25_924, 'Antique lamp (master ca)');
setItemAlias(25_925, 'Antique lamp (grandmaster ca)');

setItemAlias(73_203, 'Enigma token');
49 changes: 37 additions & 12 deletions src/lib/invention/inventions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ export async function transactMaterialsFromUser({
addToResearchedMaterialsBank?: boolean;
addToGlobalInventionCostBank?: boolean;
}) {
const materialsOwnedBank = user.ownedMaterials();
const materialsOwnedBank = user.materialsOwned();
if (add) materialsOwnedBank.add(add);
if (remove) materialsOwnedBank.remove(remove);

Expand Down Expand Up @@ -627,15 +627,18 @@ type InventionItemBoostResult =
success: false;
};

export function canAffordInventionBoost(user: MUser, inventionID: InventionID, duration: number) {
export function calcInventionCost(
inventionID: InventionID,
duration: number,
noLimit: boolean = false
): { invention: Invention; materialCost: MaterialBank } {
const invention = Inventions.find(i => i.id === inventionID)!;
if (invention.usageCostMultiplier === null) {
throw new Error('Tried to calculate cost of invention that has no cost.');
}
const materialsOwned = user.materialsOwned();
const materialCost = new MaterialBank();
let multiplier = Math.ceil(duration / (Time.Minute * 3));
multiplier = clamp(Math.floor(multiplier * invention.usageCostMultiplier), 1, 1000);
if (!noLimit) multiplier = clamp(Math.floor(multiplier * invention.usageCostMultiplier), 1, 1000);
materialCost.add(invention.materialTypeBank.clone().multiply(multiplier));
for (const [mat, boosts] of materialBoosts) {
if (!materialCost.has(mat)) continue;
Expand All @@ -647,6 +650,17 @@ export function canAffordInventionBoost(user: MUser, inventionID: InventionID, d
}
materialCost.validate();

return { invention, materialCost };
}
export function canAffordInventionBoost(
user: MUser,
inventionID: InventionID,
duration: number,
noLimit: boolean = false
) {
const materialsOwned = user.materialsOwned();
const { invention, materialCost } = calcInventionCost(inventionID, duration, noLimit);

return {
invention,
materialsOwned,
Expand All @@ -655,23 +669,34 @@ export function canAffordInventionBoost(user: MUser, inventionID: InventionID, d
};
}

export function inventionEnabled(user: MUser, inventionID: InventionID) {
const invention = Inventions.find(i => i.id === inventionID)!;
return !(
user.user.disabled_inventions.includes(invention.id) ||
(invention.flags.includes('equipped') && !user.hasEquipped(invention.item.id)) ||
(invention.flags.includes('bank') && !user.hasEquippedOrInBank([invention.item.id]))
);
}

export async function inventionItemBoost({
user,
inventionID,
duration
duration,
noLimit
}: {
user: MUser;
inventionID: InventionID;
duration: number;
noLimit?: boolean;
}): Promise<InventionItemBoostResult> {
const { materialCost, canAfford, invention } = await canAffordInventionBoost(user, inventionID, duration);

const { materialCost, canAfford, invention } = canAffordInventionBoost(
user,
inventionID,
duration,
noLimit ?? false
);
// If it has to be equipped, and isn't, or has to be in bank, and isn't, fail.
if (
user.user.disabled_inventions.includes(invention.id) ||
(invention.flags.includes('equipped') && !user.hasEquipped(invention.item.id)) ||
(invention.flags.includes('bank') && !user.hasEquippedOrInBank([invention.item.id]))
) {
if (!inventionEnabled(user, invention.id) || duration === 0) {
return { success: false };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const Akumu: CustomMonster = {
highestDeathChance: 65
},
minimumFoodHealAmount: 22,
allItems: resolveItems([]),
allItems: [],
minimumGearRequirements: {
melee: {}
},
Expand Down
Loading
Loading