Ejemplo n.º 1
0
    List <BattleMove> GetAllMoves()
    {
        // init list of battle move options
        // it is always possible to defend, that why we will predefine this option during initialization
        List <BattleMove> battleMoves = new List <BattleMove> {
            new BattleMove(BattleMove.Option.Defend)
        };

        // verify if it is possible to flee
        // this only possible if hero party was on map
        if (battleScreen.ActiveUnitUI.LPartyUnit.GetUnitParty().CanEscapeFromBattle)
        {
            // add flee option
            battleMoves.Add(new BattleMove(BattleMove.Option.Flee));
        }
        // verify if it is possible to wait
        // this is only possible if hero did not wait yet = TurnPhase does not equal PostWait
        if (battleScreen.BattleTurnPhase != BattleTurnPhase.PostWait)
        {
            // add wait option
            battleMoves.Add(new BattleMove(BattleMove.Option.Wait));
        }
        // get all attack targets options
        //  for damaging powers
        List <UnitSlot> powerApplyTargets = battleScreen.GetEnemyPartyPanel().GetAllPowerTargetableUnitSlots();

        foreach (UnitSlot unitSlot in powerApplyTargets)
        {
            battleMoves.Add(new BattleMove(BattleMove.Option.ApplyPower, unitSlot));
        }
        powerApplyTargets = battleScreen.GetPlayerPartyPanel().GetAllPowerTargetableUnitSlots();
        //  for buffing and healing powers
        foreach (UnitSlot unitSlot in powerApplyTargets)
        {
            battleMoves.Add(new BattleMove(BattleMove.Option.ApplyPower, unitSlot));
        }
        return(battleMoves);
    }