Пример #1
0
SHINE = Behave('shine', '@cosmos', direct='@visitor')
SHINE.after = """

[now] they [drive/2/v] cars, seeking flatpacks across the sprawl

once they were supposed to cluster [here]

[@visitor/s] [arrive/ed/v], visitor to this place where [@visitor/s] briefly 
lived years ago, where [@visitor/s] knew spaces and faces now almost forgotten

there is one [here] less lost to you than the others, though, and it [is/1/v] 
right [here] in this plaza, about [now], that [@visitor/s] [are/v] to meet him

somewhere right around [here]"""

SEE_PLAZA = Sense('see', '@visitor', direct='@plaza_center', modality='sight')

initial_actions = [SHINE, SEE_PLAZA]


class Distance_Filter:
    'Increases narrative distance by changing to less immediate styles.'

    def __init__(self, how_far):
        self.suffixes = [
            ', apparently ', ', evidently', ', or so it seemed',
            ', if memory serves', ', perhaps'
        ]
        self.prefixes = [
            'it seemed that', 'it appeared that', 'it looked like',
            'it was as if', 'no doubt,'
Пример #2
0
COUNT_SLIPS = Behave('count', '@teller', direct='@slips')
DON_MASK = Configure('wear', '@robber', direct='@mask', new=('on', '@robber'),
    template='[agent/s] [put/v] on [direct/o]')
TYPE = Behave('type', '@teller')
PLAY = Behave('play', '@teller',
    template="[agent/s] [play/v] Solitaire a bit on [agent's] computer")
ROBBER_TO_LOBBY = Behave('leave', '@robber',
    template='[agent/s] [leave/v] the street',
    direct='@robber', direction='in')
WAVE = Behave('wave', '@teller', target='@robber',
    template='[agent/s] [wave/v] to [direct/o]')
BRANDISH = Behave('brandish', '@robber', target='@teller', indirect='@fake_gun',
    template='[agent/s] [brandish/v] [indirect/o] at [direct/o]')
LAUGH = Behave('laugh', '@teller')
WAKE = Behave('wake', '@guard')
SEE_ROBBER = Sense('see', '@guard', direct='@robber', modality='sight')
GUARD_TO_LOBBY = Behave('leave', '@guard',
    template='[agent/s] [leave/v] the guard post',
    direct='@guard', direction='out')
BAG_FAKE = Configure('put', '@teller', direct='@fake_money', new=('in', '@bag'),
    template='[agent/s] [put/v] [direct/o] in [@bag/o]')
TURN = Behave('turn', '@robber', target='@guard',
    template = '[agent/s] [turn/v] to [direct/o]')
SHOOT_1 = Behave('shoot', '@guard', target='@robber',
    template='[agent/s] [shoot/v] [direct/o] in the chest')
SHOOT_2 = Behave('shoot', '@guard', target='@robber',
    template='[agent/s] [shoot/v] [direct/o] in the chest')
FALL = Behave('fall', '@robber')
DIE = Behave('die', '@robber')
CRY = Behave('cry', '@teller')
Пример #3
0
        'narratee': '@person',
        'known_directions': True
    }
}

ARRIVE = Behave('arrive',
                '@person',
                template="""
                hurrying through the rainswept November night, [@person/s] 
                [are/v] glad to see the bright lights of the Opera House""",
                indirect='@foyer')
ARRIVE.after = """it [is/1/v] surprising that there [are/not/2/v] more people 
               about but, hey, what should [@person/s] expect in a cheap demo 
               game?"""

LOOK_AROUND = Sense('see', '@person', direct='@foyer', modality='sight')

initial_actions = [ARRIVE, LOOK_AROUND]


class ScrawledMessage(Thing):
    def __init__(self, tag, **keywords):
        self.intact = True
        Thing.__init__(self, tag, **keywords)

    def react(self, world, basis):
        actions = []
        if (basis.sense and basis.direct == '@message'
                and basis.modality == 'sight'):
            sigh = Behave('sigh', basis.agent)
            sigh.final = True
Пример #4
0
def touch(agent, tokens, _):
    'to come in contact with; to extend the hand so as to reach and feel'
    return Sense('touch', agent, direct=tokens[1], modality='touch')
Пример #5
0
def taste(agent, tokens, _):
    'to perceive by the sense of taste, by sampling a small bit'
    return Sense('taste', agent,
                 template='[agent/s] [taste/v] [direct/o]',
                 direct=tokens[1], modality='taste')
Пример #6
0
def smell_of(agent, tokens, _):
    'to perceive something by the sense of smell'
    return Sense('smell', agent,
                 template='[agent/s] [smell/v] [direct/o]',
                 direct=tokens[1], modality='smell')
Пример #7
0
def look_at(agent, tokens, _):
    'to inspect something carefully, visually'
    return Sense('examine', agent,
                 template='[agent/s] [look/v] at [direct/o]',
                 modality='sight', direct=tokens[1])
Пример #8
0
def listen_to(agent, tokens, _):
    'to give close attention to something specified with the purpose of hearing'
    return Sense('hear', agent,
                 template='[agent/s] [listen/v] to [direct/o]',
                 direct=tokens[1], modality='hearing')