本文整理汇总了C#中Chummer.Spirit类的典型用法代码示例。如果您正苦于以下问题:C# Spirit类的具体用法?C# Spirit怎么用?C# Spirit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Spirit类属于Chummer命名空间,在下文中一共展示了Spirit类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: cmdAddSpirit_Click
private void cmdAddSpirit_Click(object sender, EventArgs e)
{
int i = panSpirits.Controls.Count;
// The number of bound Spirits cannot exeed the character's CHA.
if (i >= _objCharacter.CHA.Value && !_objCharacter.IgnoreRules)
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_BoundSpiritLimit"), LanguageManager.Instance.GetString("MessageTitle_BoundSpiritLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Spirit objSpirit = new Spirit(_objCharacter);
_objCharacter.Spirits.Add(objSpirit);
SpiritControl objSpiritControl = new SpiritControl();
objSpiritControl.SpiritObject = objSpirit;
objSpiritControl.EntityType = SpiritType.Spirit;
// Attach an EventHandler for the ServicesOwedChanged Event.
objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
objSpiritControl.ForceChanged += objSpirit_ForceChanged;
objSpiritControl.BoundChanged += objSpirit_BoundChanged;
objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;
int intMAG = Convert.ToInt32(_objCharacter.MAG.TotalValue);
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
{
intMAG = _objCharacter.MAG.TotalValue;
}
if (_objOptions.SpiritForceBasedOnTotalMAG)
{
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
objSpiritControl.Force = _objCharacter.MAG.TotalValue;
}
else
{
if (intMAG == 0)
intMAG = 1;
objSpiritControl.ForceMaximum = intMAG;
objSpiritControl.Force = intMAG;
}
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
_blnIsDirty = true;
UpdateWindowTitle();
}
开发者ID:cormanater,项目名称:chummer5a,代码行数:51,代码来源:frmCreate.cs
示例2: cmdAddSprite_Click
private void cmdAddSprite_Click(object sender, EventArgs e)
{
int i = panSprites.Controls.Count;
// The number of registered Sprites cannot exceed the character's LOG.
if (i >= _objCharacter.LOG.Value && !_objCharacter.IgnoreRules)
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_RegisteredSpriteLimit"), LanguageManager.Instance.GetString("MessageTitle_RegisteredSpriteLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Spirit objSprite = new Spirit(_objCharacter);
_objCharacter.Spirits.Add(objSprite);
SpiritControl objSpriteControl = new SpiritControl();
objSpriteControl.SpiritObject = objSprite;
objSpriteControl.EntityType = SpiritType.Sprite;
// Attach an EventHandler for the ServicesOwedChanged Event.
objSpriteControl.ServicesOwedChanged += objSprite_ServicesOwedChanged;
objSpriteControl.ForceChanged += objSprite_ForceChanged;
objSpriteControl.BoundChanged += objSprite_BoundChanged;
objSpriteControl.DeleteSpirit += objSprite_DeleteSpirit;
objSpriteControl.FileNameChanged += objSprite_FileNameChanged;
objSpriteControl.ForceMaximum = Convert.ToInt32(nudRES.Value);
objSpriteControl.Force = Convert.ToInt32(nudRES.Value);
objSpriteControl.RebuildSpiritList(_objCharacter.TechnomancerStream);
objSpriteControl.Top = i * objSpriteControl.Height;
panSprites.Controls.Add(objSpriteControl);
_blnIsDirty = true;
UpdateWindowTitle();
}
开发者ID:cormanater,项目名称:chummer5a,代码行数:35,代码来源:frmCreate.cs
示例3: AddPACKSKit
//.........这里部分代码省略.........
case "Detection":
treSpells.Nodes[1].Nodes.Add(objNode);
treSpells.Nodes[1].Expand();
break;
case "Health":
treSpells.Nodes[2].Nodes.Add(objNode);
treSpells.Nodes[2].Expand();
break;
case "Illusion":
treSpells.Nodes[3].Nodes.Add(objNode);
treSpells.Nodes[3].Expand();
break;
case "Manipulation":
treSpells.Nodes[4].Nodes.Add(objNode);
treSpells.Nodes[4].Expand();
break;
case "Rituals":
int intNode = 5;
if (_objCharacter.AdeptEnabled && !_objCharacter.MagicianEnabled)
intNode = 0;
treSpells.Nodes[intNode].Nodes.Add(objNode);
treSpells.Nodes[intNode].Expand();
break;
}
treSpells.SortCustom();
}
}
}
// Update Spirits.
if (objXmlKit["spirits"] != null)
{
foreach (XmlNode objXmlSpirit in objXmlKit.SelectNodes("spirits/spirit"))
{
int i = panSpirits.Controls.Count;
Spirit objSpirit = new Spirit(_objCharacter);
_objCharacter.Spirits.Add(objSpirit);
SpiritControl objSpiritControl = new SpiritControl();
objSpiritControl.SpiritObject = objSpirit;
objSpiritControl.EntityType = SpiritType.Spirit;
// Attach an EventHandler for the ServicesOwedChanged Event.
objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
objSpiritControl.ForceChanged += objSpirit_ForceChanged;
objSpiritControl.BoundChanged += objSpirit_BoundChanged;
objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
objSpiritControl.Name = objXmlSpirit["name"].InnerText;
objSpiritControl.Force = Convert.ToInt32(objXmlSpirit["force"].InnerText);
objSpiritControl.ServicesOwed = Convert.ToInt32(objXmlSpirit["services"].InnerText);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
}
}
// Update Lifestyles.
if (objXmlKit["lifestyles"] != null)
{
XmlDocument objXmlLifestyleDocument = XmlManager.Instance.Load("lifestyles.xml");
foreach (XmlNode objXmlLifestyle in objXmlKit.SelectNodes("lifestyles/lifestyle"))
{
开发者ID:cormanater,项目名称:chummer5a,代码行数:67,代码来源:frmCreate.cs
示例4: Load
//.........这里部分代码省略.........
}
catch
{
}
}
// Attempt to load the Magic Tradition.
try
{
_strMagicTradition = objXmlDocument.SelectSingleNode("/character/tradition").InnerText;
}
catch
{
}
// Attempt to load the Magic Tradition Drain Attributes.
try
{
_strTraditionDrain = objXmlDocument.SelectSingleNode("/character/traditiondrain").InnerText;
}
catch
{
}
// Attempt to load the Magic Tradition Name.
try
{
_strTraditionName = objXmlDocument.SelectSingleNode("/character/traditionname").InnerText;
}
catch
{
}
// Attempt to load the Spirit Combat Name.
try
{
_strSpiritCombat = objXmlDocument.SelectSingleNode("/character/spiritcombat").InnerText;
}
catch
{
}
// Attempt to load the Spirit Detection Name.
try
{
_strSpiritDetection = objXmlDocument.SelectSingleNode("/character/spiritdetection").InnerText;
}
catch
{
}
// Attempt to load the Spirit Health Name.
try
{
_strSpiritHealth = objXmlDocument.SelectSingleNode("/character/spirithealth").InnerText;
}
catch
{
}
// Attempt to load the Spirit Illusion Name.
try
{
_strSpiritIllusion = objXmlDocument.SelectSingleNode("/character/spiritillusion").InnerText;
}
catch
{
}
// Attempt to load the Spirit Manipulation Name.
try
{
_strSpiritManipulation = objXmlDocument.SelectSingleNode("/character/spiritmanipulation").InnerText;
开发者ID:ercflemng,项目名称:chummer5a,代码行数:67,代码来源:clsCharacter.cs
示例5: cmdAddSprite_Click
private void cmdAddSprite_Click(object sender, EventArgs e)
{
int i = panSprites.Controls.Count;
Spirit objSprite = new Spirit(_objCharacter);
_objCharacter.Spirits.Add(objSprite);
SpiritControl objSpriteControl = new SpiritControl(true);
objSpriteControl.SpiritObject = objSprite;
objSpriteControl.EntityType = SpiritType.Sprite;
// Attach an EventHandler for the ServicesOwedChanged Event.
objSpriteControl.ServicesOwedChanged += objSprite_ServicesOwedChanged;
objSpriteControl.ForceChanged += objSprite_ForceChanged;
objSpriteControl.BoundChanged += objSprite_BoundChanged;
objSpriteControl.DeleteSpirit += objSprite_DeleteSpirit;
objSpriteControl.FileNameChanged += objSprite_FileNameChanged;
objSpriteControl.ForceMaximum = _objCharacter.RES.TotalValue * 2;
objSpriteControl.Force = Convert.ToInt32(_objCharacter.RES.Value);
objSpriteControl.RebuildSpiritList(_objCharacter.TechnomancerStream);
objSpriteControl.Top = i * objSpriteControl.Height;
panSprites.Controls.Add(objSpriteControl);
_blnIsDirty = true;
UpdateWindowTitle();
}
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:28,代码来源:frmCareer.cs
示例6: cmdAddSpirit_Click
private void cmdAddSpirit_Click(object sender, EventArgs e)
{
int i = panSpirits.Controls.Count;
Spirit objSpirit = new Spirit(_objCharacter);
_objCharacter.Spirits.Add(objSpirit);
SpiritControl objSpiritControl = new SpiritControl(true);
objSpiritControl.SpiritObject = objSpirit;
objSpiritControl.EntityType = SpiritType.Spirit;
// Attach an EventHandler for the ServicesOwedChanged Event.
objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
objSpiritControl.ForceChanged += objSpirit_ForceChanged;
objSpiritControl.BoundChanged += objSpirit_BoundChanged;
objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;
int intMAG = Convert.ToInt32(_objCharacter.MAG.TotalValue);
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
{
intMAG = _objCharacter.MAGMagician;
}
if (_objOptions.SpiritForceBasedOnTotalMAG)
{
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue * 2;
objSpiritControl.Force = _objCharacter.MAG.TotalValue;
}
else
{
if (intMAG == 0)
intMAG = 1;
objSpiritControl.ForceMaximum = intMAG * 2;
objSpiritControl.Force = intMAG;
}
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
_blnIsDirty = true;
UpdateWindowTitle();
}
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:43,代码来源:frmCareer.cs
示例7: Load
//.........这里部分代码省略.........
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);
}
// Martial Art Maneuvers.
objXmlNodeList = objXmlDocument.SelectNodes("/character/martialartmaneuvers/martialartmaneuver");
foreach (XmlNode objXmlManeuver in objXmlNodeList)
{
MartialArtManeuver objManeuver = new MartialArtManeuver(this);
objManeuver.Load(objXmlManeuver);
_lstMartialArtManeuvers.Add(objManeuver);
}
开发者ID:Nebual,项目名称:chummer,代码行数:67,代码来源:clsCharacter.cs
注:本文中的Chummer.Spirit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论