Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Test
- {
- class Kinght
- {
- public int HP { get; set; }
- public string Name { get; set; }
- public int MP { get; set; }
- public int Heal = 30;
- public void InputInfo()
- {
- Name = Console.ReadLine();
- HP = int.Parse(Console.ReadLine());
- MP = int.Parse(Console.ReadLine());
- }
- public bool CheckMP()
- {
- return MP >= 50;
- }
- public void UseSkill()
- {
- if (MP >= 50)
- {
- MP -= 50;
- HP += Heal;
- }
- ShowInfo();
- }
- public void ShowInfo()
- {
- Console.WriteLine("HP: " + HP);
- Console.WriteLine("MP: " + MP);
- }
- }
- class RunMain
- {
- static void Main(string[] args)
- {
- Kinght a = new Kinght();
- a.InputInfo();
- while (a.CheckMP())
- {
- a.UseSkill();
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment