-
Notifications
You must be signed in to change notification settings - Fork 0
/
info_generator.py
executable file
·66 lines (58 loc) · 2.42 KB
/
info_generator.py
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
# -*- coding: utf-8 -*-
from load_json import Import
import os
import random
character_file = Import()
ancestry_path = ".%sancestries%s%s%s%s_%s.json"
profession_path = ".%sprofessions%s%s.json"
profession_type = random.choice([
"academic", "common", "criminal", "martial", "religious", "wilderness"])
personality_path = ".%spersonality_traits%s%s_personality_traits.json"
interesting_things_path = ".%sinteresting_things%stable_%s.json"
wealth_path = ".%swealth%swealth.json"
class Generator():
@classmethod
def ancestry_info(self, char_ancestry, char_info):
if os.name == "posix":
attributes_list = character_file.json_file(ancestry_path % (
"/", "/", char_ancestry, "/", char_ancestry, char_info))
else:
attributes_list = character_file.json_file(ancestry_path % (
"\\", "\\", char_ancestry, "\\", char_ancestry, char_info))
return(attributes_list)
@classmethod
def profession_info(self):
if os.name == "posix":
profession_list = character_file.json_file(profession_path % (
"/", "/", profession_type))
else:
profession_list = character_file.json_file(profession_path % (
"\\", "\\", profession_type))
return(profession_list)
@classmethod
def personality_info(self, personality_type):
if os.name == "posix":
personality_list = character_file.json_file(personality_path % (
"/", "/", personality_type))
else:
personality_list = character_file.json_file(personality_path % (
"\\", "\\", personality_type))
return(personality_list)
@classmethod
def interesting_things_info(self, roll):
if os.name == "posix":
interesting_things_list = character_file.json_file(
interesting_things_path % ("/", "/", roll))
else:
interesting_things_list = character_file.json_file(
interesting_things_path % ("\\", "\\", roll))
return(interesting_things_list)
@classmethod
def wealth_info(self):
if os.name == "posix":
wealth_list = character_file.json_file(
wealth_path % ("/", "/"))
else:
wealth_list = character_file.json_file(
wealth_path % ("\\", "\\"))
return(wealth_list)