blob: 0d821876a162b094b196a10a8b0bc9883d3024ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Engine;
namespace ShiftOS.WinForms.Viruses
{
public class CPLeach : IVirus
{
public System.Windows.Forms.Timer Timer = null;
public void Infect(int threatlevel)
{
Timer = new System.Windows.Forms.Timer();
Timer.Interval = 6000;
Timer.Tick += (o, a) =>
{
ulong codepointDecrease = (ulong)threatlevel * 4;
if (SaveSystem.CurrentSave.Codepoints >= codepointDecrease)
SaveSystem.CurrentSave.Codepoints -= codepointDecrease;
else
SaveSystem.CurrentSave.Codepoints = 0;
};
Timer.Start();
}
public void Disinfect()
{
Timer.Stop();
}
}
}
|