"""
Personalized insults
"""

import supybot
import re, random

__revision__ = "$Id$"
__author__ = "sam@progeny.com"
__contributors__ = {}


import supybot.conf as conf
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.ircdb as ircdb
import supybot.ircmsgs as ircmsgs
import supybot.privmsgs as privmsgs
import supybot.registry as registry
import supybot.callbacks as callbacks


def configure(advanced):
    # This will be called by setup.py to configure this module.  Advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Wirt', True)

conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'nouns',
    registry.SpaceSeparatedListOfStrings( ['bat toenails', 'bug spit',
    'cat hair', 'fish heads', 'gunk', 'pond scum', 'rat retch',
    'red dye number-9', 'Sun IPC manuals', 'waffle-house grits', 'yoo-hoo',
    'squirrel guts', 'snake bait', 'buzzard gizzards', 'cat-hair-balls',
    'pods', 'armadillo snouts', 'entrails', 'snake snot', 'eel ooze',
    'toxic waste', 'Stimpy-drool', 'poopy', 'poop',
    'craptacular carpet droppings', 'cold sores', 'IE user'],
    """Determines the base set of words used as the pool for nouns."""))
conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'foulNouns',
    registry.SpaceSeparatedListOfStrings( ['chicken piss', 'dog vomit',
    'dung', 'fat woman\'s stomach-bile', 'guano', 'dog balls', 'seagull puke',
    'cat bladders', 'pus', 'urine samples', 'snake assholes', 'rat-farts',
    'slurpee-backwash', 'jizzum', 'anal warts'],
    """Determines the set of foul words added to the pool of nouns."""))
conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'amounts',
    registry.SpaceSeparatedListOfStrings(['accumulation', 'bucket', 'gob',
    'coagulation', 'half-mouthful', 'heap', 'mass', 'mound', 'petrification',
    'pile', 'puddle', 'stack', 'thimbleful', 'tongueful', 'ooze', 'quart',
    'bag', 'plate'],
    """Determines the base set of words used as the pool for amounts."""))
conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'foulAmounts',
    registry.SpaceSeparatedListOfStrings(['enema-bucketful', 'ass-full',
    'assload'], """Determines the set of foul words added to the pool of
    amounts."""))
conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'adjectives',
    registry.SpaceSeparatedListOfStrings( ['acidic', 'antique',
    'contemptible', 'culturally-unsound', 'despicable', 'evil', 'fermented',
    'festering', 'foul', 'fulminating', 'humid', 'impure', 'inept',
    'inferior', 'industrial', 'left-over', 'low-quality', 'off-color',
    'petrified', 'pointy-nosed', 'salty', 'sausage-snorfling', 'tasteless',
    'tempestuous', 'tepid', 'tofu-nibbling', 'unintelligent', 'unoriginal',
    'uninspiring', 'weasel-smelling', 'wretched', 'spam-sucking',
    'egg-sucking', 'decayed', 'halfbaked', 'infected', 'squishy', 'porous',
    'pickled', 'thick', 'vapid', 'unmuzzled', 'bawdy', 'vain', 'lumpish',
    'churlish', 'fobbing', 'craven', 'jarring', 'fly-bitten', 'fen-sucked',
    'spongy', 'droning', 'gleeking', 'warped', 'currish', 'milk-livered',
    'surly', 'mammering', 'ill-borne', 'beef-witted', 'tickle-brained',
    'half-faced', 'headless', 'wayward', 'onion-eyed', 'beslubbering',
    'villainous', 'lewd-minded', 'cockered', 'full-gorged', 'rude-snouted',
    'crook-pated', 'pribbling', 'dread-bolted', 'fool-born', 'puny',
    'fawning', 'sheep-biting', 'dankish', 'goatish', 'weather-bitten',
    'knotty-pated', 'malt-wormy', 'saucyspleened', 'motley-mind',
    'it-fowling', 'vassal-willed', 'loggerheaded', 'clapper-clawed', 'frothy',
    'ruttish', 'clouted', 'common-kissing', 'folly-fallen', 'plume-plucked',
    'flap-mouthed', 'swag-bellied', 'dizzy-eyed', 'gorbellied', 'weedy',
    'reeky', 'measled', 'spur-galled', 'mangled', 'impertinent', 'bootless',
    'toad-spotted', 'hasty-witted', 'horn-beat', 'yeasty', 'hedge-born',
    'imp-bladdereddle-headed', 'tottering', 'hugger-muggered', 'elf-skinned',
    'Microsoft-loving'], """Determines the base set of words used as the pool
    for adjectives."""))
conf.registerGlobalValue(conf.supybot.plugins.Wirt, 'foulAdjectives',
    registry.SpaceSeparatedListOfStrings(['pignutted', 'pox-marked', 'rank',
    'malodorous', 'penguin-molesting', 'coughed-up', 'hacked-up', 'rump-fed',
    'boil-brained'], """Determines the set of foul words added to the pool of
    adjectives."""))

conf.registerPlugin('Wirt')
# This is where your configuration variables (if any) should go.

class Wirt(callbacks.PrivmsgCommandAndRegexp):
    def doJoin(self, irc, msg):
      nicks = ['Ginsu_Squirrel', 'jdr', 'aargh', 'TimeWalker', 'piccard', 'gecika', 'soulless_dragon', 'Lancer_Koala', 'Evil_Pink_Robot', 'superbenk', 'schultmc']
      if msg.nick in nicks:
          irc = callbacks.SimpleProxy(irc, msg)
          tempinsult = self._buildInsult()
          irc.reply('%s: %s ' % (msg.nick, tempinsult), prefixName=False)
      if msg.nick == 'criswell':
          irc = callbacks.SimpleProxy(irc, msg)
          irc.reply('ALL HAIL CRISWELL!', prefixName=False)

    def _buildInsult(self):
        """
        Insults are formed by making combinations of:
        You are nothing but a(n) {adj} {amt} of {adj} {noun}
        """
        _nouns = self.registryValue('nouns')
        _amounts = self.registryValue('amounts')
        _adjectives = self.registryValue('adjectives')
        adj1 = random.choice(_adjectives)
        adj2 = random.choice(_adjectives)
        noun = random.choice(_nouns)
        amount = random.choice(_amounts)
        if adj1 == adj2:
            adj2 = random.choice(_adjectives)
        if not adj1[0] in 'aeiou':
            an = 'a'
        else:
            an = 'an'
        return 'You are nothing but %s %s %s of %s %s.' % (
            an, adj1, amount, adj2, noun)

Class = Wirt

# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
