예제 #1
0
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions
from game_code.objects import item, entry

closet_room = interactions.room.Room(
    name='Closet Room',
    opening_text='The smell of wet leather fills the air.\n'
    'Before you are a few vacant coat hangers and a rotting wooden closet.',
    choices=[
        choices.ChoiceInspectRoom('Search the closet',
                                  'closet',
                                  conditions=[conditions.OnlyOnce()]),
        choices.ChoiceNavigate('Leave room',
                               level='level_1',
                               room='entrance_hall'),
    ],
    scenes={
        'closet':
        interactions.thing.Thing(
            name='Closet',
            opening_text='As you open the closet a cloud of moths fly out,\n'
            'a few stinking leather coats hang on frail hooks.\n'
            'You search the pockets and eventually find a key',
            events=[
                events.AddItem(item.iron_key),
                events.UnlockJournal(entry.found_a_key)
            ])
    })
예제 #2
0
living_room = interactions.room.Room(
    name='Living Room',
    opening_text='The old wooden door is barely hanging by one bent hinge,\n'
    'you push it ever so slightly and it falls flat on the chamber floor producing a loud thud\n'
    'and sending a cloud of dust that fills the air. As soon as you take one step,\n'
    'the dust fog forms into a ghastly image\n'
    'releasing a foul scream and charging at you with horrid intent!',
    future_text='The old wooden door is barely hanging by one bent hinge',
    room_flags={'ghast_dead': False},
    choices=[
        choices.ChoiceInspectRoom(
            text=
            'Hold your holy cross firmly before the ghost and recite a banishment prayer!',
            scene='ghast_destroyed',
            conditions=[
                conditions.OnlyOnce(),
                conditions.RoomFlagFalse('ghast_dead'),
                conditions.PlayerHasItem(item.holy_cross)
            ],
        ),
        choices.ChoiceInspectRoom(
            text=
            'Stand your ground. There is nothing to fear. God is on your side.',
            scene='ghast_illusion',
            conditions=[
                conditions.OnlyOnce(),
                conditions.RoomFlagFalse('ghast_dead')
            ],
        ),
        choices.ChoiceInspectRoom(
            text='Go to the Iron Gate',
예제 #3
0
 ],
 scenes={
     'table': interactions.thing.Thing(
         name='Table',
         opening_text='After observing the table from all sides you decide to take a look underneath.\n'
                      'You lift the silken table cloth to find an inscription carved into one of the legs\n'
                      '"Fortunes close. Masked by time"',
         future_text='The inscription carved into one of the legs reads: "Fortunes close. Masked by time"',
         events=[events.UnlockJournal(entry.examine_table)]
     ),
     'hidden_door': interactions.thing.Thing(
         name='Hidden Door',
         opening_text='The clock mechanism seems to have revealed a hidden door.\n'
                      'Perhaps it will lead to something of worth.',
         choices=[
             choices.ChoiceInspectRoom('Open the Door', 'treasure_room', conditions=[conditions.OnlyOnce()]),
             choices.ChoiceNavigate('Leave room', level='level_2', room='grande_hall'),
         ],
     ),
     'treasure_room': interactions.thing.Thing(
         name='Treasure Room',
         opening_text='The door opens to reveal a treasure room. A large iron chest is chained to the floor.\n'
                      'A heavy lock seals the chest.\n'
                      'As you examine the lock the shadows around you form into a fiend made of black\n'
                      '"WHERE IS MY RING?!!" he shrieks loudly.',
         choices=[
             choices.ChoiceInspectRoom('Attack the Shadow', 'shadow_combat'),
             choices.ChoiceInspectRoom('Robert is that you?', 'robert',
                                       conditions=[conditions.OnlyOnce(), conditions.GameFlagTrue('robert')]),
         ],
     ),