本文整理汇总了C#中Chummer.Skill类的典型用法代码示例。如果您正苦于以下问题:C# Skill类的具体用法?C# Skill怎么用?C# Skill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skill类属于Chummer命名空间,在下文中一共展示了Skill类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Absorb
public bool Absorb(Skill skill)
{
if (CharacterObject.Skills.Remove(skill))
{
_fold.Add(skill);
Karma += skill.Karma; //This is not a question about if, but when this will cause bugs
Base += skill.Base; //but i hope nothing will show until after rewrite of clsImprovement
Rating += skill.Rating; //then skill will need rewrite anyway to use features
} //Removing life modules will probably give bugs here
//Easier fix, expand all when removing? Might not happen all that often?
//Save state and recollect later? Dirty as fuck, but might just be the duct
//tape this codebase deserves? Not the duct tape it needs... Yeah, batman reference
//But this have more shit that Gotham, as long as we don't count The Joker. The Joker is awesome.
//sudden toughts, don't even need to expand all, if remove does a check if it exists in objCharacter.Skills or a sub
return false;
}
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:18,代码来源:clsUnique.cs
示例2: ProcessBonus
//.........这里部分代码省略.........
_strSelectedValue = frmPickItem.SelectedItem;
if (blnConcatSelectedValue)
strSourceName += " (" + _strSelectedValue + ")";
Log.Info("_strSelectedValue = " + _strSelectedValue);
Log.Info("strSourceName = " + strSourceName);
// Create the Improvement.
Log.Info("Calling CreateImprovement");
CreateImprovement(frmPickItem.SelectedItem, objImprovementSource, strSourceName,
Improvement.ImprovementType.Restricted, strUnique);
}
if (bonusNode.LocalName == "cyberseeker")
{
//Check if valid attrib
if (new string[] {"BOD", "AGI", "STR", "REA", "LOG", "CHA", "INT", "WIL", "BOX"}.Any(x => x == bonusNode.InnerText))
{
CreateImprovement(bonusNode.InnerText, objImprovementSource, strSourceName, Improvement.ImprovementType.Seeker, strUnique,0,0,0,0,0,0);
}
else
{
Utils.BreakIfDebug();
}
}
// Select a Skill.
if (bonusNode.LocalName == ("selectskill"))
{
Log.Info("selectskill");
if (_strForcedValue == "+2 to a Combat Skill")
_strForcedValue = "";
Log.Info("_strSelectedValue = " + _strSelectedValue);
Log.Info("_strForcedValue = " + _strForcedValue);
// Display the Select Skill window and record which Skill was selected.
frmSelectSkill frmPickSkill = new frmSelectSkill(_objCharacter);
if (strFriendlyName != "")
frmPickSkill.Description = LanguageManager.Instance.GetString("String_Improvement_SelectSkillNamed")
.Replace("{0}", strFriendlyName);
else
frmPickSkill.Description = LanguageManager.Instance.GetString("String_Improvement_SelectSkill");
Log.Info("selectskill = " + bonusNode.OuterXml.ToString());
if (bonusNode.OuterXml.Contains("skillgroup"))
frmPickSkill.OnlySkillGroup = bonusNode.Attributes["skillgroup"].InnerText;
else if (bonusNode.OuterXml.Contains("skillcategory"))
frmPickSkill.OnlyCategory = bonusNode.Attributes["skillcategory"].InnerText;
else if (bonusNode.OuterXml.Contains("excludecategory"))
frmPickSkill.ExcludeCategory = bonusNode.Attributes["excludecategory"].InnerText;
else if (bonusNode.OuterXml.Contains("limittoskill"))
frmPickSkill.LimitToSkill = bonusNode.Attributes["limittoskill"].InnerText;
else if (bonusNode.OuterXml.Contains("limittoattribute"))
frmPickSkill.LinkedAttribute = bonusNode.Attributes["limittoattribute"].InnerText;
if (_strForcedValue != "")
{
frmPickSkill.OnlySkill = _strForcedValue;
frmPickSkill.Opacity = 0;
}
frmPickSkill.ShowDialog();
开发者ID:Keroth,项目名称:chummer5a,代码行数:66,代码来源:clsImprovement.cs
示例3: Load
/// <summary>
/// Load the Attribute from the XmlNode.
/// </summary>
/// <param name="objNode">XmlNode to load.</param>
public void Load(XmlNode objNode)
{
string strId;
if (objNode.TryGetField("id", out strId))
{
Id = Guid.Parse(strId);
}
_strName = objNode["name"].InnerText;
_strSkillGroup = objNode["skillgroup"].InnerText;
_strSkillCategory = objNode["skillcategory"].InnerText;
_blnIsGrouped = Convert.ToBoolean(objNode["grouped"].InnerText);
_blnDefault = Convert.ToBoolean(objNode["default"].InnerText);
_intRating = Convert.ToInt32(objNode["rating"].InnerText);
bool basefail = false;
try
{
_intBase = Convert.ToInt32(objNode["base"].InnerText);
}
catch
{
_intBase = _intRating;
basefail = true;
}
try
{
_intKarma = Convert.ToInt32(objNode["karma"].InnerText);
}
catch
{
_intKarma = 0;
}
if (!basefail)
{
if (_intRating != _intKarma + _intBase)
{
_intBase = _intRating - _intKarma;
}
}
_intFreeLevels = Convert.ToInt32(objNode["freelevels"].InnerText);
_intRatingMaximum = Convert.ToInt32(objNode["ratingmax"].InnerText);
_blnKnowledgeSkill = Convert.ToBoolean(objNode["knowledge"].InnerText);
try
{
_blnExoticSkill = Convert.ToBoolean(objNode["exotic"].InnerText);
}
catch
{
}
try
{
_blnBuyWithKarma = Convert.ToBoolean(objNode["buywithkarma"].InnerText);
}
catch
{
}
if (objNode["spec"].InnerText.Contains("Hold-Outs"))
objNode["spec"].InnerText = "Holdouts";
_strSkillSpec = objNode["spec"].InnerText;
if (_strSkillSpec != "")
{
SkillSpecialization objSpec = new SkillSpecialization(_strSkillSpec);
_lstSpecializations.Add(objSpec);
_strSkillSpec = "";
}
_blnAllowDelete = Convert.ToBoolean(objNode["allowdelete"].InnerText);
_strAttribute = objNode["attribute"].InnerText;
if (objNode.InnerXml.Contains("skillspecializations"))
{
XmlNodeList nodSpecializations = objNode.SelectNodes("skillspecializations/skillspecialization");
foreach (XmlNode nodSpecialization in nodSpecializations)
{
SkillSpecialization objSpec = new SkillSpecialization("");
objSpec.Load(nodSpecialization);
_lstSpecializations.Add(objSpec);
}
}
try
{
_strSource = objNode["source"].InnerText;
_strPage = objNode["page"].InnerText;
}
catch
{
}
if (objNode["folded"] != null)
{
foreach (XmlNode foldNode in objNode["folded"].ChildNodes)
{
Skill s = new Skill(_objCharacter);
s.Load(foldNode);
//.........这里部分代码省略.........
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:101,代码来源:clsUnique.cs
示例4: LoadMetatype
//.........这里部分代码省略.........
if (blnAddPower)
{
objXmlCritterPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[name = \"Evanescence\"]");
objNode = new TreeNode();
objPower = new CritterPower(this);
objPower.Create(objXmlCritterPower, this, objNode, 0, "");
objPower.CountTowardsLimit = false;
CritterPowers.Add(objPower);
}
}
// Remove the Critter's Materialization Power if they have it. Add the Possession or Inhabitation Power if the Possession-based Tradition checkbox is checked.
if (blnPossessionBased)
{
foreach (CritterPower objCritterPower in CritterPowers)
{
if (objCritterPower.Name == "Materialization")
{
CritterPowers.Remove(objCritterPower);
break;
}
}
// Add the selected Power.
XmlNode objXmlCritterPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[name = \"" + strPossessionMethod + "\"]");
TreeNode objNode = new TreeNode();
CritterPower objPower = new CritterPower(this);
objPower.Create(objXmlCritterPower, this, objNode, 0, "");
objPower.CountTowardsLimit = false;
CritterPowers.Add(objPower);
}
// Set the Skill Ratings for the Critter.
foreach (XmlNode objXmlSkill in objXmlCritter.SelectNodes("skills/skill"))
{
if (objXmlSkill.InnerText.Contains("Exotic"))
{
Skill objExotic = new Skill(this);
objExotic.ExoticSkill = true;
objExotic.Attribute = "AGI";
if (objXmlSkill.Attributes["spec"] != null)
objExotic.Specialization = objXmlSkill.Attributes["spec"].InnerText;
if (Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0)) > 6)
objExotic.RatingMaximum = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0));
objExotic.Rating = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0));
objExotic.Name = objXmlSkill.InnerText;
Skills.Add(objExotic);
}
else
{
foreach (Skill objSkill in Skills)
{
if (objSkill.Name == objXmlSkill.InnerText)
{
if (objXmlSkill.Attributes["spec"] != null)
objSkill.Specialization = objXmlSkill.Attributes["spec"].InnerText;
if (Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0)) > 6)
objSkill.RatingMaximum = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0));
objSkill.Rating = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, intForce, 0));
break;
}
}
}
}
// Set the Skill Group Ratings for the Critter.
开发者ID:janhelke,项目名称:chummer2,代码行数:67,代码来源:clsCharacter.cs
示例5: UpdateCharacterInfo
//.........这里部分代码省略.........
}
}
// Update the Attribute information.
lblBOD.Text = _objCharacter.BOD.Value.ToString();
lblAGI.Text = _objCharacter.AGI.Value.ToString();
lblREA.Text = _objCharacter.REA.Value.ToString();
lblSTR.Text = _objCharacter.STR.Value.ToString();
lblCHA.Text = _objCharacter.CHA.Value.ToString();
lblINT.Text = _objCharacter.INT.Value.ToString();
lblLOG.Text = _objCharacter.LOG.Value.ToString();
lblWIL.Text = _objCharacter.WIL.Value.ToString();
lblEDG.Text = _objCharacter.EDG.Value.ToString();
if (_objCharacter.MAG.Value - intEssenceLoss < 0)
lblMAG.Text = "0";
else
lblMAG.Text = (_objCharacter.MAG.Value - intEssenceLoss).ToString();
if (_objCharacter.RES.Value - intEssenceLoss < 0)
lblRES.Text = "0";
else
lblRES.Text = (_objCharacter.RES.Value - intEssenceLoss).ToString();
// If the Attribute reaches 0, the character has burned out.
if (_objCharacter.MAG.Value - intEssenceLoss < 1 && _objCharacter.MAGEnabled)
{
_objCharacter.MAG.Value = 0;
_objCharacter.MAG.MetatypeMinimum = 0;
_objCharacter.MAG.MetatypeMaximum = 0;
_objCharacter.MAG.MetatypeAugmentedMaximum = 0;
if (_objCharacter.MAGEnabled)
{
// Move all MAG-linked Active Skills to Knowledge Skills.
List<Skill> lstNewSkills = new List<Skill>();
foreach (Skill objSkill in _objCharacter.Skills)
{
if (objSkill.Attribute == "MAG" && objSkill.Rating > 0)
{
int i = panKnowledgeSkills.Controls.Count;
Skill objKnowledge = new Skill(_objCharacter);
SkillControl objSkillControl = new SkillControl();
objKnowledge.Name = objSkill.Name;
objSkillControl.SkillObject = objKnowledge;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objKnowledgeSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.DeleteSkill += objKnowledgeSkill_DeleteSkill;
objSkillControl.SkillKarmaClicked += objKnowledgeSkill_KarmaClicked;
objSkillControl.DiceRollerClicked += objSkill_DiceRollerClicked;
objSkillControl.KnowledgeSkill = true;
objSkillControl.AllowDelete = true;
if (objSkill.Rating > 13)
objSkillControl.SkillRatingMaximum = objSkill.Rating;
else
objSkillControl.SkillRatingMaximum = 12;
objSkillControl.SkillRating = objSkill.Rating;
objSkillControl.SkillCategory = "Professional";
// Set the SkillControl's Location since scrolling the Panel causes it to actually change the child Controls' Locations.
objSkillControl.Location = new Point(0, objSkillControl.Height * i + panKnowledgeSkills.AutoScrollPosition.Y);
panKnowledgeSkills.Controls.Add(objSkillControl);
lstNewSkills.Add(objKnowledge);
}
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:67,代码来源:frmCareer.cs
示例6: BuildSkillList
/// <summary>
/// Buid the list of Skills.
/// </summary>
private void BuildSkillList()
{
// Load the Skills information.
XmlDocument objXmlDocument = XmlManager.Instance.Load("skills.xml");
// Populate the Skills list.
XmlNodeList objXmlSkillList = objXmlDocument.SelectNodes("/chummer/skills/skill[not(exotic) and (" + Options.BookXPath() + ")]");
// First pass, build up a list of all of the Skills so we can sort them in alphabetical order for the current language.
List<ListItem> lstSkillOrder = new List<ListItem>();
foreach (XmlNode objXmlSkill in objXmlSkillList)
{
ListItem objSkill = new ListItem();
objSkill.Value = objXmlSkill["name"].InnerText;
if (objXmlSkill["translate"] != null)
objSkill.Name = objXmlSkill["translate"].InnerText;
else
objSkill.Name = objXmlSkill["name"].InnerText;
lstSkillOrder.Add(objSkill);
}
SortListItem objSort = new SortListItem();
lstSkillOrder.Sort(objSort.Compare);
// Second pass, retrieve the Skills in the order they're presented in the list.
foreach (ListItem objItem in lstSkillOrder)
{
XmlNode objXmlSkill = objXmlDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + objItem.Value + "\"]");
Skill objSkill = new Skill(this);
objSkill.Name = objXmlSkill["name"].InnerText;
objSkill.Id = Guid.Parse(objXmlSkill["id"].InnerText);
objSkill.SkillCategory = objXmlSkill["category"].InnerText;
objSkill.SkillGroup = objXmlSkill["skillgroup"].InnerText;
objSkill.Attribute = objXmlSkill["attribute"].InnerText;
if (objXmlSkill["default"].InnerText.ToLower() == "yes")
objSkill.Default = true;
else
objSkill.Default = false;
if (objXmlSkill["source"] != null)
objSkill.Source = objXmlSkill["source"].InnerText;
if (objXmlSkill["page"] != null)
objSkill.Page = objXmlSkill["page"].InnerText;
_lstSkills.Add(objSkill);
}
}
开发者ID:ercflemng,项目名称:chummer5a,代码行数:47,代码来源:clsCharacter.cs
示例7: cmdAddKnowledgeSkill_Click
private void cmdAddKnowledgeSkill_Click(object sender, EventArgs e)
{
int i = panKnowledgeSkills.Controls.Count;
Skill objSkill = new Skill(_objCharacter);
objSkill.Attribute = "LOG";
objSkill.SkillCategory = "Academic";
if (_objCharacter.MaxSkillRating > 0)
objSkill.RatingMaximum = _objCharacter.MaxSkillRating;
SkillControl objSkillControl = new SkillControl(_objCharacter);
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objKnowledgeSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.DeleteSkill += objKnowledgeSkill_DeleteSkill;
objSkillControl.BuyWithKarmaChanged += objKnowledgeSkill_BuyWithKarmaChanged;
objSkillControl.MergeClicked += knoSkill_MergeClick;
objSkillControl.KnowledgeSkill = true;
objSkillControl.AllowDelete = true;
if (_objCharacter.IgnoreRules)
{
objSkillControl.SkillRatingMaximum = 12;
}
else
{
objSkillControl.SkillRatingMaximum = 6;
}
// Set the SkillControl's Location since scrolling the Panel causes it to actually change the child Controls' Locations.
objSkillControl.Location = new Point(0, objSkillControl.Height * i + panKnowledgeSkills.AutoScrollPosition.Y);
panKnowledgeSkills.Controls.Add(objSkillControl);
_objCharacter.Skills.Add(objSkill);
_blnIsDirty = true;
UpdateWindowTitle();
}
开发者ID:cormanater,项目名称:chummer5a,代码行数:38,代码来源:frmCreate.cs
示例8: SkillTest
public void SkillTest()
{
// Create a new character with a BOD of 4.
Character objCharacter = new Character();
objCharacter.BOD.Value = 4;
// Create a new Skill.
Skill objSkill = new Skill(objCharacter);
objSkill.Name = "Diving";
objSkill.Attribute = "BOD";
objSkill.SkillCategory = "Physical Active";
objSkill.Default = true;
objSkill.RatingMaximum = 12;
objSkill.Rating = 3;
objSkill.Source = "Test";
objSkill.Page = "123";
// Make sure the Skill's properties are valid.
Assert.AreEqual("Diving", objSkill.Name, "Skill name mismatch.");
Assert.AreEqual(3, objSkill.Rating, "Skill Rating mismatch.");
Assert.AreEqual("BOD", objSkill.Attribute, "Skill Attribute mismatch.");
Assert.AreEqual("Physical Active", objSkill.SkillCategory, "Skill Category mismatch.");
Assert.AreEqual("Test", objSkill.Source, "Skill Source mistmatch.");
Assert.AreEqual("123", objSkill.Page, "Skill Page mismatch.");
Assert.AreEqual(4, objSkill.AttributeModifiers, "Skill's Attribute value does not match actual Attribute value.");
Assert.AreEqual(7, objSkill.TotalRating, "Skill Rating does not equal the expected value of 7.");
}
开发者ID:janhelke,项目名称:chummer2,代码行数:27,代码来源:UniqueTests.cs
示例9: TestMetatype
//.........这里部分代码省略.........
{
_objCharacter.BOD.Value = _objCharacter.BOD.TotalMinimum;
_objCharacter.AGI.Value = _objCharacter.AGI.TotalMinimum;
_objCharacter.REA.Value = _objCharacter.REA.TotalMinimum;
_objCharacter.STR.Value = _objCharacter.STR.TotalMinimum;
_objCharacter.CHA.Value = _objCharacter.CHA.TotalMinimum;
_objCharacter.INT.Value = _objCharacter.INT.TotalMinimum;
_objCharacter.LOG.Value = _objCharacter.LOG.TotalMinimum;
_objCharacter.WIL.Value = _objCharacter.WIL.TotalMinimum;
}
// Add any Critter Powers the Metatype/Critter should have.
XmlNode objXmlCritter = objXmlDocument.SelectSingleNode("/chummer/metatypes/metatype[name = \"" + _objCharacter.Metatype + "\"]");
objXmlDocument = XmlManager.Instance.Load("critterpowers.xml");
foreach (XmlNode objXmlPower in objXmlCritter.SelectNodes("powers/power"))
{
XmlNode objXmlCritterPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[name = \"" + objXmlPower.InnerText + "\"]");
TreeNode objNode = new TreeNode();
CritterPower objPower = new CritterPower(_objCharacter);
string strForcedValue = "";
int intRating = 0;
if (objXmlPower.Attributes["rating"] != null)
intRating = Convert.ToInt32(objXmlPower.Attributes["rating"].InnerText);
if (objXmlPower.Attributes["select"] != null)
strForcedValue = objXmlPower.Attributes["select"].InnerText;
objPower.Create(objXmlCritterPower, _objCharacter, objNode, intRating, strForcedValue);
_objCharacter.CritterPowers.Add(objPower);
}
// Set the Skill Ratings for the Critter.
foreach (XmlNode objXmlSkill in objXmlCritter.SelectNodes("skills/skill"))
{
if (objXmlSkill.InnerText.Contains("Exotic"))
{
Skill objExotic = new Skill(_objCharacter);
objExotic.ExoticSkill = true;
objExotic.Attribute = "AGI";
if (objXmlSkill.Attributes["spec"] != null)
objExotic.Specialization = objXmlSkill.Attributes["spec"].InnerText;
if (Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0)) > 6)
objExotic.RatingMaximum = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0));
objExotic.Rating = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0));
objExotic.Name = objXmlSkill.InnerText;
_objCharacter.Skills.Add(objExotic);
}
else
{
foreach (Skill objSkill in _objCharacter.Skills)
{
if (objSkill.Name == objXmlSkill.InnerText)
{
if (objXmlSkill.Attributes["spec"] != null)
objSkill.Specialization = objXmlSkill.Attributes["spec"].InnerText;
if (Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0)) > 6)
objSkill.RatingMaximum = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0));
objSkill.Rating = Convert.ToInt32(ExpressionToString(objXmlSkill.Attributes["rating"].InnerText, Convert.ToInt32(intForce), 0));
break;
}
}
}
}
// Set the Skill Group Ratings for the Critter.
开发者ID:hollis21,项目名称:Chummer,代码行数:67,代码来源:frmTest.cs
示例10: PrintToStream
//.........这里部分代码省略.........
objWriter.WriteStartElement("matrixip");
objWriter.WriteElementString("base", MatrixInitiativePasses);
objWriter.WriteEndElement();
// <magenabled />
objWriter.WriteElementString("magenabled", _blnMAGEnabled.ToString());
// <initiategrade />
objWriter.WriteElementString("initiategrade", _intInitiateGrade.ToString());
// <resenabled />
objWriter.WriteElementString("resenabled", _blnRESEnabled.ToString());
// <submersiongrade />
objWriter.WriteElementString("submersiongrade", _intSubmersionGrade.ToString());
// <groupmember />
objWriter.WriteElementString("groupmember", _blnGroupMember.ToString());
// <groupname />
objWriter.WriteElementString("groupname", _strGroupName);
// <groupnotes />
objWriter.WriteElementString("groupnotes", _strGroupNotes);
// <composure />
objWriter.WriteElementString("composure", Composure.ToString());
// <judgeintentions />
objWriter.WriteElementString("judgeintentions", JudgeIntentions.ToString());
// <liftandcarry />
objWriter.WriteElementString("liftandcarry", LiftAndCarry.ToString());
// <memory />
objWriter.WriteElementString("memory", Memory.ToString());
// <liftweight />
objWriter.WriteElementString("liftweight", (_attSTR.TotalValue * 15).ToString());
// <carryweight />
objWriter.WriteElementString("carryweight", (_attSTR.TotalValue * 10).ToString());
// Staple on the alternate Leadership Skills.
Skill objLeadership = new Skill(this);
Skill objLeadershipCommand = new Skill(this);
Skill objLeadershipDirect = new Skill(this);
if (_objOptions.PrintLeadershipAlternates)
{
foreach (Skill objSkill in _lstSkills)
{
if (objSkill.Name == "Leadership")
{
objLeadership = objSkill;
break;
}
}
// Leadership, Command.
objLeadershipCommand.Name = objLeadership.DisplayName + ", " + LanguageManager.Instance.GetString("String_SkillCommand");
objLeadershipCommand.SkillGroup = objLeadership.SkillGroup;
objLeadershipCommand.SkillCategory = objLeadership.SkillCategory;
objLeadershipCommand.IsGrouped = objLeadership.IsGrouped;
objLeadershipCommand.Default = objLeadership.Default;
objLeadershipCommand.Rating = objLeadership.Rating;
objLeadershipCommand.RatingMaximum = objLeadership.RatingMaximum;
objLeadershipCommand.KnowledgeSkill = objLeadership.KnowledgeSkill;
objLeadershipCommand.ExoticSkill = objLeadership.ExoticSkill;
objLeadershipCommand.Specialization = objLeadership.Specialization;
objLeadershipCommand.Attribute = "LOG";
objLeadershipCommand.Source = objLeadership.Source;
objLeadershipCommand.Page = objLeadership.Page;
_lstSkills.Add(objLeadershipCommand);
// Leadership, Direct Fire
objLeadershipDirect.Name = objLeadership.DisplayName + ", " + LanguageManager.Instance.GetString("String_SkillDirectFire");
开发者ID:Nebual,项目名称:chummer,代码行数:67,代码来源:clsCharacter.cs
示例11: MetatypeSelected
/// <summary>
/// A Metatype has been selected, so fill in all of the necessary Character information.
/// </summary>
void MetatypeSelected()
{
if (cboTalents.SelectedIndex == -1)
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_Metatype_SelectTalent"), LanguageManager.Instance.GetString("MessageTitle_Metatype_SelectTalent"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if ((cboSkill1.SelectedIndex == -1 && cboSkill1.Visible) || (cboSkill2.SelectedIndex == -1 && cboSkill2.Visible))
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_Metatype_SelectSkill"), LanguageManager.Instance.GetString("MessageTitle_Metatype_SelectSkill"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (cboSkill1.Visible && cboSkill2.Visible && cboSkill1.SelectedValue.ToString() == cboSkill2.SelectedValue.ToString())
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_Metatype_Duplicate"), LanguageManager.Instance.GetString("MessageTitle_Metatype_Duplicate"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (lstMetatypes.Text != "")
{
ImprovementManager objImprovementManager = new ImprovementManager(_objCharacter);
XmlDocument objXmlDocument = XmlManager.Instance.Load(_strXmlFile);
XmlNode objXmlMetatype = objXmlDocument.SelectSingleNode("/chummer/metatypes/metatype[name = \"" + lstMetatypes.SelectedValue + "\"]");
XmlNode objXmlMetavariant = objXmlDocument.SelectSingleNode("/chummer/metatypes/metatype[name = \"" + lstMetatypes.SelectedValue + "\"]/metavariants/metavariant[name = \"" + cboMetavariant.SelectedValue + "\"]");
int intForce = 0;
if (nudForce.Visible)
intForce = Convert.ToInt32(nudForce.Value);
// Set Metatype information.
if (cboMetavariant.SelectedValue.ToString() != "None")
{
_objCharacter.BOD.AssignLimits(ExpressionToString(objXmlMetavariant["bodmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["bodmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["bodaug"].InnerText, intForce, 0));
_objCharacter.AGI.AssignLimits(ExpressionToString(objXmlMetavariant["agimin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["agimax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["agiaug"].InnerText, intForce, 0));
_objCharacter.REA.AssignLimits(ExpressionToString(objXmlMetavariant["reamin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["reamax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["reaaug"].InnerText, intForce, 0));
_objCharacter.STR.AssignLimits(ExpressionToString(objXmlMetavariant["strmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["strmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["straug"].InnerText, intForce, 0));
_objCharacter.CHA.AssignLimits(ExpressionToString(objXmlMetavariant["chamin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["chamax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["chaaug"].InnerText, intForce, 0));
_objCharacter.INT.AssignLimits(ExpressionToString(objXmlMetavariant["intmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["intmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["intaug"].InnerText, intForce, 0));
_objCharacter.LOG.AssignLimits(ExpressionToString(objXmlMetavariant["logmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["logmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["logaug"].InnerText, intForce, 0));
_objCharacter.WIL.AssignLimits(ExpressionToString(objXmlMetavariant["wilmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["wilmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["wilaug"].InnerText, intForce, 0));
_objCharacter.INI.AssignLimits(ExpressionToString(objXmlMetavariant["inimin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["inimax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["iniaug"].InnerText, intForce, 0));
_objCharacter.MAG.AssignLimits(ExpressionToString(objXmlMetavariant["magmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["magmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["magaug"].InnerText, intForce, 0));
_objCharacter.RES.AssignLimits(ExpressionToString(objXmlMetavariant["resmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["resmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["resaug"].InnerText, intForce, 0));
_objCharacter.EDG.AssignLimits(ExpressionToString(objXmlMetavariant["edgmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["edgmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["edgaug"].InnerText, intForce, 0));
_objCharacter.ESS.AssignLimits(ExpressionToString(objXmlMetavariant["essmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["essmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetavariant["essaug"].InnerText, intForce, 0));
_objCharacter.MetatypeBP = Convert.ToInt32(lblMetavariantBP.Text);
}
else if (_strXmlFile != "critters.xml" || lstMetatypes.SelectedValue.ToString() == "Ally Spirit")
{
_objCharacter.BOD.AssignLimits(ExpressionToString(objXmlMetatype["bodmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["bodmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["bodaug"].InnerText, intForce, 0));
_objCharacter.AGI.AssignLimits(ExpressionToString(objXmlMetatype["agimin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["agimax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["agiaug"].InnerText, intForce, 0));
_objCharacter.REA.AssignLimits(ExpressionToString(objXmlMetatype["reamin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["reamax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["reaaug"].InnerText, intForce, 0));
_objCharacter.STR.AssignLimits(ExpressionToString(objXmlMetatype["strmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["strmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["straug"].InnerText, intForce, 0));
_objCharacter.CHA.AssignLimits(ExpressionToString(objXmlMetatype["chamin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["chamax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["chaaug"].InnerText, intForce, 0));
_objCharacter.INT.AssignLimits(ExpressionToString(objXmlMetatype["intmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["intmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["intaug"].InnerText, intForce, 0));
_objCharacter.LOG.AssignLimits(ExpressionToString(objXmlMetatype["logmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["logmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["logaug"].InnerText, intForce, 0));
_objCharacter.WIL.AssignLimits(ExpressionToString(objXmlMetatype["wilmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["wilmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["wilaug"].InnerText, intForce, 0));
_objCharacter.INI.AssignLimits(ExpressionToString(objXmlMetatype["inimin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["inimax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["iniaug"].InnerText, intForce, 0));
_objCharacter.MAG.AssignLimits(ExpressionToString(objXmlMetatype["magmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["magmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["magaug"].InnerText, intForce, 0));
_objCharacter.RES.AssignLimits(ExpressionToString(objXmlMetatype["resmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["resmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["resaug"].InnerText, intForce, 0));
_objCharacter.EDG.AssignLimits(ExpressionToString(objXmlMetatype["edgmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["edgmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["edgaug"].InnerText, intForce, 0));
_objCharacter.ESS.AssignLimits(ExpressionToString(objXmlMetatype["essmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["essmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["essaug"].InnerText, intForce, 0));
}
else
{
int intMinModifier = -3;
if (cboCategory.SelectedValue.ToString() == "Mutant Critters")
intMinModifier = 0;
_objCharacter.BOD.AssignLimits(ExpressionToString(objXmlMetatype["bodmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["bodmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["bodmin"].InnerText, intForce, 3));
_objCharacter.AGI.AssignLimits(ExpressionToString(objXmlMetatype["agimin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["agimin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["agimin"].InnerText, intForce, 3));
_objCharacter.REA.AssignLimits(ExpressionToString(objXmlMetatype["reamin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["reamin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["reamin"].InnerText, intForce, 3));
_objCharacter.STR.AssignLimits(ExpressionToString(objXmlMetatype["strmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["strmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["strmin"].InnerText, intForce, 3));
_objCharacter.CHA.AssignLimits(ExpressionToString(objXmlMetatype["chamin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["chamin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["chamin"].InnerText, intForce, 3));
_objCharacter.INT.AssignLimits(ExpressionToString(objXmlMetatype["intmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["intmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["intmin"].InnerText, intForce, 3));
_objCharacter.LOG.AssignLimits(ExpressionToString(objXmlMetatype["logmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["logmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["logmin"].InnerText, intForce, 3));
_objCharacter.WIL.AssignLimits(ExpressionToString(objXmlMetatype["wilmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["wilmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["wilmin"].InnerText, intForce, 3));
_objCharacter.INI.AssignLimits(ExpressionToString(objXmlMetatype["inimin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["inimax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["iniaug"].InnerText, intForce, 0));
_objCharacter.MAG.AssignLimits(ExpressionToString(objXmlMetatype["magmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["magmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["magmin"].InnerText, intForce, 3));
_objCharacter.RES.AssignLimits(ExpressionToString(objXmlMetatype["resmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["resmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["resmin"].InnerText, intForce, 3));
_objCharacter.EDG.AssignLimits(ExpressionToString(objXmlMetatype["edgmin"].InnerText, intForce, intMinModifier), ExpressionToString(objXmlMetatype["edgmin"].InnerText, intForce, 3), ExpressionToString(objXmlMetatype["edgmin"].InnerText, intForce, 3));
_objCharacter.ESS.AssignLimits(ExpressionToString(objXmlMetatype["essmin"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["essmax"].InnerText, intForce, 0), ExpressionToString(objXmlMetatype["essaug"].InnerText, intForce, 0));
}
// If we're working with a Critter, set the Attributes to their default values.
if (_strXmlFile == "critters.xml")
{
_objCharacter.BOD.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["bodmin"].InnerText, intForce, 0));
_objCharacter.AGI.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["agimin"].InnerText, intForce, 0));
_objCharacter.REA.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["reamin"].InnerText, intForce, 0));
_objCharacter.STR.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["strmin"].InnerText, intForce, 0));
_objCharacter.CHA.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["chamin"].InnerText, intForce, 0));
_objCharacter.INT.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["intmin"].InnerText, intForce, 0));
_objCharacter.LOG.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["logmin"].InnerText, intForce, 0));
_objCharacter.WIL.Value = Convert.ToInt32(ExpressionToString(objXmlMetatype["wilmin"].InnerText, intForce, 0));
//.........这里部分代码省略.........
开发者ID:ltdouthit,项目名称:chummer5a,代码行数:101,代码来源:frmPriorityMetatype.cs
示例12: Load
/// <summary>
/// Load the Character from an XML file.
/// </summary>
public bool Load()
{
XmlDocument objXmlDocument = new XmlDocument();
objXmlDocument.Load(_strFileName);
XmlNode objXmlCharacter = objXmlDocument.SelectSingleNode("/character");
XmlNodeList objXmlNodeList;
try
{
_blnIgnoreRules = Convert.ToBoolean(objXmlCharacter["ignorerules"].InnerText);
}
catch
{
_blnIgnoreRules = false;
}
try
{
_blnCreated = Convert.ToBoolean(objXmlCharacter["created"].InnerText);
}
catch
{
}
ResetCharacter();
// Get the game edition of the file if possible and make sure it's intended to be used with this version of the application.
try
{
if (objXmlCharacter["gameedition"].InnerText != string.Empty && objXmlCharacter["gameedition"].InnerText != "SR4")
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_IncorrectGameVersion_SR5"), LanguageManager.Instance.GetString("MessageTitle_IncorrectGameVersion"), MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
catch
{
}
// Get the name of the settings file in use if possible.
try
{
_strSettingsFileName = objXmlCharacter["settings&quo
|
请发表评论