示例#1
0
 public static void Is_Alive_Neutral(Player _player)
 {
     if (_player.Char_Health <= 0)
     {
         isalive = false;
         Console.WriteLine("You are dead.");
         End.End_Method();
     }
     else
     {
         isalive = true;
     }
 }
示例#2
0
        public static void Action_Handler(Player _player, Enemy _enemy, string _Sentence01, string _Sentence02)
        {
            while (_enemy.Enemy_Health > 0f && _player.Char_Health > 0f)
            {
                Console.Write("What do you do?:  Attack [1] | Defend [2] | View Inventory [3] | Save [4] | Quit [5]");
                string actionchoice = Console.ReadLine();
                if (_enemy.Enemy_Health > 0 && _player.Char_Health > 0)
                {
                    switch (actionchoice)
                    {
                    case "1":
                        Give_Damage(_player, _enemy);
                        break;

                    case "2":
                        Take_Damage(_player, _enemy);
                        break;

                    case "3":
                        Draw_UI.Draw_Inventory_Main(_player, _Sentence01, _Sentence02);
                        break;

                    case "4":
                        Save.Save_Character(_player);
                        break;

                    case "5":
                        Exit.Exit_Main();
                        break;
                    }
                }
                else
                {
                    if (_enemy.Enemy_Health <= 0)
                    {
                        Console.WriteLine("Enemy is dead");
                        break;
                    }
                    else
                    {
                        Console.WriteLine("You are dead.");
                        End.End_Method();
                    }
                }
            }
        }