Update to Roll and Created EightBall

Added more use to the Roll command, can now do basic math in addition to rolling dice.
Created Eightball, a command to output a standard eightball saying.
This commit is contained in:
Alex Stewart
2019-03-10 20:20:11 -07:00
parent 0d0e1e09ab
commit 36b210e0f5
3 changed files with 164 additions and 50 deletions
+25
View File
@@ -0,0 +1,25 @@
package commands;
import core.Command;
import dataStructures.*;
public class CommandEightBall extends Command
{
String [] answers = {"It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.",
"Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.",
"Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."};
public CommandEightBall(KittyRole level, KittyRating rating)
{
super(level, rating);
}
@Override
public String HelpText() { return "Answers a yes or no question! Warning: Kitty can not actually tell the future,"
+ " she claims no responsibility for any lion mauling, lack of lottery wins, or felony charges."; }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
res.Call(answers[(int) (Math.random()*answers.length)]);
}
}