コード例 #1
0
def generategem():
    """Generate a gem"""
    features = feature_filter('gem')
    titletext = 'OOOH, Shiny...'
    if ('count' in request.args and valid_count(request.args['count'])):
        gems = []
        for _ in xrange(int(request.args['count'])):
            gems.append(Gem(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=gems, oneliner=gems[0], titletext=titletext, generator='gem')
    else:
        gem = Gem(app.server, features)
        return render_template('oneliner.html', oneliner=gem, titletext=titletext, generator='gem')
コード例 #2
0
def generatelegend():
    """Generate a legend"""
    features = feature_filter('legend')
    titletext = 'Let me tell you a story...'
    if ('count' in request.args and valid_count(request.args['count'])):
        legends = []
        for _ in xrange(int(request.args['count'])):
            legends.append(Legend(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=legends,
                               oneliner=legends[0], titletext=titletext, generator='legend')
    else:
        legend = Legend(app.server, features)
        return render_template('oneliner.html', oneliner=legend, titletext=titletext, generator='legend')
コード例 #3
0
def generateartwork():
    """Generate a artwork"""
    features = feature_filter('artwork')
    titletext = 'A Work of Art...'
    if ('count' in request.args and valid_count(request.args['count'])):
        artworks = []
        for _ in xrange(int(request.args['count'])):
            artworks.append(Artwork(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=artworks,
                               oneliner=artworks[0], titletext=titletext, generator='artwork')
    else:
        artwork = Artwork(app.server, features)
        return render_template('oneliner.html', oneliner=artwork, titletext=titletext, generator='artwork')
コード例 #4
0
def generatemundaneitem():
    """Generate a mundaneitem"""

    features = feature_filter('mundaneitem')
    titletext = 'Look what I found!'
    if ('count' in request.args and valid_count(request.args['count'])):
        mundaneitems = []
        for _ in xrange(int(request.args['count'])):
            mundaneitems.append(MundaneItem(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=mundaneitems,
                               oneliner=mundaneitems[0], titletext=titletext, generator='mundaneitem')
    else:
        mundaneitem = MundaneItem(app.server, features)
        return render_template('oneliner.html', oneliner=mundaneitem, titletext=titletext, generator='mundaneitem')
コード例 #5
0
def generatephobia():
    """Generate a phobia"""
    features = feature_filter('phobia')
    titletext = 'You know what really scares me?'

    if ('count' in request.args and valid_count(request.args['count'])):
        phobias = []
        for _ in xrange(int(request.args['count'])):
            phobias.append(Phobia(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=phobias,
                               oneliner=phobias[0], titletext=titletext, generator='phobia')
    else:
        phobia = Phobia(app.server, features)
        return render_template('oneliner.html', oneliner=phobia, titletext=titletext, generator='phobia')
コード例 #6
0
def generatemotivation():
    """Generate a motivation"""
    features = feature_filter('motivation')
    titletext = 'I\'m Motivated...'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        motivations = []
        for _ in xrange(int(request.args['count'])):
            motivations.append(Motivation(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=motivations,
                               oneliner=motivations[0], titletext=titletext, generator='motivation')
    else:
        motivation = Motivation(app.server, features)
        return render_template('oneliner.html', oneliner=motivation, titletext=titletext, generator='motivation')
コード例 #7
0
def generateflaw():
    """Generate a flaw"""
    features = feature_filter('flaw')
    titletext = 'My Greatest Flaw...'

    if ('count' in request.args and valid_count(request.args['count'])):
        flaws = []
        for _ in xrange(int(request.args['count'])):
            flaws.append(Flaw(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=flaws,
                               oneliner=flaws[0], titletext=titletext, generator='flaw')
    else:
        flaw = Flaw(app.server, features)
        return render_template('oneliner.html', oneliner=flaw, titletext=titletext, generator='flaw')
コード例 #8
0
def generatecurrency():
    """Generate a currency"""
    features = feature_filter('currency')
    titletext = 'Spare Some Change?'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        currencys = []
        for _ in xrange(int(request.args['count'])):
            currencys.append(Currency(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=currencys,
                               oneliner=currencys[0], titletext=titletext, generator='currency')
    else:
        currency = Currency(app.server, features)
        return render_template('oneliner.html', oneliner=currency, titletext=titletext, generator='currency')
コード例 #9
0
def generaterumor():
    """Generate a rumor"""
    features = feature_filter('rumor')
    titletext = 'Did You Hear?'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        rumors = []
        for _ in xrange(int(request.args['count'])):
            rumors.append(Rumor(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=rumors,
                               oneliner=rumors[0], titletext=titletext, generator='rumor')
    else:
        rumor = Rumor(app.server, features)
        return render_template('oneliner.html', oneliner=rumor, titletext=titletext, generator='rumor')
コード例 #10
0
def generatecuisine():
    """Generate a cuisine"""
    features = feature_filter('cuisine')
    features['region'] = Region(app.server)
    titletext = 'What\'s for Dinner?'
    if ('count' in request.args and valid_count(request.args['count'])):
        cuisines = []
        for _ in xrange(int(request.args['count'])):
            cuisines.append(Cuisine(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=cuisines,
                               oneliner=cuisines[0], titletext=titletext, generator='cuisine')
    else:
        cuisine = Cuisine(app.server, features)
        return render_template('oneliner.html', oneliner=cuisine, titletext=titletext, generator='cuisine')
コード例 #11
0
def generatecurse():
    """Generate a curse"""

    features = feature_filter('curse')
    titletext = 'Unforseen Consequences...'
    if ('count' in request.args and valid_count(request.args['count'])):
        curses = []
        for _ in xrange(int(request.args['count'])):
            curses.append(Curse(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=curses,
                               oneliner=curses[0], titletext=titletext, generator='curse')
    else:
        curse = Curse(app.server, features)
        return render_template('oneliner.html', oneliner=curse, titletext=titletext, generator='curse')
コード例 #12
0
def generateresource():
    """Generate a resource"""

    features = feature_filter('resource')
    titletext = 'At Your Disposal...'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        resources = []
        for _ in xrange(int(request.args['count'])):
            resources.append(Resource(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=resources,
                               oneliner=resources[0], titletext=titletext, generator='resource')
    else:
        resource = Resource(app.server, features)
        return render_template('oneliner.html', oneliner=resource, titletext=titletext, generator='resource')
コード例 #13
0
def generatejobposting():
    """Generate a jobposting"""

    features = feature_filter('jobposting')
    titletext = 'Help Wanted!'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        jobpostings = []
        for _ in xrange(int(request.args['count'])):
            jobpostings.append(JobPosting(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=jobpostings,
                               oneliner=jobpostings[0], titletext=titletext, generator='jobposting')
    else:
        jobposting = JobPosting(app.server, features)
        return render_template('oneliner.html', oneliner=jobposting, titletext=titletext, generator='jobposting')
コード例 #14
0
def generatemisfire():
    """Generate a misfire"""

    features = feature_filter('misfire')
    titletext = 'My Spell Misfired!'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        misfires = []
        for _ in xrange(int(request.args['count'])):
            misfires.append(Misfire(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=misfires,
                               oneliner=misfires[0], titletext=titletext, generator='misfire')
    else:
        misfire = Misfire(app.server, features)
        return render_template('oneliner.html', oneliner=misfire, titletext=titletext, generator='misfire')
コード例 #15
0
def generategrafitti():
    """Generate a grafitti"""

    features = feature_filter('grafitti')
    titletext = 'Scrawled on a Nearby Wall...'
    features['npc'] = NPC(app.server, {})
    if ('count' in request.args and valid_count(request.args['count'])):
        grafittis = []
        for _ in xrange(int(request.args['count'])):
            grafittis.append(Grafitti(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=grafittis,
                               oneliner=grafittis[0], titletext=titletext, generator='grafitti')
    else:
        grafitti = Grafitti(app.server, features)
        return render_template('oneliner.html', oneliner=grafitti, titletext=titletext, generator='grafitti')
コード例 #16
0
def generatebond():
    """Generate a bond"""

    features = feature_filter('bond')
    titletext = 'The Ties that Bind Us...'
    features['npc'] = NPC(app.server, {})
    if ('count' in request.args and valid_count(request.args['count'])):
        bonds = []
        for _ in xrange(int(request.args['count'])):
            bonds.append(Bond(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=bonds,
                               oneliner=bonds[0], titletext=titletext, generator='bond')
    else:
        bond = Bond(app.server, features)
        return render_template('oneliner.html', oneliner=bond, titletext=titletext, generator='bond')
コード例 #17
0
def generateevent():
    """Generate a event"""

    features = feature_filter('event')
    titletext = 'Look over there...'
    features['npc'] = NPC(app.server)
    if ('count' in request.args and valid_count(request.args['count'])):
        events = []
        for _ in xrange(int(request.args['count'])):
            events.append(Event(app.server, features))
            features['seed'] = set_seed()
        return render_template('oneliner.html', oneliners=events,
                               oneliner=events[0], titletext=titletext, generator='event')
    else:
        event = Event(app.server, features)
        return render_template('oneliner.html', oneliner=event, titletext=titletext, generator='event')