diff options
| author | MichaelTheShifter <[email protected]> | 2016-05-24 20:27:25 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-05-24 20:27:35 -0400 |
| commit | b6bc4fd3de7324dd4b086c215768bc50b54c49bb (patch) | |
| tree | eba44505bcd8d824a093a0b18d471ffa0477384a /source/WindowsFormsApplication1/Computer.cs | |
| parent | 95a1f2e4ae8fdb6862dc238106b1cda4948262a9 (diff) | |
| download | shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.tar.gz shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.tar.bz2 shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.zip | |
0.1.1 Release Candidate 1
Committing all code for 0.1.1 Release Candidate 1.
Diffstat (limited to 'source/WindowsFormsApplication1/Computer.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Computer.cs | 32 |
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) { |
