当前位置: 首页>>代码示例>>C#>>正文


C# ImprovementManager.ValueOf方法代码示例

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


在下文中一共展示了ImprovementManager.ValueOf方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RefreshControl

        /// <summary>
        /// Update the Modified Rating shown.
        /// </summary>
        public void RefreshControl()
        {
            bool blnSkillsoft = false;
            ImprovementManager objImprovementManager = new ImprovementManager(_objSkill.CharacterObject);

            int intRating = _objSkill.TotalRating;
            lblModifiedRating.Text = intRating.ToString();

            int intSkillRating = _objSkill.Rating;
            foreach (Gear objGear in _objSkill.CharacterObject.Gear)
            {
                // Look for any Skillsoft that would conflict with the Skill's Rating.
                if (objGear.Equipped && objGear.Category == "Skillsofts" && (objGear.Extra == _objSkill.Name || objGear.Extra == _objSkill.Name + ", " + LanguageManager.Instance.GetString("Label_SelectGear_Hacked")))
                {
                    if (objGear.Rating > _objSkill.Rating)
                    {
                        // Use the Skillsoft's Rating or Skillwire Rating, whichever is lower.
                        // If this is a Knowsoft or Linguasoft, it is not limited to the Skillwire Rating.
                        if (objGear.Name == "Activesoft")
                            intSkillRating = Math.Min(objGear.Rating, objImprovementManager.ValueOf(Improvement.ImprovementType.Skillwire));
                        else
                            intSkillRating = objGear.Rating;
                        blnSkillsoft = true;
                        break;
                    }
                }

                foreach (Gear objChild in objGear.Children)
                {
                    if (objChild.Equipped && objChild.Category == "Skillsofts" && (objChild.Extra == _objSkill.Name || objChild.Extra == _objSkill.Name + ", " + LanguageManager.Instance.GetString("Label_SelectGear_Hacked")))
                    {
                        if (objChild.Rating > _objSkill.Rating)
                        {
                            // Use the Skillsoft's Rating or Skillwire Rating, whichever is lower.
                            // If this is a Knowsoft or Linguasoft, it is not limited to the Skillwire Rating.
                            if (objChild.Name == "Activesoft")
                                intSkillRating = Math.Min(objChild.Rating, objImprovementManager.ValueOf(Improvement.ImprovementType.Skillwire));
                            else
                                intSkillRating = objChild.Rating;
                            blnSkillsoft = true;
                            break;
                        }
                    }
                }
            }
            if (_objSkill.FreeLevels > 0)
            {
                nudSkill.Minimum = _objSkill.FreeLevels;
            }
            else
            {
                nudSkill.Minimum = 0;
            }

            if (cboSpec.Text != "" && !_objSkill.ExoticSkill)
            {
                bool blnFound = false;
                if (this.SkillName == "Artisan")
                {
                    // Look for the Inspired quality to see if we get a free specialization
                    foreach (Quality objQuality in _objSkill.CharacterObject.Qualities)
                    {
                        if (objQuality.Name == "Inspired")
                            blnFound = true;
                    }
                }
                if (!blnFound)
                {
                    lblModifiedRating.Text += " (" + (intRating + 2).ToString() + ")";
                }
                else
                {
                    lblModifiedRating.Text += " (" + (intRating + 3).ToString() + ")";
                }
            }
            lblAttribute.Text = _objSkill.DisplayAttribute;

            // Build the Tooltip.
            string strTooltip = "";
            if (blnSkillsoft)
                strTooltip += LanguageManager.Instance.GetString("Tip_Skill_SkillsoftRating") + " (" + intSkillRating.ToString() + ")";
            else
                strTooltip += LanguageManager.Instance.GetString("Tip_Skill_SkillRating") + " (" + _objSkill.Rating.ToString() + ")";

            if (_objSkill.Default && intSkillRating == 0)
                strTooltip += " - " + LanguageManager.Instance.GetString("Tip_Skill_Defaulting") + " (1)";
            if ((!_objSkill.Default && intSkillRating > 0) || _objSkill.Default)
            {
                strTooltip += " + " + LanguageManager.Instance.GetString("String_Attribute" + _objSkill.Attribute + "Short") + " (" + _objSkill.AttributeModifiers.ToString() + ")";
            }

            // Modifiers only apply when not Defaulting.
            if (intSkillRating > 0 || _objSkill.CharacterObject.Options.SkillDefaultingIncludesModifiers)
            {
                if (_objSkill.RatingModifiers != 0)
                {
                    if (_objSkill.CharacterObject.Options.EnforceMaximumSkillRatingModifier)
//.........这里部分代码省略.........
开发者ID:ltdouthit,项目名称:chummer5a,代码行数:101,代码来源:SkillControl.cs

示例2: RequirementMet


//.........这里部分代码省略.........
                                    if (objCyberware.Name.Contains(objXmlCyberware.InnerText))
                                    {
                                        if (objXmlCyberware.Attributes["select"] == null)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                        else if (objXmlCyberware.Attributes["select"].InnerText == objCyberware.Location)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                    }
                                }
                            }

                            // Check Bioware name that contain a straing.
                            foreach (XmlNode objXmlDocument in objXmlRequired.SelectNodes("biowarecontains"))
                            {
                                foreach (Cyberware objCyberware in _objCharacter.Cyberware)
                                {
                                    if (objCyberware.Name.Contains(objXmlCyberware.InnerText))
                                    {
                                        if (objXmlCyberware.Attributes["select"] == null)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                        else if (objXmlCyberware.Attributes["select"].InnerText == objCyberware.Location)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                    }
                                }
                            }

                            // Check for Cyberware Plugins.
                            foreach (XmlNode objXmlDocument in objXmlRequired.SelectNodes("cyberwareplugin"))
                            {
                                foreach (Cyberware objCyberware in _objCharacter.Cyberware)
                                {
                                    foreach (Cyberware objPlugin in objCyberware.Children)
                                    {
                                        if (objPlugin.Name == objXmlCyberware.InnerText)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                    }
                                }
                            }

                            // Check for Cyberware Categories.
                            foreach (XmlNode objXmlDocument in objXmlRequired.SelectNodes("cyberwarecategory"))
                            {
                                foreach (Cyberware objCyberware in _objCharacter.Cyberware)
                                {
                                    if (objCyberware.Category == objXmlCyberware.InnerText)
                                        intTotal++;
                                }
                            }

                            if (intTotal >= Convert.ToInt32(objXmlRequired["count"].InnerText))
                                blnOneOfMet = true;
                        }
                        else if (objXmlRequired.Name == "streetcredvsnotoriety")
                        {
                            // Street Cred must be higher than Notoriety.
                            if (_objCharacter.StreetCred >= _objCharacter.Notoriety)
                                blnOneOfMet = true;
                        }
                        else if (objXmlRequired.Name == "damageresistance")
                        {
                            // Damage Resistance must be a particular value.
                            ImprovementManager _objImprovementManager = new ImprovementManager(_objCharacter);
                            if (_objCharacter.BOD.TotalValue + _objImprovementManager.ValueOf(Improvement.ImprovementType.DamageResistance) >= Convert.ToInt32(objXmlRequired.InnerText))
                                blnOneOfMet = true;
                        }
                    }

                    // Update the flag for requirements met.
                    blnRequirementMet = blnRequirementMet && blnOneOfMet;
                    strRequirement += strThisRequirement;
                }

                // The character has not met the requirements, so display a message and uncheck the item.
                if (!blnRequirementMet)
                {
                    string strMessage = LanguageManager.Instance.GetString("Message_SelectQuality_QualityRequirement");
                    strMessage += strRequirement;

                    if (blnShowMessage)
                        MessageBox.Show(strMessage, LanguageManager.Instance.GetString("MessageTitle_SelectQuality_QualityRequirement"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return false;
                }
            }

            return true;
        }
