37 lines
847 B
Python
37 lines
847 B
Python
import random
|
|
|
|
|
|
def get_age(chartype):
|
|
ages = {
|
|
"human": {
|
|
'youth': (14, 18),
|
|
'young': (19, 38),
|
|
'midage': (39, 58),
|
|
'veteran': (59, 72)
|
|
},
|
|
"humanoid": {
|
|
'youth': (8, 19),
|
|
'young': (20, 48),
|
|
'midage': (49, 68),
|
|
'veteran': (69, 82)
|
|
},
|
|
"mutant": {
|
|
'youth': (8, 13),
|
|
'young': (14, 28),
|
|
'midage': (29, 48),
|
|
'veteran': (49, 62)
|
|
},
|
|
"cyborg": {
|
|
'youth': (14, 18),
|
|
'young': (19, 38),
|
|
'midage': (39, 58),
|
|
'veteran': (59, 72)
|
|
}
|
|
}
|
|
|
|
char_range = ages[chartype]
|
|
age_group = random.choice(list(char_range.keys()))
|
|
age_range = char_range[age_group]
|
|
|
|
return random.choice(age_range)
|