-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFunCommands.cs
124 lines (117 loc) · 4.86 KB
/
FunCommands.cs
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
using System;
using Squishy.Irc.Commands;
namespace DarkwaterSupportBot
{
class FunCommands
{
#region EightBallCommand
public class EightBallCommand : Command
{
public EightBallCommand()
: base("eightball", "eight", "eb")
{
Usage = "eightball DecisionQuestion";
Description = "Provide an answer to decision";
}
public override void Process(CmdTrigger trigger)
{
try
{
string[] eightballanswers = {
"As I see it, yes",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again",
"Don't count on it",
"It is certain",
"It is decidedly so",
"Most likely",
"My reply is no",
"My sources say no",
"Outlook good",
"Outlook not so good",
"Reply hazy, try again",
"Signs point to yes",
"Very doubtful",
"Without a doubt",
"Yes",
"Yes - definitely",
"You may rely on it"
};
if (!String.IsNullOrEmpty(trigger.Args.Remainder))
{
var rand = new Random();
var randomchoice = rand.Next(0, 19);
trigger.Reply(eightballanswers[randomchoice]);
}
else
{
trigger.Reply("You didnt give me a decision question!");
}
}
catch (Exception e)
{
UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
}
}
}
#endregion
#region ActionCommand
public class ActionCommand : Command
{
public ActionCommand()
: base("Action", "Me")
{
Usage = "action -target destination action to write";
Description = "Writes the provided Action.";
}
public override void Process(CmdTrigger trigger)
{
try
{
string target = trigger.Target.ToString();
if (trigger.Args.NextModifiers() == "target")
{
target = trigger.Args.NextWord();
}
if(!string.IsNullOrEmpty(trigger.Args.Remainder))
trigger.Irc.CommandHandler.Describe(target, trigger.Args.Remainder, trigger.Args);
else
trigger.Reply("Empty action");
}
catch (Exception e)
{
trigger.Reply("I cant write that action, perhaps invalid target?");
trigger.Reply(e.Message);
UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
}
}
}
#endregion
#region ReactToAction
public static string ReactToAction()
{
try
{
string[] actions = {
"dodges",
"ducks",
"evades",
"parries",
"blocks",
"does the monkey dance"
};
var rand = new Random();
var randomchoice = rand.Next(0, 5);
return actions[randomchoice];
}
catch(Exception e)
{
UtilityMethods.Print(e.Data + e.StackTrace,true);
return "";
}
}
#endregion
}
}