Changeset 1106

Show
Ignore:
Timestamp:
11/11/08 21:57:48 (2 months ago)
Author:
faux
Message:

Tarotty goodness.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/contrib/MiscMsg.java

    r1094 r1106  
    100100                        // Assume 1. 
    101101                } 
    102                 irc.sendContextReply(mes, "Random number between 0 and " + max + " is " + new Random().nextDouble()*max + "."); 
    103         } 
    104  
    105         private void randomReply(final Message mes, final String[] replies ) 
    106         { 
    107                 irc.sendContextReply(mes, replies[new Random().nextInt(replies.length)]); 
     102                irc.sendContextReply(mes, "Random number between 0 and " + max + " is " + Math.random()*max + "."); 
     103        } 
     104 
     105        private void randomReply(final Message mes, final String[] replies) 
     106        { 
     107                randomReply(mes, replies, "", ""); 
     108        } 
     109 
     110        private void randomReply(final Message mes, final String[] replies, String prefix, String suffix) 
     111        { 
     112                irc.sendContextReply(mes, prefix + replies[new Random().nextInt(replies.length)] + suffix); 
    108113        } 
    109114 
     
    206211                "<Question> is some a question for the 8 ball the think over." 
    207212        }; 
    208         public void command8Ball( final Message mes
     213        public void command8Ball(final Message mes
    209214        { 
    210215                // http://r.wesley.edwards.net/writes/JavaScript/magic8ball.js 
    211                 randomReply(mes, new String[] {"Signs point to yes.", "Yes.", "Reply hazy, try again.", "Without a doubt.", "My sources say no.", "As I see it, yes.", "You may rely on it.", "Concentrate and ask again.", "Outlook not so good.", "It is decidedly so.", "Better not tell you now.", "Very doubtful.", "Yes - definitely.", "It is certain.", "Cannot predict now.", "Most likely.", "Ask again later.", "My reply is no.", "Outlook good.", "Don't count on it." }); 
    212         } 
     216                randomReply(mes, new String[] { "Signs point to yes.", "Yes.", "Reply hazy, try again.", 
     217                                "Without a doubt.", "My sources say no.", "As I see it, yes.", 
     218                                "You may rely on it.", "Concentrate and ask again.", "Outlook not so good.", 
     219                                "It is decidedly so.", "Better not tell you now.", "Very doubtful.", 
     220                                "Yes - definitely.", "It is certain.", "Cannot predict now.", "Most likely.", 
     221                                "Ask again later.", "My reply is no.", "Outlook good.", "Don't count on it." }); 
     222        } 
     223 
     224        public String[] helpCommandTarot = { "Draw a card from the tarot pack.", }; 
     225 
     226        public void commandTarot(final Message mes) 
     227        { 
     228                // http://en.wikipedia.org/wiki/Major_Arcana 
     229                randomReply(mes, new String[] { "The Fool", "The Magician", "The High Priestess", 
     230                                "The Empress", "The Emperor", "The Hierophant or The Pope", "The Lovers", 
     231                                "The Chariot", "Strength", "The Hermit", "Wheel of Fortune", "Justice", 
     232                                "The Hanged Man", "Death", "Temperance", "The Devil", "The Tower", "The Star", 
     233                                "The Moon", "The Sun", "Judgment", "The World" }, "You drew ", "."); 
     234        } 
     235 
    213236 
    214237        public void commandDiscordianDate(final Message mes)