public CharacterTriggerData Build()
        {
            CharacterTriggerData characterTriggerData = new CharacterTriggerData(this.Trigger, null);

            AccessTools.Field(typeof(CharacterTriggerData), "additionalTextOnTriggerKey").SetValue(characterTriggerData, this.AdditionalTextOnTriggerKey);
            AccessTools.Field(typeof(CharacterTriggerData), "descriptionKey").SetValue(characterTriggerData, this.DescriptionKey);
            AccessTools.Field(typeof(CharacterTriggerData), "displayEffectHintText").SetValue(characterTriggerData, this.DisplayEffectHintText);
            AccessTools.Field(typeof(CharacterTriggerData), "effects").SetValue(characterTriggerData, this.Effects);
            AccessTools.Field(typeof(CharacterTriggerData), "hideTriggerTooltip").SetValue(characterTriggerData, this.HideTriggerTooltip);
            AccessTools.Field(typeof(CharacterTriggerData), "trigger").SetValue(characterTriggerData, this.Trigger);
            return(characterTriggerData);
        }
        /// <summary>
        /// Builds the CharacterTriggerData represented by this builders's parameters recursively;
        /// all Builders represented in this class's various fields will also be built.
        /// </summary>
        /// <returns>The newly created CardTraitData</returns>
        public CharacterTriggerData Build()
        {
            foreach (var builder in this.EffectBuilders)
            {
                this.Effects.Add(builder.Build());
            }
            CharacterTriggerData characterTriggerData = new CharacterTriggerData(this.Trigger, null);

            BuilderUtils.ImportStandardLocalization(this.AdditionalTextOnTriggerKey, this.AdditionalTextOnTrigger);
            AccessTools.Field(typeof(CharacterTriggerData), "additionalTextOnTriggerKey").SetValue(characterTriggerData, this.AdditionalTextOnTriggerKey);
            BuilderUtils.ImportStandardLocalization(this.DescriptionKey, this.Description);
            AccessTools.Field(typeof(CharacterTriggerData), "descriptionKey").SetValue(characterTriggerData, this.DescriptionKey);
            AccessTools.Field(typeof(CharacterTriggerData), "displayEffectHintText").SetValue(characterTriggerData, this.DisplayEffectHintText);
            AccessTools.Field(typeof(CharacterTriggerData), "effects").SetValue(characterTriggerData, this.Effects);
            AccessTools.Field(typeof(CharacterTriggerData), "hideTriggerTooltip").SetValue(characterTriggerData, this.HideTriggerTooltip);
            AccessTools.Field(typeof(CharacterTriggerData), "trigger").SetValue(characterTriggerData, this.Trigger);
            return(characterTriggerData);
        }
Example #3
0
        public static string GetUpgradeText(CardUpgradeData arg)
        {
            string val = arg.GetUpgradeTitleKey().Localize(null);

            if (val.Length == 0)
            {
                for (int i = 0; i < arg.GetTraitDataUpgrades().Count; i++)
                {
                    val += arg.GetTraitDataUpgrades()[i].GetTraitStateName() + ((i != arg.GetTraitDataUpgrades().Count - 1) ? ", " : "");
                }
                if (val.Length != 0 && arg.GetStatusEffectUpgrades().Count > 0)
                {
                    val += " & ";
                }
                for (int j = 0; j < arg.GetStatusEffectUpgrades().Count; j++)
                {
                    val += StatusEffectManager.GetLocalizedName(arg.GetStatusEffectUpgrades()[j].statusId, arg.GetStatusEffectUpgrades()[j].count)
                           + ((j != arg.GetStatusEffectUpgrades().Count - 1) ? ", " : "");
                }
                if (val.Length != 0 && arg.GetTriggerUpgrades().Count > 0)
                {
                    val += " & ";
                }
                for (int k = 0; k < arg.GetTriggerUpgrades().Count; k++)
                {
                    val += CharacterTriggerData.GetKeywordText(arg.GetTriggerUpgrades()[k].GetTrigger())
                           + ": "
                           + arg.GetTriggerUpgrades()[k].GetDescriptionKey().Localize(null)
                           + ((k != arg.GetTriggerUpgrades().Count - 1) ? ", " : "");
                }
                if (val.Length != 0 && arg.GetCardTriggerUpgrades().Count > 0)
                {
                    val += " & ";
                }
                for (int l = 0; l < arg.GetCardTriggerUpgrades().Count; l++)
                {
                    CardTriggerTypeMethods.GetLocalizedName(arg.GetCardTriggerUpgrades()[l].GetTrigger(), out string text);
                    val += text
                           + ": "
                           + arg.GetCardTriggerUpgrades()[l].GetDescriptionKey().Localize(null);
                }
                if (arg.GetBonusDamage() > 0)
                {
                    if (val.Length != 0)
                    {
                        val += " ";
                    }
                    val += "Bonus Damage: " + arg.GetBonusDamage();
                }
                if (arg.GetBonusHeal() > 0)
                {
                    if (val.Length != 0)
                    {
                        val += "\n";
                    }
                    val += "Bonus Heal: " + arg.GetBonusHeal();
                }
                if (arg.GetBonusHP() > 0)
                {
                    if (val.Length != 0)
                    {
                        val += "\n";
                    }
                    val += "Bonus HP: " + arg.GetBonusHP();
                }
                if (arg.GetBonusSize() > 0)
                {
                    if (val.Length != 0)
                    {
                        val += "\n";
                    }
                    val += "Bonus Size: " + arg.GetBonusSize();
                }
                if (arg.GetCostReduction() < 99 && arg.GetCostReduction() != 0)
                {
                    if (val.Length != 0)
                    {
                        val += "\n";
                    }
                    val += "Reduce Cost: " + arg.GetCostReduction();
                }
                if (arg.GetXCostReduction() > 0)
                {
                    if (val.Length != 0)
                    {
                        val += "\n";
                    }
                    val += "Reduce X Cost: " + arg.GetXCostReduction();
                }
            }
            if (val.Length == 0)
            {
                val = arg.GetUpgradeDescriptionKey().Localize(null);
            }
            if (val.Length == 0)
            {
                val = arg.name;
            }
            val = RemoveTags(val);
            return(val);
        }