Large diffs are not rendered by default.

@@ -78,7 +78,7 @@ public Commlink FindCommlink(string strGuid, List<Gear> lstCommlink)

foreach (Gear objGear in lstCommlink)
{
if (objGear.Category == "Commlinks)")
if (objGear.Category == "Commlinks")
{
lstCheckGear.Add(objGear);
}
@@ -865,6 +865,30 @@ public List<Commlink> FindCharacterCommlinks(List<Gear> lstGear)

return lstReturn;
}

/// <summary>
/// Find and disable any other items selected as a home node.
/// </summary>
/// <param name="strGuid">GUID to whitelist when disabling other home nodes.</param>
/// <param name="lstGear">List of Gear to search within for Home Node status.</param>
/// <param name="lstVehicles">List of Gear to search within for Home Node status.</param>
public void ReplaceHomeNodes(string strGuid, List<Gear>lstGear, List<Vehicle> lstVehicles)
{
foreach (Commlink objGear in lstGear)
{
if (objGear.HomeNode && (objGear.InternalId.ToString() != strGuid))
{
objGear.HomeNode = false;
}
}
foreach (Vehicle objVehicle in lstVehicles)
{
if (objVehicle.HomeNode && (objVehicle.InternalId.ToString() != strGuid))
{
objVehicle.HomeNode = false;
}
}
}
#endregion

#region Delete Functions
@@ -969,6 +993,22 @@ public void DeleteVehicleGear(Gear objGear, TreeView treVehicles, Vehicle objVeh
objVehicle.Weapons.Remove(objRemoveWeapon);
}
}

/// <summary>
/// Verify that the user wants to delete an item.
/// </summary>
public bool ConfirmDelete(string strMessage)
{
if (!_objCharacter.Options.ConfirmDelete)
return true;
else
{
if (MessageBox.Show(strMessage, LanguageManager.Instance.GetString("MessageTitle_Delete"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return false;
else
return true;
}
}
#endregion

#region Tree Functions
@@ -1467,21 +1507,6 @@ public void LogWrite(LogType logType, string strClass, string strLine)
}
#endregion

/// <summary>
/// Verify that the user wants to delete an item.
/// </summary>
public bool ConfirmDelete(string strMessage)
{
if (!_objCharacter.Options.ConfirmDelete)
return true;
else
{
if (MessageBox.Show(strMessage, LanguageManager.Instance.GetString("MessageTitle_Delete"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
return false;
else
return true;
}
}

/// <summary>
/// Word wraps the given text to fit within the specified width.
@@ -11102,8 +11102,23 @@ public string InternalId
{
return _guiID.ToString();
}
}

}

/// <summary>
/// Whether or not an item is an A.I.'s Home Node.
/// </summary>
public bool HomeNode
{
get
{
return _blnHomeNode;
}
set
{
_blnHomeNode = value;
}
}

/// <summary>
/// Guid of a Cyberware Weapon.
/// </summary>
@@ -11610,21 +11625,6 @@ public string Location
}
}

/// <summary>
/// Whether or not an item is an A.I.'s Home Node.
/// </summary>
public bool HomeNode
{
get
{
return _blnHomeNode;
}
set
{
_blnHomeNode = value;
}
}

/// <summary>
/// Whether or not the Gear qualifies as a Program in the printout XML.
/// </summary>
@@ -12565,6 +12565,7 @@ public class Commlink : Gear
private int _intSleaze = 0;
private int _intDataProcessing = 0;
private int _intFirewall = 0;
private bool _blnHomeNode = false;

#region Constructor, Create, Save, Load, and Print Methods
public Commlink(Character objCharacter) : base(objCharacter)
@@ -13172,12 +13173,27 @@ public new int DeviceRating
{
_intDeviceRating = value;
}
}

/// <summary>
/// Attack.
/// </summary>
public int Attack
}

/// <summary>
/// Whether or not an item is an A.I.'s Home Node.
/// </summary>
public bool HomeNode
{
get
{
return _blnHomeNode;
}
set
{
_blnHomeNode = value;
}
}

