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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
namespace ShiftOS.FinalMission
{
public enum Choice
{
SideWithDevX,
StopDevX,
EndAll
}
public class EndGameHandler
{
#region Properties
public static Choice CurrentChoice
{
get { return currentChoice; }
}
public static Dictionary<string, bool> ThingsToDo
{
get
{
return thingsToDo;
}
}
public static bool C2_ShellShockBreachCommand { get; set; }
public static string CurrentObjective
{
get
{
try
{
return thingsToDo.Keys.ElementAt<string>(currentObjective);
}
catch
{
return "";
}
}
}
public static string CurrentObjectivePrompt
{
get { return objPrompt; }
}
public static MissionGuide MissionGuide
{
get { return mguide; }
}
public static bool GodModeInstallEnabled { get; set; }
#endregion
public static FakeChatClient FakeHoloChatRoom
{
get
{
if (currentObjective == 0)
{
var room = new FakeChatClient();
room.Name = "The Hacker Alliance";
room.OtherCharacters = new List<string>();
switch (currentChoice)
{
case Choice.EndAll:
room.Topic = "Oh no. | The ShiftOS Hacker Alliance: We don't mess around.";
room.OtherCharacters.Add("???");
room.OtherCharacters.Add("Hacker101");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice3);
break;
case Choice.StopDevX:
room.Topic = "The ShiftOS Hacker Alliance: We don't mess around.";
room.OtherCharacters.Add("???");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice2);
break;
case Choice.SideWithDevX:
room.Topic = "Chat seized by DevX";
room.OtherCharacters.Add("DevX");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice1);
break;
}
return room;
}
else
{
return null;
}
}
}
#region Events
public static event EventHandler ObjectiveCompleted;
public static event EventHandler MissionComplete;
#endregion
#region Variables
private static Choice currentChoice = Choice.EndAll;
private static Dictionary<string, bool> thingsToDo = new Dictionary<string, bool>();
private static int currentObjective = 0;
private static string objPrompt;
private static MissionGuide mguide;
#endregion
#region Methods
public static void Initiate(int choice)
{
mguide = new MissionGuide();
mguide.Show();
switch (choice)
{
case 1:
currentChoice = Choice.SideWithDevX;
currentObjective = 0;
thingsToDo.Add("Chat with DevX on HoloChat", false);
thingsToDo.Add("Install DevX's packages", false);
mguide.ShowButton = false;
objPrompt = "Go chat with DevX on HoloChat.";
break;
case 2:
currentChoice = Choice.StopDevX;
thingsToDo.Add("Chat with the Other Player on HoloChat", false);
thingsToDo.Add("Hack through DevX's firewall", false);
thingsToDo.Add("Take down DevX's primary server", false);
thingsToDo.Add("Take down DevX's secondary server", false);
thingsToDo.Add("Forkbomb DevX's storage and telemetry server", false);
thingsToDo.Add("One last battle...", false);
thingsToDo.Add("Uninstall ShiftOS", false);
mguide.ShowButton = false;
objPrompt = "It's time to destroy DevX. Head to the Hacker Alliance HoloChat room to begin.";
break;
case 3:
currentChoice = Choice.EndAll;
thingsToDo.Add("Trouble in the Hacker Alliance...", false);
mguide.ShowButton = false;
objPrompt = "Something's wrong in the Hacker Alliance chatroom... They need you.";
break;
}
API.CurrentSession.EndGame_AttachEvents();
}
public static void GoToNextObjective()
{
var h = ObjectiveCompleted;
if (h != null)
{
h(CurrentObjective, new EventArgs());
}
currentObjective += 1;
SetupGUIforCurrent();
}
public static void SetupGUIforCurrent()
{
GodModeInstallEnabled = false;
C2_ShellShockBreachCommand = false;
switch(currentChoice)
{
case Choice.SideWithDevX:
switch(currentObjective)
{
case 1:
mguide.ShowButton = false;
objPrompt = "Go open your Terminal and install the 'god_utils' package.";
GodModeInstallEnabled = true;
break;
case 2:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
case Choice.EndAll:
switch(currentObjective)
{
case 1:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
case Choice.StopDevX:
switch(currentObjective)
{
case 1:
mguide.ShowButton = true;
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_Firewall);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Before we can do anything major, we need to bust through DevX's firewall. It should be easy, but beware. It's just a firewall. The real stuff's coming soon.";
break;
case 2:
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_PrimaryNet);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Alright, we're through. Next on the list is DevX's primary server. Take this down and we can get further into the network without him finding out.";
break;
case 3:
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_Secondary);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Primary server's D to the O to the W to the N. DOWN. Next we gotta take down his secondary server. Once it goes down, he's finished.";
break;
case 4:
mguide.ButtonText = "Begin attack in Terminal";
mguide.OnButtonClick = new Action(() =>
{
var t = new Terminal();
API.CreateForm(t, API.LoadedNames.TerminalName, API.GetIcon("Terminal"));
t.StartShellShock();
});
objPrompt = "Bye, have a great time, DevX! Arighty, DevX has one last server running that needs to go before we do anything more. This one sits on shiftnet://devx/tracker and is the server DevX uses to track other ShiftOS users. Take it down and he can't see any of this.";
break;
case 5:
mguide.ShowButton = false;
objPrompt = "THAT did it. I'd keep that terminal open until connection to the server drops. Once it's done, I'll close it and tell you what to do next.";
mguide.ButtonText = "Connect to server";
break;
case 6:
mguide.ShowButton = true;
mguide.ButtonText = "End DevX";
mguide.OnButtonClick = new Action(() =>
{
//code to run to start uninstall of ShiftOS.
});
objPrompt = "Firewall, check. Primary server, check. Secondary server, CHECK. Telemetry server, CHECK. Now it's time to disable DevX himself. After all, he IS just code.";
break;
case 7:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
}
}
#endregion
}
}
|