summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/HudOverrideSystemType.cs
blob: 82558cbdd4e723eacdee9edd75c0cc69fcb01bd5 (plain)
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
35
36
37
38
39
40
using System;
using Hazel;

internal class HudOverrideSystemType : ISystemType, IActivatable
{
	public bool IsActive { get; private set; }

	public const byte DamageBit = 128;

	public const byte TaskMask = 127;

	public bool Detoriorate(float deltaTime)
	{
		if (this.IsActive && !PlayerTask.PlayerHasHudTask(PlayerControl.LocalPlayer))
		{
			PlayerControl.LocalPlayer.AddSystemTask(SystemTypes.Comms);
		}
		return false;
	}

	public void RepairDamage(PlayerControl player, byte amount)
	{
		if ((amount & 128) > 0)
		{
			this.IsActive = true;
			return;
		}
		this.IsActive = false;
	}

	public void Serialize(MessageWriter writer, bool initialState)
	{
		writer.Write(this.IsActive);
	}

	public void Deserialize(MessageReader reader, bool initialState)
	{
		this.IsActive = reader.ReadBoolean();
	}
}