Advertisement
DanDelatt

Game

Sep 15th, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 16.99 KB | None | 0 0
  1. # ----- Setup -----
  2. import time
  3. import sys
  4. import os
  5.  
  6. def clear():
  7.     if sys.platform == 'win32':
  8.         os.system('cls')
  9.     else:
  10.         os.system('clear')
  11.        
  12. # ----- Variables -----
  13. lang = 0
  14. t0 = ''
  15.  
  16. choice = 0
  17. i = 0
  18.  
  19. d_ka = True
  20. boss01_alive = True
  21.  
  22. sword = False
  23.  
  24. # ----- Language -----
  25. while lang == 0:
  26.     print('''Language:
  27.          
  28.          1. English  2. Русский
  29.          
  30.          
  31.          ''') #3. Rkfdbfnehysq  4. Español  5. Deutsch
  32.  
  33.     lang = input('Select: ')
  34.  
  35.     if lang == '1':
  36.         welcome = 'Welcome!'
  37.         t0 = '''
  38.         Loading ...
  39.         '''
  40.  
  41.         last = '''
  42.         Blood...
  43.  
  44.         1. ...
  45.         2. ...
  46.         3. ...
  47.         4. ...
  48.         '''
  49.  
  50.         boss_dead0 = '''
  51.         You pierced him with a sword ...
  52.         It seems that you remember why you are here.
  53.         '''
  54.  
  55.         boss_dead1 = '''
  56.         You answered for your sins ...
  57.         Do not return ... I ask.
  58.         I do not want to hurt you anymore.
  59.         '''
  60.  
  61.         play_again = '''
  62.  
  63.         
  64.         Want to start over? (1. Yes / 2. No)
  65.         '''
  66.  
  67.         death001 = '''
  68.         South door?
  69.         How did you decide that it exists at all?
  70.         Contrary to all your prejudices, there is an ordinary wall there.
  71.         ...
  72.         You turned back ...
  73.         All the doors, in an unknown way for you, have disappeared ...
  74.         Your demise is inevitable. '''
  75.  
  76.         death002 = '''
  77.         You chose the north door.
  78.         After a meaningless three-minute walk along a monotonous corridor, you notice that the walls are sharply tapering ... But the beckoning light at the end of the corridor is so close that it seems you can reach out with your hand.
  79.         It is impossible to move.
  80.         A sad thought makes your blood freeze in your veins.
  81.         "This is the end"'''
  82.  
  83.         death003 = '''
  84.         You grabbed the torch.
  85.         His bright flame blinded you ...
  86.         In a second you were already flying to the bottom of the abyss ...
  87.         
  88.         Your death is inevitable.
  89.         Even after that, you are still flying down ... '''
  90.  
  91.         death004 = '''
  92.         You run ...
  93.         A bitter smell eats your eyes ...
  94.         You do not feel anything ...
  95.  
  96.         This is another "end" ...
  97.         '''
  98.  
  99.         death005 = '''
  100.         * click * ...
  101.         You have hurt the faith ...
  102.  
  103.         Your head was struck by an arrow.
  104.         
  105.         '''
  106.  
  107.         death006 = '''
  108.         "Die, murderer!"
  109.         
  110.         '''
  111.  
  112.         death007 = '''
  113.         You run to the aisle.
  114.         Suddenly a beast jumps on you.
  115.         You can not do anything now, because the beast opens its jaws and tears you apart.
  116.         '''
  117.  
  118.         death008 = '''
  119.         ...
  120.         '''
  121.  
  122.         tt0 = '''
  123.         You feel the weight of your sins ...
  124.         Pain in the bones and muscles.
  125.         Around the whole darkness, however, raising your head, you found three doors ...
  126.         That it does not mean now you have a choice:
  127.         
  128.         1. The Western Door
  129.         2. The North Door
  130.         3. The Eastern door
  131.         '''
  132.  
  133.         tt1 = '''
  134.         A lovely blacksmith, alone, forges a sword.
  135.         She does not pay attention to you.
  136.         It seems that you can safely pass by.
  137.         
  138.         1. To run away
  139.         2. Take the torch
  140.         3. Come closer
  141.         4. Grasp the torch
  142.         5. Go back
  143.         '''
  144.  
  145.         tt15 = '''
  146.         The Sword lies alone on the ground
  147.         
  148.         1. To run away
  149.         2. Take the torch
  150.         3. Come closer
  151.         4. Go back
  152.         '''
  153.  
  154.         tt2 = '''
  155.         You came closer.
  156.         You beckon to touch the sword ...
  157.         You touch the sword.
  158.         We shout a name you do not know.
  159.         Waving. Hit. Blood...
  160.         '''
  161.  
  162.         tt3 = '''
  163.         You grabbed the torch.
  164.         His bright flame blinded the girl ...
  165.         
  166.         Having drawn a sword she will scream and fall into the abyss ... '''
  167.  
  168.         tt4 = '''
  169.         You walked along the old corridor ...
  170.         Unexpectedly pleasant and odd for a dungeon smell of homemade baking fills a small room.
  171.         In front of you there is a blond man dressed in a blue blouse. His misted steampank glasses gleam in the bright light of the torch.
  172.         Your views are chained to each other.
  173.         His smile becomes wider and wider ...
  174.         ...
  175.         There is no way back.
  176.         
  177.         1. The Western Door
  178.         2. The Eastern door
  179.         3. Something else ...
  180.         
  181.         The choice is yours.
  182.         '''
  183.  
  184.         tt5 = '''
  185.         
  186.         A terribly stuffy room, you want to escape from it as quickly as possible.
  187.         
  188.         Before you the next choice:
  189.         
  190.         1. West
  191.         2. North
  192.         3. East
  193.         
  194.         But you do not care.
  195.         '''
  196.  
  197.         ttpost5 = 'And again ...'
  198.  
  199.         tt6 = '''
  200.         You raised the torch ...
  201.         You put the torch back ...
  202.         '''
  203.  
  204.         sw = '''
  205.         You raised your sword.
  206.         '''
  207.  
  208.         lose = '''
  209.         You went back ...
  210.         The earth goes under your feet.
  211.         '''
  212.  
  213.         win = '''
  214.         Freedom ... I don't need your body anymore ... =)
  215.         '''
  216.     elif lang == '2':
  217.         welcome = 'Добро пожаловать!'
  218.         t0 = '''
  219.        Идет загрузка...
  220.        '''
  221.  
  222.         last = '''
  223.        Кровь...
  224.  
  225.        1. ...
  226.        2. ...
  227.        3. ...
  228.        4. ...
  229.        '''
  230.        
  231.         boss_dead0 = '''
  232.        Вы пронзили его мечом...
  233.        Кажется, вы споминаете от чего вы здесь.
  234.        '''
  235.  
  236.         boss_dead1 = '''
  237.        Ты ответил за свои грехи...
  238.        Не возращайся... Прошу.
  239.        Я не хочу причинять тебе боль снова.
  240.        '''
  241.        
  242.         play_again = '''
  243.  
  244.        
  245.        Хотите начать сначала? (1. Да / 2. Нет)
  246.        '''
  247.        
  248.         death001 = '''
  249.        Южная дверь?
  250.        С чего вы решили, что она вообще существует?
  251.        Вопреки всем вашим предубеждениям, там находится обычная стена.
  252.        ...
  253.        Вы повернулись обратно...
  254.        Все двери, неведомым для вас способом, исчезли...
  255.        Ваша кончина неизбежна.'''
  256.        
  257.         death002 = '''
  258.        Вы выбрали северную дверь.
  259.        После бессмысленного трехминутного хождения по однообразному коридору вы замечаете, что стены резко сужаются... Но манящий свет находящийся в конце коридора так близко, что кажется можно дотянуться рукой.
  260.        Невозможно пошевелиться.
  261.        Печальная мысль заставляет вашу кровь застыть в жилах.
  262.        "Это конец"'''
  263.        
  264.         death003 = '''
  265.        Вы схватили факел.
  266.        Его яркое пламя ослепило вас...
  267.        Через секунду вы уже летели на дно бездны...
  268.        
  269.        Ваша смерть неизбежна.
  270.        Даже после этого, вы все ещё летите вниз...'''
  271.  
  272.         death004 = '''
  273.        Вы бежите...
  274.        Едкий запах разъедает вам глаза...
  275.        Вы ничего не чувствуете...
  276.  
  277.        Это очередной "конец"...
  278.        '''
  279.        
  280.         death005 = '''
  281.        *щелк*...
  282.        Вы задели вере...
  283.  
  284.        Вашу голову пробила стрела.
  285.        
  286.        '''
  287.  
  288.         death005 = '''
  289.        *щелк*...
  290.        Вы задели вере...
  291.  
  292.        Вашу голову пробила стрела.
  293.        
  294.        '''
  295.        
  296.         death006 = '''
  297.        "Умри, убийца!"
  298.        
  299.        '''
  300.  
  301.         death007 = '''
  302.        Вы бежите к проходу.
  303.        Внезапно на вас прыгает зверь.
  304.        Вы не можете, что-либо сделать сейчас, потому что зверь открывает свои челюсти и разрывает вас на части.
  305.        '''
  306.        
  307.         death008 = '''
  308.        ...
  309.        '''
  310.        
  311.         tt0 = '''
  312.        Вы чувствуете тяжесть своих грехов...
  313.        Боль в костях и мышцах.
  314.        Вокруг сплошная тьма, однако, подняв голову, вы обнаружили три двери...
  315.        Чтобы это не значило сейчас вам предстоит выбор:
  316.        
  317.        1. Западная дверь
  318.        2. Северная дверь
  319.        3. Восточная дверь
  320.        '''
  321.         tt1 = '''
  322.        Милая девушка-кузнец в одиночестве кует меч.
  323.        Она не обращает на вас внимания.
  324.        Похоже, что вы можете спокойно пройти мимо.
  325.        
  326.        1. Бежать
  327.        2. Взять факел
  328.        3. Подойти ближе
  329.        4. Схватить факел
  330.        5. Вернуться
  331.        '''
  332.         tt15 = '''
  333.        Меч одиноко лежит на земле
  334.        
  335.        1. Бежать
  336.        2. Взять факел
  337.        3. Подойти ближе
  338.        4. Вернуться
  339.        '''
  340.         tt2 = '''
  341.        Вы подошли ближе.
  342.        Вас манит дотронуться до меча...
  343.        Вы дотрагиваетесь до меча.
  344.        Мы кричите незнакомое вам имя.
  345.        Взмах. Удар. Кровь...
  346.        '''  
  347.         tt3 = '''
  348.        Вы схватили факел.
  349.        Его яркое пламя ослепило девушку...
  350.        
  351.        Обранив меч она с криками падет в бездну...'''
  352.         tt4 = '''
  353.        Вы прошли по старому коридору...
  354.        Неожидано приятный и странный для подземелья запах домашней выпечки заполняет небольшую комнату.
  355.        Перед вами предстаёт блондин облаченный в синюю кофту. Его запотевшие паропанковские очки блестят в ярком свете факела.
  356.        Ваши взгляды прикованы друг другу.
  357.        Его улыбка становится все шире и шире...
  358.        ...
  359.        Пути назад нет.
  360.        
  361.        1. Западная дверь
  362.        2. Восточная дверь
  363.        3. Что-то другое...
  364.        
  365.        Выбор остаётся за вами.
  366.        '''
  367.         tt5 = '''
  368.        
  369.        Ужасно душная комната, вы хотите поскорее сбежать из неё.
  370.        
  371.        Перед вами очередной выбор:
  372.        
  373.        1. Запад
  374.        2. Север
  375.        3. Восток
  376.        
  377.        Но вам всё равно.
  378.        '''
  379.         ttpost5 = 'И снова...'
  380.         tt6 = '''
  381.        Вы подняли факел...
  382.        Вы положили факел обратно...
  383.        '''
  384.  
  385.         sw = '''
  386.        Вы подняли меч.
  387.        '''
  388.  
  389.         lose = '''
  390.        Вы пошли назад...
  391.        Земля уходит у вас из под ног.
  392.        '''
  393.  
  394.         win = '''
  395.        Свобода... Твоё тело мне больше не нужно... =)
  396.        '''
  397.     #elif lang == 3:
  398.         #welcome = 'Lj,hj gj;fkjdfnm!'
  399.     #elif lang == 4:
  400.         #welcome = '¡Bienvenido!'
  401.     #elif lang == 5:
  402.         #welcome = 'Herzlich willkommen!'
  403.     else:
  404.         lang = 0
  405.        
  406.         clear()
  407.        
  408.         print('''
  409.              
  410.              
  411.              Error #001: invalid language code
  412.              * Write correct language code, please.
  413.    
  414.    
  415.              ''')
  416.        
  417.         if type(lang) != int:
  418.             clear()
  419.        
  420.             print('''
  421.                  
  422.                  
  423.                  Error #002: invalid language code
  424.                  * Write language code in numbers, please.
  425.                  
  426.                  
  427.                  ''')
  428.  
  429. # ----- Welcome -----
  430. clear()
  431.  
  432. print('''
  433.      {}
  434.      '''.format(welcome))
  435.  
  436. print('''
  437.      {}
  438.      '''.format(t0))
  439.  
  440. time.sleep(5)
  441. clear()
  442.  
  443. # ----- Overworld -----
  444. # --- Room n.1 ---
  445. def rm_001():
  446.     print(tt0)
  447.    
  448.     choice = input("> ")
  449.    
  450.     if '1' in choice:
  451.         clear()
  452.         rm_002()
  453.     elif '2' in choice:
  454.         game_over(death002)
  455.     elif '3' in choice:
  456.         clear()
  457.         rm_004()
  458.     elif '4' in choice:
  459.         game_over(death001)
  460.     else:
  461.         clear()
  462.         rm_001()
  463.  
  464. # --- Room n.2 ---
  465. def rm_002():
  466.     print(tt5)
  467.    
  468.     choice = input("> ")
  469.  
  470.     if '1' in choice:
  471.         game_over(death005)
  472.     elif '2' in choice:
  473.         clear()
  474.         rm_003()
  475.     elif '3' in choice:
  476.         clear()
  477.         print(ttpost5)
  478.         rm_001()
  479.     else:
  480.         clear()
  481.         rm_002()
  482.  
  483. # --- Room n.3 ---
  484. def rm_003():
  485.  
  486.     global d_ka
  487.     global sword
  488.  
  489.     if d_ka:
  490.         print(tt1)
  491.  
  492.         choice = input("> ")
  493.  
  494.         if "1" in choice:
  495.             game_over(death007)
  496.         elif "2" in choice:
  497.             print(tt3)
  498.             d_ka = False
  499.             rm_003()
  500.         elif "3" in choice:
  501.             print(tt2)
  502.             d_ka = False
  503.             sword = True
  504.             rm_003()
  505.         elif "4" in choice:
  506.             game_over(death003)
  507.         elif "5" in choice:
  508.             rm_002()
  509.         else:
  510.             clear()
  511.             rm_003()
  512.  
  513.     else:
  514.         print(tt15)
  515.  
  516.         choice = input("> ")
  517.  
  518.         if "1" in choice:
  519.             rm_004()
  520.         elif "2" in choice:
  521.             print(tt6)
  522.             rm_003()
  523.         elif "3" in choice:
  524.             print(sw)
  525.             sword = True
  526.             rm_004()
  527.         elif "4" in choice:
  528.             game_over(lose)
  529.         elif "5" in choice:
  530.             rm_002()
  531.         else:
  532.             rm_003()
  533.  
  534. # ----- Boss 01 -----
  535. def rm_004():
  536.  
  537.     global boss01_alive
  538.  
  539.     if boss01_alive:
  540.         print(tt4)
  541.        
  542.         if sword:
  543.             print(boss_dead0)
  544.             boss01_alive = False
  545.            
  546.             clear()
  547.             rm_004()
  548.         else:
  549.             print(boss_dead1)
  550.  
  551.         choice = input("> ")
  552.  
  553.         game_over(death006)
  554.  
  555.     else:
  556.         choice = input("> ")
  557.  
  558.         if '1' in choice:
  559.             print(last)
  560.             game_over(death008)
  561.         elif '2' in choice:
  562.             clear()
  563.             print(ttpost5)
  564.             rm_001()
  565.            
  566.         elif '3' in choice:
  567.             clear()
  568.             rm_004()
  569.         elif '4' in choice:
  570.             game_over(win)
  571.         else:
  572.             clear()
  573.             rm_004()
  574.  
  575. # ----- START -----
  576. def start():
  577.     rm_001()
  578.  
  579. # ----- GAME OVER -----
  580. def game_over(text):
  581.     global beast_alive
  582.     global boss01_alive
  583.     global sword
  584.  
  585.     d_ka = True
  586.     boss01_alive = True
  587.     sword = False
  588.  
  589.     print(text)
  590.     time.sleep(5)
  591.    
  592.     print(play_again)
  593.  
  594.     choice = ""
  595.     while choice != '1' and choice != '2':
  596.         choice = input('> ')
  597.         if choice == '1':
  598.             clear()
  599.             start()
  600.         elif choice == '2':
  601.             exit(0)
  602.  
  603.  
  604. # ----- MAIN -----
  605. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement