Пример #1
0
        /** Shows all spells from given spell class. */
        private void viewSpellClass(MDRSpellClass spellClass)
        {
            spellClassList.Visible = false;
            spellHeader.Visible    = true;
            spellList.Visible      = true;
            backButton.Visible     = true;

            spellHeader.SpellClass = spellClass;

            if (Character == null)
            {
                spellList.Clear();
                return;
            }

            var knownSpells = new List <MDRSpell>();

            foreach (MDRSpell spell in Character.KnownSpells)
            {
                if (spell.SpellClass.ID == spellClass.ID)
                {
                    knownSpells.Add(spell);
                }
            }

            spellList.SetSpells(knownSpells);
        }
Пример #2
0
 private void setSpellClass(MDRSpellClass value)
 {
     _spellClass = value;
     if (value != null)
     {
         icon.Sprite   = value.Icon;
         title.Caption = value.Name;
     }
 }
Пример #3
0
 public GuiSpellClassButton(MDRSpellClass spellClass)
     : base("")
 {
     Style             = Engine.GetStyleCopy("SquareButton");
     InnerShadow       = true;
     CaptionDropShadow = true;
     Width             = (int)(Style.padding.horizontal + spellClass.Icon.rect.width);
     Height            = (int)(Style.padding.vertical + spellClass.Icon.rect.height);
     Image             = new GuiImage(0, 0, spellClass.Icon);
     Caption           = spellClass.ShortName;
 }
Пример #4
0
        public override string LongDescription()
        {
            string magicSchools = "";

            for (var lp = 0; lp < CoM.SpellClasses.Count; lp++)
            {
                MDRSpellClass sc    = CoM.SpellClasses[lp];
                MDRSkill      skill = sc.Skill;
                if (skill != null)
                {
                    if (SkillRate[skill.ID] > 0)
                    {
                        magicSchools += sc + ",";
                    }
                }
            }
            if (magicSchools != "")
            {
                magicSchools = magicSchools.TrimEnd(',');
            }

            return(Name + " may cast spells from [" + magicSchools + "]");
        }