Advertisement
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 Created as a use case for learning Python.
- # 12/08/2017 Updated to Python 3.6. Corrected potential crash conditions and added more comments.
- # Abbreviations:
- # essence = permanent Essence rating
- # will = permanent Willpower rating
- # comp = Compassion rating
- # conv = Conviction rating
- # temp = Temperance rating
- # valor = Valor rating
- # essencePeri = 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
- essencePeri = (essence * 7) + will + comp + conv + temp + valor
- print("\nPersonal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePeri))
- 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)
- essencePeri = (essence * 4) + (will * 2) + (max(virtues) * 4)
- print("\nPersonal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePeri))
- def calcEssenceSidereal(essence, will, comp, conv, temp, valor):
- # Calculates and prints mote pools for Sidereal Exalted.
- essencePers = (essence * 2) + will
- essencePeri = (essence * 6) + will + comp + conv + temp + valor
- print("\nPersonal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePeri))
- def calcEssenceTerrestrial(essence, will, comp, conv, temp, valor):
- #Calculates and prints mote pools for Terrestrial Exalted.
- #Create an array 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 array in order to get the second-largest.
- virtues.remove(max(virtues))
- #After removing the largest virtue rating from the array, assign the new largest rating to 'second_largest'.
- second_largest = max(virtues)
- essencePers = essence + will
- essencePeri = (essence * 4) + will + (largest + second_largest)
- print("\nPersonal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePeri))
- def calcEssenceAlchemical(essence, will, comp, conv, temp, valor):
- #Calculates and prints mote pools for Terrestrial Exalted.
- virtues = [comp, conv, temp, valor]
- essencePers = (essence * 3) + will
- essencePeri = (essence * 5) + (will * 3) + (max(virtues) * 2)
- print("\nPersonal Essence Pool: {} motes".format(essencePers))
- print("Peripheral Essence Pool: {} motes".format(essencePeri))
- # User selects Exalt type
- while True:
- print("\n1. Solar/Abyssal/Infernal")
- print("2. Lunar")
- print("3. Sidereal")
- print("4. Terrestrial")
- print("5. Alchemical\n")
- exaltType = input("Select Exalt Type: ")
- # User input is converted to an integer if possible.
- try:
- exaltType = int(exaltType)
- except:
- print("\nInvalid choice. Try again.\n")
- 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("\nInvalid choice. Try again.\n")
- # 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 rating 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 rating 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 rating 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 rating 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 rating 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 rating 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement