本文整理汇总了C#中Chummer.SpiritControl类的典型用法代码示例。如果您正苦于以下问题:C# SpiritControl类的具体用法?C# SpiritControl怎么用?C# SpiritControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpiritControl类属于Chummer命名空间,在下文中一共展示了SpiritControl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例3: frmCreate_Load
//.........这里部分代码省略.........
}
objPower.MaxLevels = intImprovedAbilityMaximum;
}
else
{
objPowerControl.MaxLevels = objPower.MaxLevels;
}
}
else
{
objPowerControl.MaxLevels = objPower.MaxLevels;
}
}
objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
if (objPower.Rating < 1)
objPower.Rating = 1;
objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
if (objPower.DiscountedAdeptWay)
objPowerControl.DiscountedByAdeptWay = true;
if (objPower.DiscountedGeas)
objPowerControl.DiscountedByGeas = true;
objPowerControl.Top = i * objPowerControl.Height;
panPowers.Controls.Add(objPowerControl);
}
// Populate Magician Spirits.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Spirit)
{
i++;
SpiritControl objSpiritControl = new SpiritControl();
objSpiritControl.SpiritObject = objSpirit;
// 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;
objSpiritControl.SpiritName = objSpirit.Name;
objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
{
if (_objOptions.SpiritForceBasedOnTotalMAG)
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
else
objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
}
else
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
objSpiritControl.CritterName = objSpirit.CritterName;
objSpiritControl.Force = objSpirit.Force;
objSpiritControl.Bound = objSpirit.Bound;
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
}
}
// Populate Technomancer Sprites.
i = -1;
示例4: AddPACKSKit
//.........这里部分代码省略.........
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"))
{
string strName = objXmlLifestyle["name"].InnerText;
int intMonths = Convert.ToInt32(objXmlLifestyle["months"].InnerText);
// Create the Lifestyle.
TreeNode objNode = new TreeNode();
Lifestyle objLifestyle = new Lifestyle(_objCharacter);
示例5: frmCreate_Load
//.........这里部分代码省略.........
// Populate Adept Powers.
i = -1;
foreach (Power objPower in _objCharacter.Powers)
{
i++;
PowerControl objPowerControl = new PowerControl();
objPowerControl.PowerObject = objPower;
// Attach an EventHandler for the PowerRatingChanged Event.
objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
objPowerControl.DeletePower += objPower_DeletePower;
objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
if (objPower.Rating < 1)
objPower.Rating = 1;
objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
if (objPower.DiscountedAdeptWay)
objPowerControl.DiscountedByAdeptWay = true;
if (objPower.DiscountedGeas)
objPowerControl.DiscountedByGeas = true;
objPowerControl.Top = i * objPowerControl.Height;
panPowers.Controls.Add(objPowerControl);
}
// Populate Magician Spirits.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Spirit)
{
i++;
SpiritControl objSpiritControl = new SpiritControl();
objSpiritControl.SpiritObject = objSpirit;
// 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;
objSpiritControl.SpiritName = objSpirit.Name;
objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
else
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
objSpiritControl.CritterName = objSpirit.CritterName;
objSpiritControl.Force = objSpirit.Force;
objSpiritControl.Bound = objSpirit.Bound;
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
}
}
// Populate Technomancer Sprites.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Sprite)
{
i++;
示例6: 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();
}
示例7: 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();
}
示例8: frmCareer_Load
//.........这里部分代码省略.........
objPowerControl.PowerObject = objPower;
// Attach an EventHandler for the PowerRatingChanged Event.
objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
objPowerControl.DeletePower += objPower_DeletePower;
objPowerControl.PowerName = objPower.Name;
objPowerControl.Extra = objPower.Extra;
objPowerControl.PointsPerLevel = objPower.PointsPerLevel;
objPowerControl.AdeptWayDiscount = objPower.AdeptWayDiscount;
objPowerControl.LevelEnabled = objPower.LevelsEnabled;
if (objPower.MaxLevels > 0)
objPowerControl.MaxLevels = objPower.MaxLevels;
objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
if (objPower.Rating < 1)
objPower.Rating = 1;
objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
if (objPower.DiscountedAdeptWay)
objPowerControl.DiscountedByAdeptWay = true;
if (objPower.DiscountedGeas)
objPowerControl.DiscountedByGeas = true;
objPowerControl.Top = i * objPowerControl.Height;
panPowers.Controls.Add(objPowerControl);
}
// Populate Magician Spirits.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Spirit)
{
i++;
SpiritControl objSpiritControl = new SpiritControl(true);
objSpiritControl.SpiritObject = objSpirit;
// 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;
objSpiritControl.SpiritName = objSpirit.Name;
objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
if (_objOptions.SpiritForceBasedOnTotalMAG)
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue * 2;
else
objSpiritControl.ForceMaximum = intCharacterMAG * 2;
objSpiritControl.CritterName = objSpirit.CritterName;
objSpiritControl.Force = objSpirit.Force;
objSpiritControl.Bound = objSpirit.Bound;
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
}
}
// Populate Technomancer Sprites.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Sprite)
{
i++;
示例9: frmCreate_Load
//.........这里部分代码省略.........
}
objPower.MaxLevels = intImprovedAbilityMaximum;
}
else
{
objPowerControl.MaxLevels = objPower.MaxLevels;
}
}
else
{
objPowerControl.MaxLevels = objPower.MaxLevels;
}
}
objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
if (objPower.Rating < 1)
objPower.Rating = 1;
objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
if (objPower.DiscountedAdeptWay)
objPowerControl.DiscountedByAdeptWay = true;
if (objPower.DiscountedGeas)
objPowerControl.DiscountedByGeas = true;
objPowerControl.Top = i * objPowerControl.Height;
panPowers.Controls.Add(objPowerControl);
}
// Populate Magician Spirits.
i = -1;
foreach (Spirit objSpirit in _objCharacter.Spirits)
{
if (objSpirit.EntityType == SpiritType.Spirit)
{
i++;
SpiritControl objSpiritControl = new SpiritControl();
objSpiritControl.SpiritObject = objSpirit;
// 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;
objSpiritControl.SpiritName = objSpirit.Name;
objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
{
if (_objOptions.SpiritForceBasedOnTotalMAG)
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
else
objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
}
else
objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
objSpiritControl.CritterName = objSpirit.CritterName;
objSpiritControl.Force = objSpirit.Force;
objSpiritControl.Bound = objSpirit.Bound;
objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);
objSpiritControl.Top = i * objSpiritControl.Height;
panSpirits.Controls.Add(objSpiritControl);
}
}
// Populate Technomancer Sprites.
i = -1;