public void DoTurn()
    {//All turn in 1 go (IA vs IA)
        for (int i = 0; i < characters.Count; i++)
        {
            BattleAction action = characters[i].ChooseRandAction();

            if (action.targets_enemy)
            {
                action.Execute(ChooseRandEnemy(characters[i].enemy));
            }
            else
            {
                action.Execute(ChooseRandEnemy(!characters[i].enemy));
            }
        }

        LowerBuffTimers();
    }
    public void PlayerVSIADoTurn(Selection p0, Selection p1)
    {
        OrderCharacters();

        int index_p0 = characters.IndexOf(p0.this_char), index_p1 = characters.IndexOf(p1.this_char);

        for (int i = 0; i < characters.Count; i++)
        {
            if (characters[i].enemy)
            {
                BattleAction action = characters[i].ChooseRandAction();

                if (action.targets_enemy)
                {
                    action.Execute(ChooseRandEnemy(characters[i].enemy));
                }
                else
                {
                    action.Execute(ChooseRandEnemy(!characters[i].enemy));
                }
            }
            else
            {
                if (i == index_p0)
                {
                    p0.action.Execute(p0.target_char);
                }
                else
                {
                    if (i == index_p1)
                    {
                        p1.action.Execute(p1.target_char);
                    }
                }
            }
        }

        OrderCharacters();
        LowerBuffTimers();
    }
示例#3
0
    public override bool QUpdate(BattleManager manager)
    {
        if (m_Agent.CP < 100)
        {
            return(true);
        }

        BattleAction decision = m_Decider.Update();

        if (decision != null)
        {
            BattleQueueTime.Generator t = new BattleQueueTime.FiniteGenerator(time - 1, 2);
            decision.Execute(manager, t.Generate());

            time = t.Generate();
            manager.Add(this);

            return(true);
        }

        return(false);
    }
示例#4
0
 public override void QStart(BattleManager manager)
 {
     m_Action.Execute(manager, time);
 }
示例#5
0
 /// <summary>
 /// BattleAction을 실행합니다.
 /// </summary>
 public void ExecuteBattleAction(BattleAction battleAction)
 {
     battleAction.Execute(enemy);
 }