Advertisement
Nikolcho

ShowHero & ShowHeroAction

May 27th, 2020
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.70 KB | None | 0 0
  1. Console.WriteLine("Select what you want to do: (write the number before the action)");
  2.             Console.WriteLine("1. Skip");
  3.             Console.WriteLine("2. Fight");
  4.             Console.WriteLine("3. Deal");
  5.             Console.WriteLine("4. Speak");
  6.  
  7.             int action = 1;
  8.             do
  9.             {
  10.                 action = int.Parse(Console.ReadLine());
  11.             } while (action < 0 || action > 4);
  12.  
  13.             switch (action)
  14.             {
  15.                 case 1:
  16.                     return HeroActionType.Skip;
  17.                 case 2:
  18.                     return HeroActionType.Fight;
  19.                 case 3:
  20.                     return HeroActionType.Deal;
  21.                 case 4:
  22.                     return HeroActionType.Speak;
  23.             }
  24.  
  25.             // default case
  26.             return HeroActionType.Skip;
  27.  
  28.  
  29.  
  30.  
  31. showaheroactio
  32.  
  33. switch (action)
  34.             {
  35.                 case HeroActionType.Skip:
  36.                     Console.WriteLine($"You skipped the {opponent.Name}");
  37.                     break;
  38.                 case HeroActionType.Fight:
  39.                     Console.WriteLine($"You fight with " + opponent.Name + "you have" + Game.MyHero.Power +
  40.                     "power left" + Game.MyHero.Gold +
  41.                     " gold and your experiance is" + Game.MyHero.Experience);
  42.                     break;
  43.                 case HeroActionType.Deal:
  44.                     Console.WriteLine($"You deal with {opponent.Name}");
  45.                     break;
  46.                 case HeroActionType.Speak:
  47.                     Console.WriteLine($"You speak with {opponent.Name}");
  48.                     break;
  49.                 default:
  50.                     break;
  51.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement