Skip to content
Permalink
Browse files

fix odds in sample size

  • Loading branch information...
Manuel-777 committed Mar 15, 2019
1 parent 5bc4fa1 commit 113637427222793e0b767acc539d8439a003ecd0
Showing with 9 additions and 9 deletions.
  1. +9 −9 window_background/background.js
@@ -7,7 +7,7 @@ global
windowOverlay,
get_rank_index,
playerDataDefault,
hypergeometric,
hypergeometricRange,
onLabelOutLogInfo,
onLabelGreToClient,
eventsToFormat,
@@ -1644,37 +1644,37 @@ function forceDeckUpdate(removeUsed = true) {
else if (c.type.includes("Planeswalker", 0)) typePla += card.quantity;
}
card.chance = Math.round(
hypergeometric(1, cardsleft, odds_sample_size, card.quantity) * 100
hypergeometricRange(1, Math.min(odds_sample_size, card.quantity), cardsleft, odds_sample_size, card.quantity) * 100
);
});

currentMatch.playerCards.chanceCre =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeCre) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeCre), cardsleft, odds_sample_size, typeCre) * 1000
) / 10;
currentMatch.playerCards.chanceIns =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeIns) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeIns), cardsleft, odds_sample_size, typeIns) * 1000
) / 10;
currentMatch.playerCards.chanceSor =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeSor) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeSor), cardsleft, odds_sample_size, typeSor) * 1000
) / 10;
currentMatch.playerCards.chancePla =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typePla) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typePla), cardsleft, odds_sample_size, typePla) * 1000
) / 10;
currentMatch.playerCards.chanceArt =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeArt) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeArt), cardsleft, odds_sample_size, typeArt) * 1000
) / 10;
currentMatch.playerCards.chanceEnc =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeEnc) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeEnc), cardsleft, odds_sample_size, typeEnc) * 1000
) / 10;
currentMatch.playerCards.chanceLan =
Math.round(
hypergeometric(1, cardsleft, odds_sample_size, typeLan) * 1000
hypergeometricRange(1, Math.min(odds_sample_size, typeLan), cardsleft, odds_sample_size, typeLan) * 1000
) / 10;
currentMatch.playerCards.deckSize = decksize;
currentMatch.playerCards.cardsLeft = cardsleft;

0 comments on commit 1136374

Please sign in to comment.
You can’t perform that action at this time.