Blowing up the reactor sets karma to 0, all jobs except assistant require a certain karma level

This commit is contained in:
juanjp600
2017-12-04 17:05:22 -03:00
parent 2347f2937e
commit a0782e5d8d
9 changed files with 57 additions and 15 deletions
@@ -209,7 +209,7 @@ namespace Barotrauma.Items.Components
if (progressBar != null) progressBar.Size = new Vector2(60.0f, 20.0f);
#endif
targetStructure.AddDamage(sectionIndex, -StructureFixAmount * degreeOfSuccess);
targetStructure.AddDamage(sectionIndex, -StructureFixAmount * degreeOfSuccess,user);
//if the next section is small enough, apply the effect to it as well
//(to make it easier to fix a small "left-over" section)
@@ -20,6 +20,8 @@ namespace Barotrauma.Items.Components
private float temperature;
private Client BlameOnBroken;
//is automatic temperature control on
//(adjusts the cooling rate automatically to keep the
//amount of power generated balanced with the load)
@@ -326,6 +328,14 @@ namespace Barotrauma.Items.Components
if (containedItem == null) continue;
containedItem.Condition = 0.0f;
}
if (GameMain.Server != null)
{
if (GameMain.Server.ConnectedClients.Contains(BlameOnBroken))
{
BlameOnBroken.Karma = 0.0f;
}
}
}
public override bool Pick(Character picker)
@@ -387,8 +397,12 @@ namespace Barotrauma.Items.Components
float coolingRate = msg.ReadRangedSingle(0.0f, 100.0f, 8);
float fissionRate = msg.ReadRangedSingle(0.0f, 100.0f, 8);
if (!item.CanClientAccess(c)) return;
if (!item.CanClientAccess(c)) return;
if (!autoTemp && AutoTemp) BlameOnBroken = c;
if (shutDownTemp > ShutDownTemp) BlameOnBroken = c;
if (fissionRate > FissionRate) BlameOnBroken = c;
AutoTemp = autoTemp;
ShutDownTemp = shutDownTemp;