开发者ID:argo2445,项目名称:chummer5a,代码行数:101,代码来源:frmSelectCyberware.cs

示例3: CalculateValues

        /// <summary>
        /// Calculate the LP value for the selected items.
        /// </summary>
        private int CalculateValues(bool blnIncludePercentage = true)
        {
            if (_blnSkipRefresh)
                return 0;

            int intNuyen = 0;
            decimal decBaseCost = 0;
            decimal decCost = 0;
            // Get the base cost of the lifestyle
            XmlNode objXmlAspect = _objXmlDocument.SelectSingleNode("/chummer/lifestyles/lifestyle[name = \"" + cboLifestyle.SelectedValue + "\"]");
            decBaseCost += Convert.ToDecimal(objXmlAspect["cost"].InnerText);
            _objLifestyle.Dice = Convert.ToInt32(objXmlAspect["dice"].InnerText);
            _objLifestyle.Multiplier = Convert.ToInt32(objXmlAspect["multiplier"].InnerText);

            // Add the flat costs from qualities
            foreach (TreeNode objNode in treQualities.Nodes)
            {
                if (objNode.Checked)
                {
                    XmlNode objXmlQuality = _objXmlDocument.SelectSingleNode("/chummer/qualities/quality[name = \"" + GetQualityName(objNode.Tag.ToString()) + "\"]");
                    if (objXmlQuality["cost"] != null && objXmlQuality["cost"].InnerText != "")
                        decCost += Convert.ToDecimal(objXmlQuality["cost"].InnerText);
                }
            }

            decimal decMod = 0;
            if (blnIncludePercentage)
            {
                // Add the modifiers from qualities
                foreach (TreeNode objNode in treQualities.Nodes)
                {
                    if (objNode.Checked)
                    {
                        objXmlAspect = _objXmlDocument.SelectSingleNode("/chummer/qualities/quality[name = \"" + GetQualityName(objNode.Tag.ToString()) + "\"]");
                        if (objXmlAspect["multiplier"] != null)
                            decMod += (Convert.ToDecimal(objXmlAspect["multiplier"].InnerText) / 100);
                    }
                }

                // Check for modifiers in the improvements
                ImprovementManager objImprovementManager = new ImprovementManager(_objCharacter);
                decimal decModifier = Convert.ToDecimal(objImprovementManager.ValueOf(Improvement.ImprovementType.LifestyleCost), GlobalOptions.Instance.CultureInfo);
                decMod += Convert.ToDecimal(decModifier / 100, GlobalOptions.Instance.CultureInfo);
            }

            intNuyen = Convert.ToInt32(decBaseCost + (decBaseCost * decMod));
            intNuyen += Convert.ToInt32(decCost);
            lblCost.Text = String.Format("{0:###,###,##0¥}", intNuyen);

            if (nudPercentage.Value != 100)
            {
                decimal decDiscount = 0;
                decDiscount = decBaseCost + (decBaseCost * decMod);
                decDiscount += decCost;
                decDiscount = decDiscount * (nudPercentage.Value /100);
                lblCost.Text += String.Format(" (" + "{0:###,###,##0¥}" +")", Convert.ToInt32(decDiscount));
            }
            return intNuyen;
        }
