Advertisement
Guest User

D&D

a guest
Feb 10th, 2019
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module Module1
  2.     Declare Sub Sleep Lib "kernel32.dll" (ByVal Milliseconds As Integer)
  3.     'Dim NL = VBCr
  4.  
  5.     Sub Main()
  6.         Dim age As Integer
  7.         Dim name As String
  8.         Dim wish As String
  9.         Dim msg As String
  10.  
  11.         Console.WriteLine("How old are you?")
  12.         age = Console.ReadLine()
  13.         If age < 13 Then
  14.             Console.WriteLine("Please Exit the game")
  15.             Console.WriteLine("Sorry you have to be 13 or older to play this game.")
  16.             Goodbye("")
  17.         End If
  18.         Console.WriteLine("What is your name?")
  19.         name = Console.ReadLine()
  20.         Console.WriteLine("Hello " + name)
  21.  
  22.         'Console.WriteLine("Do you wish to continue?")
  23.  
  24.         If doAction("Do you wish to continue?", {"Yes", "No"}) = 2 Then Goodbye(name)
  25.  
  26.  
  27.         'Start Game
  28.        wish = doAction("You are asked to visit the Mayor, do you accept his invitation or not?", {"Yes", "no"})
  29.         If wish = 2 Then Console.WriteLine("Your wife manages to convince you to visit the mayor.")
  30.  
  31.         wish = doAction("You are given a quest to kill the Sea Dragon, do you wish to accept it or not?", {"Yes", "no"})
  32.         If wish = 2 Then Goodbye("You are exiled to the mountain for cowardness.")
  33.         RoadFork(name)
  34.         'End of Game
  35.        Console.WriteLine("Thanks for playing " + name)
  36.  
  37.     End Sub
  38.     Private Function RoadFork(name As String)
  39.         Dim wish As String
  40.  
  41.         wish = doAction("You meet a fork in the fork in the road." & vbCrLf & " Do you go left or right?", {"left", "right"})
  42.         'LeftRight("You meet a fork in the fork in the road. ")
  43.        If wish = 1 Then      ' do left  
  44.            ' Console.WriteLine()
  45.            If doAction("You get ambushed by a Horde of Kobolds. What do you do?" & vbCrLf +
  46.                         "Run, fight or hide.", {"Run", "Fight", "Hide"}) = 3 Then
  47.                 Console.WriteLine("Good choice " + name)
  48.                 Console.WriteLine("They walk past without detecting you.")
  49.  
  50.             Else Goodbye(name)
  51.             End If
  52.             wish = doAction("You are in hiding," & vbCrLf +
  53.                             "Do you want to make a run for it now to get away fast Or wait till midday " +
  54.                             "when the kobolds have slightly lower stats?", {"now", "run", "wait"})
  55.             If wish = 1 Or wish = 2 Then
  56.                 Goodbye("One of the kobolds spots you out of the corner of his eye and cuts your stomach open.")
  57.             ElseIf wish = 3 Then
  58.                 Console.WriteLine("Patience is a virtue my friend, You manage to escape the kobolds territory leaving them snarling and hungry.")
  59.  
  60.             End If
  61.  
  62.             wish = doAction("You have just escaped a horde of Kobolds," & vbCrLf +
  63.                             "Do you wish to continue to the Fjord to kill the Sea Dragon like a soldier " +
  64.                             "or return to your village to rejuvenate and save the dragon for tommorow?", {"Rest", "Continue"})
  65.             If wish = 1 Then
  66.                 Console.WriteLine("You tell the Mayor of your day and he allows you to rest and deal with the dragon tommorow.")
  67.                 Dim a As Integer
  68.                 For a = 1 To 5
  69.                     Console.Write(".")
  70.                     Sleep(1750)
  71.                 Next
  72.                 Console.WriteLine(". A day has passed")
  73.  
  74.                 RoadFork(name)
  75.             ElseIf wish = 2 Then
  76.                 Console.WriteLine("All of this trouble only to get mauled by a sill polar bear, Patience is a virtue fool")
  77.                 Goodbye(name)
  78.             End If
  79.  
  80.         Else
  81.  
  82.             ' do right
  83.            RightPath(name)
  84.  
  85.  
  86.         End If
  87.     End Function
  88.  
  89.     Private Sub Goodbye(msg As String)
  90.         Console.WriteLine(msg)
  91.         Dead()
  92.         Console.WriteLine("Press <Enter> to quit")
  93.         Console.ReadLine()
  94.  
  95.     End Sub
  96.  
  97.     Private Function doAction(msg As String, ByRef choice() As String)
  98.         Dim myoption As String
  99.         Dim wish As String
  100.         Dim count As Integer
  101.         For Each myoption In choice
  102.             Console.Write(myoption + "/ ")
  103.         Next
  104.         Console.WriteLine(vbBack + vbBack + ".")
  105.         count = 0
  106.         Console.WriteLine(msg)
  107.         wish = Left(Console.ReadLine().ToLower.Trim(), 1)
  108.         For Each myoption In choice
  109.             count = count + 1
  110.             'Console.WriteLine("Your wish is:" & wish & "     Option:" & myoption & "     count:" & count)
  111.            If wish = Left(myoption.ToLower.Trim(), 1) Then Return count
  112.         Next
  113.         Console.WriteLine("I don't know what " + wish + " means")
  114.         Console.WriteLine("please choose either")
  115.  
  116.         Return doAction(msg, choice)
  117.  
  118.  
  119.     End Function
  120.  
  121.  
  122.  
  123.     Private Function LeftRight(msg As String)
  124.  
  125.         Console.WriteLine(msg + "Do you go Left or Right?")
  126.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "l" Then Return 1
  127.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "r" Then Return 2
  128.         Console.WriteLine("its a simple choice.")
  129.  
  130.         Return 0
  131.     End Function
  132.  
  133.     Private Function RunFightHide()
  134.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "r" Then Return 1
  135.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "f" Then Return 2
  136.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "h" Then Return 3
  137.  
  138.  
  139.     End Function
  140.  
  141.     Private Function NowWait()
  142.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "n" Then Return 1
  143.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "w" Then Return 2
  144.     End Function
  145.  
  146.     Private Function RestContinue()
  147.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "r" Then Return 1
  148.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "c" Then Return 2
  149.     End Function
  150.  
  151.     Private Function RightPath(name As String)
  152.         Dim wish As String
  153.         wish = doAction("You arrive at the Fjord", {"Call", "Go"})
  154.         If wish = 1 Then
  155.             wish = doAction("The dragon lunges out of the water", {"Attack", "Run"})
  156.             If wish = 1 Then
  157.                 wish = doAction("Choose the weapon you would like to fight the dragon with", {"Crossbow", "Tommohawks", "Flail"})
  158.                 If wish = 1 Then
  159.                     Goodbye("The arrow fails to penetrate his scales and he melts you with boiling water")
  160.                 ElseIf wish = 2 Then
  161.                     wish = doAction("You manage to beach the dragon and it is severely injured, do you want to finnish the dragon or wait for it to die?", {"Finnish", "wait"})
  162.                     If wish = 1 Then
  163.                         Goodbye("The dragon uses its last bit of life to burn you with a blast of boiling water.")
  164.                     Else
  165.                         Console.WriteLine("Patience is a virtue, you have succesfully defeated the sea dragon")
  166.                         Console.WriteLine("The dragon has breathed its last breath, your job is done")
  167.                         wish = doAction("Do you take home some of the dragons flesh to show the Mayor or do you run home in victory and maybe get extra reward for your rapid time", {"Flesh", "home"})
  168.                         If wish = 1 Then
  169.                             Console.WriteLine("The Mayor commends you on your valiance, You are now free to leave the city when you please.")
  170.                             Console.WriteLine("Thankyou for playing my game and CONGRATULATIONS!")
  171.                         Else
  172.                             Console.WriteLine("You need proof")
  173.                             wish = doAction("You return to the dragon corpse to see it is being ravished by two gnolls, do you fight them or run away.", {"Fight", "Run"})
  174.                             If wish = 1 Then
  175.                                 Console.WriteLine("You manage to grab and tie up both gnolls in some hemp cloth.")
  176.                                 wish = doAction("Do you leave them to rot or take them back with the dragon meat", {"Rot", "take"})
  177.                                 If wish = 1 Then
  178.                                     Console.WriteLine("They are discovered by other unlawfuls and there is now a bounty on your head")
  179.                                     wish = doAction("Bounty hunters arrive at your village do you barter with them, Run away, Fight them, or hide from them", {"Barter", "Run", "Fight", "Hide"})
  180.                                     If wish = 1 Then
  181.                                         Console.WriteLine("You must give them 105 gold each")
  182.                                         wish = doAction("Do you give them the money or not", {"Yes", "No"})
  183.                                         If wish = 1 Then
  184.                                             Console.WriteLine("They leave you alone but you are now bankrupt, However you are free to leave the city and expand your buisness.")
  185.                                             Console.WriteLine("You need money and fast.")
  186.                                             wish = doAction("Do you beg for money or turn to theft.", {"Beg", "Theft"})
  187.                                             If wish = 1 Then
  188.                                                 Console.WriteLine("A Half Orc wearing a suit suit and tie beats you up and leaves you for dead for being so petty as to beg for money.")
  189.                                                 wish = doAction("Do you scream loudly for help or wait for someone to walk by.", {"Scream", "Wait"})
  190.                                                 If wish = 1 Then
  191.                                                     Goodbye("You attract a pack of wild wolves which feast on your guts, YOU DIE.")
  192.                                                 Else
  193.                                                     Goodbye("No One passes and you eventually freeze to death, YOU DIE.")
  194.                                                 End If
  195.                                             End If
  196.                                         End If
  197.                                     ElseIf wish = 2 Then
  198.                                         Console.WriteLine("They catch up with you and bring you to the sheriff who locks you up in an underground prison with NO escape.
  199.  
  200. ")
  201.                                         Console.WriteLine("(@@@@@@@@ @@@&.@@@# @@@@@@*    @@@@@@% @@@( %@@% @@@@@@@@.                                                  
  202.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@@ %@@% @@@@ @@@@                                                  
  203.                                                    .@@@%   @@@&*@@@# @@@@       @@@@    @@@@@%@@% @@@@ @@@@                                                  
  204.                                                    .@@@%   @@@@@@@@# @@@@@@     @@@@@@* @@@@@@@@% @@@@ @@@@                                                  
  205.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@(@@@@% @@@@ @@@@                                                  
  206.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@ @@@@% @@@@ @@@@                                                  
  207.                                                    .@@@%   @@@&.@@@# @@@@@@&    @@@@@@@ @@@  @@@% @@@@@@@@&")
  208.                                     ElseIf wish = 3 Then
  209.                                         Console.WriteLine("You are Outnumbered and the work together to bring you to the sheriff who locks you up in an underground prison with NO escape.
  210.  
  211. ")
  212.                                         Console.WriteLine("(@@@@@@@@ @@@&.@@@# @@@@@@*    @@@@@@% @@@( %@@% @@@@@@@@.                                                  
  213.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@@ %@@% @@@@ @@@@                                                  
  214.                                                    .@@@%   @@@&*@@@# @@@@       @@@@    @@@@@%@@% @@@@ @@@@                                                  
  215.                                                    .@@@%   @@@@@@@@# @@@@@@     @@@@@@* @@@@@@@@% @@@@ @@@@                                                  
  216.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@(@@@@% @@@@ @@@@                                                  
  217.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@ @@@@% @@@@ @@@@                                                  
  218.                                                    .@@@%   @@@&.@@@# @@@@@@&    @@@@@@@ @@@  @@@% @@@@@@@@&")
  219.                                     Else
  220.                                         Console.WriteLine("They tear the town up and find you hidden in the toilet of the Tavern, they bring you to the sheriff who locks you up in an underground prison with NO escape.
  221.  
  222. ")
  223.                                         Console.WriteLine("(@@@@@@@@ @@@&.@@@# @@@@@@*    @@@@@@% @@@( %@@% @@@@@@@@.                                                  
  224.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@@ %@@% @@@@ @@@@                                                  
  225.                                                    .@@@%   @@@&*@@@# @@@@       @@@@    @@@@@%@@% @@@@ @@@@                                                  
  226.                                                    .@@@%   @@@@@@@@# @@@@@@     @@@@@@* @@@@@@@@% @@@@ @@@@                                                  
  227.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@(@@@@% @@@@ @@@@                                                  
  228.                                                    .@@@%   @@@&.@@@# @@@@       @@@@    @@@ @@@@% @@@@ @@@@                                                  
  229.                                                    .@@@%   @@@&.@@@# @@@@@@&    @@@@@@@ @@@  @@@% @@@@@@@@&")
  230.                                     End If
  231.  
  232.                                 Else
  233.                                 Console.WriteLine("The mayor fines them 650 gold each and lets them go, He  gives you 500 gold as well as freedom to leave the city")
  234.                                 Console.WriteLine("Thankyou for playong my game and CONGRATULATIONS!")
  235.                             End If
  236.  
  237.                             Else
  238.                             Goodbye("You get lost in the heavy snow and freeze to death.")
  239.                             End If
  240.                         End If
  241.  
  242.  
  243.                     End If
  244.                 Else
  245.                     Goodbye("You got too close to the dragon and it bit off your head, YOU DIE.")
  246.                 End If
  247.             ElseIf wish = 2 Then
  248.                 Console.WriteLine("You have escaped the dragon.")
  249.                 emptyhanded(name)
  250.             End If
  251.         Else
  252.         emptyhanded(name)
  253.         End If
  254.     End Function
  255.  
  256.     Private Function emptyhanded(name As String)
  257.         Dim wish As String
  258.         wish = doAction("Do you return empty handed or kill another animal and pretend it is the dragon.", {"Return", "Pretend"})
  259.         If wish = 1 Then
  260.             Goodbye("You" + name + "are exiled")
  261.         ElseIf wish = 2 Then
  262.             Console.WriteLine("You need proof")
  263.             wish = doAction("Do you kill the dragon or admit that your lying.", {"Kill", "Admit"})
  264.             If wish = 2 Then
  265.                 Goodbye("You ar hung in the town square for lying and dis respecting the Mayor")
  266.             Else
  267.                 RightPath(name)
  268.             End If
  269.         End If
  270.  
  271.     End Function
  272.  
  273.     Private Function Weapon(name As String)
  274.  
  275.     End Function
  276.  
  277.     Private Function EndWait(name As String)
  278.  
  279.     End Function
  280.  
  281.     Private Function LieReturn(name As String)
  282.  
  283.     End Function
  284.  
  285.  
  286.     'Check for yes or no
  287.    Private Function YesNo()
  288.         If Left(Console.ReadLine().ToLower.Trim(), 1) = "y" Then Return 1
  289.         Return 0
  290.     End Function
  291.  
  292.     Private Function Mayor()
  293.         Console.WriteLine("You are asked to visit the Mayor" +
  294.                           "Do you accept his invitation or not?")
  295.         If (YesNo() = 0) Then
  296.             Console.WriteLine("Your wife manages to convince you to visit the mayor.")
  297.         End If
  298.         Console.WriteLine("You are given a quest to kill the Sea Dragon." +
  299.                           "Do you wish to accept it or not?")
  300.         Return YesNo()
  301.  
  302.     End Function
  303.  
  304.     Private Function Quest()
  305.         Console.WriteLine()
  306.         'Dim LR As Integer
  307.        'LR = LeftRight()
  308.        'While LR = 0
  309.        'LR = LeftRight()
  310.  
  311.         'End While
  312.        'Console.WriteLine(LR)
  313.        Return 0
  314.     End Function
  315.  
  316.     Private Function Deadsg()
  317.         Form1.ActiveForm.Show()
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.     End Function
  326.  
  327.  
  328.  
  329.  
  330.     Private Sub Dead()
  331.         Console.WriteLine("                                                                              
  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.     End Sub
  380.  
  381.  
  382.  
  383. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement