示例#1
0
 public CardPresenter(View.card card, Tarea task)
 {
     // TODO: Complete member initialization
     this.card = card;
     this.Task = task;
     LoadTask();
 }
示例#2
0
    // Attempts to play that card index on given tile.
    public AttemptToPlayCardFailReasons AttemptToPlayCard(CardInterface cardToPlay, Vector2Int target)
    {
        // Check if we can play card
        if (!TurnManager.instance.CanPlayCard())
        {
            return(AttemptToPlayCardFailReasons.notPlayerTurn);
        }

        // Do we have the energy for it?
        if (cardToPlay.cardData.CardInfo.EnergyCost > CurrentEnergy)
        {
            return(AttemptToPlayCardFailReasons.notEnoughEnergy);
        }

        var tile = BattleGrid.instance.CurrentFloor.map[target.x, target.y];
        var boss = tile.GetEntityOnTile() as BossBody;

        if (boss != null && boss.Invincible)
        {
            return(AttemptToPlayCardFailReasons.bossInvincible);
        }

        // Play the card
        TriggerCardPlay(cardToPlay, target);
        // Discarding/banishing is handled in ResolveCardPlayed()
        //playerDeck.DiscardCardAtIndex(index);
        return(AttemptToPlayCardFailReasons.success);
    }
示例#3
0
    public override void Start(CardInterface owner)
    {
        base.Start(owner);
        owner.Anim.enabled            = false;
        Owner.CardCanvas.sortingOrder = 1;

        (Owner.transform as RectTransform).sizeDelta = Owner.OriginCardSize * 1.5f;
        Owner.CardCanvas.overrideSorting             = false;

        SettingUIDisplayMode();
    }
示例#4
0
    public override void Start(CardInterface owner)
    {
        base.Start(owner);
        owner.Anim.enabled = false;
        IsVisible          = true;

        _destCardSize = Owner.OriginCardSize;
        _destRotation = Quaternion.identity;

        _target = new TargetData();
    }
示例#5
0
    public void SettingCard()
    {
        if (CardList == null)
        {
            CardList = new List <CardInterface>();
        }

        if (CardTableList == null)
        {
            CardTableList = DataManager.GetDatas <CardTable>();
        }

        if (Card.CardInstanceSet == null)
        {
            Card.MakeCardInstanceSet(CardTableList);
        }

        List <CardTable> displayList = CardTableList.Where(TapSectionClippingList).
                                       Where(CostSectionClippingList).
                                       Where(SearchTextClippingList).OrderBy((card) => card._Cost).ThenBy((card) => card._krName).ToList();

        Vector3 basePos = new Vector3(200f, -220f, 0f);

        while (CardList.Count < displayList.Count)
        {
            CardList.Add(CardInterface.CreateCard(Content.transform));
        }

        Vector2 size = (Content.transform as RectTransform).sizeDelta;

        size.y = ((displayList.Count / 4) + 1) * 500f;
        (Content.transform as RectTransform).sizeDelta = size;

        for (int i = 0; i < CardList.Count; ++i)
        {
            if (displayList.Count <= i)
            {
                CardList[i].gameObject.SetActive(false);
            }
            else
            {
                CardList[i].CardData      = Card.CardInstanceSet[displayList[i]];
                CardList[i].CurrentAction = UICardListAction.GetInstance();
                (CardList[i].transform as RectTransform).anchorMin = new Vector2(0f, 1f);
                (CardList[i].transform as RectTransform).anchorMax = new Vector2(0f, 1f);
                CardList[i].transform.localPosition = basePos + Vector3.right * (i % 4) * 340f + Vector3.down * (i / 4) * 500f;
                CardList[i].gameObject.SetActive(true);
            }
        }
    }
示例#6
0
    // Plays the relevant card. Does not discard it afterwards.
    private void TriggerCardPlay(CardInterface cardToPlay, Vector2Int target, bool resetTrackerWhenDone = true)
    {
        // Start card tracking
        BattleManager.instance.StartCardTracking(cardToPlay);

        // Pay the cost of the card
        PayCardCost(cardToPlay.cardData);

        // Activate its effects.
        cardToPlay.cardData.Activate(BattleManager.ConvertVector(transform.position), target);

        if (resetTrackerWhenDone)
        {
            ResolveCardPlayed();
        }
    }
示例#7
0
 void card_EndCaptureEvent(CardInterface card)
 {
     mainForm.LoadCard(card as Form);
 }
示例#8
0
 public override void Start(CardInterface owner)
 {
     base.Start(owner);
     owner.Anim.enabled = false;
     _startFloat        = Owner.DissolveValue;
 }
 // Enables and disables tracking of things that happen when a card is resolved.
 public void StartCardTracking(CardInterface input)
 {
     cardResolveStack.ResetTracker();
     cardResolveStack.AddCardToTracker(input);
 }
示例#10
0
 public override void Start(CardInterface owner)
 {
     base.Start(owner);
     owner.Anim.enabled = true;
     owner.Anim.Play("DrawCard");
 }
示例#11
0
 public virtual void Start(CardInterface owner)
 {
     Owner = owner;
 }