-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.py
More file actions
131 lines (94 loc) · 5.03 KB
/
Copy pathevents.py
File metadata and controls
131 lines (94 loc) · 5.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
128
129
130
131
import time
import random
from menu import *
from ascii import ascii_money
def death_check(player_name : str, potato_status : bool, death_status : bool, num_deaths : int):
"""Checks if the player can and wants to continue playing after a death; if not, ends the game.
Parameters:
player_name = "name", the name the player chose
potato_status = "potato_in_bag", if the player has or not the potato
death_status = "is_dead", if the player has died or not
num_deaths = "deaths", the number of times the player has died
"""
name = player_name
potato_in_bag = potato_status
is_dead = death_status
deaths = num_deaths
if is_dead: # Checks if the player is actually dead as they should be.
print_med("\n- Parece-me que sua aventura chegou ao fim...")
if potato_in_bag: # Checks if they have the potato.
if deaths == 1: # And if they have already died before.
print_med("- Mas vejo que já conseguiu....")
print_med("- ...ela.")
print_med("- Pois bem, se você quiser, eu posso te levar de volta ao início. Ela ainda tem um destino para cumprir.")
print_fast("- O que me diz? Pense bem.")
else: # Or if it's their first death.
print_fast("- Já sabe:")
print("\n] sim | não [")
reset = input(">>> ").lower()
if reset == "sim":
# Changes their death status, making them alive.
is_dead = False
time.sleep(1)
if deaths == 0: # Extra dialogue if it's their first death.
print_med("\n- Excelente... realmente excelente...")
print_med(f"- Boa sorte, {name}, vai precisar.")
print_long("\n> Um clarão te cega e você desmaia, caíndo no que parece ser o infinito.")
# Exits the function and "is_dead" gets assigned to the variable is_dead in the main function.
return is_dead
else: # Finishes the program.
time.sleep(1)
print_med("\n- Que assim seja.\n")
quit()
else: # Checks if the player doesn't have the potato and finishes the program.
print_med("- Infelizmente você não cumpriu o requisito para continuar a aventura...")
print_long("- Mas não é nada pessoal, entenda; é a burocracia, a papelada, essas coisas, sabe?")
print_med(f"\n- Bom, acho que isso é um adeus, {name}.\n")
quit()
def death_messages(num : int, num_deaths : int, endings_seen : list):
"""Prints out a death message and the total number of endings found.
Parameters:
num = the specific ending's id number
num_deaths = "deaths", the number of times the player has died
endings_seen = a list made out of the id numbers of the deaths the player has seen
"""
index = num
deaths = num_deaths
total_deaths_seen = len(endings_seen)
# Updates the amount of times they've died.
deaths += 1
messages = ["\n# Sua aventura chega ao fim pelas piranhas famintas... #",
"\n# Sua aventura chega ao fim pelo peso da magia da consciência... #",
"\n# Sua aventura chega ao fim pelo ataque de um ser desconhecido... #",
"\n# Sua aventura chega ao fim por uma batata jogada comicamente rápida na sua cara... #",
"\n# Sua aventura chega ao fim pela mordida na perna feita por um bicho que mirava a batata... #",
"\n# Sua aventura chega ao fim pela gula causada pela batata... #",
"\n# Sua aventura chega ao fim por um goblin que apenas queria comer algumas batatas... #",
"\n# Sua aventura chega ao fim pelo ataque inesperado do espantalho... #"
]
print_med(messages[index])
print_long(f"Final: {index + 1} de {len(messages)} | Vistos: {total_deaths_seen}")
# Exits the function and "deaths" gets assigned to the variable deaths in the main function.
return deaths
def money_get(current_money : int):
"""Prints out an ascii image of a dollar bill, then says how much money the player has.
"""
money = current_money
ascii_money()
print_long("\n{ 1 DINHEIRO ADQUIRIDO }\n")
print_long(f"> Você agora tem {money} dinheiro!")
def input_error(player_name : str):
"""Randomly picks an error message to print if the user inputs something that they shouldn't.
"""
name = player_name
errors = ["> Isso não é válido agora,",
"> Acho que não dá para fazer isso agora,",
"> Não tem como você fazer isso,",
"> Não é a hora para isso,",
"> Outra coisa talvez funcione,",
"> Não, isso não tá certo,",
"> Procure outra escolha,",
"> No momento, essa não é uma escolha boa,",
"> Tente escolher uma opção plausível,"
]
print_fast(f"{random.choice(errors)} {name}.")