private void toolStripMenuItem6_Click(object sender, EventArgs e)
        {
            ResourceFeature f = new ResourceFeature();

            f = new FeatureForms.ResourceFeatureForm(f).edit(HistoryManager);
            list.Add(f);
            fill();
        }
        public BonusFeatureForm(BonusFeature f)
        {
            bf = f;

            if (f.DamageBonusModifier != Ability.None)
            {
                f.DamageBonus         = ResourceFeatureForm.convert(f.DamageBonusModifier, f.DamageBonus);
                f.DamageBonusModifier = Ability.None;
            }

            InitializeComponent();
            foreach (Ability s in Enum.GetValues(typeof(Ability)))
            {
                if (s != Ability.None)
                {
                    BaseAbility.Items.Add(s, f.BaseAbility.HasFlag(s));
                }
            }
            foreach (Ability s in Enum.GetValues(typeof(Ability)))
            {
                if (s != Ability.None)
                {
                    SaveBonusAbility.Items.Add(s, f.SavingThrowAbility.HasFlag(s));
                }
            }
            Condition.DataBindings.Add("Text", f, "Condition", true, DataSourceUpdateMode.OnPropertyChanged);
            Attack.DataBindings.Add("Text", f, "AttackBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            SaveDC.DataBindings.Add("Text", f, "SaveDCBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            AC.DataBindings.Add("Text", f, "ACBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            Initiative.DataBindings.Add("Text", f, "InitiativeBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            Damage.DataBindings.Add("Text", f, "DamageBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            DamageText.DataBindings.Add("Text", f, "DamageBonusText", true, DataSourceUpdateMode.OnPropertyChanged);
            Skill.DataBindings.Add("Text", f, "SkillBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            Passive.DataBindings.Add("Checked", f, "SkillPassive", true, DataSourceUpdateMode.OnPropertyChanged);
            saveBonus.DataBindings.Add("Text", f, "SavingThrowBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            profBonus.DataBindings.Add("Text", f, "ProficiencyBonus", true, DataSourceUpdateMode.OnPropertyChanged);
            BonusSize.DataBindings.Add("Value", f, "SizeChange", true, DataSourceUpdateMode.OnPropertyChanged);
            attackOption.DataBindings.Add("Text", f, "OptionalText", true, DataSourceUpdateMode.OnPropertyChanged);
            offhandAbility.DataBindings.Add("Checked", f, "OffHandAbilityScoreDamage", true, DataSourceUpdateMode.OnPropertyChanged);
            allowOffhand.DataBindings.Add("Checked", f, "AllowsOffHand", true, DataSourceUpdateMode.OnPropertyChanged);
            SkillList.Items          = f.Skills;
            proficiencyOptions.Items = f.ProficiencyOptions;
            Program.Context.ImportSkills();
            SkillList.Suggestions = Program.Context.SkillsSimple.Keys;
            Program.Context.ImportItems();
            proficiencyOptions.Suggestions = from it in Program.Context.ItemsSimple.Values where it is Weapon select it.Name;
            basicFeature1.Feature          = f;
            foreach (string s in Program.Context.ItemsSimple.Keys)
            {
                if (Program.Context.ItemsSimple[s] is Weapon)
                {
                    Spell.AutoCompleteCustomSource.Add(s);
                    Spell.Items.Add(s);
                }
            }
            Spell.DataBindings.Add("Text", f, "BaseItemChange");
        }
Ejemplo n.º 3
0
        public SpellcastingFeatureForm(SpellcastingFeature f)
        {
            bf = f;

            if (f.PrepareCountAdditionalModifier != Ability.None)
            {
                f.PrepareCount = ResourceFeatureForm.convert(f.PrepareCountAdditionalModifier, f.PrepareCount);
                f.PrepareCountAdditionalModifier = Ability.None;
            }
            if (f.PrepareCountPerClassLevel != 0)
            {
                f.PrepareCount = (f.PrepareCount == null || f.PrepareCount.Trim() == "0" || f.PrepareCount.Trim() == "" ? "" : f.PrepareCount + " + ") + "ClassLevel" + (f.PrepareCountPerClassLevel > 1 ? " * " + f.PrepareCountPerClassLevel : "");
                f.PrepareCountPerClassLevel = 0;
            }
            if (f.PrepareCountAdditional != 0)
            {
                f.PrepareCount           = (f.PrepareCount == null || f.PrepareCount.Trim() == "0" || f.PrepareCount.Trim() == "" ? "" : f.PrepareCount + " + ") + f.PrepareCountAdditional;
                f.PrepareCountAdditional = 0;
            }
            InitializeComponent();
            foreach (Ability s in Enum.GetValues(typeof(Ability)))
            {
                if (s != Ability.None)
                {
                    SpellcastingAbility.Items.Add(s, f.SpellcastingAbility.HasFlag(s));
                }
            }
            foreach (PreparationMode s in Enum.GetValues(typeof(PreparationMode)))
            {
                PrepareMode.Items.Add(s);
            }
            PrepareMode.DataBindings.Add("SelectedItem", f, "Preparation", true, DataSourceUpdateMode.OnPropertyChanged);
            SpellcastingID.DataBindings.Add("Text", f, "SpellcastingID", true, DataSourceUpdateMode.OnPropertyChanged);
            Condition.DataBindings.Add("Text", f, "PrepareableSpells", true, DataSourceUpdateMode.OnPropertyChanged);
            checkBox1.DataBindings.Add("Checked", f, "IgnoreMulticlassing", true, DataSourceUpdateMode.OnPropertyChanged);
            DisplayName.DataBindings.Add("Text", f, "DisplayName", true, DataSourceUpdateMode.OnPropertyChanged);
            Amount.DataBindings.Add("Text", f, "PrepareCount", true, DataSourceUpdateMode.OnPropertyChanged);
            foreach (RechargeModifier s in Enum.GetValues(typeof(RechargeModifier)))
            {
                Recharge.Items.Add(s);
            }
            Recharge.DataBindings.Add("SelectedItem", f, "PreparationChange", true, DataSourceUpdateMode.OnPropertyChanged);
            basicFeature1.Feature = f;
        }