开发者ID:RunnerHub,项目名称:chummer5a,代码行数:62,代码来源:frmSelectLifestyle.cs

示例4: SkillControl_Load


//.........这里部分代码省略.........
                            {
                                intKarmaCost = ((_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill) - 1;
                            }
                            //Academic Knowledge Skills > Rank 2 gain a 1 karma discount with the College Education quality.
                            else if (_objSkill.CharacterObject.CollegeEducation && _objSkill.SkillCategory == "Academic")
                            {
                                intKarmaCost = ((_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill) - 1;
                            }
                            //Professional Knowledge Skills > Rank 2 gain a 1 karma discount with the Tech School quality.
                            else if (_objSkill.CharacterObject.TechSchool && _objSkill.SkillCategory == "Professional")
                            {
                                intKarmaCost = ((_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill) - 1;
                            }
                            //Linguist Skills > Rank 2 gain a 1 karma discount with the Linguist quality.
                            else if (_objSkill.CharacterObject.Linguist && _objSkill.SkillCategory == "Language")
                            {
                                intKarmaCost = ((_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill) - 1;
                            }
                        }
                        else
                            intKarmaCost = (_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill;
                    }
                    // Double the Karma cost if the character is Uneducated and is a Technical Active, Academic, or Professional Skill.
                    if (_objSkill.CharacterObject.Uneducated && (SkillCategory == "Technical Active" || SkillCategory == "Academic" || SkillCategory == "Professional"))
                        intKarmaCost *= 2;
                    //Double the Karma cost if the character is Uncouth and is a Social Active Skill.
                    if (_objSkill.CharacterObject.Uncouth && (SkillCategory == "Social Active"))
                    {
                        intKarmaCost *= 2;
                    }
                    strTooltip = LanguageManager.Instance.GetString("Tip_ImproveItem").Replace("{0}", intNewRating.ToString()).Replace("{1}", intKarmaCost.ToString());
                    tipTooltip.SetToolTip(cmdImproveSkill, strTooltip);
                }

                ImprovementManager objImprovementManager = new ImprovementManager(_objSkill.CharacterObject);
                if (objImprovementManager.ValueOf(Improvement.ImprovementType.AdeptLinguistics) > 0 && SkillCategory == "Language" && SkillRating == 0)
                    strTooltip = LanguageManager.Instance.GetString("Tip_ImproveItem").Replace("{0}", "1").Replace("{1}", "0");
                tipTooltip.SetToolTip(cmdImproveSkill, strTooltip);

                nudSkill.Visible = false;
                nudKarma.Visible = false;
                lblSkillRating.Visible = true;
                cmdImproveSkill.Visible = true;

                if (_objSkill.FreeLevels > 0)
                    nudSkill.Minimum = _objSkill.FreeLevels;
                else
                    nudSkill.Minimum = 0;

                // Show the Dice Rolling button if the option is enabled.
                if (_objSkill.CharacterObject.Options.AllowSkillDiceRolling)
                {
                    cmdRoll.Visible = true;
                    this.Width += 30;
                    cboSpec.Left += 30;
                    lblSpec.Left += 30;
                    cmdChangeSpec.Left += 30;
                    cboKnowledgeSkillCategory.Left += 30;
                    cmdDelete.Left += 30;
                    tipTooltip.SetToolTip(cmdRoll, LanguageManager.Instance.GetString("Tip_DiceRoller"));
                }

                if (!_objSkill.ExoticSkill)
                {
                    cboSpec.Visible = false;
                    lblSpec.Visible = true;
                    lblSpec.Text = _objSkill.Specialization;
                    cmdChangeSpec.Visible = true;
                    cboSpec.Enabled = false;
                }
                else
                {
                    cboSpec.Text = _objSkill.Specialization;
                }

                string strTip = LanguageManager.Instance.GetString("Tip_Skill_AddSpecialization").Replace("{0}", _objSkill.CharacterObject.Options.KarmaSpecialization.ToString());
                tipTooltip.SetToolTip(cmdChangeSpec, strTip);
            }
            if (KnowledgeSkill)
            {
                this.Width = cmdExpand.Left + cmdExpand.Width;
            }
            else
                this.Width = cmdChangeSpec.Left + cmdChangeSpec.Width;

            if (!_objSkill.CharacterObject.Created && _objSkill.SkillGroupObject != null && _objSkill.SkillGroupObject.Broken)
            {
                if (!_objSkill.CharacterObject.Options.UsePointsOnBrokenGroups)
                    nudSkill.Enabled = false;
                cmdBreakGroup.Visible = false;
            }

            this.Height = lblSpec.Height + 10;

            chkKarma.Checked = _objSkill.BuyWithKarma;
            lblAttribute.Text = _objSkill.DisplayAttribute;

            RefreshControl();
            _blnSkipRefresh = false;
        }
