Last active
October 1, 2023 03:20
-
-
Save layertwo/9a99b46c5b2214ed9d91ba583ec49715 to your computer and use it in GitHub Desktop.
7 Days To Die party gamestage calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/env/python | |
# startWeight | |
BASE_MULTIPLIER = 1.0 | |
# dimishingReturns | |
PARTY_MULTIPLIER = 0.5 | |
# player gamestage levels | |
PLAYERS = [50, 49, 49, 48, 30] | |
def main() -> None: | |
gamestage = 0 | |
stages = sorted(PLAYERS, reverse=True) | |
for idx, stage in enumerate(stages): | |
if idx == 0: | |
gamestage = stage * BASE_MULTIPLIER | |
else: | |
multiplier = PARTY_MULTIPLIER**idx | |
gamestage += stage * multiplier | |
total_gamestage = sum(PLAYERS) | |
fractional = gamestage / total_gamestage | |
print(f"expected gamestage level: {gamestage}") | |
print(f"total party gamestage: {total_gamestage}") | |
print(f"fractional percentage: {fractional*100:0.2f}%") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment