repl.it
@mattcooke/

1300's peasant simulator

Python

Basically Dark Souls but with Feudalism

fork
loading
Files
  • main.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#1300's simulator!
from termcolor import colored
from os import system, name
import random

global bruh
bruh = 'alive'

family = random.randint(3,5)
chance = 0

endings = []

def cprint(text, color):
  print(colored(text, color))

def familydie():
  global family
  if family == 0:
    cprint('Oh no! All of your family members have died. You are now sad and very alone.','cyan')

def clear():
  if name == 'nt':
    system('cls')
  else:
    system('clear')

def intro():
  cprint("Welcome to the 1300's! You are a peasant who works on a farm. If you die, you lose. You cannot win. Make choices to survive as long as possible. \nPress enter to begin.",'cyan')

def familysick():
  cprint('A family member has caught the plague. Do do you wish to treat them? You can hire a doctor [1], pray [2], or leave them to die [3]','cyan')
  choice = input()
  clear()
  if choice == '1':
    cprint('You have hired a doctor from the local apothecary.','cyan')
    hmmm = random.randint(1,4)
    global family
    global chance
    if hmmm == 1:
      cprint('Miraculously, your family member was saved! Press enter to continue.','cyan')
      input()
      clear()
    else:
      cprint('Unfortunately, your family member died. Press enter to continue.','cyan')
      family += -1
      chance += 1
      familydie()
      input()
      clear()
  elif choice == '2':
    cprint('You have decided to pray to God.','cyan')
    global holiness
    hmm = random.randint(1,6)
    if hmm == 1:
      cprint('Miraculously, your family member was saved! Press enter to continue.','cyan')  
      input()
      clear()
    else:   
      cprint("Unfortunately, you weren't holy enough and your family member died. Press enter to continue.",'cyan')
      chance += 1
      family -= 1
      familydie()
      input()
      clear()

  else:
    cprint('You have left them to die. Press enter to continue','cyan')
    family -= 1
    chance += 1
    familydie()
    input()
    clear()

def selfsick():
  global endings
  global chance
  if chance <= 0:
    chance = 1
  hmm = random.randint(1,chance + 1)
  if hmm != 1:
    options = ['hire a doctor.','hire a doctor.','pray.','pray.','leave you to die.']
    h = random.randint(0,4)
    if family > 0:
      cprint('Oh no! You have the plague. Your family decided to ' + options[h],'cyan')
    else:
      h = 4
      cprint('Oh no! You have the plague but you have no family to care for you.','cyan')
      if not 'Forever alone' in endings:
        endings.append('Forever alone')
    
    if h == 4:
      cprint('Oh dear. You have died. Press enter to continue.','cyan')
      input()
      clear()
      if family > 0 and not 'Left to die' in endings:
        endings.append('Left to die')
      return('dead')
    else:
      hm = random.randint(1,4)
      if hm == 1:
        cprint('Miraculously, you lived! Press enter to continue.','cyan')
        input()
        clear()
      else:
        cprint('Oh dear. Your family could not save you and you have died. Press enter to continue.','cyan')
        input()
        clear()
        if not 'Failed cure' in endings:
          endings.append('Failed cure')
        return('dead')
  else:
    cprint('Nothing happened today. Press enter to continue.','cyan')
    input()
    clear()

def burglary():
  global endings
  global family
  cprint('Oh no! Your house is being burgled. Do you fight [1] or give up [2]? ','cyan')
  choice = input()
  if choice == '1':
    h = random.randint(0,2)
    if h == 0:
      cprint('You decided to fight but lost. The burglar ran away with some of your money. Press enter to continue.','cyan')
      input()
      clear()
    elif h == 1:
      cprint('You decided to fight and were killed in the process. Press enter to continue.','cyan')
      if not 'Home invasion' in endings:
        endings.append('Home invasion')
      input()
      clear()
      return('dead')
    else:
      cprint('You decided to fight and won! Press enter to continue.','cyan')
      input()
      clear()
  else:
    h = random.randint(0,2)
    if h == 0:
      cprint('You dedcided to give up and surrender, but you were killed anyways. Press enter to continue.','cyan')
      if not 'Surrender' in endings:
        endings.append('Surrender')
      input()
      clear()
      return('dead')
    else:
      cprint('You decided to surrender and the burglar took a lot of your stuff. Press enter to continue.','cyan')
      input()
      clear()

