miron / NeonCore

Terminal based Cyberpunk Tabletop RPG with Nostr as database and openAI API compatible commands
3 stars 1 forks source link

add selector for languages #74

Open miron opened 1 year ago

miron commented 1 year ago

languages for cultural region are not rolled but selected, add selector i.e.:

# iterate over the tuple and print each element with its index
for i, lang in enumerate(languages):
    print(i + 1, lang)

# get the player's choice as an integer
choice = int(input("Enter a number: "))

# check if the choice is valid
if 1 <= choice <= len(languages):
    # get the selected string from the tuple
    selected = languages[choice - 1]
    # print it
    print("You chose:", selected)
else:
    # print an error message
    print("Invalid choice.")

Can be done inside the Lifepath class with new method, and initialized in Character with the rolled cultural region as key. Player gets also 4 points for the language skill in the beginning for the chosen language.