-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
107 lines (93 loc) · 2.61 KB
/
app.py
File metadata and controls
107 lines (93 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Import Modules
import json
import random
import os
clear = lambda: os.system('cls')
# Import JSON Files
fClasses = open('classes.json')
fPersonalities = open('personalities.json')
fProfessions = open('professions.json')
fRaces = open('races.json')
fFeatures = open('features.json')
# Initialize JSON Variables
classes = json.load(fClasses)
personalities = json.load(fPersonalities)
professions = json.load(fProfessions)
races = json.load(fRaces)
features = json.load(fFeatures)
def roll(dice, die):
x = dice * die
print(random.randint(dice,x))
def info():
a = random.choice(['Male','Female','Fluid'])
c = random.choice(['Straight','Bisexual','Gay','Asexual'])
print(a)
print(c)
print(' ')
def randomClass():
c = random.choice(classes)
print('Class: ' + c)
def randomRace():
r = random.choice(races)
print('Race: ' + r)
if r == "Changeling":
s = r
while s == "Changeling":
s = random.choice(races)
print('Presentation: ' + s)
def randomPersonality():
a = random.choice(personalities["Positive"])
b = random.choice(personalities["Neutral"])
c = random.choice(personalities["Negative"])
print(' ')
print('Positive: ' + a)
print('Neutral: ' + b)
print('Negative: ' + c)
print(' ')
def randomProfession():
# credit: https://www.reddit.com/r/DnDBehindTheScreen/comments/bjkejj/i_made_a_list_of_every_profession_i_could_think/
p = random.choice(professions)
print('Profession: ' + p)
def randomFeature():
f = random.choice(features)
print('Feature: ' + f)
def randomNPC():
r = random.randint(1,100)
info()
randomRace()
randomPersonality()
randomFeature()
randomFeature()
print(' ')
if r <= 10: randomClass()
else: randomProfession()
# =============================================================
while True:
clear()
print("==============================")
print("1. NPC ")
print("2. Class ")
print("3. Race ")
print("4. Personality ")
print("5. Profession ")
print("6. Feature ")
print("==============================")
num = input("Input: ")
print("\n")
match num:
case "1":
randomNPC()
case "2":
randomClass()
case "3":
randomRace()
case "4":
randomPersonality()
case "5":
randomProfession()
case "6":
randomFeature()
case _:
print()
print("\n")
input("Press Enter to continue...")