import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim_creatures, main, random, town
from util import *

description = \
"""
This lady seriously needs to get liberated or something.
"""

nagLinesFloor = [
        'Who are you?',
        'What are you doing in my house?',
        'What manners, barging into a body\'s home like that!'
]

nagLinesGarden = [
        'My petunias!',
        'Mind the garden, please!',
        'Stay outta my garden!',
        'My tomatoes!',
        'My cabbage!',
        'My compost!',
]

class NPCClass(sim_creatures.NPC):
    def __init__(self):
        sim_creatures.NPC.__init__(
            self,
            'housewife',    # name
            parole.map.AsciiTile('@', colors['Pink']), # symbol, color
            11,  # str
            8, # dex
            11,  # con
            11, # per
            10, # spd
            1,  # level
            description=description,
        )
        parole.info('New NPC: housewife.')

        main.schedule.listen('enter tile', self)

    def listen(self, event):
        super(NPCClass, self).listen(event)
        if random.random() < 0.5:
            return
        if event.id == 'enter tile':
            eObj, ePos, eMap = event.args
            if eMap is self.parentTile.map and eObj is main.player:
                for obj in eMap[ePos]:
                    if isinstance(obj, town.HouseFloor):
                        self.say(random.choice(nagLinesFloor))
                        break
                    elif obj.name == 'vegetable garden':
                        self.say(random.choice(nagLinesGarden))
                        break

#========================================
thingClass = NPCClass




