Exemplo n.º 1
0
        public void CUIGetPCCommands()
        {
            for (int i = 0; i < m_nPCNum; ++i)
            {
                BattleCharacter PC = m_PCs[i];
                string          line;
                int             num = -1;
                do
                {
                    Console.WriteLine("{0}은(는) 무엇을 합니까?", PC.Name);
                    line = Console.ReadLine();
                }while (false == int.TryParse(line, out num));

                SetCommand(i, num);
            }
        }
Exemplo n.º 2
0
        // data
        public void InitBattle()
        {
            Screen.Inst().ClearScreen();

            // 전장 초기화
            m_nPCNum = 3;
            m_PCs    = new BattleCharacter[m_nPCNum];
            for (int i = 0; i < m_nPCNum; ++i)
            {
                BattleCharacter tmp = new BattleCharacter();
                tmp.MaxHP = 100;
                tmp.HP    = 100;
                tmp.Idx   = i;
                m_PCs[i]  = tmp;
            }
            m_PCs[0].Name = "Warrior";
            m_PCs[1].Name = "Magician";
            m_PCs[2].Name = "Cleric";

            m_nEnemyNum = 3;
            m_Enemys    = new BattleCharacter[m_nEnemyNum];
            for (int i = 0; i < m_nEnemyNum; ++i)
            {
                BattleCharacter tmp = new BattleCharacter();
                tmp.Name    = "Enemy" + i.ToString();
                tmp.MaxHP   = 100;
                tmp.HP      = 100;
                tmp.Idx     = i + m_nPCNum;
                m_Enemys[i] = tmp;
            }

            m_nCharNum = m_nPCNum + m_nEnemyNum;
            m_AllChars = new BattleCharacter[m_nCharNum];
            for (int i = 0; i < m_nPCNum; ++i)
            {
                m_AllChars[i] = m_PCs[i];
            }
            for (int i = 0; i < m_nEnemyNum; ++i)
            {
                m_AllChars[m_nPCNum + i] = m_Enemys[i];
            }

            // 전투 시작 메시지
            Screen.Inst().WriteLine("Battle Start!");
        }