Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Essence Calculator for Exalted 2.5 role-playing game.
- # Calculates and prints mote pools for various Exalt types after entering relevant stats.
- # 09/01/2013 v1.0 Created as a use case for learning Python.
- # 12/08/2017 v1.1 Updated to Python 3.6. Corrected potential crash conditions and added more comments.
- # 02/06/2018 v1.2 Added function to print pool results instead of doing it within calc functions. Also, formatting.
- # Abbreviations:
- # essence = permanent Essence rating
- # will = permanent Willpower rating
- # comp = Compassion rating
- # conv = Conviction rating
- # temp = Temperance rating
- # valor = Valor rating
- # essencePrph = Peripheral Essence pool
- # essencePers = Personal Essence pool
- # Essence calculation functions by Exalt type.
- def calcEssenceSolar(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Solar/Abyssal/Infernal Exalted.
- essencePers = (essence * 3) + will
- essencePrph = (essence * 7) + will + comp + conv + temp + valor
- printPools(essencePers, essencePrph)
- def calcEssenceLunar(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Lunar Exalted.
- virtues = [comp, conv, temp, valor]
- essencePers = essence + (will * 2)
- essencePrph = (essence * 4) + (will * 2) + (max(virtues) * 4)
- printPools(essencePers, essencePrph)
- def calcEssenceSidereal(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Sidereal Exalted.
- essencePers = (essence * 2) + will
- essencePrph = (essence * 6) + will + comp + conv + temp + valor
- printPools(essencePers, essencePrph)
- def calcEssenceTerrestrial(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Terrestrial Exalted.
- # Create a list called virtues, populated with the values of the virtue ratings.
- virtues = [comp, conv, temp, valor]
- # Assign the largest virtue rating to 'largest'.
- largest = max(virtues)
- # Remove the largest virtue rating from the list in order to get the second-largest.
- virtues.remove(max(virtues))
- # After removing the largest virtue rating from the list, assign the new largest rating to 'second_largest'.
- second_largest = max(virtues)
- essencePers = essence + will
- essencePrph = (essence * 4) + will + (largest + second_largest)
- printPools(essencePers, essencePrph)
- def calcEssenceAlchemical(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Alchemical Exalted.
- virtues = [comp, conv, temp, valor]
- essencePers = (essence * 3) + will
- essencePrph = (essence * 5) + (will * 3) + (max(virtues) * 2)
- printPools(essencePers, essencePrph)
- def printPools(essencePers, essencePrph):
- # Prints pool amounts from values passed by calc functions.
- print()
- print("-" * 20)
- print("Personal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePrph))
- print("-" * 20)
- print()
- # User selects Exalt type
- while True:
- print()
- print("-" * 20)
- print("1. Solar/Abyssal/Infernal")
- print("2. Lunar")
- print("3. Sidereal")
- print("4. Terrestrial")
- print("5. Alchemical")
- print("-" * 20)
- print()
- exaltType = input("Select Exalt Type: ")
- # User input is converted to an integer if possible.
- try:
- exaltType = int(exaltType)
- except:
- print()
- print("-" * 20)
- print("Please enter a number between 1 and 5.")
- print("-" * 20)
- print()
- continue
- # If the selection is an integer, check to see if it's in the range of 1-5.
- if exaltType > 0 and exaltType <= 5:
- print()
- break
- else:
- print()
- print("-" * 20)
- print("Please enter a number between 1 and 5.")
- print("-" * 20)
- print()
- # User enters Virtue, Essence, and Willpower scores. Scores are converted to integers, if possible,
- # then checked to see if they're in the correct range.
- # Virtue scores
- # Compassion
- while True:
- virtueComp = input("Enter Compassion Rating (1-5): ")
- try:
- virtueComp = int(virtueComp)
- except:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- continue
- if virtueComp in range(1, 6):
- break
- else:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- # Conviction
- while True:
- virtueConv = input("Enter Conviction Rating (1-5): ")
- try:
- virtueConv = int(virtueConv)
- except:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- continue
- if virtueConv in range(1, 6):
- break
- else:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- # Temperance
- while True:
- virtueTemp = input("Enter Temperance Rating (1-5): ")
- try:
- virtueTemp = int(virtueTemp)
- except:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- continue
- if virtueTemp in range(1, 6):
- break
- else:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- # Valor
- while True:
- virtueValor = input("Enter Valor Rating (1-5): ")
- try:
- virtueValor = int(virtueValor)
- except:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- continue
- if virtueValor in range(1, 6):
- break
- else:
- print("Invalid choice. Please choose a number between 1 and 5.\n")
- # Essence score
- while True:
- essence = input("Enter Essence Rating (2-10): ")
- try:
- essence = int(essence)
- except:
- print("Invalid choice. Please choose a number between 2 and 10.\n")
- continue
- if essence in range(2, 11):
- break
- else:
- print("Invalid choice. Please choose a number between 2 and 10.\n")
- # Willpower score
- while True:
- willpower = input("Enter Willpower Rating (1-10): ")
- try:
- willpower = int(willpower)
- except:
- print("Invalid choice. Please choose a number between 1 and 10.\n")
- continue
- if willpower in range(1, 11):
- break
- else:
- print("Invalid choice. Please choose a number between 1 and 10.\n")
- # Essence calculation functions are called based on Exalt type, using scores provided by user,
- # and mote pool totals are displayed.
- if exaltType == 1:
- calcEssenceSolar(essence, willpower, virtueComp, virtueConv, virtueTemp, virtueValor)
- elif exaltType == 2:
- calcEssenceLunar(essence, willpower, virtueComp, virtueConv, virtueTemp, virtueValor)
- elif exaltType == 3:
- calcEssenceSidereal(essence, willpower, virtueComp, virtueConv, virtueTemp, virtueValor)
- elif exaltType == 4:
- calcEssenceTerrestrial(essence, willpower, virtueComp, virtueConv, virtueTemp, virtueValor)
- elif exaltType == 5:
- calcEssenceAlchemical(essence, willpower, virtueComp, virtueConv, virtueTemp, virtueValor)
Add Comment
Please, Sign In to add comment