aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Computer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'source/WindowsFormsApplication1/Computer.cs')
-rw-r--r--source/WindowsFormsApplication1/Computer.cs32
1 files changed, 30 insertions, 2 deletions
diff --git a/source/WindowsFormsApplication1/Computer.cs b/source/WindowsFormsApplication1/Computer.cs
index db1f24e..3b546b7 100644
--- a/source/WindowsFormsApplication1/Computer.cs
+++ b/source/WindowsFormsApplication1/Computer.cs
@@ -12,6 +12,8 @@ namespace ShiftOS
{
public partial class Computer : UserControl
{
+ public int TotalHP = 100;
+
public Computer()
{
InitializeComponent();
@@ -318,6 +320,16 @@ namespace ShiftOS
if (this.HP > 0)
{
lbstats.Text = $"HP: {_HP}";
+ if(!Enemy)
+ {
+ foreach(var m in Hacking.MyNetwork)
+ {
+ if(m.Hostname == Hostname)
+ {
+ m.HP = _HP;
+ }
+ }
+ }
switch (Type)
{
case SystemType.Core:
@@ -369,8 +381,24 @@ namespace ShiftOS
{
if (API.Upgrades["limitlesscustomshades"] == true)
{
- int mod = _HP % 255;
- this.BackColor = Color.FromArgb(255, mod, mod);
+ if(_HP > TotalHP / 2)
+ {
+ this.BackColor = Color.Green;
+ lbstats.ForeColor = Color.Black;
+ }
+ else
+ {
+ if(_HP > TotalHP / 3)
+ {
+ this.BackColor = Color.Orange;
+ lbstats.ForeColor = Color.Black;
+ }
+ else
+ {
+ this.BackColor = Color.Red;
+ lbstats.ForeColor = Color.White;
+ }
+ }
}
if (Enemy == true)
{