-
Notifications
You must be signed in to change notification settings - Fork 3
/
rpg.py
1199 lines (1006 loc) · 41 KB
/
rpg.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# MAIN SCRIPT RPG TIF
import sys
import rpg_config as config
from rpg_functools import *
import random
from os import system, name
def credits():
clear_screen()
print(p_color("narration/credits.txt"))
input()
clear_screen()
return
def launch_video():
open_file('./narration/rise_of_champetier.mp4')
clear_screen()
def menu_principal(**kwargs):
while (True):
menu_choice = check_input(p_color('narration/menu_principal.txt'),
['1', '2', '3', '4'])
if menu_choice == "1":
launch_video()
if menu_choice == "2":
clear_screen()
game(**kwargs)
if menu_choice == "3":
credits()
if menu_choice == "4":
sys.exit(0)
clear_screen()
def die():
clear_screen()
print(p_color(
"[RED]CATASTROPHE ! \n[GREEN]Tiphaine[DEFAULT] a [RED]crevé[DEFAULT].\n"
"Elle a visiblement fait de très [RED]mauvais[DEFAULT] choix... Il faut recommencer"),
file=False)
input()
clear_screen()
menu_principal()
def game(DEBUG=False, **kwargs):
# global variables
time = config.start_hour * 60 # starts at 8 am
energy = Energy(100)
# needed for advancement
badge = False
gpu = False
felipe_badge = False
hamac_votes = ['ouardia', 'tiphaine', 'alexis']
daoult_password = False # TODO: check if used
coffee = False
eaten = False
huel = False
# potential weapons
selfie = True
covid = False
fungus = False
mbti = False
hamac_weapon = False
# quests
analysis = False
diploma = False
hamac_quest = False
babyfoot = False
whistleblower = False
# Allies
alexis = True
paoletti = False
holcman = False
###############################
# PROLOGUE
###############################
# Star Wars Init
input(p_color("narration/intro.txt"))
clear_screen()
# TBD: remove if video
# Retour
input(p_color("narration/retour.txt"))
clear_screen()
# Tutoriel
input(p_color("narration/tutoriel.txt"))
clear_screen()
###############################
# INITIAL SEQUENCE
###############################
print_INFO(time, energy)
# wake-up
snooze = check_input(p_color("narration/matin/matin.txt"), ['T', 'F'])
if snooze == 'T':
time += config.snooze_dt
energy += config.snooze_de
print_result_action(config.snooze_dt, config.snooze_de)
print(p_color("narration/matin/matin_snooze.txt"))
else:
rd = random.random()
if rd <= config.wakeup_proba:
# Tif manages to wakeup
time += config.nonsnooze_dt
energy += config.nonsnooze_de
print_result_action(config.nonsnooze_dt, config.nonsnooze_de)
print(p_color("narration/matin/matin_lever_success.txt"))
else:
# fail
time += config.snooze_dt
energy += config.nonsnooze_de
print_result_action(config.snooze_dt, config.nonsnooze_de)
print(p_color("narration/matin/matin_lever_fail.txt"))
print_INFO(time, energy)
input()
clear_screen()
# bike
bike_fight = check_input(p_color("narration/bike/bike.txt"), ['T', 'F'])
if bike_fight == 'T':
time += config.bike_fight_dt
energy += config.bike_fight_de
print_result_action(config.bike_fight_dt, config.bike_fight_de)
print(p_color("narration/bike/bike_fight.txt"))
else:
time += config.non_bike_fight_dt
energy += config.non_bike_fight_de
print(p_color("narration/bike/bike_no_fight.txt"))
print_result_action(config.non_bike_fight_dt, config.non_bike_fight_de)
print_INFO(time, energy)
input()
clear_screen()
# arrival
if time <= config.morning_deadline * 60: # before 9am
# meeting with Daoult
time += config.daoult_talk_dt
print(p_color("narration/arrivee_ibens/daoult/daoult.txt"))
print_result_action(config.daoult_talk_dt, 0)
input()
if bike_fight == 'T':
time += config.daoult_fight_dt
energy += config.daoult_fight_de
print(p_color(
"narration/arrivee_ibens/daoult/daoult2_si_agression.txt"))
print_result_action(config.daoult_fight_dt, config.daoult_fight_de)
else:
# daoult does take the MBTI test
time += config.daoult_test_mbti_dt
mbti = True
print(p_color(
"narration/arrivee_ibens/daoult/daoult2_si_mbti.txt"))
print_result_action(config.daoult_test_mbti_dt, 0)
else: # after 10am
time += config.swann_beer_dt
mbti = True
print(p_color(
"narration/arrivee_ibens/swann/swann.txt"))
print_result_action(config.swann_beer_dt, 0)
print_INFO(time, energy)
input()
clear_screen()
# sysinfo
convince_pv = check_input(p_color("narration/sysinfo/pv.txt"), ["T", "F"])
wait_sysinfo = False
if convince_pv == 'T':
rd = random.random()
energy += config.convince_pv_de
time += config.pv_dt
if rd <= config.pv_convincing_proba:
# pv is convinced!
badge = True
print(p_color("narration/sysinfo/pv_after.txt"))
else:
# local var
wait_sysinfo = True
print(p_color("narration/sysinfo/pv_not_convinced.txt"))
print_result_action(config.pv_dt, config.convince_pv_de)
if convince_pv == 'F' or wait_sysinfo:
# wait
time += config.after_pv_dt
print_result_action(config.after_pv_dt, 0)
input()
phiphuong = check_input(
p_color("narration/sysinfo/deal_w_phiphuong.txt"),
['T', 'F'])
if phiphuong == 'T':
time += config.phiphuong_dt
energy += config.phiphuong_de
badge = True
print(p_color("narration/sysinfo/phiphuong_after.txt"))
print_result_action(config.phiphuong_dt,
config.phiphuong_de)
else:
time += config.bilel_dt
badge = True
print(p_color("narration/sysinfo/bilel.txt"))
print_result_action(config.bilel_dt, 0)
print_INFO(time, energy)
input()
clear_screen()
# 6th floor
meeting_auguste = check_input(
p_color("narration/sixth_floor_kitchen/arrival.txt"), ['T', 'F'])
if meeting_auguste == 'T':
time += config.auguste_meeting_dt
energy += config.auguste_meeting_de
covid = True
print(p_color("narration/sixth_floor_kitchen/meeting_auguste.txt"))
print_result_action(config.auguste_meeting_dt,
config.auguste_meeting_de)
else:
# stay with Pierre and Jerome
listen_pj = check_input(
p_color("narration/sixth_floor_kitchen/choice_pierrejerome.txt"),
['T', 'F'])
if listen_pj == 'T':
time += config.resistance_talk_dt
daoult_password = True
print(
p_color(
"narration/sixth_floor_kitchen/listen_pierrejerome.txt"))
print_result_action(config.resistance_talk_dt, 0)
else:
rd = random.random()
if rd < 0.5:
# montessori talk
time += config.montessori_talk_dt
energy += config.montessori_talk_de
print(p_color(
"narration/sixth_floor_kitchen/montessori.txt"))
print_result_action(config.montessori_talk_dt,
config.montessori_talk_de)
else:
# hydroponics talk
time += config.hydroponics_talk_dt
energy += config.hydroponics_talk_de
print(p_color(
"narration/sixth_floor_kitchen/hydroponics.txt"))
print_result_action(config.hydroponics_talk_dt,
config.hydroponics_talk_de)
print_INFO(time, energy)
input()
clear_screen()
# in the lab
lab_choice = check_input(p_color("narration/bureau/bureau.txt"),
['1', '2', '3'])
# local variable toilets
toilets = False
if lab_choice == '3':
# plants
time += config.plants_dt
print(p_color("narration/bureau/plantes.txt"))
print_result_action(config.plants_dt, 0)
elif lab_choice == '1':
coffee = True
energy += config.coffee_de
time += config.coffee_dt
print_result_action(config.coffee_dt,
config.coffee_de) # TODO: check if order is ok between the 2 prints
lab_choice = check_input(p_color("narration/bureau/cafe.txt"),
['1', '2'])
if lab_choice == '2':
# caca
toilets = True
rd = random.random()
if rd < 0.5:
# discuss her poop
time += config.poop_talk_dt
poop_email = check_input(
p_color("narration/bureau/caca_explication.txt"),
['T', 'F'])
print_result_action(config.poop_talk_dt + config.poop_dt, 0)
else:
energy += config.poop_constipated_de
poop_email = check_input(
p_color("narration/bureau/caca_constipee.txt"),
['T', 'F'])
print_result_action(config.poop_dt, config.poop_constipated_de)
time += config.poop_dt
if poop_email == 'T':
time += config.poop_email_dt
energy += config.poop_email_de
print_result_action(config.poop_dt, config.poop_constipated_de)
check_input(p_color("narration/bureau/reponse_mail.txt"), ['1'])
else:
check_input(
p_color("narration/bureau/toilettes_degueues_passer_outre.txt"),
['1'])
if not toilets:
# Tif asphyxiates Alexis, he is not her allie anymore
print(p_color("narration/bureau/asphyxier_alexis.txt"))
alexis = False
hamac_votes.remove('alexis')
if DEBUG:
print("\nIN THE LAB\n")
print(f"alexis = {alexis}, hamac_votes = {hamac_votes}")
print_INFO(time, energy)
input()
clear_screen()
# email auguste
ignore_email_auguste = check_input(
p_color("narration/bureau/mail_auguste.txt"),
['T', 'F'])
if ignore_email_auguste == 'T':
time += config.auguste_email_answer_dt
print(p_color("narration/bureau/ignorer_auguste.txt"))
else:
covid = True
print(p_color("narration/bureau/engueuler_auguste.txt"))
print_result_action(config.auguste_email_answer_dt, 0)
if DEBUG:
print('\nLAB')
print(
f'covid = {covid}, coffee = {coffee}, toilets = {toilets}, alexis = {alexis}')
print_INFO(time, energy)
input()
clear_screen()
# 7th FLOOR
time += config.floor7_dt
print(p_color("narration/seventh_floor/seventh_floor_data.txt"))
print_result_action(config.floor7_dt, 0)
print_INFO(time, energy)
input()
clear_screen()
# Analysis
print(p_color("narration/gpu/gpu.txt"))
shifumi_output = shifumi()
while not shifumi_output:
time += config.shifumi_between_games_dt
print_result_action(config.shifumi_between_games_dt, 0)
shifumi_output = shifumi()
gpu = True
if DEBUG:
print('\nSHIFUMI')
print(f'gpu = {gpu}')
print_INFO(time, energy)
input()
clear_screen()
# Analysis
check_input(p_color("narration/analyse/question_troll.txt"),
['1', '2', '3', '4'])
if coffee:
time += config.analysis_if_coffee_dt
energy -= config.analysis_if_coffee_de
print(p_color("narration/analyse/avec_cafe.txt"))
print_result_action(config.analysis_if_coffee_dt,
config.analysis_if_coffee_de)
else:
promise_mathieu = check_input(
p_color("narration/analyse/sans_cafe.txt"),
['T', 'F'])
if promise_mathieu == 'T':
time += config.promise_mathieu_dt
energy -= config.analysis_de
# mathieu is an allie
hamac_votes.append('mathieu')
print(p_color("narration/analyse/gentille_avec_mathieu.txt"))
print_result_action(config.promise_mathieu_dt,
config.analysis_de)
else:
time += config.non_promise_mathieu_dt
energy -= config.analysis_de
print(p_color("narration/analyse/pasgentille_avec_mathieu.txt"))
print_result_action(config.promise_mathieu_dt, config.analysis_de)
analysis = True
if DEBUG:
print('\nANALYSIS')
print(f'analysis = {analysis}, coffee = {coffee}')
print_INFO(time, energy)
input()
clear_screen()
# Discussion with Alexis about admin problems
print(p_color("narration/convaincre_le_monde/interlude.txt"))
if alexis:
print(
p_color("narration/convaincre_le_monde/answer_alexis_if_caca.txt"))
else:
print(p_color(
"narration/convaincre_le_monde/answer_alexis_if_not_caca.txt"))
input()
# France & Guillaume encounters
discuss_france = check_input(p_color(
"narration/convaincre_le_monde/discussion_france_beginning.txt"),
['T', 'F'])
if discuss_france == 'T':
print(p_color(
"narration/convaincre_le_monde/discussion_france_follow.txt"))
print_result_action(config.france_dt, config.france_e - energy.e)
time += config.france_dt
energy = Energy(config.france_e)
huel = True
hamac_votes.append('france')
print_INFO(time, energy)
input()
clear_screen()
discuss_guillaume = check_input(p_color(
"narration/convaincre_le_monde/choice_discussion_guillaume.txt"),
['T', 'F'])
if discuss_guillaume == 'T':
time += config.guillaume_dt
energy += config.guillaume_de
hamac_votes.append('guillaume')
print(p_color("narration/convaincre_le_monde/discussion_guillaume.txt"))
print_result_action(config.guillaume_dt, config.guillaume_de)
if DEBUG:
print('\nF&G ENCOUNTERS')
print(f'hamac_votes = {hamac_votes}')
print_INFO(time, energy)
input()
if not all([time <= 14 * 60, energy.e > 0, badge, analysis, gpu]):
clear_screen()
print(p_color("narration/fail_checkpoint.txt"))
input()
clear_screen()
return False
##########################################
# PARALLEL QUESTS
##########################################
while (time < config.end_hour * 60 and energy > 0) and (
(not diploma) or (not hamac_quest) or (
not babyfoot)): # TODO: check constraints
clear_screen()
print('\n\n')
print_INFO(time, energy)
print('\n\nQue faire ?\n\n')
if DEBUG:
print(
f"diplome = {diploma}, hamac_quest = {hamac_quest}, babyfoot = {babyfoot}")
to_display_menu = display_menu(time, hamac_quest, diploma, babyfoot,
eaten)
menu_choice = check_input('\n'.join(
[f'- {value} [{key}]' for key, value in
to_display_menu.items()]) + '\n',
[str(k) for k in to_display_menu.keys()])
# HAMAC
# 14 people max can vote
if menu_choice == '0':
### HAMAC_QUEST
clear_screen()
print(p_color("narration/quetes_paralleles/hamac/HAMAC.txt"))
if ('France' in hamac_votes) and not ('Guillaume' in hamac_votes):
hamac_votes.append('Guillaume')
# TODO: verify hamac_votes has no redundacy
assert len(hamac_votes) == len(set(hamac_votes))
print(f'Il y a {len(hamac_votes)} personnes pour le hamac sur 14.')
# try convince some people
# TODO: il manque les fioritures la: les probas qui changent en fonction de la conversation
print(p_color("narration/quetes_paralleles/hamac/FELIPE.txt"))
convince_hamac = check_input("", ["T", "F"])
if convince_hamac == 'T':
rd = random.random()
time += config.convince_felipe_dt
energy += config.convince_felipe_de
if rd < config.convince_felipe_proba:
hamac_votes.append('felipe')
print(p_color("narration/quetes_paralleles/hamac/FELIPE_success_convaincre.txt"))
else:
print(p_color("narration/quetes_paralleles/hamac/FELIPE_fail_convaincre.txt"))
print_result_action(config.convince_felipe_dt, config.convince_felipe_de)
print_INFO(time, energy)
else:
print(p_color("narration/quetes_paralleles/hamac/FELIPE_ignorer.txt"))
input("")
clear_screen()
print(p_color("narration/quetes_paralleles/hamac/TONI.txt"))
convince_hamac = check_input("", ["T", "F"])
if convince_hamac == 'T':
rd = random.random()
time += config.convince_tony_dt
energy += config.convince_tony_de
if rd < config.convince_tony_proba:
hamac_votes.append('tony')
print(p_color("narration/quetes_paralleles/hamac/TONI_success_convaincre.txt"))
else:
print(p_color("narration/quetes_paralleles/hamac/TONI_fail_convaincre.txt"))
print_result_action(config.convince_tony_dt, config.convince_tony_de)
print_INFO(time, energy)
else:
print(p_color("narration/quetes_paralleles/hamac/TONI_ignorer.txt"))
input("")
clear_screen()
print(p_color("narration/quetes_paralleles/hamac/LISA.txt"))
convince_hamac = check_input("", ["T", "F"])
if convince_hamac == 'T':
rd = random.random()
time += config.convince_lisa_dt
energy += config.convince_lisa_de
if rd < config.convince_lisa_proba:
hamac_votes.append('lisa')
print(p_color("narration/quetes_paralleles/hamac/LISA_success_convaincre.txt"))
else:
print(p_color("narration/quetes_paralleles/hamac/LISA_fail_convaincre.txt"))
print_result_action(config.convince_lisa_dt, config.convince_lisa_de)
else:
print(p_color("narration/quetes_paralleles/hamac/LISA_ignorer.txt"))
input("")
clear_screen()
print(p_color("narration/quetes_paralleles/hamac/vote.txt"))
input("")
if len(hamac_votes) >= config.n_people_hamac_vote:
print(p_color("narration/quetes_paralleles/hamac/final_success.txt"))
hamac_weapon = True
energy += config.winning_hamac_de
time += config.hamac_quest_dt
print_result_action(config.hamac_quest_dt, config.winning_hamac_de)
else:
print(p_color("narration/quetes_paralleles/hamac/final_failed.txt"))
# couch with auguste
covid = True
energy += config.loosing_hamac_de
time += config.hamac_quest_dt
print_result_action(config.hamac_quest_dt, config.loosing_hamac_de)
hamac_quest = True
if DEBUG:
print('\nHAMAC')
print(f'hamac_votes = {hamac_votes}, hamac = {hamac_weapon}')
print_INFO(time, energy)
input('')
clear_screen()
# DIPLOMA
elif menu_choice == '1':
diploma_dir = "narration/diploma/"
if DEBUG:
print(f"time = {time}, {config.diploma_deadline * 60}, alexis = {alexis}")
if time >= config.diploma_deadline * 60:
# after 5 pm
print(p_color(diploma_dir + "vigile.txt"))
input()
clear_screen()
return False
# Lina's signature sequence
if alexis:
time += config.if_alexis_lina_dt
energy += config.if_alexis_lina_de
print(p_color(diploma_dir + "lina_with_alexis.txt"))
print_result_action(config.if_alexis_lina_dt, config.if_alexis_lina_de)
else:
if time <= config.admin_lina_deadline * 60:
# before 2 pm
print(p_color(diploma_dir + "wait_for_lina.txt"))
print_result_action(config.admin_lina_deadline * 60 - time, 0)
time = config.admin_lina_deadline * 60
time += config.if_not_alexis_lina_dt
energy += config.if_not_alexis_lina_de
print(p_color(diploma_dir + "lina_wo_alexis.txt"))
print_result_action(config.if_not_alexis_lina_dt, config.if_not_alexis_lina_de)
print_INFO(time, energy)
input()
clear_screen()
# Auguste's signature sequence
if alexis:
time += config.if_alexis_auguste_dt
energy += config.if_alexis_auguste_de
print(p_color(diploma_dir + "auguste_with_alexis.txt"))
print_result_action(config.if_alexis_auguste_dt, config.if_alexis_auguste_de)
else:
time += config.if_not_alexis_auguste_dt
energy += config.if_not_alexis_auguste_de
print(p_color(diploma_dir + "auguste_wo_alexis.txt"))
print_result_action(config.if_not_alexis_auguste_dt, config.if_not_alexis_auguste_de)
print_INFO(time, energy)
input()
clear_screen()
# Paoletti's signature sequence
if alexis:
time += config.if_alexis_paoletti_dt
energy += config.if_alexis_paoletti_de
print(p_color(diploma_dir + "paoletti_with_alexis.txt"))
print_result_action(config.if_alexis_paoletti_dt, config.if_alexis_paoletti_de)
else:
time += config.if_not_alexis_paoletti_dt
energy += config.if_not_alexis_paoletti_de
print(p_color(diploma_dir + "paoletti_wo_alexis.txt"))
print_result_action(config.if_not_alexis_paoletti_dt, config.if_not_alexis_paoletti_de)
print_INFO(time, energy)
input()
clear_screen()
# diploma quest achieved
diploma = True
print(p_color(diploma_dir + "rencontre_felipe.txt"))
# meet with Felipe
felipe_badge = True
input()
clear_screen()
# BABYFOOT
elif menu_choice == '2':
print(p_color("narration/quetes_paralleles/babyfoot/babyfoot_tournament.txt"))
if fungus:
print(p_color("narration/quetes_paralleles/babyfoot/fungus_handicap.txt"))
energy += config.if_fungus_de
print_result_action(0, config.if_fungus_de)
else:
print(p_color("narration/quetes_paralleles/babyfoot/fungus_no_handicap.txt"))
# compliment Maxime and Nikita
hamac_votes.extend(['nikita', 'maxime'])
print(p_color("narration/quetes_paralleles/babyfoot/maxime_nikita.txt"))
daoult_password = True
time += config.baby_dt
print(p_color("narration/quetes_paralleles/babyfoot/amira_ouardia.txt"))
print_result_action(config.baby_dt, 0)
print_INFO(time, energy)
input('')
clear_screen()
print(p_color("narration/quetes_paralleles/babyfoot/question_troll.txt"))
input('')
clear_screen()
clear_screen()
print(p_color("narration/quetes_paralleles/babyfoot/holcman_paoletti.txt"))
# choose between paoletti and holcman
paoletti_vs_holcman = check_input(
'De Pierre Paloetti [0] et David Holcman [1], qui choisis-tu comme allie contre Daoult? [0/1]\n\n',
["0", "1"])
if paoletti_vs_holcman == '0':
# choose paoletti
paoletti = True
print(p_color("narration/quetes_paralleles/babyfoot/paoletti_only.txt"))
else:
print(p_color("narration/quetes_paralleles/babyfoot/holcman_only.txt"))
holcman = False
# babyfoot quest achieved
babyfoot = True
print_INFO(time, energy)
input('')
clear_screen()
if DEBUG:
print('\nBABYFOOT')
print(
f'babyfoot = {babyfoot}, paoletti = {paoletti}, holcman = {holcman},')
print(f'daoult_password = {daoult_password}, fungus = {fungus}')
print(f'time = {time2hours(time)}; energy = {energy}\n')
# LUNCH
elif menu_choice == '3':
clear_screen()
if time <= config.tony_lunch_deadline * 60:
# lunch with Tony
print(p_color("narration/quetes_paralleles/manger/toni/toni.txt"))
selfie = True
else:
# eat with Solene and Elise
hamac_votes.extend(['elise', 'raphael', 'solene'])
# cure fungal infection?
fungal_choice = check_input(p_color("narration/quetes_paralleles/manger/elise_solene/elise_solene.txt"),
["0", "1"])
if fungal_choice == '0':
# elise: the fungal infection grows worse
print(p_color("narration/quetes_paralleles/manger/elise_solene/elise.txt"))
fungus = True
time += config.lunch_dt
print_result_action(config.lunch_dt, 0)
else:
# solene: the fungal infection is cured
print(p_color("narration/quetes_paralleles/manger/elise_solene/solene.txt"))
energy += config.fungal_de
time += config.lunch_dt
print_result_action(config.lunch_dt, config.fungal_de)
print_INFO(time, energy)
eaten = True
input('')
clear_screen()
if DEBUG:
print('\nLUNCH')
print(f'hamac_votes = {hamac_votes}, selfie={selfie}')
# NAP
else: # if menu_choice == '4':
energy += config.nap_de
time += config.nap_dt
print_result_action(config.nap_dt, config.nap_de)
if time >= config.end_hour * 60 or energy < 0:
clear_screen()
print(p_color("narration/fail_checkpoint.txt"))
input()
clear_screen()
return False
if not all([babyfoot, hamac_quest, diploma,
(covid or fungus or hamac_weapon)]):
clear_screen()
print(p_color("narration/fail_checkpoint_2.txt"))
input()
clear_screen()
return False
########################################
# WHISTLEBLOWER QUEST
########################################
assert daoult_password # hamac_quest
assert felipe_badge # diploma quest
if paoletti:
office_check = check_input(
p_color("narration/whistleblower_quest/whistleblower_allie_paoletti.txt"),
[str(i) for i in range(4)])
else:
office_check = check_input(
p_color(
"narration/whistleblower_quest/whistleblower_allie_holcman.txt"),
[str(i) for i in range(4)])
if office_check == '0':
# choose Daoult
if mbti:
print(p_color("narration/whistleblower_quest/daoult_si_mbti.txt"))
energy += config.if_mbti_daoult_office_de
time += config.whistleblower_dt
print_result_action(config.whistleblower_dt, config.if_mbti_daoult_office_de)
else:
print(p_color("narration/whistleblower_quest/daoult_sans_mbti.txt"))
energy += config.not_mbti_adoult_office_de
time += config.whistleblower_dt
print_result_action(config.whistleblower_dt, config.not_mbti_adoult_office_de)
elif office_check == '1':
# choose paoletti
if paoletti:
print(p_color("narration/whistleblower_quest/allie_paoletti.txt"))
energy += config.allie_is_evil_de
time += config.whistleblower_dt
print_result_action(config.whistleblower_dt, config.allie_is_evil_de)
else:
time += config.whistleblower_dt
print(p_color("narration/whistleblower_quest/not_allie_paoletti.txt"))
print_result_action(config.whistleblower_dt, 0)
elif office_check == '2':
# choose Holcman
if paoletti:
time += config.whistleblower_dt
print(p_color("narration/whistleblower_quest/not_allie_holcman.txt"))
print_result_action(config.whistleblower_dt, 0)
else:
print(p_color("narration/whistleblower_quest/allie_holcman.txt"))
print_result_action(config.whistleblower_dt, config.allie_is_evil_de)
energy += config.allie_is_evil_de
time += config.whistleblower_dt
whistleblower_choice = check_input(p_color("narration/whistleblower_quest/whistleblower_end.txt"),
["T", "F"])
if whistleblower_choice == 'T':
whistleblower = True
print_INFO(time, energy)
input('')
clear_screen()
##########################################
# FINAL QUEST
##########################################
if time >= config.end_hour * 60 or energy < 0:
clear_screen()
print(p_color("narration/fail_checkpoint.txt"))
input()
clear_screen()
return False
# get an appointment with Daoult
if diploma:
# appointment OK
print(p_color("narration/final_quest/appointment_daoult_if_diploma.txt"))
else:
# appointment not valid
print(
p_color("narration/final_quest/appointment_daoult_if_no_diploma.txt"))
input()
clear_screen()
return False
print_NRJ(energy)
input()
clear_screen()
if whistleblower:
if paoletti:
allie_confrontation = check_input(p_color(
"narration/final_quest/if_whistleblower"
"/allie_confrontation_paoletti.txt"),
["T", "F"])
else:
allie_confrontation = check_input(p_color(
"narration/final_quest/if_whistleblower"
"/allie_confrontation_holcman.txt"),
["T", "F"])
if allie_confrontation == 'T':
energy += config.confrontation_allie_de
if paoletti:
print(p_color(
"narration/final_quest/if_whistlblower"
"/confrontation_paoletti.txt"))
else:
print(p_color(
"narration/final_quest/if_whistlblower"
"/confrontation_paoletti.txt"))
print_NRJ(energy)
input()
clear_screen()
if huel:
huel_choice = check_input(p_color("narration/final_quest/huel.txt"),
["T", "F"])
if huel_choice == 'T':
energy = 100
print(p_color("narration/final_quest/huel_yes.txt"))
print_NRJ(energy)
else:
print(p_color("narration/final_quest/huel_no.txt"))
input()
clear_screen()
if selfie:
daoult_proposition = check_input(
p_color("narration/final_quest/if_whistleblower"
"/proposition_daoult_if_lydia.txt"),
["0", "1", "2"])
else:
daoult_proposition = check_input(
p_color("narration/final_quest/if_whistleblower"
"/proposition_daoult_no_lydia.txt"),
["0", "1"])
energy += config.daoult_proposition_de
print_result_action(0, config.daoult_proposition_de)
if daoult_proposition == '0':
# accepter
if energy >= config.trust_daoult_energy_threshold:
# epilogue 1
print(p_color("narration/final_quest/if_whistleblower"
"/epilogue1_enough_energy.txt"))
input()
clear_screen()
return True
else:
clear_screen()
print(p_color(
"narration/final_quest/if_whistleblower"
"/epilogue1_not_enough_energy.txt"))
input()
clear_screen()
return False
elif daoult_proposition == '1':
# le confronter
if energy >= config.dont_trust_daoult_energy_threshold:
possible_keys, txt = attack(covid, hamac_weapon,
fungus, daoult=True)
daoult_weapon_choice = check_input(p_color(txt, file=False),
possible_keys)
if daoult_weapon_choice == '0':
# epilogue 2