Beispiel #1
0
        private static FightState GetCurrentFightStateBalanced(Playfield p)
        {
            FightState fightState = FightState.WAIT;

            if (GameBeginning)
            {
                StartLoadedDeploy = false;
                return(Decision.GameBeginningDecision(p, out GameBeginning));
            }

            int dangerOrAttackLine = Decision.DangerOrBestAttackingLine(p);

            if (dangerOrAttackLine < 0)
            {
                Logger.Debug("Danger");
                StartLoadedDeploy = false;
                fightState        = Decision.DangerousSituationDecision(p, dangerOrAttackLine * (-1));
            }
            else if (dangerOrAttackLine > 0)
            {
                Logger.Debug("Chance");
                StartLoadedDeploy = false;
                fightState        = Decision.GoodAttackChanceDecision(p, dangerOrAttackLine);
            }
            else
            {
                if (p.ownMana >= Setting.ManaTillDeploy)
                {
                    StartLoadedDeploy = true;
                    fightState        = Decision.DefenseDecision(p);
                }

                if (StartLoadedDeploy)
                {
                    fightState = Decision.DefenseDecision(p);
                }
            }

            //Logger.Debug("FightSate = {0}", fightState.ToString());
            return(fightState);
        }