kisame1313

Lecture_3

Aug 26th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         byte PlayerAge;
  12.         string PlayerName;
  13.         int PlayerHealth, DamageToPlayer;
  14.         bool PlayerDeath, PlayerHands, DoorIsOpen, KeyFromDoor;
  15.  
  16.         static void Main(string[] args)
  17.         {
  18.  
  19.         }
  20.  
  21.         void UserInfo()
  22.         {
  23.             Console.Clear();
  24.  
  25.             Console.WriteLine();
  26.             PlayerName = Console.ReadLine();
  27.  
  28.             Console.WriteLine();
  29.             PlayerAge = Convert.ToByte(Console.ReadLine());
  30.  
  31.             Console.WriteLine();
  32.             PlayerHealth = Convert.ToInt32(Console.ReadLine());
  33.         }
  34.  
  35.         void UserHands()
  36.         {
  37.             Console.WriteLine();
  38.             char PlayerAnswer = Convert.ToChar(Console.ReadLine().ToUpper());
  39.  
  40.             if (PlayerAnswer == 'Y')
  41.             {
  42.                 PlayerHands = true;
  43.             }
  44.             else if (PlayerAnswer == 'N')
  45.             {
  46.                 PlayerHands = false;
  47.             }
  48.             else
  49.             {
  50.                 return;
  51.             }
  52.         }
  53.  
  54.         void UserHasKey()
  55.         {
  56.             Console.WriteLine();
  57.             char PlayerAnswer = Convert.ToChar(Console.ReadLine().ToUpper());
  58.  
  59.             if (PlayerAnswer == 'Y')
  60.             {
  61.                 KeyFromDoor = true;
  62.             }
  63.             else if (PlayerAnswer == 'N')
  64.             {
  65.                 KeyFromDoor = false;
  66.             }
  67.             else
  68.             {
  69.                 return;
  70.             }
  71.         }
  72.  
  73.         void DoorOpen()
  74.         {
  75.             Console.WriteLine();
  76.             char PlayerAnswer = Convert.ToChar(Console.ReadLine().ToUpper());
  77.  
  78.             if (PlayerAnswer == 'Y')
  79.             {
  80.                 DoorIsOpen = true;
  81.             }
  82.             else if (PlayerAnswer == 'N')
  83.             {
  84.                 DoorIsOpen = false;
  85.             }
  86.             else
  87.             {
  88.                 return;
  89.             }
  90.         }
  91.  
  92.         void UserEntrance()
  93.         {
  94.             if (DoorIsOpen || (PlayerHands && KeyFromDoor))
  95.             {
  96.                 Console.WriteLine();
  97.             }
  98.             else
  99.             {
  100.                 Console.WriteLine();
  101.                
  102.             }
  103.         }
  104.  
  105.         void UserBattle()
  106.         {
  107.             Console.WriteLine();
  108.             DamageToPlayer = Convert.ToInt32(Console.ReadLine());
  109.             PlayerHealth -= DamageToPlayer;
  110.  
  111.             if (PlayerHealth <= 0)
  112.             {
  113.                 Console.WriteLine();
  114.                 PlayerDeath = true;
  115.                 if (PlayerDeath)
  116.                 {
  117.                     PlayerName = "DeathUser";
  118.                     Console.WriteLine();
  119.                 }
  120.             }
  121.             else
  122.             {
  123.                 return;
  124.             }
  125.         }
  126.     }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment