Exemple #1
0
 public void AttemptToDuplicateSelectedCard()
 {
     if (currentSave != null && selectedCardState != null && selectedCardStateGameobject.gameObject.activeSelf)
     {
         currentSave.AddCardToDeck(data.FindCardData(selectedCardState.GetCardDataID()), selectedCardState.GetCardStateModifiers(), true);
     }
 }
        private int GetExtraDamage(CardState thisCard)
        {
            CardStateModifiers cardStateModifiers          = thisCard.GetCardStateModifiers();
            CardStateModifiers temporaryCardStateModifiers = thisCard.GetTemporaryCardStateModifiers();

            return(CardStateModifiers.GetUpgradedStatValue(CardStateModifiers.GetUpgradedStatValue(0, CardStateModifiers.StatType.Damage, cardStateModifiers), CardStateModifiers.StatType.Damage, temporaryCardStateModifiers));
        }
Exemple #3
0
        static void Postfix(CardDraftScreen __instance, IDraftableUI draftedItem)
        {
            //Get SaveManager and DraftItems
            SaveManager save = ReflectionMethods.GetInstanceField<SaveManager, CardDraftScreen>(__instance,"saveManager");
            List<IDraftableUI> draftItems = ReflectionMethods.GetInstanceField<List<IDraftableUI>, CardDraftScreen>(__instance, "draftItems");

            //Safety First
            if (save != null)
            {
                foreach (IDraftableUI uI in draftItems)
                {
                    if (uI != draftedItem)
                    {
                        CardState cardState = (uI as CardUI).GetCardState();
                        CardData cardData = save.GetAllGameData().FindCardData(cardState.GetCardDataID());
                        CardStateModifiers cardStateModifiers = cardState.GetCardStateModifiers();
                        save.AddCardToDeck(cardData, cardStateModifiers, true, true, false, true, true);
                    }
                }
            }
        }
Exemple #4
0
        public string GetCardStateName(CardState card)
        {
            string             modifiers = "";
            CardStateModifiers st        = card.GetCardStateModifiers();

            if (st != null)
            {
                List <CardUpgradeState> upgrades = st.GetCardUpgrades().OrderBy(x => x.GetUpgradeTitle()).ToList();
                if (upgrades.Count > 0)
                {
                    modifiers += ":";
                }
                for (int index = 0; index < upgrades.Count; index++)
                {
                    modifiers += GetUpgradeText(data.FindCardUpgradeData(upgrades[index].GetCardUpgradeDataId())) + ((index != upgrades.Count - 1) ? ", " : "");
                }
            }
            string text2 = $"{card.GetTitle()}{modifiers}";

            return(text2);
        }