-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacterGen.py
138 lines (105 loc) · 7.04 KB
/
characterGen.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
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
128
129
130
131
132
133
134
135
136
137
138
import random
profs = tuple
phobias = tuple
hobbies = tuple
cards = tuple
inventory = tuple
specialties = tuple
# reading data from txt files
profsFile = open('proffession.txt', 'r', encoding="utf-8")
profs = profsFile.readlines()
profsFile.close()
for i in range(len(profs)):
profs[i]=profs[i].rstrip('\n')
phobiasFile = open('phobias.txt', 'r', encoding="utf-8")
for i in phobiasFile:
phobias = i.split("$")
phobiasFile.close()
hobbiesFile = open('hobbies.txt', 'r', encoding="utf-8")
for i in hobbiesFile:
hobbies = i.split(",")
hobbiesFile.close()
cardsFile = open('cards.txt', 'r', encoding="utf-8")
cards = cardsFile.readlines()
cardsFile.close()
for i in range(len(cards)):
cards[i] = cards[i].rstrip('\n')
inventoryFile = open('inventory.txt', 'r', encoding="utf-8")
inventory = inventoryFile.readlines()
inventoryFile.close()
for i in range(len(inventory)):
inventory[i] =inventory[i].rstrip('\n')
specialtiesFile = open('specialties.txt', 'r', encoding="utf-8")
specialties = specialtiesFile.readlines()
specialtiesFile.close()
for i in range(len(specialties)):
specialties[i] = specialties[i].rstrip('\n')
#############################
sexes = (':male_sign:', ':female_sign:')
childFree = (':negative_squared_cross_mark: Чайлдфри', ':white_check_mark: Фертилен', ':sweat_drops: Бык-осеменитель')
bodyTypes = ("Не может самостоятельно передвигаться из-за ожирения", "Не хватает сил, чтобы перемещаться самостоятельно", "Хилое", "Худое", "Стройное", "Мускулистое", "Полное", "Жирное", "Геракл", "Афина")
bodyLimbs = ("всё при себе", "нет руки", "нет ноги", "нет рук", "нет ног", "Вуйчич", "нет глаза", "нет уха")
health = ("Здоров", "HIV", "Герпес", "Геморрой", "Наркоман", "Наркоман крайней степени тяжести", "Глухонемой", "Глухой", "Немой", "Маниакальное расстройство", "Паранойя", "Шизофрения", "Астма", "Астма в крайней степени тяжести", "Рак легких", "Фимоз", "Радикулит", "Остеопороз", "Идеально здоров", "Простуда", "Хронический бронхит", "Хронический насморк", "Пневмония", "В целом здоров", "Кариес", "Флюс", "Артрит", "Гипертония", "Гипотония", "Расстройство пищевого поведения")
traits = ("Мерзкий", "Скромный", "Беззрасудный", "Гений", "Маэстро", "Хладнокровный", "Никакущий", "Мечтатель", "Подлый", "Добрый", "Любезный", "Хороший", "Среднестатист", "Человечишка", "Быдло", "Жалкий", "Крутой", "Глупый", "Обаяшка", "Диоген")
def characterCreation(profBool):
if profBool == True:
proffesion = str(random.choice(profs))
profLevel = random.randrange(0, 5)
return f'{proffesion}, умение: {profLevel} из 5'
createdCharacter = ''
sex = random.choice(sexes)
childFreeSex = random.choices(childFree, weights=(10, 75, 5))
childFreeSex = str(childFreeSex[0])
age = int(random.triangular(16, 100, 40))
bCL = random.choices(bodyLimbs, weights=(50, 7, 7, 7, 7, 8, 7, 7), k=1)
bCL = str(bCL[0])
if bCL == bodyLimbs[0]:
bodyCondition = (random.choices(bodyTypes, weights=(1,1,25,25,10,5,25,15,3,3)))
bodyCondition = str(bodyCondition[0])
else:
bodyCondition = (random.choices(bodyTypes, weights=(1,1,25,25,10,5,25,15,3,3)))
bodyCondition = str(bodyCondition[0] + f', :wheelchair: {bCL}')
proffesion = str(random.choice(profs))
profLevel = random.randrange(0, 5)
healthCondition = random.choices(health, weights=(25,1,10,1,5,2,15,15,15,1,6,12,3,8,1,50,2,2,10,5,25,25,1,75,35,35,1,50,50,90), k=1)
healthCondition = str(healthCondition[0])
hobbie = str(random.choice(hobbies))
phobia = random.choices(phobias, weights=(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 50))
phobia = str(phobia[0])
trait = random.choices(traits, weights=(5,5,1,1,3,3,10,5,5,25,25,25,90,11,4,4,1,10,50,1))
trait = str(trait[0])
backpack = str(random.choice(inventory))
specialty = str(random.choice(specialties))
card1 = str(random.choice(cards))
card2 = str(random.choice(cards))
while (card1 == card2): # no duplicate card
card2 = random.choice(cards)
# a tuple with character parameters
createdCharacterPool = [
f'\n:busts_in_silhouette: Пол: {sex} {childFreeSex.lower()}',
f':calendar_spiral: Возраст: {str(age)}',
f':bust_in_silhouette: Тело: {bodyCondition.lower()}',
f':tools: Профессия: {proffesion.lower()}, умение: {str(profLevel)} из 5',
f':anatomical_heart: Здоровье: {healthCondition.lower()}',
f':thought_balloon: Хобби: {hobbie.lower()}',
f':eye: Фобия: {phobia.lower()}',
f':speaking_head: Характер: {trait.lower()}',
f':package: С собой: {backpack.lower()}',
f':bookmark: О себе: {specialty.lower()}\n',
f':flower_playing_cards: №1: {card1.lower()}',
f':flower_playing_cards: №2: {card2.lower()}']
# beautifying changes • emoji
### aging emojis
### if (age >= 50) and (sex == ':male_sign:'):
### createdCharacterPool[0] = f'\n:older_man: Пол: {sex}, {childFreeSex.lower()}'
### elif (age >= 50) and (sex == ':female_sign:'):
### createdCharacterPool[0] = f'\n:older_woman: Пол: {sex}, {childFreeSex.lower()}'
### elif (age < 50) and (sex == ':male_sign:'):
### createdCharacterPool[0] = f'\n:man_raising_hand: Пол: {sex}, {childFreeSex.lower()}'
### elif (age < 50) and (sex == ':female_sign:'):
### createdCharacterPool[0] = f'\n:woman_raising_hand: Пол: {sex}, {childFreeSex.lower()}'
# finishing character creation
for i in createdCharacterPool:
createdCharacter = createdCharacter + i + '\n'
return '\n' + createdCharacter + '\n– ---------------- –– ---------------- –\n\n'
# • сделать отдельную команду для смены профессии