-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
127 lines (118 loc) · 3.03 KB
/
main.py
File metadata and controls
127 lines (118 loc) · 3.03 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import file_operations
import random
import os
from faker import Faker
RUNIC_DICTIONARY = {
'а': 'а͠',
'б': 'б̋',
'в': 'в͒͠',
'г': 'г͒͠',
'д': 'д̋',
'е': 'е͠',
'ё': 'ё͒͠',
'ж': 'ж͒',
'з': 'з̋̋͠',
'и': 'и',
'й': 'й͒͠',
'к': 'к̋̋',
'л': 'л̋͠',
'м': 'м͒͠',
'н': 'н͒',
'о': 'о̋',
'п': 'п̋͠',
'р': 'р̋͠',
'с': 'с͒',
'т': 'т͒',
'у': 'у͒͠',
'ф': 'ф̋̋͠',
'х': 'х͒͠',
'ц': 'ц̋',
'ч': 'ч̋͠',
'ш': 'ш͒͠',
'щ': 'щ̋',
'ъ': 'ъ̋͠',
'ы': 'ы̋͠',
'ь': 'ь̋',
'э': 'э͒͠͠',
'ю': 'ю̋͠',
'я': 'я̋',
'А': 'А͠',
'Б': 'Б̋',
'В': 'В͒͠',
'Г': 'Г͒͠',
'Д': 'Д̋',
'Е': 'Е',
'Ё': 'Ё͒͠',
'Ж': 'Ж͒',
'З': 'З̋̋͠',
'И': 'И',
'Й': 'Й͒͠',
'К': 'К̋̋',
'Л': 'Л̋͠',
'М': 'М͒͠',
'Н': 'Н͒',
'О': 'О̋',
'П': 'П̋͠',
'Р': 'Р̋͠',
'С': 'С͒',
'Т': 'Т͒',
'У': 'У͒͠',
'Ф': 'Ф̋̋͠',
'Х': 'Х͒͠',
'Ц': 'Ц̋',
'Ч': 'Ч̋͠',
'Ш': 'Ш͒͠',
'Щ': 'Щ̋',
'Ъ': 'Ъ̋͠',
'Ы': 'Ы̋͠',
'Ь': 'Ь̋',
'Э': 'Э͒͠͠',
'Ю': 'Ю̋͠',
'Я': 'Я̋',
' ': ' '
}
SKILLS = [
"Стремительный прыжок",
"Электрический выстрел",
"Ледяной удар",
"Стремительный удар",
"Кислотный взгляд",
"Тайный побег",
"Ледяной выстрел",
"Огненный заряд"
]
def main():
if not os.path.exists("output/RPGCharacters"):
os.makedirs("output/RPGCharacters")
fake = Faker("ru_RU")
runic_skills = []
for skill in SKILLS:
new_skill = ""
for sign in skill:
for rune in RUNIC_DICTIONARY:
if sign == rune:
new_skill = new_skill + RUNIC_DICTIONARY[rune]
runic_skills.append(new_skill)
for count in range(10):
random_runic_skill = random.sample(runic_skills, 3)
context = {
"first_name": fake.first_name(),
"last_name": fake.last_name(),
"job": fake.job(),
"town": fake.city(),
"strength": random.randint(3, 18),
"agility": random.randint(3, 18),
"endurance": random.randint(3, 18),
"intelligence": random.randint(3, 18),
"luck": random.randint(3, 18),
"skill_1": random_runic_skill[0],
"skill_2": random_runic_skill[1],
"skill_3": random_runic_skill[2]
}
file_operations.render_template(
"src/template.svg",
"output/RPGCharacters/Character № {}.svg".format(count),
context
)
if __name__ == '__main__':
main()