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); } }
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"); } }