Skip to content

Commit

Permalink
Add death chance of atleast 4
Browse files Browse the repository at this point in the history
  • Loading branch information
TastyPumPum committed Oct 13, 2023
1 parent 6a0a8cd commit b7de1a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/util/calcWildyPkChance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ export async function calcWildyPKChance(
): Promise<[number, boolean, string]> {
// Chance per minute, Difficulty from 1 to 10, and factor a million difference, High peak 5x as likley encounter, Medium peak 1x, Low peak 5x as unlikley
const peakInfluence = peakFactor.find(_peaktier => _peaktier.peakTier === peak?.peakTier)?.factor ?? 1;
let pkChance = (1 / (7_000_000 / (Math.pow(monster.pkActivityRating ?? 1, 6) * peakInfluence))) * 100;
let pkChance;

Check failure on line 53 in src/lib/util/calcWildyPkChance.ts

View workflow job for this annotation

GitHub Actions / ESLint

[eslint] reported by reviewdog 🐶 Variable 'pkChance' should be initialized on declaration. Raw Output: {"ruleId":"@typescript-eslint/init-declarations","severity":2,"message":"Variable 'pkChance' should be initialized on declaration.","line":53,"column":6,"nodeType":"VariableDeclarator","messageId":"initialized","endLine":53,"endColumn":14}
if (monster.canBePked && monster.pkActivityRating && monster.pkActivityRating >= 4) {
pkChance = (1 / (7_000_000 / (Math.pow(monster.pkActivityRating, 6) * peakInfluence))) * 100;
} else {

Check failure on line 56 in src/lib/util/calcWildyPkChance.ts

View workflow job for this annotation

GitHub Actions / ESLint

[eslint] reported by reviewdog 🐶 Delete `··` Raw Output: {"ruleId":"prettier/prettier","severity":2,"message":"Delete `··`","line":56,"column":2,"nodeType":null,"messageId":"delete","endLine":56,"endColumn":4,"fix":{"range":[2138,2140],"text":""}}
pkChance = (1 / (7_000_000 / (Math.pow(4, 6) * peakInfluence))) * 100;
}

Check failure on line 58 in src/lib/util/calcWildyPkChance.ts

View workflow job for this annotation

GitHub Actions / ESLint

[eslint] reported by reviewdog 🐶 Delete `··` Raw Output: {"ruleId":"prettier/prettier","severity":2,"message":"Delete `··`","line":58,"column":2,"nodeType":null,"messageId":"delete","endLine":58,"endColumn":4,"fix":{"range":[2223,2225],"text":""}}
let chanceString = `**PK Chance:** ${pkChance.toFixed(2)}% per min (${peak.peakTier} peak time)`;

const evasionReduction = await getWildEvasionPercent(user);
Expand Down

0 comments on commit b7de1a8

Please sign in to comment.