开发者ID:ltdouthit,项目名称:chummer5a,代码行数:101,代码来源:SkillControl.cs

示例5: UpdateConditionMonitor

        /// <summary>
        /// Update the label and tooltip for the character's Condition Monitors.
        /// </summary>
        /// <param name="lblPhysical"></param>
        /// <param name="lblStun"></param>
        /// <param name="tipTooltip"></param>
        protected void UpdateConditionMonitor(Label lblPhysical, Label lblStun, ToolTip tipTooltip, ImprovementManager _objImprovementManager)
        {
            // Condition Monitor.
            double dblBOD = _objCharacter.BOD.TotalValue;
            double dblWIL = _objCharacter.WIL.TotalValue;
            int intCMPhysical = _objCharacter.PhysicalCM;
            int intCMStun = _objCharacter.StunCM;

            // Update the Condition Monitor labels.
            lblPhysical.Text = intCMPhysical.ToString();
            lblStun.Text = intCMStun.ToString();
            string strCM = "8 + (BOD/2)(" + ((int)Math.Ceiling(dblBOD / 2)).ToString() + ")";
            if (_objImprovementManager.ValueOf(Improvement.ImprovementType.PhysicalCM) != 0)
                strCM += " + " + LanguageManager.Instance.GetString("Tip_Modifiers") + " (" +
                         _objImprovementManager.ValueOf(Improvement.ImprovementType.PhysicalCM).ToString() + ")";
            tipTooltip.SetToolTip(lblPhysical, strCM);
            strCM = "8 + (WIL/2)(" + ((int)Math.Ceiling(dblWIL / 2)).ToString() + ")";
            if (_objImprovementManager.ValueOf(Improvement.ImprovementType.StunCM) != 0)
                strCM += " + " + LanguageManager.Instance.GetString("Tip_Modifiers") + " (" +
                         _objImprovementManager.ValueOf(Improvement.ImprovementType.StunCM).ToString() + ")";
            tipTooltip.SetToolTip(lblStun, strCM);
        }