/// <summary>
/// Attack.
/// </summary>
public int Attack
{
get
{
@@ -583,7 +583,7 @@ public int TotalValue
intReturn = TotalAugmentedMaximum;

// An Attribute cannot go below 1 unless it is EDG, MAG, or RES, the character is a Critter, or the Metatype Maximum is 0.
if (_objCharacter.CritterEnabled || _strAbbrev == "EDG" || _intMetatypeMax == 0 || (_objCharacter.EssencePenalty != 0 && (_strAbbrev == "MAG" || _strAbbrev == "RES")))
if (_objCharacter.CritterEnabled || _strAbbrev == "EDG" || _intMetatypeMax == 0 || (_objCharacter.EssencePenalty != 0 && (_strAbbrev == "MAG" || _strAbbrev == "RES")) || (_objCharacter.MetatypeCategory != "A.I." && _strAbbrev == "DEP"))
{
if (intReturn < 0)
return 0;
@@ -4,6 +4,8 @@ Application Change:
- Built-in weapon accessories are automatically assigned to the Internal accessory slot by default. If a weapon accessory should take up a slot naturally, just add a <mount> value to the accessory. This change only affects newly created/purchased weapons, so any existing weapons will need to be altered manually or deleted and re-added. Fixes #566.
- Ammunition can now add and replace the fire modes of weapons, using the firemode and firemodeplace nodes. This change only takes effect during career mode, and is currently used exclusively for the Taurus Omni-6's heavy ammo type. Fixes #577.
- Fixed a crash issue caused by changing priority selection in Sum to Ten mode. Fixes #572.
- Qualities can have their Limit assigned as either 'no' or a numeric value. This is intended as something of a placeholder until proper levels for qualities are implemented at a later date.
- Added the Depth statistic for AI; this shouldn't have an effect on existing characters.

Data Change:
- Added missing required values for the Hospitalized lifestyles.

Large diffs are not rendered by default.

@@ -42,6 +42,11 @@
<value>A</value>
<category>Heritage</category>
<metatypes>
<metatype>
<name>E-Ghost</name>
<value>9</value>
<karma>0</karma>
</metatype>
<metatype>
<name>Human</name>
<value>9</value>

Large diffs are not rendered by default.

@@ -266,6 +266,11 @@ private void frmCareer_Load(object sender, EventArgs e)
treFoci.Visible = _objCharacter.MAGEnabled;
cmdCreateStackedFocus.Visible = _objCharacter.MAGEnabled;

lblDEPLabel.Enabled = (_objCharacter.Metatype == "A.I.");
lblDEPAug.Enabled = (_objCharacter.Metatype == "A.I.");
lblDEP.Enabled = (_objCharacter.Metatype == "A.I.");
lblDEPMetatype.Enabled = (_objCharacter.Metatype == "A.I.");

lblRESLabel.Enabled = _objCharacter.RESEnabled;
lblRESAug.Enabled = _objCharacter.RESEnabled;
lblRES.Enabled = _objCharacter.RESEnabled;
@@ -4044,6 +4049,47 @@ private void cmdImproveRES_Click(object sender, EventArgs e)
_blnIsDirty = true;
UpdateWindowTitle();
}

private void cmdImproveDEP_Click(object sender, EventArgs e)
{
// Make sure the character has enough Karma to improve the Attribute.
int intKarmaCost = 0;
if (!_objOptions.SpecialKarmaCostBasedOnShownValue)
intKarmaCost = (_objCharacter.DEP.Value + _objCharacter.DEP.AttributeValueModifiers + 1) * _objOptions.KarmaAttribute;
else
intKarmaCost = (_objCharacter.DEP.Value - _objCharacter.EssencePenalty + 1) * _objOptions.KarmaAttribute;

if (intKarmaCost > _objCharacter.Karma)
{
MessageBox.Show(LanguageManager.Instance.GetString("Message_NotEnoughKarma"), LanguageManager.Instance.GetString("MessageTitle_NotEnoughKarma"), MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}

int intFromValue = 0;
if (!_objOptions.SpecialKarmaCostBasedOnShownValue)
intFromValue = _objCharacter.DEP.Value + _objCharacter.DEP.AttributeValueModifiers;
else
intFromValue = _objCharacter.DEP.Value - _objCharacter.EssencePenalty;

if (!ConfirmKarmaExpense(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpense").Replace("{0}", LanguageManager.Instance.GetString("String_AttributeDEPShort")).Replace("{1}", (intFromValue + 1).ToString()).Replace("{2}", intKarmaCost.ToString())))
return;

// Create the Karma expense.
ExpenseLogEntry objExpense = new ExpenseLogEntry();
objExpense.Create(intKarmaCost * -1, LanguageManager.Instance.GetString("String_ExpenseAttribute") + " " + LanguageManager.Instance.GetString("String_AttributeDEPShort") + " " + (intFromValue).ToString() + " -> " + (intFromValue + 1).ToString(), ExpenseType.Karma, DateTime.Now);
_objCharacter.ExpenseEntries.Add(objExpense);
_objCharacter.Karma -= intKarmaCost;

ExpenseUndo objUndo = new ExpenseUndo();
objUndo.CreateKarma(KarmaExpenseType.ImproveAttribute, "DEP");
objExpense.Undo = objUndo;

_objCharacter.DEP.Value += 1;
UpdateCharacterInfo();

_blnIsDirty = true;
UpdateWindowTitle();
}

private void nudResponse_ValueChanged(object sender, EventArgs e)
{
@@ -18386,9 +18432,17 @@ private void cboWeaponAmmo_SelectedIndexChanged(object sender, EventArgs e)

private void chkGearHomeNode_CheckedChanged(object sender, EventArgs e)
{
Gear objGear = new Gear(_objCharacter);
objGear = (Gear)_objFunctions.FindGear(treGear.SelectedNode.Tag.ToString(), _objCharacter.Gear);
objGear.HomeNode = chkGearHomeNode.Checked;
Commlink objCommlink = _objFunctions.FindCommlink(treGear.SelectedNode.Tag.ToString(), _objCharacter.Gear);
if (objCommlink == null)
return;
objCommlink.HomeNode = chkGearHomeNode.Checked;
_objCharacter.HomeNodeCategory = "Gear";
_objCharacter.HomeNodeDataProcessing = objCommlink.TotalDataProcessing;
_objCharacter.HomeNodePilot = 0;
_objCharacter.HomeNodeHandling = "0";
_objCharacter.HomeNodeSensor = 0;
_objFunctions.ReplaceHomeNodes(treGear.SelectedNode.Tag.ToString(), _objCharacter.Gear, _objCharacter.Vehicles);
_objCharacter.HasHomeNode = chkGearHomeNode.Checked;
RefreshSelectedGear();
UpdateCharacterInfo();

@@ -19753,15 +19807,34 @@ private void chkVehicleHomeNode_CheckedChanged(object sender, EventArgs e)
return;

objVehicle.HomeNode = chkVehicleHomeNode.Checked;
_objCharacter.HasHomeNode = chkVehicleHomeNode.Checked;
_objCharacter.HomeNodeCategory = "Vehicle";
_objCharacter.HomeNodeDataProcessing = 0;
_objCharacter.HomeNodePilot = objVehicle.Pilot;
_objCharacter.HomeNodeHandling = objVehicle.Handling;
_objCharacter.HomeNodeSensor = objVehicle.CalculatedSensor;
}
else
{
Commlink objGear = new Commlink(_objCharacter);
Commlink objCommlink = new Commlink(_objCharacter);
Vehicle objSelectedVehicle = new Vehicle(_objCharacter);
objGear = (Commlink)_objFunctions.FindVehicleGear(treVehicles.SelectedNode.Tag.ToString(), _objCharacter.Vehicles, out objSelectedVehicle);
objGear.HomeNode = chkVehicleHomeNode.Checked;
objCommlink = (Commlink)_objFunctions.FindVehicleGear(treVehicles.SelectedNode.Tag.ToString(), _objCharacter.Vehicles, out objSelectedVehicle);
if (objCommlink == null)
{
return;
}
objCommlink.HomeNode = chkVehicleHomeNode.Checked;
_objCharacter.HasHomeNode = chkVehicleHomeNode.Checked;
_objCharacter.HomeNodeCategory = "Gear";
_objCharacter.HomeNodeDataProcessing = objCommlink.TotalDataProcessing;
_objCharacter.HomeNodePilot = 0;
_objCharacter.HomeNodeHandling = "0";
_objCharacter.HomeNodeSensor = 0;
}

_objCharacter.HasHomeNode = chkVehicleHomeNode.Checked;
_objFunctions.ReplaceHomeNodes(treVehicles.SelectedNode.Tag.ToString(), _objCharacter.Gear, _objCharacter.Vehicles);

RefreshSelectedVehicle();
UpdateCharacterInfo();

@@ -22213,6 +22286,7 @@ public void MetatypeSelected()
lblEDG.Text = _objCharacter.EDG.Value.ToString();
lblMAG.Text = (_objCharacter.MAG.Value - intEssenceLoss).ToString();
lblRES.Text = (_objCharacter.RES.Value - intEssenceLoss).ToString();
lblDEP.Text = (_objCharacter.DEP.Value - intEssenceLoss).ToString();

_blnSkipUpdate = false;

@@ -22426,6 +22500,10 @@ public void UpdateCharacterInfo()
lblRES.Text = "0";
else
lblRES.Text = (_objCharacter.RES.Value - intEssenceLoss).ToString();
if (_objCharacter.DEP.Value - intEssenceLoss < 0)
lblDEP.Text = "0";
else
lblDEP.Text = (_objCharacter.DEP.Value - intEssenceLoss).ToString();

// If the Attribute reaches 0, the character has burned out.
if (_objCharacter.MAG.Value - intEssenceLoss < 1 && _objCharacter.MAGEnabled)
@@ -22536,8 +22614,8 @@ public void UpdateCharacterInfo()
_objCharacter.MAGAdept = _objCharacter.MAG.TotalValue;

// If the character is an A.I., set the Edge MetatypeMaximum to their Rating.
if (_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients")
_objCharacter.EDG.MetatypeMaximum = _objCharacter.Rating;
if (_objCharacter.Metatype == "A.I.")
_objCharacter.EDG.MetatypeMaximum = _objCharacter.DEP.Value;

// If the character is Cyberzombie, adjust their Attributes based on their Essence.
if (_objCharacter.MetatypeCategory == "Cyberzombie")
@@ -22636,6 +22714,7 @@ public void UpdateCharacterInfo()
cmdImproveINT.Enabled = !(_objCharacter.INT.Value == _objCharacter.INT.TotalMaximum);
cmdImproveLOG.Enabled = !(_objCharacter.LOG.Value == _objCharacter.LOG.TotalMaximum);
cmdImproveWIL.Enabled = !(_objCharacter.WIL.Value == _objCharacter.WIL.TotalMaximum);
cmdImproveDEP.Enabled = !(_objCharacter.DEP.Value == _objCharacter.DEP.TotalMaximum);
cmdImproveEDG.Enabled = !(_objCharacter.EDG.Value == _objCharacter.EDG.TotalMaximum);

// Disable the Magic or Resonance Karma buttons if they have reached their current limits.
@@ -22938,6 +23017,19 @@ public void UpdateCharacterInfo()
tipTooltip.SetToolTip(lblRESAug, "");
}

// Attribute: Resonance.
lblDEPMetatype.Text = string.Format("{0} / {1} ({2})", _objCharacter.DEP.TotalMinimum, _objCharacter.DEP.TotalMaximum, _objCharacter.DEP.TotalAugmentedMaximum);
if (_objCharacter.DEP.HasModifiers)
{
lblDEPAug.Text = string.Format("({0})", _objCharacter.DEP.TotalValue);
tipTooltip.SetToolTip(lblDEPAug, _objCharacter.DEP.ToolTip());
}
else
{
lblDEPAug.Text = "";
tipTooltip.SetToolTip(lblDEPAug, "");
}

// Update the MAG pseudo-Attributes if applicable.
int intCharacterMAG = _objCharacter.MAG.TotalValue;
if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
@@ -24361,6 +24453,11 @@ public void RefreshSelectedGear()

if (objCommlink.Category != "Commlink Upgrade")
chkActiveCommlink.Visible = true;
if (_objCharacter.Metatype == "A.I.")
{
chkGearHomeNode.Visible = true;
chkGearHomeNode.Checked = objCommlink.HomeNode;
}
}
else
{
@@ -24437,12 +24534,6 @@ public void RefreshSelectedGear()

cmdGearReduceQty.Enabled = true;

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && (objGear.GetType() == typeof(Commlink) || objGear.Category == "Nexus"))
{
chkGearHomeNode.Visible = true;
chkGearHomeNode.Checked = objGear.HomeNode;
}

treGear.SelectedNode.Text = objGear.DisplayName;
}

@@ -25858,12 +25949,11 @@ private void RefreshSelectedVehicle()
cboVehicleGearSleaze.Text = objCommlink.Sleaze.ToString();
cboVehicleGearDataProcessing.Text = objCommlink.DataProcessing.ToString();
cboVehicleGearFirewall.Text = objCommlink.Firewall.ToString();
}

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && objGear.GetType() == typeof(Commlink))
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objGear.HomeNode;
if (_objCharacter.Metatype == "A.I.")
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objCommlink.HomeNode;
}
}
}
else
@@ -26069,12 +26159,11 @@ private void RefreshSelectedVehicle()
cboVehicleGearSleaze.Text = objCommlink.Sleaze.ToString();
cboVehicleGearDataProcessing.Text = objCommlink.DataProcessing.ToString();
cboVehicleGearFirewall.Text = objCommlink.Firewall.ToString();
}

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && objGear.GetType() == typeof(Commlink))
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objGear.HomeNode;
if (_objCharacter.Metatype == "A.I.")
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objCommlink.HomeNode;
}
}
}
else
@@ -26300,12 +26389,11 @@ private void RefreshSelectedVehicle()
cboVehicleGearSleaze.Text = objCommlink.Sleaze.ToString();
cboVehicleGearDataProcessing.Text = objCommlink.DataProcessing.ToString();
cboVehicleGearFirewall.Text = objCommlink.Firewall.ToString();
}

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && objGear.GetType() == typeof(Commlink))
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objGear.HomeNode;
if (_objCharacter.Metatype == "A.I.")
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objCommlink.HomeNode;
}
}
}
else
@@ -26686,12 +26774,11 @@ private void RefreshSelectedVehicle()
cboVehicleGearSleaze.Text = objCommlink.Sleaze.ToString();
cboVehicleGearDataProcessing.Text = objCommlink.DataProcessing.ToString();
cboVehicleGearFirewall.Text = objCommlink.Firewall.ToString();
}

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && objGear.GetType() == typeof(Commlink))
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objGear.HomeNode;
if (_objCharacter.Metatype == "A.I.")
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objCommlink.HomeNode;
}
}
}
}
@@ -26738,12 +26825,11 @@ private void RefreshSelectedVehicle()
cboVehicleGearSleaze.Text = objCommlink.Sleaze.ToString();
cboVehicleGearDataProcessing.Text = objCommlink.DataProcessing.ToString();
cboVehicleGearFirewall.Text = objCommlink.Firewall.ToString();
}

