Пример #1
0
    public void SpendCard(int spentIndex)
    {
        // Random for testing...
        //int spentIndex = Random.Range(0, hand.Count);

        if (hand[spentIndex] != null && CanActivate(spentIndex))
        {
            Card spentCard = hand[spentIndex];

            pc.Energy -= spentCard.energyCost;

            AddToDiscardPile(hand[spentIndex]);

            hand[spentIndex] = null;

            spentCard.Activate();

            OnHandUpdated?.Invoke();

            AudioManager.PlaySFX(activateCardSound);
        }
        else
        {
            AudioManager.PlaySFX(activateNoEnergySound);
        }
    }
Пример #2
0
        async Task IEffect.Resolve(Game game)
        {
            card.MoveTo(playZone);
            await card.Activate(game);

            card.Deactivate();
            card.MoveTo(game.runner.zones.heap.zone);
        }
Пример #3
0
        async Task IEffect.Resolve(Game game)
        {
            card.FlipFaceUp();
            card.MoveTo(playZone);
            await card.Activate(game);

            card.Deactivate();
            card.MoveTo(game.corp.zones.archives.Zone);
        }
Пример #4
0
    public void Draw()
    {
        Card c = deck.cards.Draw();

        c.transform.SetParent(hand.transform);
        c.Activate(true);

        deck.UpdateUI();
        OnDraw.Invoke();
    }
Пример #5
0
 // CR: 8.3.5
 async private Task Place(IInstallDestination destination, Game game)
 {
     destination.Host(card);
     if (card.Faction.Side == Side.RUNNER)
     {
         // CR: 8.2.3
         card.FlipFaceUp();
         await card.Activate(game);
     }
 }
Пример #6
0
        async public Task Rez()
        {
            UnityEngine.Debug.Log("Rezzing " + card.Name);
            card.FlipFaceUp();
            await card.PlayCost.Pay(game);

            await card.Activate(game);

            UnityEngine.Debug.Log("Rezzed " + card.Name);
        }
Пример #7
0
    public void Update()
    {
        foreach (Transform child in this.transform)
        {
            Card card = child.GetComponent <Item>().card;

            if (card.isUsed == false)
            {
                card.Activate(this.transform.parent.GetComponent <BaseUnit>());
            }
        }
    }
Пример #8
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))          // if left button pressed...
     {
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit))
         {
             if (hit.transform.gameObject.CompareTag("Card"))
             {
                 Card card = hit.transform.gameObject.GetComponent <Card> ();
                 card.Activate();
             }
         }
     }
 }
Пример #9
0
    protected override void OnDragDropEnd()
    {
        CardManager.Instance.DeniedArea.enabled = false;

        // check the card is on card activation area
        if (mTrans.position.y > CardManager.Instance.CardActivationBounds.min.y)
        {
            Vector2 pos = GetWorldCoordinate();
            if (card.Activate(pos))
            {
                cardOriginal.StartCooldownTimer();
            }
        }


        base.OnDragDropEnd();
    }
Пример #10
0
 public override void Tick()
 {
     if (pawn == null)
     {
         return;
     }
     if (moveX != 0 || moveY != 0)
     {
         pawn.Move(moveX, moveY);
         moveX = 0;
         moveY = 0;
         if (cards.Count > 0)
         {
             Card card = cards[0] as Card;
             card.Activate(pawn);
             if (card.Count <= 0)
             {
                 cards.RemoveAt(0);
             }
         }
     }
 }
Пример #11
0
 void StartActivate(Card card)
 {
     Debug.Log("CardActivate");
     card.Activate();
     cardActivated.Invoke(card);
 }
Пример #12
0
    public static void CheckQ()
    {
        if (CardQ.Count != MethodQ.Count)
        {
            Debug.Log("YOU F****D UP BIGTIME");
            return;
        }

        if (CardQ.Count == 0)
        {
            S.ClickControlInst.AllowEveryInput();
            Debug.Log("Checked Q and allowed every input! This is where card effects terminate and EndTurnCheck() is called.");
            S.GameControlGUIInst.AnimateCardsToCorrectPositionInSeconds(.15f);
            S.GameControlInst.CheckDeckCount();

            // Checks if the turn is over, and if it is, takes the enemy's turn.
            if (!S.GameControlInst.EndTurnCheck())
            {
                // The player's turn is not over yet
                StateSavingControl.Save();
            }
            return;
        }

        Card        deQCard   = CardQ.Dequeue();
        QMethodType deQMethod = MethodQ.Dequeue();

        switch (deQMethod)
        {
        case QMethodType.Activate:
            deQCard.Activate(false);
            break;

        case QMethodType.FreeActivate:
            if (deQCard.CardAction == Card.CardActionTypes.TargetGridSquare)
            {
                deQCard.FreeTargetSquare = true;
                deQCard.Activate(true);
            }
            else if (deQCard.CardAction == Card.CardActionTypes.Armor)
            {
                deQCard.Activate(true);
            }
            else
            {
                Debug.Log("what is happening here?");
            }
            break;

        case QMethodType.Option:
            deQCard.OptionQCall();
            break;

        case QMethodType.Special:
            deQCard.SpecialQCall();
            break;

        case QMethodType.FreeSpecial:
            deQCard.SpecialQCall();
            break;

        case QMethodType.Discard:
            deQCard.Discard();
            break;
        }
    }