コード例 #1
0
 def get_character():
     """
     Helper function which returns a random mermaid.
     :return: string
         A mermaid based on a random fish.
     """
     merfolk = "mermaid"
     if randint(0, 3) == 0:
         merfolk = "merman"
     return '{}-{}'.format(get_animal('fish'), merfolk)
コード例 #2
0
chara = CharacterGenerator()

illustration = [
    'ninja battle',
    '"whatever you do, keep your eyes on me"',
    'kaiju attack',
    'campfire tales',
    'saving a sleepwalker from themself',
    'an astonishing slice of cake',
    'a fairytale gatecrashing a birthday party',
    'zombie apocalypse ... on ice!',
    'something wicked this way comes',
    'improve a story you like',
    'fix a story that you don\'t like',
    'your character receives a basket of baby {}s'.format(
        get_animal('mythical')),
    'the voyage home',
    'there and back again',
    'space {}s'.format(get_animal('insect')),
    'king under the mountain',
    'king of the world',
    'queen of the air',
    'queen of the deep blue sea',
    'sunken kingdom',
    'steal the thunder',
    'ride the lightning',
    'lightning in a bottle',
    'things with wings',
    'praise the sun',
    'time travelling pizza delivery',
    'late night at the alien noodle bar',
コード例 #3
0
    def __init__(self):
        super(Mermay, self).__init__()
        self.environment = [
            'artificial reef',
            'cave',
            'cavern',
            'coral palace',
            'coral reef',
            'drowned city',
            'flooded city',
            'kelp forest',
            'reef',
            'shipwreck',
            'sunken pirate ship',
            'sunken pirate treasure',
            'underwater castle',
            'underwater city',
            'whale graveyard',
        ]

        self.scene = [
            'sunbathing {}'.format(self.get_character()),
            'a {} rescuing a shipwrecked sailor'.format(self.get_character()),
            'a {} enticing sailors'.format(self.get_character()),
            'queen of the {} merfolk'.format(get_animal('fish')),
            'king of the {} merfolk'.format(get_animal('fish')),
            'a {} and their pet {}'.format(self.generate_character(),
                                           get_animal('fish')),
            'a {} exploring a {}'.format(self.get_character(), self.get_env()),
            'a {} in a {}'.format(self.generate_character(), self.get_env()),
            'a {} playing the {}'.format(self.get_character(),
                                         get_instrument()),
            'a {} eating her favourite food'.format(self.get_character()),
            'a {} and her baby'.format(self.get_character()),
            'a family of {} merfolk'.format(get_animal('fish')),
            'a {} surrounded by a shoal of {}'.format(self.get_character(),
                                                      get_animal('fish')),
            'a {} rescuing a trapped {}'.format(self.get_character(),
                                                get_animal('fish')),
            'a {} fighting a monstrous {}'.format(self.get_character(),
                                                  get_animal('fish')),
            'a {} tangled in a net'.format(self.get_character()),
            'a {} playing hide and seek'.format(self.get_character()),
            'a {} playing hide and seek in a {}'.format(
                self.get_character(), self.get_env()),
            'a {} examining human technology'.format(self.get_character()),
            'a mermaid from a {} story'.format(get_genre()),
            'a mermaid who lives in a swimming pool',
            'a tiny mermaid who lives in a fish tank',
            'a mermaid who lives in an aquarium',
            'a beached mermaid',
            'a mermaid rescued by a sailor',
            'a baby {} mermaid'.format(get_animal('fish')),
            'a {}\'s first trip to the shore'.format(self.get_character()),
            'a sea witch',
            'a freshwater mermaid',
            'a mermaid from the arctic',
            'a mermaid from the tropics',
            'a mermaid living in a desert oasis',
            'a mermaid from a river',
            'a mermaid from a swamp',
            'a mermaid from outer space',
            'a mermaid from the future',
            'a friendly mermaid',
            'a malevolent mermaid',
            'a cruel mermaid',
            'a royal {}'.format(self.get_character()),
            'a {} pin-up'.format(self.get_character()),
            'a {} {}'.format(get_size('large'), self.get_character()),
            'a {} {}'.format(get_size('small'), self.get_character()),
            'a {} gardener'.format(self.get_character()),
            'a {} pirate'.format(self.get_character()),
            'a {} warrior'.format(self.get_character()),
            'a {} superhero'.format(self.get_character()),
            'a {} merchant'.format(self.get_character()),
            'a {} pop star'.format(self.get_character()),
            'a {} artist'.format(self.get_character()),
            'a {} poet'.format(self.get_character()),
            'your mersona',
        ]
コード例 #4
0
ファイル: spooktober.py プロジェクト: PaKalsha/OMU_Twitterbot
    def __init__(self):
        self.char_type = [
            # A - E
            'black cat',
            'black dog',
            'black-eyed children',
            'bloody butcher',
            'boogeyman',
            'brain in a jar',
            'clown',
            'costume',
            'creature',
            'demon',
            'devil',
            'doll',
            'doppelganger',
            # F - J
            'faceless man',
            'faceless woman',
            'familiar',
            'ghost',
            'ghoul',
            'goatman',
            'goblin',
            'hellhound',
            'homunculus',
            'horseman',
            # K - O
            'kaiju',
            'lake monster',
            'mad scientist',
            'mummy',
            'mothman',
            'owl',
            # P - T
            'puppet',
            'raven',
            'reflection',
            'shadow',
            'skeleton',
            'skull',
            'slenderman',
            'something',
            'stranger',
            # U - Z
            'vampire',
            'warlock',
            'were-beast',
            'werewolf',
            'witch',
            'zombie'
        ]

        self.adjectives = [
            # A - E
            'alien',
            'angry',
            'bizarre',
            'bloody',
            'body-snatching',
            'burning',
            'clockwork',
            'cobwebbed',
            'corrupted',
            'creeping',
            'creepy',
            'cursed',
            'eerie',
            'envious',
            'evil',
            # F - J
            'faceless',
            'fanged',
            'frost-bitten',
            'gaunt',
            'gloomy',
            'glowing',
            'grim',
            'grotesque',
            'haunted',
            'headless',
            'hungry',
            'infected',
            # K - O
            'looming',
            'lurking',
            'macabre',
            'malevolent',
            'many-faced',
            'many-limbed',
            'mouldy',
            'mournful',
            'ominous',
            'patchwork',
            'poisonous',
            'otherworldly',
            # P - T
            'parasitic',
            'radioactive',
            'rotten',
            'scaly',
            'screaming',
            'sinister',
            'skeletal',
            'slimy',
            'spectral',
            'spidery',
            'spiky',
            'tentacled',
            'twisted',
            # U - Z
            'uncanny',
            'vengeful',
            'watchful'
        ]

        self.description = [
            'made of bones', 'from a nightmare', 'in disguise',
            'with the head of a {}'.format(get_animal('all'))
        ]

        self.nope_combo = {
            'bloody butcher': 'bloody',
            'ghost': 'spectral',
            'skeleton': ('skeletal', 'made of bones'),
            'skull': ('skeletal', 'made of bones'),
            'owl': 'with the head of an owl',
            'black cat': 'with the head of a cat',
            'black dog': 'with the head of a dog',
            'hellhound': 'with the head of a dog',
            'slenderman': ('many-limbed', 'faceless'),
            'faceless man': 'faceless',
            'costume': 'frost-bitten'
        }
コード例 #5
0
    def __init__(self):
        self.char_type = (
            # A - E
            'adventurer',
            'alchemist',
            'animal sidekick',
            'animal trainer',
            'archaeologist',
            'archer',
            'armouror',
            'art critic',
            'artist',
            'assassin',
            'baker',
            'bartender',
            'barbarian',
            'bard',
            'battle mage',
            'berserker',
            'black mage',
            'blacksmith',
            'blue mage',
            'botanist',
            'bouncer',
            'bounty hunter',
            'boxer',
            'builder',
            'bully',
            'bureaucrat',
            'captain',
            'carpenter',
            'centaur',
            'cheerleader',
            'chef',
            'chemist',
            'child',
            'class clown',
            'cleric',
            'collector',
            'con-artist',
            'cook',
            'cowboy',
            'curmudgeon',
            'dancer',
            'demon hunter',
            'detective',
            'DJ',
            'doctor',
            'dragoon',
            'druid',
            'elder',
            'elementalist',
            'emperor',
            'empress',
            'explorer',
            'extrovert',
            # F - J
            'fairy princess',
            'farmer',
            'fencer',
            'fisherman',
            'fool',
            'forest spirit',
            'fusilier',
            'gambler',
            'gardener',
            'geek',
            'geologist',
            'geomancer',
            'gossip',
            'goth',
            'gladiator',
            'guard',
            'guerrilla fighter',
            'guide',
            'gunner',
            'hacker',
            'healer',
            'herald',
            'hermit',
            'hero',
            'homemaker',
            'hunter',
            'illusionist',
            'introvert',
            'inventor',
            'jailbird',
            'jester',
            'jeweller',
            'judge',
            'juggler',
            # K - O
            'king',
            'knight',
            'librarian',
            'machinist',
            'mage',
            'martial artist',
            'mascot',
            'mathematician',
            'mayor',
            'mechanic',
            'medic',
            'merchant',
            'mime',
            'miner',
            'monk',
            'musician',
            'mystic',
            'necromancer',
            'nerd',
            'ninja',
            'nun',
            'nurse',
            'one-man band',
            'onion knight',
            'oracle',
            'orator',
            'outlaw',
            # P - T
            'painter',
            'pair of stowaways',
            'paladin',
            'performer',
            'pilot',
            'pirate',
            'plumber-turned-hero',
            'poet',
            'police officer',
            'pop star',
            'poacher',
            'priest',
            'prince',
            'princess',
            'programmer',
            'psychic',
            'pugilist',
            'puppeteer',
            'queen',
            'ranger',
            'rebel',
            'revolutionary',
            'rock star',
            'romantic',
            'saboteur',
            'sage',
            'samurai',
            'sculptor',
            'seer',
            'sentinel',
            'singer',
            'scholar',
            'scientist',
            'shaman',
            '{} shepard'.format(get_animal('mythical')),
            'sky pirate',
            'soldier',
            'soothsayer',
            'sorcerer',
            'special agent',
            'spy',
            'stagecoach driver',
            'star-crossed lovers',
            'smuggler',
            'summoner',
            'survivalist',
            'teacher',
            'techno-mage',
            'templar',
            'thief',
            'tinker',
            'time mage',
            'tracker',
            'trader',
            'trainer',
            'trickster',
            'tsundere',
            'tyrant',
            # U - Z
            'vampire',
            'viking',
            'villain',
            'village elder',
            'waif',
            'waiter',
            'waitress',
            'warrior',
            'weaver',
            'white mage',
            'witch',
            'wizard')

        self.adjectives = [
            'masked', 'magical', 'cute', 'ancient', 'regal', 'mystical',
            '{}-like'.format(get_animal('mammal')), 'interstellar', 'evil',
            'corrupt', 'corrupted', 'glamorous', 'concerned', 'flustered',
            'rude', 'serious', 'protective', 'guilty', 'humiliated',
            'reproachful', 'humble', 'overwhelmed', 'content', 'comfortable',
            'victorious', 'calm', 'confident', 'courageous', 'determined',
            'powerful', 'peaceful', 'smug', 'triumphant', 'relaxed',
            'glorious', 'laughing', 'hopeful', 'robot'
        ]

        self.description = [
            'who is out of their depth',
            'who got more than they bargained for', 'from beyond the stars',
            'from the future'
        ]

        self.nope_combo = {'romantic': 'romantic'}
コード例 #6
0
        num_descriptions = len(self.adjectives) + len(self.description)
        die = randint(1, num_descriptions)

        if (die - 1) <= len(self.adjectives):
            prompt = '{} {}'.format(self.get_adjective(), character)
            if character in self.nope_combo.keys(
            ) and self.adjectives[die] in self.nope_combo[character]:
                prompt = self.get_prompt()
        else:
            prompt = '{} {}'.format(character, self.get_description())
            if character in self.nope_combo.keys(
            ) and self.description[0] in self.nope_combo[character]:
                prompt = self.get_prompt()

        return prompt

    def get_prompt(self):
        """
        Returns a character prompt.
        :return: string
            Returns a character design prompt.
        """
        return self.generate_character()


if __name__ == '__main__':
    c = CharacterGenerator()
    print c.get_prompt()
    print c.generate_character(get_animal('mammal'))