Ejemplo n.º 1
0
 public void GameEndUpdates()
 {
     if (UsedResources.Contains(CardResources.Devotion))
     {
         var devotion       = (PlayerDevotion)Resources.Single(x => x.ResourceType == CardResources.Devotion);
         var numPrayerUnits = DeployedUnits.Where(x => x.Unit.Tags.Contains(Tags.PrayerGain)).Count();
         devotion.SetLastingPrayer(numPrayerUnits);
     }
 }
Ejemplo n.º 2
0
    public void RecruitCard(Card card, bool isCopy = true)
    {
        if (UsedResources.Contains(CardResources.Gold))
        {
            if (!(card.Type == CardTypes.Unit && ((Unit)card).HasKeyword(Keywords.Token)))
            {
                var newCard = card;
                if (isCopy)
                {
                    newCard = GameManager.instance.libraryManager.CreateCard(card.CardData, this);
                }
                AddToHand(newCard, "Recruit");

                foreach (var costAdjustment in card.CostAdjustments)
                {
                    if (!costAdjustment.FromPassive)
                    {
                        newCard.CostAdjustments.Add(new AdjustCostObject()
                        {
                            Value             = costAdjustment.Value,
                            AdjustmentType    = costAdjustment.AdjustmentType,
                            MinCost           = costAdjustment.MinCost,
                            MustBeGreaterThan = costAdjustment.MustBeGreaterThan,
                            TargetResource    = CardResources.Gold,
                        });
                    }
                }
                newCard.ResourceConvert(CardResources.Gold);
                newCard.RecalculateCost();
                newCard.Owner = this;

                if (HasSpecialPassive(SpecialPassiveEffects.ThiefsGloves, out Passive thiefsGlovesPassive))
                {
                    for (int i = 0; i < thiefsGlovesPassive.SpecialPassiveProperty; i++)
                    {
                        CopyHandCard(newCard, out Card newCopy, "Recruit");
                    }
                }
            }
        }
        else
        {
            throw new Exception("Cannot recruit cards with a non gold class");
        }
    }
Ejemplo n.º 3
0
 public void VisitNodeChangeBackground(NodeChangeBackground ncb)
 {
     UsedResources.Add(ncb.Background);
 }
Ejemplo n.º 4
0
 public void VisitNodePlaySound(NodePlaySound nps)
 {
     UsedResources.Add(nps.Sound);
 }