Skip to content

Commit

Permalink
add CritFishRelentless reroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Egner authored and Jacob Egner committed Feb 19, 2024
1 parent 082f4da commit d0b7794
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export enum Ability {
DoubleBalanced = "DoubleBalanced", // reroll 2 dice; basicially single reroll ability from two different sources
Ceaseless = "Ceaseless", // reroll all 1s
Relentless = "Relentless", // reroll any of your choosing; we choose to reroll all fails; we never fish for crits
CritFishRelentless = "CritFishRelentless", // reroll all non-crits, aka crit fishing
CeaselessPlusBalanced = "BothCeaselessAndBalanced", // ex: Auto Bolt Rifle (Ceaseless) and Devastator Doctrine (Balanced)
Tedious = "MostCommonFail", // "can re-roll any or all of your attack dice results of one result (e.g. results of 2)"
RerollMostCommonFail = "MostCommonFail", // "can re-roll any or all of your attack dice results of one result (e.g. results of 2)"

// fail/norm/crit manipulation
Rending = "Rending", // if have crit, promote one normal hit to crit
Expand All @@ -36,8 +37,9 @@ export const rerollAbilities = [
Ability.Balanced,
Ability.DoubleBalanced,
Ability.Relentless,
Ability.CritFishRelentless,
Ability.CeaselessPlusBalanced,
Ability.Tedious,
Ability.RerollMostCommonFail,
];

export const mutuallyExclusiveFightAbilities = [
Expand Down
6 changes: 3 additions & 3 deletions src/CalcEngineCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export function calcFinalDiceProb(
else if (reroll === Ability.DoubleBalanced) {
prob = calcFinalDiceProbBalanced(dieProbs, crits, norms, fails, 2);
}
else if (reroll === Ability.Tedious) {
prob = calcFinalDiceProbTedious(dieProbs, crits, norms, fails);
else if (reroll === Ability.RerollMostCommonFail) {
prob = calcFinalDiceProbRerollMostCommonFail(dieProbs, crits, norms, fails);
}
else {
prob = calcMultiRollProb(dieProbs, crits, norms, fails);
Expand Down Expand Up @@ -266,7 +266,7 @@ export function calcFinalDiceProbBalanced(
return prob;
}

export function calcFinalDiceProbTedious(
export function calcFinalDiceProbRerollMostCommonFail(
dieProbs: DieProbs,
finalCrits: number,
finalNorms: number,
Expand Down
6 changes: 6 additions & 0 deletions src/DieProbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export default class DieProbs {
normHitProb *= rerollMultiplier;
failHitProb = 1 - critHitProb - normHitProb;
}
else if (reroll === Ability.CritFishRelentless) {
const noncritProb = 1 - critHitProb;
failHitProb *= noncritProb;
normHitProb *= noncritProb;
critHitProb *= 2 - critHitProb;
}

return new DieProbs(critHitProb, normHitProb, failHitProb);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default class Note {

export const Reroll = new Note(
`Reroll`,
`Ceaseless rerolls 1s. Balanced rerolls 1 die. Relentless rerolls whatever you want.`
`Ceaseless rerolls 1s. Balanced rerolls 1 die. Relentless rerolls fails.`
+ ` CritFishRelentless rerolls non-crits.`
+ ` DoubleBalanced rerolls 2 dice.`
+ ` BothCeaselessAndBalanced rerolls 1s and then rerolls 1 die that hasn't already been rerolled.`
+ ` MostCommonFail rerolls most common fail result (ex: reroll 2s).`
Expand Down

0 comments on commit d0b7794

Please sign in to comment.