• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Chummer.Power类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Chummer.Power的典型用法代码示例。如果您正苦于以下问题:C# Power类的具体用法?C# Power怎么用?C# Power使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Power类属于Chummer命名空间,在下文中一共展示了Power类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: tsMetamagicAddEnhancement_Click

        private void tsMetamagicAddEnhancement_Click(object sender, EventArgs e)
        {
            if (treMetamagic.SelectedNode.Level != 0)
                return;

            int intGrade = 0;
            foreach (InitiationGrade objGrade in _objCharacter.InitiationGrades)
            {
                if (objGrade.InternalId == treMetamagic.SelectedNode.Tag.ToString())
                {
                    intGrade = objGrade.Grade;
                    break;
                }
            }
            frmSelectArt frmPickArt = new frmSelectArt(_objCharacter);
            frmPickArt.WindowMode = frmSelectArt.Mode.Enhancement;
            frmPickArt.ShowDialog(this);

            // Make sure a value was selected.
            if (frmPickArt.DialogResult == DialogResult.Cancel)
                return;

            string strEnhancement = frmPickArt.SelectedItem;

            XmlDocument objXmlDocument = new XmlDocument();
            XmlNode objXmlArt;

            TreeNode objNode = new TreeNode();
            Enhancement objEnhancement = new Enhancement(_objCharacter);
            Improvement.ImprovementSource objSource;

            objXmlDocument = XmlManager.Instance.Load("powers.xml");
            objXmlArt = objXmlDocument.SelectSingleNode("/chummer/enhancements/enhancement[name = \"" + strEnhancement + "\"]");
            objSource = Improvement.ImprovementSource.Initiation;

            // Find the associated Power
            string strPower = objXmlArt["power"].InnerText.ToString();

            objEnhancement.Create(objXmlArt, _objCharacter, objNode, objSource);
            objEnhancement.Grade = intGrade;
            objNode.ContextMenuStrip = cmsInitiationNotes;
            if (objEnhancement.InternalId == Guid.Empty.ToString())
                return;

            Power objPower = new Power(_objCharacter);
            bool blnPowerFound = false;
            foreach (Power objExistingPower in _objCharacter.Powers)
            {
                if (objExistingPower.Name == strPower)
                {
                    objPower = objExistingPower;
                    objPower.Enhancements.Add(objEnhancement);
                    blnPowerFound = true;
                    break;
                }
            }

            if (!blnPowerFound)
            {
                // Add it to the character instead
                _objCharacter.Enhancements.Add(objEnhancement);
            }

            treMetamagic.SelectedNode.Nodes.Add(objNode);
            treMetamagic.SelectedNode.Expand();

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:71,代码来源:frmCreate.cs


示例2: cmdAddPower_Click

        private void cmdAddPower_Click(object sender, EventArgs e)
        {
            frmSelectPower frmPickPower = new frmSelectPower(_objCharacter);
            frmPickPower.ShowDialog(this);

            // Make sure the dialogue window was not canceled.
            if (frmPickPower.DialogResult == DialogResult.Cancel)
                return;

            int i = panPowers.Controls.Count;

            Power objPower = new Power(_objCharacter);
            _objCharacter.Powers.Add(objPower);

            PowerControl objPowerControl = new PowerControl();
            objPowerControl.PowerObject = objPower;

            // Attach an EventHandler for the PowerRatingChanged Event.
            objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
            objPowerControl.DeletePower += objPower_DeletePower;
            objPowerControl.PowerName = frmPickPower.SelectedPower;
            objPowerControl.PointsPerLevel = frmPickPower.PointsPerLevel;
            objPowerControl.AdeptWayDiscount = frmPickPower.AdeptWayDiscount;
            objPowerControl.LevelEnabled = frmPickPower.LevelEnabled;

			if (frmPickPower.MaxLevels() > 0)
				if (objPower.Name == "Improved Ability (skill)")
				{
					foreach (Skill objSkill in _objCharacter.Skills)
					{
						if (objPower.Extra == objSkill.Name || (objSkill.ExoticSkill && objPower.Extra == (objSkill.DisplayName + " (" + objSkill.Specialization + ")")))
						{
							int intImprovedAbilityMaximum = objSkill.Rating + (objSkill.Rating / 2);
							if (intImprovedAbilityMaximum == 0)
							{
								intImprovedAbilityMaximum = 1;
							}
							objPower.MaxLevels = intImprovedAbilityMaximum;
						}
					}
				}
				else
				{
					objPowerControl.MaxLevels = frmPickPower.MaxLevels();
				}

			// Open the Cyberware XML file and locate the selected piece.
			XmlDocument objXmlDocument = XmlManager.Instance.Load("powers.xml");

            XmlNode objXmlPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[name = \"" + frmPickPower.SelectedPower + "\"]");

            objPower.Source = objXmlPower["source"].InnerText;
            objPower.Page = objXmlPower["page"].InnerText;
            if (objXmlPower["doublecost"] != null)
                objPower.DoubleCost = false;

            if (objXmlPower.InnerXml.Contains("bonus"))
            {
                objPower.Bonus = objXmlPower["bonus"];
                if (!_objImprovementManager.CreateImprovements(Improvement.ImprovementSource.Power, objPower.InternalId, objPower.Bonus, false, Convert.ToInt32(objPower.Rating), objPower.DisplayNameShort))
                {
                    _objCharacter.Powers.Remove(objPower);
                    return;
                }
                objPowerControl.Extra = _objImprovementManager.SelectedValue;
            }

            // Set the control's Maximum.
            objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
            objPowerControl.Top = i * objPowerControl.Height;
            objPowerControl.RefreshTooltip();
            panPowers.Controls.Add(objPowerControl);

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();

            if (frmPickPower.AddAgain)
                cmdAddPower_Click(sender, e);
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:81,代码来源:frmCreate.cs


示例3: Load


//.........这里部分代码省略.........
                Cyberware objCyberware = new Cyberware(this);
                objCyberware.Load(objXmlCyberware);
                _lstCyberware.Add(objCyberware);
            }

            // Spells.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/spells/spell");
            foreach (XmlNode objXmlSpell in objXmlNodeList)
            {
                Spell objSpell = new Spell(this);
                objSpell.Load(objXmlSpell);
                _lstSpells.Add(objSpell);
            }

            // Foci.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/foci/focus");
            foreach (XmlNode objXmlFocus in objXmlNodeList)
            {
                Focus objFocus = new Focus();
                objFocus.Load(objXmlFocus);
                _lstFoci.Add(objFocus);
            }

            // Stacked Foci.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/stackedfoci/stackedfocus");
            foreach (XmlNode objXmlStack in objXmlNodeList)
            {
                StackedFocus objStack = new StackedFocus(this);
                objStack.Load(objXmlStack);
                _lstStackedFoci.Add(objStack);
            }

            // Powers.
            List<ListItem> lstPowerOrder = new List<ListItem>();
            objXmlNodeList = objXmlDocument.SelectNodes("/character/powers/power");
            // Sort the Powers in alphabetical order.
            foreach (XmlNode objXmlPower in objXmlNodeList)
            {
                ListItem objGroup = new ListItem();
                objGroup.Value = objXmlPower["extra"].InnerText;
                objGroup.Name = objXmlPower["name"].InnerText;

                lstPowerOrder.Add(objGroup);
            }
            objSort = new SortListItem();
            lstPowerOrder.Sort(objSort.Compare);

            foreach (ListItem objItem in lstPowerOrder)
            {
                Power objPower = new Power(this);
                XmlNode objNode = objXmlDocument.SelectSingleNode("/character/powers/power[name = " + CleanXPath(objItem.Name) + " and extra = " + CleanXPath(objItem.Value) + "]");
                objPower.Load(objNode);
                _lstPowers.Add(objPower);
            }

            // Spirits/Sprites.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/spirits/spirit");
            foreach (XmlNode objXmlSpirit in objXmlNodeList)
            {
                Spirit objSpirit = new Spirit(this);
                objSpirit.Load(objXmlSpirit);
                _lstSpirits.Add(objSpirit);
            }

            // Compex Forms/Technomancer Programs.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/complexforms/complexform");
开发者ID:ercflemng,项目名称:chummer5a,代码行数:67,代码来源:clsCharacter.cs


示例4: AddPACKSKit


//.........这里部分代码省略.........
                XmlDocument objXmlMartialArtDocument = XmlManager.Instance.Load("martialarts.xml");

                foreach (XmlNode objXmlArt in objXmlKit.SelectNodes("martialarts/martialart"))
                {
                    TreeNode objNode = new TreeNode();
                    MartialArt objArt = new MartialArt(_objCharacter);
                    XmlNode objXmlArtNode = objXmlMartialArtDocument.SelectSingleNode("/chummer/martialarts/martialart[name = \"" + objXmlArt["name"].InnerText + "\"]");
                    objArt.Create(objXmlArtNode, objNode, _objCharacter);
                    objArt.Rating = Convert.ToInt32(objXmlArt["rating"].InnerText);
                    _objCharacter.MartialArts.Add(objArt);

                    // Check for Advantages.
                    foreach (XmlNode objXmlAdvantage in objXmlArt.SelectNodes("techniques/technique"))
                    {
                        TreeNode objChildNode = new TreeNode();
                        MartialArtAdvantage objAdvantage = new MartialArtAdvantage(_objCharacter);
                        XmlNode objXmlAdvantageNode = objXmlMartialArtDocument.SelectSingleNode("/chummer/martialarts/martialart[name = \"" + objXmlArt["name"].InnerText + "\"]/techniques/technique[. = \"" + objXmlAdvantage.InnerText + "\"]");
                        objAdvantage.Create(objXmlAdvantageNode, _objCharacter, objChildNode);
                        objArt.Advantages.Add(objAdvantage);

                        objNode.Nodes.Add(objChildNode);
                        objNode.Expand();
                    }

                    treMartialArts.Nodes[0].Nodes.Add(objNode);
                    treMartialArts.Nodes[0].Expand();
                }
            }

            // Update Adept Powers.
            if (objXmlKit["powers"] != null)
            {
                // Open the Powers XML file and locate the selected power.
                XmlDocument objXmlPowerDocument = XmlManager.Instance.Load("powers.xml");

                foreach (XmlNode objXmlPower in objXmlKit.SelectNodes("powers/power"))
                {
                    XmlNode objXmlPowerNode = objXmlPowerDocument.SelectSingleNode("/chummer/powers/power[name = \"" + objXmlPower["name"].InnerText + "\"]");

                    int i = panPowers.Controls.Count;

                    Power objPower = new Power(_objCharacter);
                    _objCharacter.Powers.Add(objPower);

                    PowerControl objPowerControl = new PowerControl();
                    objPowerControl.PowerObject = objPower;

                    // Attach an EventHandler for the PowerRatingChanged Event.
                    objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
                    objPowerControl.DeletePower += objPower_DeletePower;

                    objPowerControl.PowerName = objXmlPowerNode["name"].InnerText;
                    objPowerControl.PointsPerLevel = Convert.ToDecimal(objXmlPowerNode["points"].InnerText, GlobalOptions.Instance.CultureInfo);
                    objPowerControl.AdeptWayDiscount = Convert.ToDecimal(objXmlPowerNode["adeptway"].InnerText, GlobalOptions.Instance.CultureInfo);
                    if (objXmlPowerNode["levels"].InnerText == "no")
                    {
                        objPowerControl.LevelEnabled = false;
                    }
                    else
                    {
                        objPowerControl.LevelEnabled = true;
                        if (objXmlPowerNode["levels"].InnerText != "yes")
                            objPower.MaxLevels = Convert.ToInt32(objXmlPowerNode["levels"].InnerText);
                    }

                    objPower.Source = objXmlPowerNode["source"].InnerText;
开发者ID:cormanater,项目名称:chummer5a,代码行数:67,代码来源:frmCreate.cs


示例5: cmdAddPower_Click

        private void cmdAddPower_Click(object sender, EventArgs e)
        {
            frmSelectPower frmPickPower = new frmSelectPower(_objCharacter);
            frmPickPower.ShowDialog(this);

            // Make sure the dialogue window was not canceled.
            if (frmPickPower.DialogResult == DialogResult.Cancel)
                return;

            int i = panPowers.Controls.Count;

            // Open the Cyberware XML file and locate the selected piece.
            XmlDocument objXmlDocument = XmlManager.Instance.Load("powers.xml");

            XmlNode objXmlPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[id = \"" + frmPickPower.SelectedPower + "\"]");

            Power objPower = new Power(_objCharacter);
            objPower.Create(objXmlPower, _objCharacter);
            _objCharacter.Powers.Add(objPower);

            PowerControl objPowerControl = new PowerControl();
            objPowerControl.PowerObject = objPower;

            // Attach an EventHandler for the PowerRatingChanged Event.
            objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
            objPowerControl.DeletePower += objPower_DeletePower;

            objPower.Source = objXmlPower["source"].InnerText;
            objPower.Page = objXmlPower["page"].InnerText;
            if (objXmlPower["doublecost"] != null)
                objPower.DoubleCost = false;

            // Set the control's Maximum.
            objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
            objPowerControl.Top = i * objPowerControl.Height;
            objPowerControl.RefreshTooltip();
            panPowers.Controls.Add(objPowerControl);

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();

            if (frmPickPower.AddAgain)
                cmdAddPower_Click(sender, e);
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:46,代码来源:frmCreate.cs


示例6: ProcessBonus


//.........这里部分代码省略.........
                    lstGeneralItems.Add(liUnarmed);
                    frmPickCategory.GeneralItems = lstGeneralItems;

                    if (strFriendlyName != "")
                        frmPickCategory.Description =
                            LanguageManager.Instance.GetString("String_Improvement_SelectSkillNamed").Replace("{0}", strFriendlyName);
                    else
                        frmPickCategory.Description = LanguageManager.Instance.GetString("Title_SelectWeaponCategory");

                    Log.Info("_strForcedValue = " + _strForcedValue);

                    if (_strForcedValue.StartsWith("Adept:") || _strForcedValue.StartsWith("Magician:"))
                        _strForcedValue = "";

                    if (_strForcedValue != "")
                    {
                        frmPickCategory.Opacity = 0;
                    }
                    frmPickCategory.ShowDialog();

                    // Make sure the dialogue window was not canceled.
                    if (frmPickCategory.DialogResult == DialogResult.Cancel)
                    {
                        Rollback();
                        _strForcedValue = "";
                        _strLimitSelection = "";
                        return false;
                    }

                    _strSelectedValue = frmPickCategory.SelectedItem;

                    Log.Info("strSelected = " + _strSelectedValue);

                    foreach (Power objPower in _objCharacter.Powers)
                    {
                        if (objPower.InternalId == strSourceName)
                        {
                            objPower.Extra = _strSelectedValue;
                        }
                    }

                    Log.Info("Calling CreateImprovement");
                    CreateImprovement(_strSelectedValue, objImprovementSource, strSourceName,
                        Improvement.ImprovementType.WeaponCategoryDV, strUnique, ValueToInt(nodWeapon["bonus"].InnerXml, intRating));
                }
                else
                {
                    // Run through each of the Skill Groups since there may be more than one affected.
                    foreach (XmlNode objXmlCategory in objXmlCategoryList)
                    {
                        Log.Info("Calling CreateImprovement");
                        CreateImprovement(objXmlCategory["name"].InnerText, objImprovementSource, strSourceName,
                            Improvement.ImprovementType.WeaponCategoryDV, strUnique, ValueToInt(objXmlCategory["bonus"].InnerXml, intRating));
                    }
                }
            }

            // Check for Mentor Spirit bonuses.
            if (bonusNode.LocalName == ("selectmentorspirit"))
            {
                Log.Info("selectmentorspirit");
                Log.Info("selectmentorspirit = " + bonusNode.OuterXml.ToString());
                frmSelectMentorSpirit frmPickMentorSpirit = new frmSelectMentorSpirit(_objCharacter);
                frmPickMentorSpirit.ShowDialog();

                // Make sure the dialogue window was not canceled.
开发者ID:Rockzo,项目名称:chummer5a,代码行数:67,代码来源:clsImprovement.cs


示例7: tsMetamagicAddEnhancement_Click

        private void tsMetamagicAddEnhancement_Click(object sender, EventArgs e)
        {
            bool blnPayWithKarma = false;
            string strType = "";

            if (treMetamagic.SelectedNode.Level != 0)
                return;

            int intGrade = 0;
            foreach (InitiationGrade objGrade in _objCharacter.InitiationGrades)
            {
                if (objGrade.InternalId == treMetamagic.SelectedNode.Tag.ToString())
                {
                    intGrade = objGrade.Grade;
                    break;
                }
            }

            blnPayWithKarma = true;
            if (blnPayWithKarma && _objCharacter.Karma < _objOptions.KarmaSpell)
            {
                // Make sure the Karma expense would not put them over the limit.
                MessageBox.Show(LanguageManager.Instance.GetString("Message_NotEnoughKarma"), LanguageManager.Instance.GetString("MessageTitle_NotEnoughKarma"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (!ConfirmKarmaExpense(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpenseSpend").Replace("{0}", LanguageManager.Instance.GetString("String_Enhancement")).Replace("{1}", _objOptions.KarmaSpell.ToString())))
                return;

            frmSelectArt frmPickArt = new frmSelectArt(_objCharacter);
            frmPickArt.WindowMode = frmSelectArt.Mode.Enhancement;
            frmPickArt.ShowDialog(this);

            // Make sure a value was selected.
            if (frmPickArt.DialogResult == DialogResult.Cancel)
                return;

            string strEnhancement = frmPickArt.SelectedItem;

            XmlDocument objXmlDocument = new XmlDocument();
            XmlNode objXmlArt;

            TreeNode objNode = new TreeNode();
            Enhancement objEnhancement = new Enhancement(_objCharacter);
            Improvement.ImprovementSource objSource;

            objXmlDocument = XmlManager.Instance.Load("powers.xml");
            objXmlArt = objXmlDocument.SelectSingleNode("/chummer/enhancements/enhancement[name = \"" + strEnhancement + "\"]");
            objSource = Improvement.ImprovementSource.Initiation;

            // Find the associated Power
            string strPower = objXmlArt["power"].InnerText.ToString();

            objEnhancement.Create(objXmlArt, _objCharacter, objNode, objSource);
            objEnhancement.Grade = intGrade;
            objNode.ContextMenuStrip = cmsInitiationNotes;
            if (objEnhancement.InternalId == Guid.Empty.ToString())
                return;

            Power objPower = new Power(_objCharacter);
            bool blnPowerFound = false;
            foreach (Power objExistingPower in _objCharacter.Powers)
            {
                if (objExistingPower.Name == strPower)
                {
                    objPower = objExistingPower;
                    objPower.Enhancements.Add(objEnhancement);
                    blnPowerFound = true;
                    break;
                }
            }

            if (!blnPowerFound)
            {
                // Add it to the character instead
                _objCharacter.Enhancements.Add(objEnhancement);
            }

            if (blnPayWithKarma)
            {
                // Create the Expense Log Entry.
                ExpenseLogEntry objEntry = new ExpenseLogEntry();
                objEntry.Create(_objOptions.KarmaEnhancement * -1, strType + " " + frmPickArt.SelectedItem, ExpenseType.Karma, DateTime.Now);
                _objCharacter.ExpenseEntries.Add(objEntry);

                ExpenseUndo objUndo = new ExpenseUndo();
                objUndo.CreateKarma(KarmaExpenseType.AddSpell, objEnhancement.InternalId);
                objEntry.Undo = objUndo;

                // Adjust the character's Karma total.
                _objCharacter.Karma -= _objOptions.KarmaEnhancement;
            }

            treMetamagic.SelectedNode.Nodes.Add(objNode);
            treMetamagic.SelectedNode.Expand();

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
//.........这里部分代码省略.........
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:101,代码来源:frmCareer.cs


示例8: RefreshMinimum

        /// <summary>
        /// Refresh the minimum level for the Power.
        /// </summary>
        /// <param name="objPower">The power.</param>
        public void RefreshMinimum(Power objPower)
        {
            if (_objPower.FreeLevels > 0)
                nudRating.Minimum = _objPower.FreeLevels;
            else
                nudRating.Minimum = 0;

            // raise or lower value    

            _objPower.FreeLevels = objPower.FreeLevels;


            return;
        }
开发者ID:AMDX9,项目名称:chummer5a,代码行数:18,代码来源:PowerControl.cs


示例9: CreateAllPowersTest

        public void CreateAllPowersTest()
        {
            // Create a new Human character.
            Character objCharacter = new Character();
            objCharacter.LoadMetatype(Guid.Parse("e28e7075-f635-4c02-937c-e4fc61c51602"));

            XmlDocument objXmlDocument = XmlManager.Instance.Load("powers.xml");
            foreach (XmlNode objXmlNode in objXmlDocument.SelectNodes("/chummer/powers/power"))
            {
                Power objPower = new Power(objCharacter);
                objPower.Create(objXmlNode, objCharacter, 1, "", false);
            }
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:13,代码来源:UniqueTests.cs


示例10: Load


//.........这里部分代码省略.........
                objCyberware.Load(objXmlCyberware);
                _lstCyberware.Add(objCyberware);
            }

            // Spells.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/spells/spell");
            foreach (XmlNode objXmlSpell in objXmlNodeList)
            {
                Spell objSpell = new Spell(this);
                objSpell.Load(objXmlSpell);
                _lstSpells.Add(objSpell);
            }

            // Foci.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/foci/focus");
            foreach (XmlNode objXmlFocus in objXmlNodeList)
            {
                Focus objFocus = new Focus();
                objFocus.Load(objXmlFocus);
                _lstFoci.Add(objFocus);
            }

            // Stacked Foci.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/stackedfoci/stackedfocus");
            foreach (XmlNode objXmlStack in objXmlNodeList)
            {
                StackedFocus objStack = new StackedFocus(this);
                objStack.Load(objXmlStack);
                _lstStackedFoci.Add(objStack);
            }

            // Powers.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/powers/power");
            foreach (XmlNode objXmlPower in objXmlNodeList)
            {
                Power objPower = new Power(this);
                objPower.Load(objXmlPower);
                _lstPowers.Add(objPower);
            }

            // Spirits/Sprites.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/spirits/spirit");
            foreach (XmlNode objXmlSpirit in objXmlNodeList)
            {
                Spirit objSpirit = new Spirit(this);
                objSpirit.Load(objXmlSpirit);
                _lstSpirits.Add(objSpirit);
            }

            // Compex Forms/Technomancer Programs.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/techprograms/techprogram");
            foreach (XmlNode objXmlProgram in objXmlNodeList)
            {
                TechProgram objProgram = new TechProgram(this);
                objProgram.Load(objXmlProgram);
                _lstTechPrograms.Add(objProgram);
            }

            // Martial Arts.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/martialarts/martialart");
            foreach (XmlNode objXmlArt in objXmlNodeList)
            {
                MartialArt objMartialArt = new MartialArt(this);
                objMartialArt.Load(objXmlArt);
                _lstMartialArts.Add(objMartialArt);
            }
开发者ID:Nebual,项目名称:chummer,代码行数:67,代码来源:clsCharacter.cs


示例11: CreateImprovements


//.........这里部分代码省略.........
                            lstGeneralItems.Add(liUnarmed);
                            frmPickCategory.GeneralItems = lstGeneralItems;

                            if (strFriendlyName != "")
                                frmPickCategory.Description = LanguageManager.Instance.GetString("String_Improvement_SelectSkillNamed").Replace("{0}", strFriendlyName);
                            else
                                frmPickCategory.Description = LanguageManager.Instance.GetString("Title_SelectWeaponCategory");

                            objFunctions.LogWrite(CommonFunctions.LogType.Content, "Chummer.ImprovementManager", "_strForcedValue = " + _strForcedValue);

                            if (_strForcedValue.StartsWith("Adept:") || _strForcedValue.StartsWith("Magician:"))
                                _strForcedValue = "";

                            if (_strForcedValue != "")
                            {
                                frmPickCategory.Opacity = 0;
                            }
                            frmPickCategory.ShowDialog();

                            // Make sure the dialogue window was not canceled.
                            if (frmPickCategory.DialogResult == DialogResult.Cancel)
                            {
                                Rollback();
                                blnSuccess = false;
                                _strForcedValue = "";
                                _strLimitSelection = "";
                                return false;
                            }

                            string strSelected = frmPickCategory.SelectedItem;

                            objFunctions.LogWrite(CommonFunctions.LogType.Content, "Chummer.ImprovementManager", "strSelected = " + strSelected);

                            foreach (Power objPower in _objCharacter.Powers)
                            {
                                if (objPower.InternalId == strSourceName)
                                {
                                    objPower.Name = objPower.Name + " (" + strSelected + ")";
                                }
                            }

                            objFunctions.LogWrite(CommonFunctions.LogType.Message, "Chummer.ImprovementManager", "Calling CreateImprovement");
                            CreateImprovement(strSelected, objImprovementSource, strSourceName, Improvement.ImprovementType.WeaponCategoryDV, strUnique, ValueToInt(nodWeapon["bonus"].InnerXml, intRating));
                        }
                        else
                        {
                            // Run through each of the Skill Groups since there may be more than one affected.
                            foreach (XmlNode objXmlCategory in objXmlCategoryList)
                            {
                                objFunctions.LogWrite(CommonFunctions.LogType.Message, "Chummer.ImprovementManager", "Calling CreateImprovement");
                                CreateImprovement(objXmlCategory["name"].InnerText, objImprovementSource, strSourceName, Improvement.ImprovementType.WeaponCategoryDV, strUnique, ValueToInt(objXmlCategory["bonus"].InnerXml, intRating));
                            }
                        }
                    }

                    // Check for Mentor Spirit bonuses.
                    if (NodeExists(nodBonus, "selectmentorspirit"))
                    {
                        objFunctions.LogWrite(CommonFunctions.LogType.Message, "Chummer.ImprovementManager", "selectmentorspirit");
                        objFunctions.LogWrite(CommonFunctions.LogType.Content, "Chummer.ImprovementManager", "selectmentorspirit = " + nodBonus["selectmentorspirit"].OuterXml.ToString());
                        frmSelectMentorSpirit frmPickMentorSpirit = new frmSelectMentorSpirit(_objCharacter);
                        frmPickMentorSpirit.ShowDialog();

                        // Make sure the dialogue window was not canceled.
                        if (frmPickMentorSpirit.DialogResult == DialogResult.Cancel)
                        {
开发者ID:kingcortez905,项目名称:chummer5,代码行数:67,代码来源:clsImprovement.cs



注:本文中的Chummer.Power类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Chummer.PowerControl类代码示例发布时间:2022-05-24
下一篇:
C# Chummer.MartialArt类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap