aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Viruses/Shifticide.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.WinForms/Viruses/Shifticide.cs')
-rw-r--r--ShiftOS.WinForms/Viruses/Shifticide.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/Viruses/Shifticide.cs b/ShiftOS.WinForms/Viruses/Shifticide.cs
new file mode 100644
index 0000000..2efa743
--- /dev/null
+++ b/ShiftOS.WinForms/Viruses/Shifticide.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ShiftOS.Engine;
+using System.Windows.Forms;
+
+namespace ShiftOS.WinForms.Viruses
+{
+ [Virus("shifticide", "Shifticide", "Extremely deadly virus. This will delete your Home directory, and cannot be recovered.")]
+ public class Shifticide : IVirus
+ {
+ private Timer _virusTimer = null;
+ void IVirus.Disinfect()
+ {
+ _virusTimer.Stop();
+ _virusTimer = null;
+ if (ShiftOS.Objects.ShiftFS.Utils.DirectoryExists("0:/home"))
+ ShiftOS.Objects.ShiftFS.Utils.CreateDirectory("0:/home");
+
+ }
+
+ void IVirus.Infect(int threatlevel)
+ {
+ _virusTimer = new Timer();
+ _virusTimer.Interval = 5000 / threatlevel;
+ if (ShiftOS.Objects.ShiftFS.Utils.DirectoryExists("0:/home"))
+ ShiftOS.Objects.ShiftFS.Utils.Delete("0:/home");
+ }
+ }
+}