Exemplo n.º 1
0
        public void endTurnTrigger(BotMovement bot)
        {
            TurnManager turnManager = FindObjectOfType <TurnManager>();
            Deck        deck        = bot.GetComponent <Deck>();

            deck.DiscardCard(spamCard);
            turnManager.AddPlayerToQueue(bot);
        }
Exemplo n.º 2
0
        //TODO Move collided bot in front of current bot
        void OnTriggerEnter(Collider other)
        {
            BotMovement currentBot = other.GetComponent <BotMovement>();

            if (currentBot)
            {
                currentBot.GetComponent <GridPositionHandler>().CurrentWaypoint = this;
            }
        }
Exemplo n.º 3
0
        //Draw a random card, play it, then discard it
        public override void Use(BotMovement bot)
        {
            Deck deck = bot.GetComponent <Deck>();
            List <CardConfig> cards = deck.DrawCards(1);

            if (cards.Count == 1)
            {
                CardConfig card = cards[0];
                card.AttachAbilityTo(bot.gameObject);
                card.Use(bot);
                if (!card.DestroyCardAfterPlaying)
                {
                    deck.DiscardCard(card);
                }
                Destroy(this);
            }
        }
Exemplo n.º 4
0
        //TODO Consider more elegant solution to reverse movement
        public override void Use(BotMovement bot)
        {
            board = FindObjectOfType <BoardProcessor>();
            Vector3 previousPosition = bot.transform.position;

            for (int i = 0; i < (config as MoveConfig).MoveSpaces; i++)
            {
                Waypoint nextWaypoint;
                if ((config as MoveConfig).ReverseMovement)
                {
                    nextWaypoint = GetBackwardDirectionWaypoint(bot, previousPosition);
                }
                else
                {
                    nextWaypoint = GetForwardDirectionWaypoint(bot, previousPosition);
                }
                if (nextWaypoint != null)
                {
                    MoveBot(bot, nextWaypoint);
                    previousPosition = nextWaypoint.transform.position;
                }
            }
            Destroy(bot.GetComponent <MoveBehavior>());
        }
Exemplo n.º 5
0
 public override void Use(BotMovement bot)
 {
     bot.AddCommandToQueue(new Command("ROTATE", null, (config as RotateConfig).NumRotations));
     Destroy(bot.GetComponent <RotateBehavior>());
 }