blob: 43f44babe5b8b07debf5b6554bdac8ac2ac89c42 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
using System;
using System.Linq;
using System.Text;
using UnityEngine;
public class ReactorTask : SabotageTask
{
public override int TaskStep
{
get
{
return this.reactor.UserCount;
}
}
public override bool IsComplete
{
get
{
return this.isComplete;
}
}
private bool isComplete;
private ReactorSystemType reactor;
private bool even;
public override void Initialize()
{
ShipStatus instance = ShipStatus.Instance;
this.reactor = (ReactorSystemType)instance.Systems[SystemTypes.Reactor];
((ReactorShipRoom)instance.AllRooms.First((ShipRoom r) => r.RoomId == SystemTypes.Reactor)).StartMeltdown();
base.SetupArrows();
}
private void FixedUpdate()
{
if (this.isComplete)
{
return;
}
if (!this.reactor.IsActive)
{
this.Complete();
}
}
public override bool ValidConsole(global::Console console)
{
return console.TaskTypes.Contains(TaskTypes.ResetReactor);
}
public override void OnRemove()
{
}
public override void Complete()
{
this.isComplete = true;
PlayerControl.LocalPlayer.RemoveTask(this);
if (this.didContribute)
{
StatsManager instance = StatsManager.Instance;
uint sabsFixed = instance.SabsFixed;
instance.SabsFixed = sabsFixed + 1U;
}
}
public override void AppendTaskText(StringBuilder sb)
{
this.even = !this.even;
Color color = this.even ? Color.yellow : Color.red;
sb.Append(color.ToTextColor());
sb.Append(DestroyableSingleton<TranslationController>.Instance.GetString(TaskTypes.ResetReactor));
sb.Append(" ");
sb.Append((int)this.reactor.Countdown);
sb.AppendLine(string.Format(" ({0}/{1})[]", this.reactor.UserCount, 2));
for (int i = 0; i < this.Arrows.Length; i++)
{
this.Arrows[i].image.color = color;
}
}
}
|