Skip to content

Commit

Permalink
Fix boosts
Browse files Browse the repository at this point in the history
  • Loading branch information
TastyPumPum committed Oct 14, 2023
1 parent adcc444 commit 4b7da53
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions src/mahoji/lib/abstracted_commands/minionKill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ export async function minionKillCommand(
}
}

applyDragonBoost();

function applyBlackMaskBoost() {
const hasBlackMask = monster?.canBePked
? wildyGear.hasEquipped('Black mask')
Expand All @@ -268,49 +266,48 @@ export async function minionKillCommand(
}

function calculateSalveAmuletBoost() {
if (isUndead) {
const hasSalveAmulet = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet')
: user.hasEquippedOrInBank('Salve amulet');
const hasSalveAmuletI = monster?.canBePked
let salveBoost = false;
let salveEnhanced = false;
const style = attackStyles[0];
if (style === 'ranged' || style === 'magic') {
salveBoost = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet(i)')
: user.hasEquippedOrInBank('Salve amulet(i)');
const hasSalveAmuletE = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet(e)')
: user.hasEquippedOrInBank('Salve amulet(e)');
const hasSalveAmuletEI = monster?.canBePked
: user.hasEquippedOrInBank('Salve amulet (i)');
salveEnhanced = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet(ei)')
: user.hasEquippedOrInBank('Salve amulet(ei)');

if (attackStyles.includes(SkillsEnum.Ranged) || attackStyles.includes(SkillsEnum.Magic)) {
if (hasSalveAmuletI) {
salveAmuletBoost = hasSalveAmuletEI ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
hasSalveAmuletEI ? '(ei)' : '(i)'
} on non-melee task`;
}
} else if (hasSalveAmulet) {
salveAmuletBoost = hasSalveAmuletE ? 20 : oneSixthBoost;
: user.hasEquippedOrInBank('Salve amulet (ei)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
hasSalveAmuletE ? ' (e)' : ''
salveEnhanced ? '(ei)' : '(i)'
} on non-melee task`;
}
} else {
salveBoost = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet')
: user.hasEquippedOrInBank('Salve amulet');
salveEnhanced = monster?.canBePked
? wildyGear.hasEquipped('Salve amulet (e)')
: user.hasEquippedOrInBank('Salve amulet (e)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
salveEnhanced ? ' (e)' : ''
} on melee task`;
}
}
}

if (isDragon) {
if (isOnTask) {
applyDragonBoost();
} else if (monster.name.toLowerCase() !== 'vorkath') {
applyDragonBoost();
}
if (isDragon && monster.name.toLowerCase() !== 'vorkath') {
applyDragonBoost();
}

if (isOnTask) {
applyBlackMaskBoost();
}

calculateSalveAmuletBoost();
if (isUndead) {
calculateSalveAmuletBoost();
}

// Only choose greater boost:
if (salveAmuletBoost || blackMaskBoost) {
Expand Down

0 comments on commit 4b7da53

Please sign in to comment.