Esempio n. 1
0
        public static Vector2f GetNextSpellPosition(FightState gameState, ICard card)
        {
            cardToDeploy = card;

            Vector2f choosedPosition = Vector2f.Zero, nextPosition;

            if (cardToDeploy is CardSpell)
            {
                return(GetPositionOfTheBestDamagingSpellDeploy());
            }

            // ToDo: Handle Defense Gamestates
            switch (gameState)
            {
            case FightState.UAKT:
                choosedPosition = UAKT();
                break;

            case FightState.UALPT:
                choosedPosition = UALPT();
                break;

            case FightState.UARPT:
                choosedPosition = UARPT();
                break;

            case FightState.AKT:
                choosedPosition = AKT();
                break;

            case FightState.ALPT:
                choosedPosition = ALPT();
                break;

            case FightState.ARPT:
                choosedPosition = ARPT();
                break;

            case FightState.DKT:
                choosedPosition = DKT();
                break;

            case FightState.DLPT:
                choosedPosition = DLPT();
                break;

            case FightState.DRPT:
                choosedPosition = DRPT();
                break;

            default:
                //Logger.Debug("GameState unknown");
                break;
            }
            Logger.Debug("GameState: {GameState}", gameState.ToString());
            nextPosition = choosedPosition;
            //Logger.Debug("nextPosition: " + nextPosition);

            return(nextPosition);
        }
Esempio n. 2
0
        private static FightState GetCurrentFightStateBalanced()
        {
            FightState fightState = FightState.WAIT;

            if (GameBeginning)
            {
                return(GameBeginningDecision());
            }

            if (EnemyCharacterHandling.IsAnEnemyOnOurSide())
            {
                fightState = EnemyIsOnOurSideDecision();
            }
            else if (StaticValues.Player.Mana >= GameHandling.Settings.ManaTillAttack || AttackMode)
            {
                if (EnemyCharacterHandling.EnemiesWithoutTower.Count() > 2) // ToDo: CHeck more (Health, Damage etc)
                {
                    fightState = EnemyHasCharsOnTheFieldDecision();
                }
                else
                {
                    fightState = AttackDecision();
                }
            }

            Logger.Debug("FightSate = {0}", fightState.ToString());
            return(fightState);
        }
        public static Vector2f GetNextSpellPosition(FightState gameState, ICard card)
        {
            cardToDeploy = card;
            Random rnd  = StaticValues.rnd;
            float  rndX = rnd.Next(-GameHandling.Settings.RandomDeploymentValue, GameHandling.Settings.RandomDeploymentValue);
            float  rndY = rnd.Next(-GameHandling.Settings.RandomDeploymentValue, GameHandling.Settings.RandomDeploymentValue);

            Vector2f rndAddVector = new Vector2f(rndX, rndY);
            Vector2f choosedPosition = Vector2f.Zero, nextPosition;

            if (cardToDeploy is CardSpell)
            {
                return(GetPositionOfTheBestDamagingSpellDeploy());
            }

            // ToDo: Handle Defense Gamestates
            switch (gameState)
            {
            case FightState.UAKT:
                choosedPosition = UAKT();
                break;

            case FightState.UALPT:
                choosedPosition = UALPT();
                break;

            case FightState.UARPT:
                choosedPosition = UARPT();
                break;

            case FightState.AKT:
                choosedPosition = AKT();
                break;

            case FightState.ALPT:
                choosedPosition = ALPT();
                break;

            case FightState.ARPT:
                choosedPosition = ARPT();
                break;

            case FightState.DKT:
                choosedPosition = DKT();
                break;

            case FightState.DLPT:
                choosedPosition = DLPT();
                break;

            case FightState.DRPT:
                choosedPosition = DRPT();
                break;

            default:
                //Logger.Debug("GameState unknown");
                break;
            }
            Logger.Debug("GameState: {GameState}", gameState.ToString());
            nextPosition = (choosedPosition + rndAddVector);
            //Logger.Debug("nextPosition: " + nextPosition);

            return(nextPosition);
        }