开发者ID:argo2445,项目名称:chummer5a,代码行数:28,代码来源:CharacterShared.cs

示例6: SkillControl_Load

        private void SkillControl_Load(object sender, EventArgs e)
        {
            _blnSkipRefresh = true;
            if (_objSkill.KnowledgeSkill)
            {
                cboSkillName.Text = _objSkill.Name;
            }

            if (_objSkill.CharacterObject.Created)
            {
                string strTooltip = "";
                int intNewRating = _objSkill.Rating + 1;
                int intKarmaCost = 0;

                if (_objSkill.Rating < _objSkill.RatingMaximum)
                {
                    if (KnowledgeSkill == false)
                    {
                        if (_objSkill.Rating == 0)
                            intKarmaCost = _objSkill.CharacterObject.Options.KarmaNewActiveSkill;
                        else
                        {
                            if (_objSkill.Rating == 6)
                                // The cost for raising an Active Skill from 6 to 7 (thanks to Aptitude) is doubled.
                                intKarmaCost = ((_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveActiveSkill) * 2;
                            else
                                intKarmaCost = (_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveActiveSkill;
                        }
                    }
                    else
                    {
                        if (_objSkill.Rating == 0)
                            intKarmaCost = _objSkill.CharacterObject.Options.KarmaNewKnowledgeSkill;
                        else
                            intKarmaCost = (_objSkill.Rating + 1) * _objSkill.CharacterObject.Options.KarmaImproveKnowledgeSkill;
                    }

                    // Double the Karma cost if the character is Uneducated and is a Technical Active, Academic, or Professional Skill.
                    if (_objSkill.CharacterObject.Uneducated && (SkillCategory == "Technical Active" || SkillCategory == "Academic" || SkillCategory == "Professional"))
                        intKarmaCost *= 2;
                    strTooltip = LanguageManager.Instance.GetString("Tip_ImproveItem").Replace("{0}", intNewRating.ToString()).Replace("{1}", intKarmaCost.ToString());
                    tipTooltip.SetToolTip(cmdImproveSkill, strTooltip);
                }

                ImprovementManager objImprovementManager = new ImprovementManager(_objSkill.CharacterObject);
                if (objImprovementManager.ValueOf(Improvement.ImprovementType.AdeptLinguistics) > 0 && SkillCategory == "Language" && SkillRating == 0)
                    strTooltip = LanguageManager.Instance.GetString("Tip_ImproveItem").Replace("{0}", "1").Replace("{1}", "0");
                tipTooltip.SetToolTip(cmdImproveSkill, strTooltip);

                nudSkill.Visible = false;
                lblSkillRating.Visible = true;
                cmdImproveSkill.Visible = true;

                // Show the Dice Rolling button if the option is enabled.
                if (_objSkill.CharacterObject.Options.AllowSkillDiceRolling)
                {
                    cmdRoll.Visible = true;
                    this.Width += 30;
                    cboSpec.Left += 30;
                    cmdChangeSpec.Left += 30;
                    cboKnowledgeSkillCategory.Left += 30;
                    cmdDelete.Left += 30;
                    tipTooltip.SetToolTip(cmdRoll, LanguageManager.Instance.GetString("Tip_DiceRoller"));
                }

                if (!_objSkill.ExoticSkill)
                {
                    cmdChangeSpec.Visible = true;
                    cboSpec.Enabled = false;
                }

                string strTip = LanguageManager.Instance.GetString("Tip_Skill_ChangeSpecialization").Replace("{0}", _objSkill.CharacterObject.Options.KarmaSpecialization.ToString());
                tipTooltip.SetToolTip(cmdChangeSpec, strTip);
            }
            if (KnowledgeSkill)
                this.Width = cmdDelete.Left + cmdDelete.Width;
            else
                this.Width = cmdChangeSpec.Left + cmdChangeSpec.Width;

            lblAttribute.Text = _objSkill.DisplayAttribute;

            RefreshControl();
            _blnSkipRefresh = false;
        }
开发者ID:Nebual,项目名称:chummer,代码行数:84,代码来源:SkillControl.cs

示例7: RefreshControl

        /// <summary>
        /// Update the Modified Rating shown.
        /// </summary>
        public void RefreshControl()
        {
            bool blnSkillsoft = false;
            ImprovementManager objImprovementManager = new ImprovementManager(_objSkill.CharacterObject);

            int intRating = _objSkill.TotalRating;
            lblModifiedRating.Text = intRating.ToString();

            int intSkillRating = _objSkill.Rating;
            foreach (Gear objGear in _objSkill.CharacterObject.Gear)
            {
                // Look for any Skillsoft that would conflict with the Skill's Rating.
                if (objGear.Equipped && objGear.Category == "Skillsofts" && (objGear.Extra == _objSkill.Name || objGear.Extra == _objSkill.Name + ", " + LanguageManager.Instance.GetString("Label_SelectGear_Hacked")))
                {
                    if (objGear.Rating > _objSkill.Rating)
                    {
                        // Use the Skillsoft's Rating or Skillwire Rating, whichever is lower.
                        // If this is a Knowsoft or Linguasoft, it is not limited to the Skillwire Rating.
                        if (objGear.Name == "Activesoft")
                            intSkillRating = Math.Min(objGear.Rating, objImprovementManager.ValueOf(Improvement.ImprovementType.Skillwire));
                        else
                            intSkillRating = objGear.Rating;
                        blnSkillsoft = true;
                        break;
                    }
                }

                foreach (Gear objChild in objGear.Children)
                {
                    if (objChild.Equipped && objChild.Category == "Skillsofts" && (objChild.Extra == _objSkill.Name || objChild.Extra == _objSkill.Name + ", " + LanguageManager.Instance.GetString("Label_SelectGear_Hacked")))
                    {
                        if (objChild.Rating > _objSkill.Rating)
                        {
                            // Use the Skillsoft's Rating or Skillwire Rating, whichever is lower.
                            // If this is a Knowsoft or Linguasoft, it is not limited to the Skillwire Rating.
                            if (objChild.Name == "Activesoft")
                                intSkillRating = Math.Min(objChild.Rating, objImprovementManager.ValueOf(Improvement.ImprovementType.Skillwire));
                            else
                                intSkillRating = objChild.Rating;
                            blnSkillsoft = true;
                            break;
                        }
                    }
                }
            }

            foreach (TechProgram objProgram in _objSkill.CharacterObject.TechPrograms)
            {
                // Look for any Skillsoft Complex Forms that would conflict with the Skill's Rating.
                if (objProgram.Category == "Skillsofts" && (objProgram.Extra == _objSkill.Name || objProgram.Extra == _objSkill.Name + ", " + LanguageManager.Instance.GetString("Label_SelectGear_Hacked")))
                {
                    if (objProgram.Rating > _objSkill.Rating)
                    {
                        // Use the Complex Form's Rating or Skillwire Rating, whichever is lower.
                        // If this is a Knowsoft or Linguasoft, it is not limited to the Skillwire Rating.
                        if (objProgram.Name == "Activesoft")
                            intSkillRating = Math.Min(objProgram.Rating, objImprovementManager.ValueOf(Improvement.ImprovementType.Skillwire));
                        else
                            intSkillRating = objProgram.Rating;
                        blnSkillsoft = true;
                        break;
                    }
                }
            }

            if (cboSpec.Text != "" && !_objSkill.ExoticSkill)
                lblModifiedRating.Text += " (" + (intRating + 2).ToString() + ")";

            lblAttribute.Text = _objSkill.DisplayAttribute;

            // Build the Tooltip.
            string strTooltip = "";
            if (blnSkillsoft)
                strTooltip += LanguageManager.Instance.GetString("Tip_Skill_SkillsoftRating") + " (" + intSkillRating.ToString() + ")";
            else
                strTooltip += LanguageManager.Instance.GetString("Tip_Skill_SkillRating") + " (" + _objSkill.Rating.ToString() + ")";

            if (_objSkill.Default && intSkillRating == 0)
                strTooltip += " - " + LanguageManager.Instance.GetString("Tip_Skill_Defaulting") + " (1)";
            if ((!_objSkill.Default && intSkillRating > 0) || _objSkill.Default)
            {
                if (_objSkill.Attribute == "MAG" && _objSkill.CharacterObject.AdeptEnabled && _objSkill.CharacterObject.MagicianEnabled)
                {
                    // The character is a Mystic Adept, so only the MAG invested in Magician counts towards the Skill.
                    strTooltip += " + " + LanguageManager.Instance.GetString("String_Attribute" + _objSkill.Attribute + "Short") + " (" + _objSkill.CharacterObject.MAGMagician.ToString() + ")";
                }
                else
                {
                    strTooltip += " + " + LanguageManager.Instance.GetString("String_Attribute" + _objSkill.Attribute + "Short") + " (" + _objSkill.AttributeModifiers.ToString() + ")";
                }
            }

            // Modifiers only apply when not Defaulting.
            if (intSkillRating > 0 || _objSkill.CharacterObject.Options.SkillDefaultingIncludesModifiers)
            {
                if (_objSkill.RatingModifiers != 0)
                {
//.........这里部分代码省略.........
开发者ID:Nebual,项目名称:chummer,代码行数:101,代码来源:SkillControl.cs

示例8: CalculateDamageModifier

        private int CalculateDamageModifier()
        {
            var physDamage = CurrentNPC.PhysicalCMFilled;
            var stunDamage = CurrentNPC.StunCMFilled;

            ImprovementManager man = new ImprovementManager(CurrentNPC);
            var ignoredPhys=  man.ValueOf(Improvement.ImprovementType.IgnoreCMPenaltyPhysical);
            var ignoredStun = man.ValueOf(Improvement.ImprovementType.IgnoreCMPenaltyStun);
            //todo Add other types of improvements (get a list of damage modifier changing improvements) 
            var returnValue = 0;
            returnValue += physDamage > ignoredPhys ? physDamage/3 : 0;
            returnValue += stunDamage > ignoredStun ? stunDamage/3 : 0;

            return -returnValue;
        }
开发者ID:GhostWhoWalksInside,项目名称:chummer5a_Dashboard,代码行数:15,代码来源:frmGMDashboard.cs

示例9: RequirementMet


//.........这里部分代码省略.........
                                    {
                                        if (objPlugin.Name == objXmlCyberware.InnerText)
                                        {
                                            intTotal++;
                                            break;
                                        }
                                    }
                                }
                            }

                            // Check for Cyberware Categories.
                            foreach (XmlNode objXmlCyberware in objXmlRequired.SelectNodes("cyberwarecategory"))
                            {
                                foreach (Cyberware objCyberware in _objCharacter.Cyberware)
                                {
                                    if (objCyberware.Category == objXmlCyberware.InnerText)
                                        intTotal++;
                                }
                            }

                            if (intTotal >= Convert.ToInt32(objXmlRequired["count"].InnerText))
                                blnOneOfMet = true;
                        }
                        else if (objXmlRequired.Name == "streetcredvsnotoriety")
                        {
                            // Street Cred must be higher than Notoriety.
                            if (_objCharacter.StreetCred >= _objCharacter.Notoriety)
                                blnOneOfMet = true;
                        }
                        else if (objXmlRequired.Name == "damageresistance")
                        {
                            // Damage Resistance must be a particular value.
                            ImprovementManager _objImprovementManager = new ImprovementManager(_objCharacter);
                            if (_objCharacter.BOD.TotalValue + _objImprovementManager.ValueOf(Improvement.ImprovementType.DamageResistance) >= Convert.ToInt32(objXmlRequired.InnerText))
                                blnOneOfMet = true;
                        }
                    }

                    // Update the flag for requirements met.
                    blnRequirementMet = blnRequirementMet && blnOneOfMet;
                    strRequirement += strThisRequirement;
                }

                // Loop through the allof requirements.
                objXmlRequiredList = objXmlQuality.SelectNodes("required/allof");
                foreach (XmlNode objXmlAllOf in objXmlRequiredList)
                {
                    bool blnAllOfMet = true;
                    string strThisRequirement = "\n" + LanguageManager.Instance.GetString("Message_SelectQuality_AllOf");
                    XmlNodeList objXmlAllOfList = objXmlAllOf.ChildNodes;
                    foreach (XmlNode objXmlRequired in objXmlAllOfList)
                    {
                        bool blnFound = false;
                        if (objXmlRequired.Name == "quality")
                        {
                            // Run through all of the Qualities the character has and see if the current required item exists.
                            // If so, turn on the RequirementMet flag so it can be selected.
                            foreach (Quality objCharacterQuality in _objCharacter.Qualities)
                            {
                                if (objCharacterQuality.ExternalId == objXmlRequired.InnerText)
                                    blnFound = true;
                            }

                            if (!blnFound)
                            {
                                XmlNode objNode = _objXmlDocument.SelectSingleNode("/chummer/qualities/quality[id = \"" + objXmlRequired.InnerText + "\"]");
开发者ID:janhelke,项目名称:chummer2,代码行数:67,代码来源:frmSelectQuality.cs


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