Ejemplo n.º 1
0
        public static Handcard GetMobInPeace(Playfield p, FightState currentSituation)
        {
            if (PlayfieldAnalyse.lines[0].Danger <= Level.LOW || PlayfieldAnalyse.lines[1].Danger <= Level.LOW)
            {
                var tanks = p.ownMinions.Where(n => Classification.IsMobsTankCurrentHP(n))
                            .OrderBy(n => n.HP).ToArray();
                switch (currentSituation)
                {
                case FightState.DPTL1:
                case FightState.APTL1:
                    BoardObj tankL1 = tanks.Where(n => n.Line == 1).OrderBy(n => n.HP).FirstOrDefault();

                    if (tankL1 != null)
                    {
                        return(p.getPatnerForMobInPeace(tankL1));
                    }
                    else
                    {
                        return(p.getPatnerForMobInPeace(p.ownMinions.Where(n => n.Line == 1).OrderBy(n => n.Atk).FirstOrDefault()));
                    }

                case FightState.DPTL2:
                case FightState.APTL2:
                    BoardObj tankL2 = tanks.Where(n => n.Line == 2).OrderBy(n => n.HP).FirstOrDefault();

                    if (tankL2 != null)
                    {
                        return(p.getPatnerForMobInPeace(tankL2));
                    }
                    else
                    {
                        return(p.getPatnerForMobInPeace(p.ownMinions.Where(n => n.Line == 2).OrderBy(n => n.Atk).FirstOrDefault()));
                    }

                case FightState.DKT:
                case FightState.AKT:
                    if (tanks.FirstOrDefault() != null)
                    {
                        return(p.getPatnerForMobInPeace(tanks.FirstOrDefault()));
                    }
                    else
                    {
                        return(p.getPatnerForMobInPeace(p.ownMinions.OrderBy(n => n.Atk).FirstOrDefault()));
                    }

                case FightState.UAPTL1:
                case FightState.UAPTL2:
                case FightState.UAKTL1:
                case FightState.UAKTL2:
                case FightState.START:
                case FightState.WAIT:
                default:
                    break;
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        private static Handcard BigGroupDecision(Playfield p, FightState fightState)
        {
            var aoe   = p.enemyMinions.Where(n => n.card.aoeAir || n.card.aoeGround);
            var tanks = p.ownMinions.Where(n => Classification.IsMobsTankCurrentHP(n));

            // ToDo: Improve condition
            switch (fightState)
            {
            case FightState.UAPTL1:
            case FightState.UAKTL1:
            case FightState.APTL1:
            case FightState.DPTL1:
                if (aoe.Any(n => n.Line == 1) || !tanks.Any(n => n.Line == 1))
                {
                    return(null);
                }
                break;

            case FightState.UAKTL2:
            case FightState.UAPTL2:
            case FightState.APTL2:
            case FightState.DPTL2:
                if (aoe.Any(n => n.Line == 2) || !tanks.Any(n => n.Line == 2))
                {
                    return(null);
                }
                break;

            case FightState.AKT:
            case FightState.DKT:
                if (aoe.Any(n => n.Line == 1) || !tanks.Any(n => n.Line == 1) ||
                    aoe.Any(n => n.Line == 2) || !tanks.Any(n => n.Line == 2))
                {
                    return(null);
                }
                break;

            default:
                break;
            }
            return(Classification.GetOwnHandCards(p, boardObjType.MOB, SpecificCardType.MobsBigGroup).FirstOrDefault());
        }