-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChallengeCommandHandler.cs
More file actions
74 lines (68 loc) · 2.43 KB
/
ChallengeCommandHandler.cs
File metadata and controls
74 lines (68 loc) · 2.43 KB
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
using System;
using CoreLib.Submodules.ChatCommands;
using UnityEngine;
namespace PainMod;
public class ChallengeCommandHandler : IChatCommandHandler
{
public CommandOutput Execute(string[] parameters)
{
string res = "";
string finalText;
string activeText = "";
string inactiveText = "";
bool becameActive = false;
if (parameters.Length != 1)
return new CommandOutput("Please type in the challenge you would like to activate. \n List is: \n minesweeper\n GhormKeeper\n AfraidOfTheDark", Color.yellow);
if (parameters[0].Equals("minesweeper", StringComparison.OrdinalIgnoreCase))
{
res = "minesweeper";
Plugin.mineChallengeActive = !Plugin.mineChallengeActive;
if (Plugin.mineChallengeActive)
becameActive = true;
else
becameActive = false;
}
else if (parameters[0].Equals("GhormKeeper", StringComparison.OrdinalIgnoreCase))
{
res = "Ghorm Keeper";
Plugin.ghormChallengeActive = !Plugin.ghormChallengeActive;
if (Plugin.ghormChallengeActive)
becameActive = true;
else
becameActive = false;
}
else if (parameters[0].Equals("AfraidOfTheDark", StringComparison.OrdinalIgnoreCase))
{
res = "Afraid of the dark";
Plugin.darkChallengeActive = !Plugin.darkChallengeActive;
if (Plugin.darkChallengeActive)
becameActive = true;
else
becameActive = false;
}
else
{
return new CommandOutput(
"Please type in the challenge you would like to activate. \n List is: \n minesweeper", Color.red);
}
activeText = "Good luck m8, ur gonna need it if you want to suceed with the challenge: " + res;
inactiveText = "I see, " + res + " is quite a hard challenge, sad to see you werent up for it though, maybe next time?";
if (becameActive)
finalText = activeText;
else
finalText = inactiveText;
return (finalText);
}
public string GetDescription()
{
return "Activate challenges with /challenge (challenge name)";
}
public string[] GetTriggerNames()
{
return new[] {"challenge"};
}
public string GetModName()
{
return "PainMod";
}
}