Exemple #1
0
        private CheckBox CheckBoxForSpell(ModifierSpell spell)
        {
            Type spellType = spell.GetType();

            if (spellType == typeof(Bless))
            {
                return(BlessChbx);
            }
            if (spellType == typeof(Bloodlust))
            {
                return(BloodlustChbx);
            }
            if (spellType == typeof(Frenzy))
            {
                return(FrenzyChbx);
            }
            if (spellType == typeof(Prayer))
            {
                return(PrayerChbx);
            }
            if (spellType == typeof(Precision))
            {
                return(PrecisionChbx);
            }
            if (spellType == typeof(Slayer))
            {
                return(SlayerChbx);
            }

            if (spellType == typeof(Shield))
            {
                return(ShieldChbx);
            }
            if (spellType == typeof(StoneSkin))
            {
                return(StoneSkinChbx);
            }
            if (spellType == typeof(AirShield))
            {
                return(AirShieldChbx);
            }

            if (spellType == typeof(DisruptingRay))
            {
                return(DisruptingRayChbx);
            }
            if (spellType == typeof(Curse))
            {
                return(CurseChbx);
            }
            if (spellType == typeof(Weakness))
            {
                return(WeaknessChbx);
            }

            return(null);
        }
Exemple #2
0
        private void CheckSpellCheckbox(CheckBox chbx, Type spellType, List <ModifierSpell> spells, HeroStats heroStats)
        {
            if (chbx.Checked)
            {
                ModifierSpell spell = (ModifierSpell)Activator.CreateInstance(spellType);
                spell.CasterStats = heroStats.SpellCasterStatsForSpell(spell);

                spells.Add(spell);
            }
        }