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

            deck.DiscardCard(spamCard);
            turnManager.AddPlayerToQueue(bot);
        }
Beispiel #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;
            }
        }
Beispiel #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);
            }
        }
Beispiel #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>());
        }
 public override void Use(BotMovement bot)
 {
     bot.AddCommandToQueue(new Command("ROTATE", null, (config as RotateConfig).NumRotations));
     Destroy(bot.GetComponent <RotateBehavior>());
 }