def flagellants():
  global chance
  cprint('The flagellants have come to town! They beat themselves mercilessly to appease God in the town square. Press enter to continue.','cyan')
  chance += 1
  input()
  clear()

def cleaners():
  global chance
  global endings
  h = random.randint(1,3)
  if h != 1:
    cprint("The Baron's workers have come to clean the streets of dead bodies and human waste. Yay! Press enter to continue.",'cyan')
    input()
    clear()
    chance -= 1
  else:
    cprint("The Baron's workers came to clean up dead bodies and waste, and while you were sleeping they took you by mistake. Press enter to continue.",'cyan')
    input()
    clear()
    if not 'Lazy workers' in endings:
      endings.append('Lazy workers')
    return('dead')


def herbs():
  global chance
  cprint('You decided to go out and buy some herbs to protect you from the plague. At the apothecary, you see a some bottles with leaves and grab a few.','cyan')
  m= random.randint(0,3)
  if m == 0:
    cprint('Unfortunately, you cannot read and pick a bottle named "Hemlock". You die after consuming it. Press enter to continue.','cyan')
    input()
    clear()
    if not 'Home doctor' in endings:
      endings.append('Home doctor')
    return('dead')
  else:
    cprint('You cannot read and pick a nice smelling bottle of leaves. It may not do much, but now the house smells better.','cyan')
    h = random.randint (0,2)
    chance -= h
    input()
    clear()

def blessing():
  global endings
  h = random.randint(0,3)
  if h == 0:
    cprint('You were found to be a heretic and were executed. Press enter to continue','cyan')
    input()
    clear()
    if not 'Heresy' in endings:
      endings.append('Heresy')
    return('dead')
  else:
    cprint('A bishop has come to town to bless it. Press enter to continue.','cyan')
    input()
    clear()

def witches():
  global endings
  cprint('The village has decided to hold a witch hunt.','cyan')
  h = random.randint(1,3)
  if h == 1:
    cprint('You were found guilty of witchcraft and were burned at the stake. Press enter to continue.','cyan')
    input()
    clear()
    if not 'Kentucky Fried Witch' in endings:
      endings.append('Kentucky Fried Witch')
    return('dead')
  else:
    cprint('A few villagers were burnt to death on account of their witchcraft. Press enter to continue.','cyan')
    input()
    clear()
  
def fight():
  global endings
  cprint('You got into a fight!','cyan')
  h = random.randint(1,5)
  if h == 1:
    cprint('You lost the fight and went home bruised. Press enter to continue.','cyan')
    input()
    clear()
  elif h == 2:
    cprint('You died in the fight. Press enter to continue.','cyan')
    input()
    clear()
    if not 'To Valhalla' in endings:
      endings.append('To Valhalla')
    return('dead')
  else:
    cprint('You won the fight and came home victorious. Press enter to continue.','cyan')
    input()
    clear()

def event():
  ID = random. randint(1,10)
  if ID == 1:
    if family > 0:
      familysick()
    else:
      cprint('Nothing happened today. Press enter to continue.','cyan')
      input()
      clear()
  elif ID == 2:
    return(selfsick())
  elif ID == 3:
    return(burglary())
  elif ID == 4:
    flagellants()
  elif ID == 5:
    return(cleaners())
  elif ID == 6:
    return(herbs())
  elif ID == 7:
    return(blessing())
  elif ID == 8:
    return(witches())
  elif ID == 9:
    return(fight())
  else:
    cprint('Nothing happened today. Press enter to continue.','cyan')
    input()
    clear()

day = 0

def game():
  global day
  global bruh
  intro()
  input()
  clear()
  day = 0
  while bruh != 'dead':
    day += 1
    cprint('Day ' + str(day), 'magenta')
    bruh = event()

  cprint('You survived ' + str(day) + ' days.','red')

game()
most_days_survived = 0

while 1 == 1:
  if day == 1 and not 'Speedrunner' in endings:
    endings.append('Speedrunner')
  if day >= 50 and not 'Fifty day gang' in endings:
    endings.append('Fifty day gang')

  if day > most_days_survived:
    most_days_survived = day

  cprint('Most days survived: {}'.format(most_days_survived), 'red')
    
  cprint('You have unlocked the following endings:','cyan')
  for item in endings:
    cprint(item,'red')
  cprint('Press enter to replay.','cyan')
  input()
  clear()
  bruh = ''
  family = random.randint(3,5)
  game()
Fetching token
?