From e3c151517db758419d184136fe43f088ab1c6518 Mon Sep 17 00:00:00 2001 From: Nayla Hanegan Date: Wed, 16 Oct 2024 15:18:32 -0400 Subject: [PATCH] fix a bug with calculations --- codes/marioParty4.py | 1 - events/marioParty4_items2.py | 70 ++++++++++-------------------------- 2 files changed, 18 insertions(+), 53 deletions(-) diff --git a/codes/marioParty4.py b/codes/marioParty4.py index a74e977..16c53d1 100644 --- a/codes/marioParty4.py +++ b/codes/marioParty4.py @@ -464,7 +464,6 @@ def getItemShopOddsFour(miniMushroomEarlyOdds1, miniMushroomEarlyOdds2, miniMush 98640000 98640004 98640008 9864000C 98640010 00000000 - 02139DB2 0000{miniMushroomEarlyOdds1}{megaMushroomEarlyOdds1} 04139DB4 {superMiniMushroomEarlyOdds1}{superMegaMushroomEarlyOdds1}{miniMegaHammerEarlyOdds1}{warpPipeEarlyOdds1} 04139DB8 {swapCardEarlyOdds1}{sparkyStickerEarlyOdds1}{gaddlightEarlyOdds1}{chompCallEarlyOdds1} diff --git a/events/marioParty4_items2.py b/events/marioParty4_items2.py index 6c31d17..68d9152 100644 --- a/events/marioParty4_items2.py +++ b/events/marioParty4_items2.py @@ -1541,32 +1541,15 @@ def calculateWeight(weight, total): lateOdds2Weights = sum(int(weight) for weight in lateOdds2) lateOdds34Weights = sum(int(weight) for weight in lateOdds34) - if int(earlyOdds1Weights) < 101: - earlyOdds1Max = max(zip(earlyOdds1, earlyOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(earlyOdds2Weights) < 101: - earlyOdds2Max = max(zip(earlyOdds2, earlyOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(earlyOdds34Weights) < 101: - earlyOdds34Max = max(zip(earlyOdds34, earlyOdds34), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds1Weights) < 101: - midOdds1Max = max(zip(midOdds1, midOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds2Weights) < 101: - midOdds2Max = max(zip(midOdds2, midOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds34Weights) < 101: - midOdds34Max = max(zip(midOdds34, midOdds34), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds1Weights) < 101: - lateOdds1Max = max(zip(lateOdds1, lateOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds2Weights) < 101: - lateOdds2Max = max(zip(lateOdds2, lateOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds34Weights) < 101: - lateOdds34Max = max(zip(lateOdds34, lateOdds34), key=lambda tuple: int(tuple[1]))[0] + earlyOdds1Max = max(zip(earlyOdds1, earlyOdds1), key=lambda tuple: int(tuple[1]))[0] + earlyOdds2Max = max(zip(earlyOdds2, earlyOdds2), key=lambda tuple: int(tuple[1]))[0] + earlyOdds34Max = max(zip(earlyOdds34, earlyOdds34), key=lambda tuple: int(tuple[1]))[0] + midOdds1Max = max(zip(midOdds1, midOdds1), key=lambda tuple: int(tuple[1]))[0] + midOdds2Max = max(zip(midOdds2, midOdds2), key=lambda tuple: int(tuple[1]))[0] + midOdds34Max = max(zip(midOdds34, midOdds34), key=lambda tuple: int(tuple[1]))[0] + lateOdds1Max = max(zip(lateOdds1, lateOdds1), key=lambda tuple: int(tuple[1]))[0] + lateOdds2Max = max(zip(lateOdds2, lateOdds2), key=lambda tuple: int(tuple[1]))[0] + lateOdds34Max = max(zip(lateOdds34, lateOdds34), key=lambda tuple: int(tuple[1]))[0] # Mini Mushroom if earlyOdds1Max == 'miniMushroomEarlyOdds1': @@ -3720,32 +3703,15 @@ def calculateWeight(weight, total): lateOdds2Weights = sum(int(weight) for weight in lateOdds2) lateOdds34Weights = sum(int(weight) for weight in lateOdds34) - if int(earlyOdds1Weights) < 101: - earlyOdds1Max = max(zip(earlyOdds1, earlyOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(earlyOdds2Weights) < 101: - earlyOdds2Max = max(zip(earlyOdds2, earlyOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(earlyOdds34Weights) < 101: - earlyOdds34Max = max(zip(earlyOdds34, earlyOdds34), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds1Weights) < 101: - midOdds1Max = max(zip(midOdds1, midOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds2Weights) < 101: - midOdds2Max = max(zip(midOdds2, midOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(midOdds34Weights) < 101: - midOdds34Max = max(zip(midOdds34, midOdds34), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds1Weights) < 101: - lateOdds1Max = max(zip(lateOdds1, lateOdds1), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds2Weights) < 101: - lateOdds2Max = max(zip(lateOdds2, lateOdds2), key=lambda tuple: int(tuple[1]))[0] - - if int(lateOdds34Weights) < 101: - lateOdds34Max = max(zip(lateOdds34, lateOdds34), key=lambda tuple: int(tuple[1]))[0] + earlyOdds1Max = max(zip(earlyOdds1, earlyOdds1), key=lambda tuple: int(tuple[1]))[0] + earlyOdds2Max = max(zip(earlyOdds2, earlyOdds2), key=lambda tuple: int(tuple[1]))[0] + earlyOdds34Max = max(zip(earlyOdds34, earlyOdds34), key=lambda tuple: int(tuple[1]))[0] + midOdds1Max = max(zip(midOdds1, midOdds1), key=lambda tuple: int(tuple[1]))[0] + midOdds2Max = max(zip(midOdds2, midOdds2), key=lambda tuple: int(tuple[1]))[0] + midOdds34Max = max(zip(midOdds34, midOdds34), key=lambda tuple: int(tuple[1]))[0] + lateOdds1Max = max(zip(lateOdds1, lateOdds1), key=lambda tuple: int(tuple[1]))[0] + lateOdds2Max = max(zip(lateOdds2, lateOdds2), key=lambda tuple: int(tuple[1]))[0] + lateOdds34Max = max(zip(lateOdds34, lateOdds34), key=lambda tuple: int(tuple[1]))[0] # Mini Mushroom if earlyOdds1Max == 'miniMushroomEarlyOdds1':