void _SetCommand(CNewBattle battle, int nCmdNum, int targetIdx)
        {
            BattleCharacter PC = battle.GetPCs()[m_nCmdInputState]; //m_PCs[m_nCmdInputState];

            switch (nCmdNum)
            {
            case 0:
            {
                Attack tmpCmd = new Attack();
                tmpCmd.actor  = PC;
                tmpCmd.target = battle.GetAllCharacters()[targetIdx];         //m_AllChars[targetIdx];
                //m_CmdList[m_nCmdInputState] = tmpCmd;
                m_CmdList.Add(tmpCmd);
                break;
            }

            default:
            {
                Skill tmpCmd = new Skill();
                tmpCmd.actor   = PC;
                tmpCmd.target  = PC;
                tmpCmd.skillID = 0;         // 가만히 있기
                //m_CmdList[m_nCmdInputState] = tmpCmd;
                m_CmdList.Add(tmpCmd);
                break;
            }
            }
        }
        void GetCmdOfNextPc(CNewBattle battle)
        {
            BattleCharacter[] pcs = battle.GetPCs();

            ++m_nCmdInputState;
            if (m_nCmdInputState >= battle.m_nPCNum)
            {
                //// 명령 수행 상태로.
                battle.GetStateMachine().ChangeState(new ExecCommandState(m_CmdList));
            }
            else
            {
                if (pcs[m_nCmdInputState].IsDead())
                {
                    //_SetCommand(battle, 0, 0);    // List 로 바꾸었기 때문에, 필요 없어짐.
                    GetCmdOfNextPc(battle);
                }
                else
                {
                    battle.GetForm().InitSelectCmd(battle.GetPCs()[m_nCmdInputState].Name);
                }
            }
        }
        public void OnStart(CNewBattle battle)
        {
            m_nCmdInputState = -1;

            //m_CmdList = new Command[battle.m_nCharNum];
            m_CmdList = new List <Command>();

            BattleCharacter[] pcs = battle.GetPCs();

            Screen.Inst().UpdateCharacterParams();

            GetCmdOfNextPc(battle);
            //ToNextPC(battle);
            //battle.GetForm().InitSelectCmd(battle.GetPCs()[m_nCmdInputState].Name);
        }
Esempio n. 4
0
 // 적군의 명령을 생성한다.
 void MakeEnemiesCommands(CNewBattle battle)
 {
     for (int i = 0; i < battle.m_nEnemyNum; ++i)
     {
         Skill tmpCmd = new Skill();
         tmpCmd.actor = battle.GetEnemies()[i]; //m_Enemys[i];
         if (tmpCmd.actor.IsAlive())
         {
             tmpCmd.target  = battle.GetPCs()[i]; //m_PCs[i];
             tmpCmd.skillID = 0;                  // 가만히 있기
             //m_CmdList[battle.m_nPCNum + i] = tmpCmd;
             m_CmdList.Add(tmpCmd);
         }
     }
 }