-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.py
More file actions
177 lines (135 loc) · 6.06 KB
/
text.py
File metadata and controls
177 lines (135 loc) · 6.06 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import time
import sys
class Interface:
def __init__(self):
self.name = "Interface"
@staticmethod
def separate_logic():
print("═════════════════════════════════════════════════")
@staticmethod
def separate_elem():
print("=================================================")
@staticmethod
def logo():
return """
______ _______ _ _
| ___ \ | ___(_) | | | |
| |_/ / ___ ___ ___ | |_ _ __ _| |__ | |_
| ___ \/ _ \/ __/ __| | _| | |/ _` | '_ \| __|
| |_/ / (_) \__ \__ \ | | | | (_| | | | | |_
\____/ \___/|___/___/ \_| |_|\__, |_| |_|\__|
__/ |
|___/
/ )) |\ ) ).
c--. (\ ( `. / ) (\ ( `. ). ( (
| | )) ) ) ( ( `.`. ) ) ( ( ) )
| | ( ( / _..----.._ ) | ( ( _..----.._ ( (
,-. | |---) V.'-------.. `-. )-/.-' ..------ `--) \._
| /===========| | ( | ) ( ``-.`\/'.-'' ( ) ``-._
| | / / / / / | |---------------------> <-------------------------_>=-
| \===========| | ..-'./\.`-.. _,,-'
`-' | |-------._------''_.-'----`-._``------_.-----'
| | ``----'' ``----''
| |
c--` """
class TextDialogue:
def __init__(self):
self.name = "dialogue system"
@staticmethod
def text_speed(texte, delai=0.01):
for i in texte:
sys.stdout.write(i)
sys.stdout.flush()
time.sleep(delai)
print()
@staticmethod
def title_speed(texte, delai=0.002):
for i in texte:
sys.stdout.write(i)
sys.stdout.flush()
time.sleep(delai)
print()
@staticmethod
def intro():
return "Les brumes du monde ancien s’épaississent... \nDans les ténèbres de la forêt d’Obsydor, des créatures oubliées s’éveillent...\nVous, humble aventurier, vous avez entendu l’appel.\nVotre voyage commence ici."
@staticmethod
def player_name():
return input("Quel est votre nom?: \n")
@staticmethod
def game_menu():
return input("Quelle action souhaitez-vous faire ?: \n'a' pour avancer dans la forêt, \n's' pour voir les statistiques du personnage \n'q' pour quitter la fôret d'Obsydor: \n")
@staticmethod
def thanks_for_playing():
print("Merci d'avoir joué ! A bientôt!")
@staticmethod
def need_to_choice():
print("Vous devez choisir entre 'a', 's' ou 'q' !")
@staticmethod
def power(player_name):
return f"Je sens un grand pouvoir émaner de vous, {player_name}....\nBienvenue dans l'univers de BossFight !"
@staticmethod
def go_wood():
return "Vous avancez dans la forêt..."
class TextFight:
def __init__(self):
self.name = "fighting system"
@staticmethod
def new_enemy_appear():
print("Un nouvel ennemi apparait !")
@staticmethod
def e_killed(player_name, monster_name):
print(f"Bien joué {player_name}, vous avez tué le {monster_name} ! \nVous avez gagné un niveau 🆙!")
@staticmethod
def lvl_up(player_lvl, player_health):
print(f"Vous êtes maintenant niveau ⬆️ {player_lvl} et vous avez {player_health} ❤️ points de vie.")
@staticmethod
def take_damage(monster_name, monster_damage, player_health):
print(f"Outch ! Le {monster_name} inflige ⚔️ {monster_damage} dégâts.")
print(f"Vous avez maintenant ❤️ {player_health} points de vie.")
@staticmethod
def trap_damages(player_health_lose, player_health):
print(f"Vous êtes tombé sur un piège ! vous perdez {player_health_lose} points de vie.")
print(f"Vous avez maintenant {player_health} ❤️ points de vie.")
@staticmethod
def walk_damage(player_health_lose,player_health):
print(f"Vous vous blessez en marchant ! Vous perdez {player_health_lose} point de vie.")
print(f"Vous avez maintenant {player_health} ❤️ points de vie.")
@staticmethod
def p_dead():
print("Vous êtes mort au combat.💀")
class TextItem:
def __init__(self):
self.name = "item system"
@staticmethod
def obj():
return ["Explose", "Potion de soin", "Bombe"]
@staticmethod
def go_search():
return "Vous fouillez les alentours..."
@staticmethod
def healing_pot(item, player_health):
print(f"Vous avez trouvé une {item.name}.")
print(f"Vous avez maintenant ❤️ {player_health} point(s) de vie.")
@staticmethod
def healing_neck(item, player_health):
print(f"Vous avez trouvé un {item.name}.")
print(f"Vous avez maintenant ❤️ {player_health} point(s) de vie.")
@staticmethod
def find_bomber():
print("Vous avez trouvé une 💣Bombe de fumée 💣. Elle vous servira à fuir un combat.")
@staticmethod
def explose_bomber(player_health_lose):
print(f"Outch ! La bombe de fumée que vous aviez dans votre inventaire à 💥💥explosée 💥💥 ! Elle vous inflige {player_health_lose} points de dégâts")
@staticmethod
def shit():
print("Vous pensiez avoir trouvé quelque chose... ce n'était qu'un tas de purin.")
@staticmethod
def find_item(item):
print(f"Vous avez trouvé l'objet {item.name}.")
print("Vous l'ajoutez à votre inventaire")
class TextForest:
def __init__(self):
self.name = "forest system"
@staticmethod
def calm():
return "Tout semble calme... pour l'instant."