if ((_objCharacter.Metatype.EndsWith("A.I.") || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && objGear.GetType() == typeof(Commlink))
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objGear.HomeNode;
if (_objCharacter.Metatype == "A.I.")
{
chkVehicleHomeNode.Visible = true;
chkVehicleHomeNode.Checked = objCommlink.HomeNode;
}
}
}
else
@@ -29312,5 +29398,5 @@ private void cboSpiritManipulation_SelectedIndexChanged(object sender, EventArgs
_blnIsDirty = true;
UpdateWindowTitle(false);
}
}
}
}
@@ -360,6 +360,7 @@ private void BuildQualityList()
{
if (objXmlQuality["name"].InnerText.StartsWith("Infected"))
{
//There was something I was going to do with this, but I can't remember what it was.
}
if ((_objCharacter.Metatype == "A.I." || _objCharacter.MetatypeCategory == "Technocritters" || _objCharacter.MetatypeCategory == "Protosapients") && chkLimitList.Checked)
{
@@ -478,7 +479,25 @@ private bool RequirementMet(XmlNode objXmlQuality, bool blnShowMessage)
if (objXmlQuality["limit"] != null)
{
if (objXmlQuality["limit"].InnerText == "no")
{
blnAllowMultiple = true;
}
else
{
int intQualityLimit = Convert.ToInt32(objXmlQuality["limit"].InnerText);
int intQualityCount = 0;
foreach (Quality objQuality in _objCharacter.Qualities)
{
if (objQuality.Name == objXmlQuality["name"].InnerText)
{
intQualityCount++;
}
}
if (intQualityCount < intQualityLimit)
{
blnAllowMultiple = true;
}
}
}
if (!blnAllowMultiple)
{
@@ -871,6 +871,14 @@
<key>String_AttributeRESShort</key>
<text>RES</text>
</string>
<string>
<key>String_AttributeDEPLong</key>
<text>Depth</text>
</string>
<string>
<key>String_AttributeDEPShort</key>
<text>DEP</text>
</string>
<string>
<key>String_AttributeINILong</key>
<text>Initiative</text>