aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Computer.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-06-24 16:44:42 -0400
committerMichaelTheShifter <[email protected]>2016-06-24 16:44:51 -0400
commitecee91bc559e1c0d716a3032e371218812df61e7 (patch)
tree49acdb538b13bc3da89185413bc4096d4e6d81f7 /source/WindowsFormsApplication1/Computer.cs
parent8ea0903788b02b352cc25c9b6f46d439bdb1356a (diff)
downloadshiftos-c--ecee91bc559e1c0d716a3032e371218812df61e7.tar.gz
shiftos-c--ecee91bc559e1c0d716a3032e371218812df61e7.tar.bz2
shiftos-c--ecee91bc559e1c0d716a3032e371218812df61e7.zip
Loads of changes...
Custom shifter options using Lua, and other stuff.
Diffstat (limited to 'source/WindowsFormsApplication1/Computer.cs')
-rw-r--r--source/WindowsFormsApplication1/Computer.cs65
1 files changed, 43 insertions, 22 deletions
diff --git a/source/WindowsFormsApplication1/Computer.cs b/source/WindowsFormsApplication1/Computer.cs
index 3b546b7..8f849d3 100644
--- a/source/WindowsFormsApplication1/Computer.cs
+++ b/source/WindowsFormsApplication1/Computer.cs
@@ -45,8 +45,7 @@ namespace ShiftOS
}
}
- private SystemType _Type = SystemType.Core;
-
+
public SystemType Type
{
get; set;
@@ -112,8 +111,6 @@ namespace ShiftOS
return AttackType.Core;
case SystemType.Turret:
return AttackType.Virus;
- case SystemType.FTPServer:
- return AttackType.Backdoor;
default:
return AttackType.None;
}
@@ -284,30 +281,31 @@ namespace ShiftOS
{
case SystemType.Core:
return 100;
- break;
default:
switch (Grade)
{
case 1:
return 10;
- break;
case 2:
return 20;
- break;
case 3:
return 40;
- break;
case 4:
return 80;
- break;
default:
return 10;
- break;
}
- break;
}
}
+ public Timer HealthTimer = null;
+
+ public bool AlreadyEnslaved = false;
+ public bool Enslaved = false;
+
+ public event EventHandler EnslavedModule;
+
+
public event EventHandler MassDDoS;
private void Computer_Load(object sender, EventArgs e)
@@ -341,7 +339,7 @@ namespace ShiftOS
(this.Parent.Height - this.Height) / 2
);
}
- catch (Exception ex)
+ catch
{
}
@@ -360,6 +358,26 @@ namespace ShiftOS
}
this.Size = new Size(32, 32);
break;
+ case SystemType.ModuleStealer:
+ var rnd = new Random();
+ int num = rnd.Next(0, 2500 / Grade);
+ if(num == 25)
+ {
+ StolenModule?.Invoke(this, new EventArgs());
+ }
+ break;
+ case SystemType.Enslaver:
+ if (AlreadyEnslaved == false)
+ {
+ var ernd = new Random();
+ int num2 = ernd.Next(0, 2500 / Grade);
+ if (num2 == 25)
+ {
+ AlreadyEnslaved = true;
+ EnslavedModule?.Invoke(this, new EventArgs());
+ }
+ }
+ break;
case SystemType.ServerStack:
var r2 = new Random();
int i2 = r2.Next(0, GetChance());
@@ -419,8 +437,11 @@ namespace ShiftOS
}
};
t.Start();
+ HealthTimer = t;
}
+ public event EventHandler StolenModule;
+
public event EventHandler OnDestruction;
public void ThrowDestroyed()
@@ -446,16 +467,16 @@ namespace ShiftOS
public enum SystemType
{
- Core,
- Antivirus,
- DedicatedDDoS,
- Turret,
- FTPServer,
- Firewall,
- ServerStack,
- Enslaver,
- DamageLogger,
- RepairModule,
+ Core = 0,
+ Antivirus = 1,
+ DedicatedDDoS = 2,
+ Turret = 3,
+ FTPServer = 4,
+ Firewall = 5,
+ ServerStack = 6,
+ Enslaver = 7,
+ RepairModule = 9,
+ ModuleStealer = 8,
}
public enum AttackType {