public static EnergyPaidInformation GetNetEnergyCostWithBloodprice(AbstractCard card) { if (GameState.Instance.energy < card.GetDisplayedEnergyCost()) { var missingEnergy = card.GetDisplayedEnergyCost() - GameState.Instance.energy; return(new EnergyPaidInformation() { ActionsToTake = new List <EnergyPaidAction> { new BloodpricePaidAction { LifePaid = 5 * missingEnergy } }, EnergyCost = GameState.Instance.energy }); } return(new EnergyPaidInformation() { EnergyCost = card.GetDisplayedEnergyCost() }); }
public static void SetToAbstractCardAttributes(this Card hyperCard, AbstractCard abstractCard) { if (abstractCard == null) { return; } hyperCard.SetCardTitle(abstractCard.Name); hyperCard.SetCardDescription(BuildTextBoxStringForCard(abstractCard)); var ownerName = abstractCard.Owner?.CharacterFullName ?? "Communal"; hyperCard.SetCardTopText($"{abstractCard.CardType}"); hyperCard.SetCardEnergyCost(abstractCard.GetDisplayedEnergyCost()); hyperCard.LogicalCardId = abstractCard.Id; hyperCard.LogicalCard = abstractCard; Image toEnable; List <Image> mutuallyExclusiveCardFrames = new List <Image> { hyperCard.CommonCardFrame, hyperCard.UncommonCardFrame, hyperCard.RareCardFrame, hyperCard.PurpleCardFrame, hyperCard.RedCardFrame }; if (abstractCard.Rarity == Rarity.COMMON || abstractCard.Rarity == Rarity.BASIC || abstractCard.Rarity == Rarity.NOT_IN_POOL) { toEnable = hyperCard.CommonCardFrame; } else if (abstractCard.Rarity == Rarity.UNCOMMON) { toEnable = hyperCard.UncommonCardFrame; } else if (abstractCard.Rarity == Rarity.RARE) { toEnable = hyperCard.RareCardFrame; } else { toEnable = hyperCard.PurpleCardFrame; } if (abstractCard.Owner != null) { hyperCard.ClassEmblem.gameObject.SetActive(true); hyperCard.ClassEmblem.sprite = abstractCard.Owner.SoldierClass.EmblemIcon.ToSprite(); } else { hyperCard.ClassEmblem.gameObject.SetActive(false); } foreach (var image in mutuallyExclusiveCardFrames) { if (image != toEnable) { image.gameObject.SetActive(false); } else { image.gameObject.SetActive(true); } } hyperCard.CurrentCardFrame = toEnable; }