using System;
namespace replace
{
internal partial class Program
{
enum gameObject
{
None,
Pdmg,
Php,
Edmg,
Ehp,
}
static void Main(string[] args)
{
Console.Write("플레이어 이름: ");
string Player = Console.ReadLine();
Console.Write("공격력: ");
int PlayerDmg = Convert.ToInt32(Console.ReadLine());
Console.Write("체력: ");
int PlayerHP = Convert.ToInt32(Console.ReadLine());
Console.Write("몬스터 이름: ");
string Enemy = Console.ReadLine();
Console.Write("공격력: ");
int EnemyDmg = Convert.ToInt32(Console.ReadLine());
Console.Write("체력: ");
int EnemyHP = Convert.ToInt32(Console.ReadLine());
gameObject playerHealth = gameObject.Php;
gameObject enemyHealth = gameObject.Ehp;
gameObject playerDamage = gameObject.Pdmg;
gameObject enemyDamage = gameObject.Edmg;
playerHealth = (gameObject)PlayerHP;
enemyHealth = (gameObject)EnemyHP;
playerDamage = (gameObject)PlayerDmg;
enemyDamage = (gameObject)EnemyDmg;
while (EnemyHP > 0)
{
Console.WriteLine("{0}이(가) {1}을(를) 공격했습니다.", Player, Enemy);
Console.WriteLine("{0}이(가) 피해(-{1})를 받았습니다.", Enemy, PlayerDmg);
EnemyHP = EnemyHP - PlayerDmg;
if (EnemyHP <= 0)
{
Console.WriteLine("{0}의 체력은 0/{1}입니다.", Enemy, (int)enemyHealth);
Console.WriteLine("{0}이(가) 죽었습니다.", Enemy);
}
else
{
Console.WriteLine("{0}의 체력은 {1}/{2}입니다.", Enemy, EnemyHP, (int)enemyHealth);
}
}
}
}
}