-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpc.py
More file actions
1573 lines (1245 loc) · 46.4 KB
/
npc.py
File metadata and controls
1573 lines (1245 loc) · 46.4 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
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
from pygame import sprite
from pygame import image
from pygame import Rect
from pygame import Surface
import pygame
import pyganim
import screens
import fonts
import functions
import text
from screens import *
from constants import *
import random
import controller
from monster import Monster
import classes
import ideas
from functions import end_dialog, war, br_change, br_auto
import items
import ends
import menu
import sounds
import img
class Gilbert (classes.Monk):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.race = 'human'
self.mname = 'Отец Гильберт'
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/priest.png')
self.icon = pygame.image.load ('images/priest_av.png')
self.image.set_colorkey ((254,254,254))
self.g = 1000
self.order = True
self.quest = False
self.hit = False
def battle_action (self, hero):
if self.hit == False:
hero.quest['gilbert_hit'] = True
self.hit = True
classes.Monk.battle_action (self, hero)
def dialog_special (self, hero):
if self.add_information == 'gold' and self.control.k_e == True:
self.control.k_e = False
if hero.gold >= 20:
hero.gold -= 20
self.branch = 4
self.s = 1
self.n = 0
else:
self.branch = 6
self.s = 1
self.n = 0
if self.add_information == 'gold_inf' and self.control.k_e == True:
self.control.k_e = False
if hero.gold >= 20:
hero.gold -= 20
self.branch = 5
self.s = 1
self.n = 0
else:
self.branch = 13
self.s = 1
self.n = 0
if self.add_information == 'hit' and self.control.k_e == True:
hero.move = True
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Потирая кулак вы отошли во свояси.')
hero.son.change_text (3, 'Посетители таверны даже не отреагировали.')
hero.son.change_text (4, 'Они просто пили своё пиво.')
hero.son.change_text (5, 'А вас кольнула булавочкой совесть: правильно ли?')
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.quest['gilbert_hit'] = True
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'trinktour' and self.control.k_e == True:
hero.move = True
self.control.k_e = False
hero.gold = 0
if ideas.gelassenheit not in hero.journal:
hero.son.clear_text ()
hero.son.change_text (2, 'Вы долго пили. И пьянствовали. Но для чего?')
hero.son.change_text (3, 'Вы и сами не знаете. Вы тупо просадили все деньги.')
hero.son.change_text (4, 'Вы и сами уже не помните, что происходило и кто за что платил.')
hero.son.change_text (5, 'Теперь у вас лишь головная боль, а впереди много дел.')
self.branch = 7
self.s = 1
self.n = 0
if ideas.gelassenheit in hero.journal:
hero.son.clear_text ()
hero.son.change_text (2, 'Вы долго пили. И пьянствовали. Но для чего?')
hero.son.change_text (3, 'Вспомнив концепцию отрешённости, вы восприняли данную пьянку как нечто пустое.')
hero.son.change_text (4, 'Отрешившись от своего тела, потребляющего алкоголь вы обратились к вечности.')
hero.son.change_text (5, 'И преисполнились внутреннего спокойствия и силы. ')
hero.son.change_text (6, 'На утро вы чувствовали себя отлично. Ваша вера возросла.')
hero.char_value['6sp'] += 1
hero.sp +=1
self.branch = 12
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'stupid' and self.control.k_e == True:
hero.move = True
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы презрительно отозвались об идеях монаха, которые')
hero.son.change_text (3, 'он вынашивал у себя под сердцем. Достойный ли это поступок?')
hero.son.change_text (4, 'Кто знает? Может вы искренне считали его построения заблужденем?')
hero.son.change_text (5, 'Или же проявили невнимание и нетерпение?')
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'magnus' and self.control.k_e == True:
hero.move = True
x = 0
for i in hero.journal:
if i.name == 'Пусто':
hero.journal[x] = ideas.order_of_magnitude
break
x +=1
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы записали концепцию Порядка Магнитуд в свой журнал.')
hero.son.change_text (3, 'Теперь вы будете по-другому смотреть на мир монстров.')
hero.son.change_text (4, 'Кто знает, до чего вас это доведёт.')
if ideas.individ not in hero.journal:
self.branch = 9
self.s = 1
self.n = 0
else:
self.branch = 7
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'individ' and self.control.k_e == True:
hero.move = True
x = 0
for i in hero.journal:
if i.name == 'Пусто':
hero.journal[x] = ideas.individ
break
x +=1
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы записали концепцию Индивидуации Города в свой журнал.')
hero.son.change_text (3, 'Теперь вы будете по-другому смотреть на городские противоречия.')
hero.son.change_text (4, 'Кто знает, до чего вас это доведёт.')
if ideas.order_of_magnitude not in hero.journal:
self.branch = 8
self.s = 1
self.n = 0
else:
self.branch = 7
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'gelassenheit' and self.control.k_e == True:
hero.move = True
x = 0
for i in hero.journal:
if i.name == 'Пусто':
hero.journal[x] = ideas.gelassenheit
break
x +=1
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы записали концепцию Отрешённости в свой дневничок.')
hero.son.change_text (3, 'Теперь вы по-другому будете относиться к внутреннему и внешнему.')
hero.son.change_text (4, 'Кто знает, до чего вас это доведёт?')
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'passage' and self.control.k_e == True:
self.control.k_e = False
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
class Barmen (classes.Monster):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Бармен'
self.race = 'human'
self.image = Surface ((45,45))
self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/tiles/barmen.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.matter = 0
self.order = True
def pay (self, add_information, quantity, where_sucsess, where_not_sucsess, hero):
if self.add_information == add_information:
if hero.gold >= quantity:
hero.gold -= quantity
self.branch = where_sucsess
self.s = 1
self.n = 0
else:
self.branch = where_not_sucsess
self.s = 1
self.n = 0
self.matter = where_sucsess
def dialog_special (self, hero):
self.pay ('pay_for_sleep', 100, 2, 1, hero)
self.pay ('pay_for_food', 40, 3, 1, hero)
self.pay ('pay_for_drink', 20, 4, 1, hero)
if self.add_information == 'sleep' and self.control.k_e == True:
self.control.k_e = False
hero.move = True
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы отлично отдохнули.')
hero.son.change_text (3, 'Ваши силы восстанавливаются.')
hero.son.change_text (4, 'Хотя, тяжесть грехов и старые раны так просто не исцелить.')
hero.son.change_text (5, 'Но вы готовы к новому дню!')
hero.day += 1
#hero.sp = hero.char_value['6sp']
hero.hp = hero.char_value['5hp']
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'pray':
if random.randint(1,6) <= hero.sp:
self.branch = 6
self.s = 1
self.n = 0
else:
self.branch = 5
self.s = 1
self.n = 0
if self.add_information == 'pray_ok' and self.control.k_e == True:
self.control.k_e = False
self.branch = self.matter
self.s = 1
self.n = 0
if self.add_information == 'food' and self.control.k_e == True:
self.control.k_e = False
hero.move = True
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы неплохо поели и частично восстановили свои силы.')
if hero.hp < hero.char_value['5hp']:
hero.hp = hero.hp + 2
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'passage' and self.control.k_e == True:
self.control.k_e = False
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
class Martin (classes.Monk):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.race = 'human'
self.mname = 'Отец Мартин'
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/priest.png')
self.icon = pygame.image.load ('images/priest_av.png')
self.image.set_colorkey ((254,254,254))
self.g = 1000
self.order = True
self.quest = False
self.qcheck = False
self.gold_quest = False
self.first = True
def interaction (self, hero):
Monster.interaction (self, hero)
if 'gilbert_hit' in hero.quest and self.qcheck == False and self.first == False:
self.branch = 2
self.qcheck = True
elif 'gilbert_hit' in hero.quest and self.qcheck == False and self.first == True:
self.branch = 6
self.qcheck = True
self.first = False
if 'martin_gold' in hero.quest and hero.quest['gold_cup'] >= 1000 and self.gold_quest == False:
self.branch = 9
self.gold_quest = True
def dialog_special (self, hero):
if self.add_information == 'gold_quest':
hero.quest['martin_gold'] = True
if self.add_information == 'concept' and self.control.k_e == True:
hero.move = True
x = 0
for i in hero.journal:
if i.name == 'Пусто':
hero.journal[x] = ideas.dark
break
x +=1
self.control.k_e = False
hero.char_value['6sp'] +=1
hero.sp +=1
hero.son.clear_text ()
hero.son.change_text (2, 'Вы записали концепцию Божественного Мрака в свой дневничок.')
hero.son.change_text (3, 'Теперь вы по-другому будете относиться к сущему и не-сущему.')
hero.son.change_text (4, 'Кто знает, до чего вас это доведёт?')
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
class Peter (classes.Monk):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.race = 'human'
self.mname = 'Отец Пётр'
self.image = image.load('images/priest4.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.g = 1000
self.order = True
self.quest = False
self.qcheck = False
self.gold_quest = False
self.first = True
def dialog_special (self, hero):
if self.add_information == 'exsor' and self.control.k_e == True:
hero.control.k_esc = True
class Rouge (Monster):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Вор'
self.race = 'human'
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/tiles/rouge.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.order = True
self.quest = False
self.peid = False
self.first_peid = True
def interaction (self, hero):
Monster.interaction (self, hero)
if 'pedron_quest' in hero.quest and self.first_peid == True:
self.first_peid = False
br_change (self, 3)
if self.peid == True:
if ideas.anarcho in hero.journal and hero.gold >= 1000:
br_change (self, 10)
elif ideas.anarcho in hero.journal and hero.gold < 1000:
br_change (self, 12)
elif ideas.anarcho not in hero.journal and hero.gold >= 1000:
br_change (self, 14)
elif ideas.anarcho not in hero.journal and hero.gold <= 1000:
br_change (self, 13)
def dialog_special (self, hero):
if self.add_information == 'anarcho':
if 'anarcho' not in hero.quest:
hero.quest['anarcho'] = True
if self.add_information == 'gold' and self.control.k_e == True:
hero.gold -= 1000
br_auto (self)
if self.add_information == 'anarcho' and self.control.k_e == True:
br_auto (self)
if self.add_information == 'sliv' and self.control.k_e == True:
self.peid = False
for i in hero.locations_dict['tower2'].block_group:
try:
if i.mname == 'Пейдрон':
i.kill ()
break
except:
pass
hero.char_value['2exp'] += 200
hero.quest['peidron_in_prison'] = True
hero.son.clear_text ()
hero.son.change_text (2, 'Вы провернули многоходовочку.')
hero.son.change_text (3, 'Конечно, вы вступили в сговор с ворами.')
hero.son.change_text (4, 'Но ведь вы предотвратили кровавую гекатомбу?')
hero.son.change_text (5, 'Вы нанесли удра в основание злой силы, клубящейся над городом... ?')
end_dialog (self, hero)
if self.add_information == 'do_it' and self.control.k_e == True:
self.peid = True
if ideas.anarcho in hero.journal and hero.gold >= 1000:
br_change (self, 10)
elif ideas.anarcho in hero.journal and hero.gold < 1000:
br_change (self, 12)
elif ideas.anarcho not in hero.journal and hero.gold >= 1000:
br_change (self, 14)
elif ideas.anarcho not in hero.journal and hero.gold <= 1000:
br_change (self, 13)
if self.add_information == 'narco' and self.control.k_e == True:
if ideas.anarcho in hero.quest:
if hero.gold > 50:
br_change (self, 8)
else:
br_change (self, 9)
else:
if hero.gold > 50:
br_change (self, 6)
else:
br_change (self, 7)
if self.add_information == 'narco_buy' and self.control.k_e == True:
hero.gold -= 50
hero.inv.append (items.melanj)
br_auto (self)
if self.add_information == 'anarcho_concept' and self.control.k_e == True:
hero.move = True
x = 0
for i in hero.journal:
if i.name == 'Пусто':
hero.journal[x] = ideas.anarcho
break
x +=1
self.control.k_e = False
hero.son.clear_text ()
hero.son.change_text (2, 'Вы записали концепцию Анархизма в свой дневничок.')
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.collide_control = False
hero.start_conv = True
if self.add_information == 'passage' and self.control.k_e == True:
self.control.k_e = False
hero.view.a = 0
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
class Augustine (classes.Monk):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Августин'
self.race = 'human'
self.item = items.peidron_key
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/priest.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.order = True
self.quest = False
def interaction (self, hero):
Monster.interaction (self, hero)
if 'gov1' in hero.quest and 'anarcho' in hero.quest:
self.branch = 12
hero.quest.pop('gov1')
def dialog_special (self, hero):
# if self.add_information == 'passage' and self.control.k_e == True:
# self.control.k_e = False
#
# if self.branch_do == 'go':
# self.branch_do = 'done'
# self.branch = self.branch_id
# self.s = 1
# self.n = 0
if self.add_information == 'gain' and self.control.k_e == True:
hero.inv.append (items.doc_elite)
br_auto (self)
hero.gold += 20
hero.char_value['2exp'] += 50
hero.son.clear_text ()
hero.son.change_text (2, 'Вы получаете Красную грамоту и немного золотишка.')
hero.son.change_text (3, 'Как приятно работать на родное правительство!')
hero.son.change_text (4, 'Оно о тебе всегда позабится.')
end_dialog (self, hero)
if self.add_information == 'info' and self.control.k_e == True:
if ideas.anarcho in hero.journal:
br_change (self, 14)
else:
br_change (self, 15)
if self.add_information == 'quest1':
hero.quest['gov1'] = True
hero.inv.append (items.doc)
end_dialog (self, hero)
if self.add_information == 'arrest' and self.control.k_e == True:
self.control.k_e = False
if hero.gold <30:
br_change(self, 4)
else:
br_change(self, 3)
#переход на локацию башня, или тюрьма.
if self.add_information == 'yel':
if hero.gold <30:
br_change(self, 6)
else:
hero.gold -= 30
br_change(self, 7)
hero.inv.append (items.doc)
if self.add_information == 'permit':
if hero.gold <100:
br_change(self, 10)
hero.son.clear_text ()
hero.son.change_text (2, 'К сожалению у вас не хватает денег,')
hero.son.change_text (3, 'чтобы получить пропуск в подземелье.')
hero.son.change_text (4, 'Приходите, когда у вас будет больше денег.')
hero.son.change_text (4, 'Или не приходите вообще!')
end_dialog (self, hero)
else:
hero.gold >= 100
hero.gold -= 100
br_change(self, 10)
hero.inv.append (items.permit)
hero.son.clear_text ()
hero.son.change_text (2, 'Вы получаете Пропуск в подземелье.')
hero.son.change_text (3, 'За него вам пришлось отвалить 100 золотых.')
hero.son.change_text (4, 'Действительно, что такое ограбление по сравнению с')
hero.son.change_text (4, 'основанием государства!')
end_dialog (self, hero)
if self.add_information == 'red':
if hero.gold <200:
br_change(self, 6)
else:
hero.gold -= 200
br_change(self, 7)
hero.inv.append (items.doc)
if self.add_information == 'prison' and self.control.k_e == True:
self.control.k_e = False
end_dialog (self, hero)
#hero.death()
menu.ending ('Вы закончили свою жизнь в тюрьме. Вас посадили за решётку и забыли за ненадобностью. Кормили вас скудно. От холода и голода вы заболели и вскоре умерли. Лёжа на гнилой соломе вы прошептали ваши последние слова "еды..." и испустили дух.', 'images/end/prison.png', 2, pic_x = 50, time_scroll = 40, pic_y = 60, speed_mod = 5)
if self.add_information == 'war' and self.control.k_e == True:
self.control.k_e = False
self.agression = True
#self.agression = True
hero.turn_main = True
hero.start_conv = True
hero.view.a = 0
hero.direction = 2
for i in hero.locations_dict['tower1'].block_group:
if i.__class__.__name__ == 'Guard2':
i.agression = True
hero.etwas = i
# a = random.randint (1,6)
def dialog_options (self,hero):
self.dialog_special (hero)
if self.add_information == 'end':
hero.move = True
self.control.k_e = False
hero.collide_control = False
hero.start_conv = True
hero.view.a = 0
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
if self.add_information == 'passage' and self.control.k_e == True:
self.control.k_e = False
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.view.a = 0
if self.add_information == 'go':
if self.branch_do == 'go':
self.branch_do = 'done'
self.branch = self.branch_id
self.s = 1
self.n = 0
hero.view.a = 0
class Guard (Monster):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Стражник'
self.race = 'human'
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/guard.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.sound = sounds.hit
self.order = True
self.quest = False
self.second = False
self.step_away = False
self.armor = 2
def interaction (self, hero):
Monster.interaction (self, hero)
if self.step_away == False:
if items.permit in hero.inv and self.second == False:
br_change(self, 11)
elif items.permit in hero.inv and self.second == True:
br_change(self, 10)
elif hero.gold>200 in hero.inv and self.second == True:
br_change(self, 8)
elif self.second == True:
br_change(self, 9)
def dialog_special (self, hero):
if self.add_information == 'what':
if hero.gold <20:
br_change(self, 2)
else:
br_change(self, 1)
if self.add_information == 'doc' and self.control.k_e == True:
self.control.k_e = False
if items.doc in hero.inv:
br_change(self, 7)
else:
br_change(self, 4)
if self.add_information == 'arrest' and self.control.k_e == True:
end_dialog (self, hero)
menu.ending ('Вы закончили свою жизнь в тюрьме. Вас посадили за решётку и забыли за ненадобностью. Кормили вас скудно. От холода и голода вы заболели и вскоре умерли. Лёжа на гнилой соломе вы прошептали ваши последние слова "еды..." и испустили дух.', 'images/end/prison.png', 2, pic_x = 50, time_scroll = 40, pic_y = 60, speed_mod = 5)
#переход на локацию башня, или тюрьма.
if self.add_information == 'briber':
if hero.gold <100:
br_change(self, 6)
else:
br_change(self, 5)
if self.add_information == 'open':
self.rect.x += 45
self.step_away = True
hero.char_value['2exp'] += 60
br_auto (self)
end_dialog (self, hero)
if self.add_information == 'second':
self.second = True
br_auto (self)
end_dialog (self, hero)
if self.add_information == 'briebery_gold':
hero.gold -= 100
self.second = True
end_dialog (self, hero)
if self.add_information == 'briebery_200' and self.control.k_e == True:
self.control.k_e = False
hero.gold -= 200
self.rect.x += 45
self.step_away = True
self.second = True
br_auto (self)
class Guard2 (Monster):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Стражник'
self.race = 'human'
self.flee = False
self.sound = sounds.hit
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/guard.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))
self.order = True
self.quest = False
self.second = False
self.step_away = False
self.priest_action = False
self.wait_for_priest_turn = False
self.priest_turn = False
self.heal = False
self.armor = 2
# def interaction (self, hero):
#Monster.interaction (self, hero)
def special_death (self,hero):
hero.collide_control = True
hero.move = False
hero.direction = 1
for i in hero.locations_dict['tower1'].block_group:
if i.__class__.__name__ == 'Augustine':
i.agression = True
hero.etwas = i
def dialog_special (self, hero):
pass
def battle_action (self, hero):
if hero.monster_turn == True:
self.son.clear_text ()
a = random.randint (1,6)
b = random.randint (1,6)
c = self.at + a
if self.master_of_sword != 0:
if a > 6-self.master_of_sword:
d = hero.ac + b
else:
d = hero.ac + b + hero.armor
self.son.change_text (1, "Атака монстра: "+str(c) + " Защита ваша: "+ str(d))
if c >= d:
if int(c/d)>1:
damg = self.damage*int(c/d)
self.son.change_text (4, 'Критический удар! Урон умножается на '+str(int(c/d)))
self.son.change_text (5, 'Критический урон: '+str(self.damage*int(c/d)))
else:
self.son.change_text (4, "Монстр попал и нанес сокрушительный удар!")
damg = self.damage
self.son.change_text (5, 'Урон: '+str(self.damage))
if hero.prevent == 0: hero.hp = hero.hp - damg
else:
if hero.prevent >= damg:
pass
else:
hero.hp = hero.hp - (damg-hero.prevent)
elif c<d:
self.son.change_text (4, 'Вы уклонились!')
self.son.change_text (7, 'Нажмите Е')
hero.monster_turn = False
self.priest_turn = True
if self.priest_turn == True and self.control.k_e == True:
self.control.k_e = False
# self.wait_for_priest_turn = False
self.son.clear_text ()
a = random.randint (1,3)
#boltAnim.blit (adventure_screen, (100, 100))
self.son.change_text (1, "Священник тем временем бормотал слова молитв...")
#self.son.change_text (2, "")
self.son.change_text (3, 'Нажмите Е')
self.lbolt = True
self.priest_turn = False
self.heal = True
if self.heal == True and self.control.k_e == True:
self.control.k_e = False
self.son.clear_text ()
a = random.randint (1,3)
#boltAnim.blit (adventure_screen, (100, 100))
self.son.change_text (1, "Раны на стражнике начали затягиваться!")
#self.son.change_text (2, "")
self.son.change_text (3, 'Нажмите Е')
self.hp += a
if self.hp > 7:
self.hp = 7
self.heal = False
self.wait_for_next_turn = True
if self.control.k_e == True and self.wait_for_next_turn == True and self.control.e_cntrl == True and hero.is_death == False:
self.wait_for_next_turn = False
self.control.k_e = False
hero.turn_main = True
self.son.clear_text ()
class Hermit (Monster):
def __init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp):
Monster.__init__ (self, x, y, battle, textus, control, at, ac, hp, dem, son, exp)
self.tree = textus
self.lbolt = False
self.mname = 'Отшельник'
self.race = 'human'
self.flee = True
#self.image.fill ((220,130,100))
self.ll = False
self.image = image.load('images/hermit.png')
self.icon = pygame.image.load ('images/priest_av.png')
#self.image.set_colorkey ((254,254,254))