Exemplo n.º 1
0
    public override void Execute(float d)
    {
        if (Input.GetMouseButtonDown(0))
        {
            List <RaycastResult> results = Settings.GetUIObjects();

            foreach (RaycastResult result in results)
            {
                CardInstance cardInst = result.gameObject.GetComponentInParent <CardInstance>();
                PlayerHolder player   = Settings.gameManager.currentPlayer;
                if (player.cardsOnTable.Contains(cardInst))
                {
                    if (cardInst.CanAttack())
                    {
                        player.attackingCards.Add(cardInst);
                        player.currentHolders.SetCardOnBattleLine(cardInst);
                    }
                }
                else
                {
                    return;
                }
            }
        }
    }
Exemplo n.º 2
0
        public override void Excute(float dt)
        {
            if (Input.GetMouseButtonDown(0))
            {
                List <RaycastResult> results = Settings.GetUIObjs();
                foreach (RaycastResult r in results)
                {
                    CardInstance inst = r.gameObject.GetComponentInParent <CardInstance>();
                    PlayerHolder p    = Settings.gameManager.currentPlayer;

                    if (!p.cardsDown.Contains(inst))
                    {
                        return;
                    }


                    if (inst.CanAttack() && !p.attackingCards.Contains(inst))
                    {
                        //Debug.Log("Add Card Attack:" + inst.name);

                        p.attackingCards.Add(inst);
                        p.currentHolder.SetCardOnBattleLine(inst);
                    }
                }
            }
        }
Exemplo n.º 3
0
    public override void Execute(float d)
    {
        if (Input.GetMouseButtonDown(0))
        {
            var results = Settings.GetUIObjects();

            foreach (RaycastResult result in results)
            {
                CardInstance instance = result.gameObject.GetComponentInParent <CardInstance>();
                PlayerHolder player   = Settings._gameManager.currentPlayer;

                if (!player.cardsDownMelee.Contains(instance) || !player.cardsDownRanged.Contains(instance))
                {
                    return;
                }

                if (instance.CanAttack())
                {
                    player.attackingCards.Add(instance);
                    // you can attack
                }
            }
        }
    }