Ejemplo n.º 1
0
        private void btnExotic_Click(object sender, EventArgs e)
        {
            if (_character.Options.KarmaNewActiveSkill > _character.Karma && _character.Created)
            {
                MessageBox.Show(LanguageManager.GetString("Message_NotEnoughKarma", GlobalOptions.Language));
                return;
            }


            XmlDocument          document           = XmlManager.Load("skills.xml");
            frmSelectExoticSkill frmPickExoticSkill = new frmSelectExoticSkill(_character);

            frmPickExoticSkill.ShowDialog(this);

            if (frmPickExoticSkill.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            XmlNode node = document.SelectSingleNode("/chummer/skills/skill[name = \"" + frmPickExoticSkill.SelectedExoticSkill + "\"]");

            ExoticSkill skill = new ExoticSkill(ObjCharacter, node)
            {
                Specific = frmPickExoticSkill.SelectedExoticSkillSpecialisation
            };

            skill.Upgrade();
            ObjCharacter.SkillsSection.Skills.Add(skill);
            ObjCharacter.SkillsSection.SkillsDictionary.Add(skill.Name + " (" + skill.DisplaySpecializationMethod(GlobalOptions.DefaultLanguage) + ')', skill);
        }
Ejemplo n.º 2
0
        private void btnExotic_Click(object sender, EventArgs e)
        {
            XmlDocument          xmlSkillsDocument  = XmlManager.Load("skills.xml");
            frmSelectExoticSkill frmPickExoticSkill = new frmSelectExoticSkill(_objCharacter);

            frmPickExoticSkill.ShowDialog(this);

            if (frmPickExoticSkill.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            XmlNode xmlSkillNode = xmlSkillsDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + frmPickExoticSkill.SelectedExoticSkill + "\"]");

            ExoticSkill objSkill = new ExoticSkill(_objCharacter, xmlSkillNode)
            {
                Specific = frmPickExoticSkill.SelectedExoticSkillSpecialisation
            };

            // Karma check needs to come after the skill is created to make sure bonus-based modifiers (e.g. JoAT) get applied properly (since they can potentially trigger off of the specific exotic skill target)
            if (_objCharacter.Created && objSkill.UpgradeKarmaCost > _objCharacter.Karma)
            {
                MessageBox.Show(LanguageManager.GetString("Message_NotEnoughKarma", GlobalOptions.Language));
                return;
            }
            objSkill.Upgrade();
            _objCharacter.SkillsSection.Skills.Add(objSkill);
            string key = objSkill.Name + " (" + objSkill.DisplaySpecializationMethod(GlobalOptions.DefaultLanguage) +
                         ')';

            if (!_objCharacter.SkillsSection.SkillsDictionary.ContainsKey(key))
            {
                _objCharacter.SkillsSection.SkillsDictionary.Add(key, objSkill);
            }
        }
Ejemplo n.º 3
0
        private void btnExotic_Click(object sender, EventArgs e)
        {
            ExoticSkill objSkill;
            XmlDocument xmlSkillsDocument = _objCharacter.LoadData("skills.xml");

            using (frmSelectExoticSkill frmPickExoticSkill = new frmSelectExoticSkill(_objCharacter))
            {
                frmPickExoticSkill.ShowDialog(this);

                if (frmPickExoticSkill.DialogResult == DialogResult.Cancel)
                {
                    return;
                }

                XmlNode xmlSkillNode = xmlSkillsDocument.SelectSingleNode("/chummer/skills/skill[name = " + frmPickExoticSkill.SelectedExoticSkill.CleanXPath() + "]");

                objSkill = new ExoticSkill(_objCharacter, xmlSkillNode)
                {
                    Specific = frmPickExoticSkill.SelectedExoticSkillSpecialisation
                };
            }

            // Karma check needs to come after the skill is created to make sure bonus-based modifiers (e.g. JoAT) get applied properly (since they can potentially trigger off of the specific exotic skill target)
            if (_objCharacter.Created && objSkill.UpgradeKarmaCost > _objCharacter.Karma)
            {
                Program.MainForm.ShowMessageBox(LanguageManager.GetString("Message_NotEnoughKarma"));
                return;
            }
            objSkill.Upgrade();
            _objCharacter.SkillsSection.Skills.Add(objSkill);
        }
Ejemplo n.º 4
0
        private void btnExotic_Click(object sender, EventArgs e)
        {
            if (_character.Options.KarmaNewActiveSkill > _character.Karma && _character.Created)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_NotEnoughKarma"));
                return;
            }

            XmlDocument document = XmlManager.Instance.Load("skills.xml");
            frmSelectExoticSkill frmPickExoticSkill = new frmSelectExoticSkill();
            frmPickExoticSkill.ShowDialog(this);

            if (frmPickExoticSkill.DialogResult == DialogResult.Cancel)
                return;

            XmlNode node =
                document.SelectSingleNode("/chummer/skills/skill[name = \"" + frmPickExoticSkill.SelectedExoticSkill + "\"]");

            ExoticSkill skill = new ExoticSkill(ObjCharacter, node);
            skill.Specific = frmPickExoticSkill.SelectedExoticSkillSpecialisation;
            skill.Upgrade();
            ObjCharacter.SkillsSection.Skills.Add(skill);
        }