Skip to content

Commit

Permalink
fix a bug with calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowTabitha committed Oct 16, 2024
1 parent 631d601 commit e3c1515
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 53 deletions.
1 change: 0 additions & 1 deletion codes/marioParty4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
70 changes: 18 additions & 52 deletions events/marioParty4_items2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit e3c1515

Please sign in to comment.