コード例 #1
0
ファイル: living_room.py プロジェクト: ziv/adventure-poc
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',
コード例 #2
0
ファイル: statue_room.py プロジェクト: ziv/adventure-poc
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions, scene
from game_code.objects import item, entry

statue_room = interactions.room.Room(
    name='Statue Room',
    opening_text='You go through the passage and enter an oval room filled with statues.\n'
                 'At the far end there is a large statue of a gargoyle.\n'
                 'As you approach the gargoyle, his eyes light up in green flames and he issues a warning:\n'
                 '"Only the head of the estate may pass".',
    room_flags={'retreated': False},
    choices=[
        choices.ChoiceInspectRoom('Present Robert\'s head', scene='head',
                                  conditions=[conditions.PlayerHasItem(item.head)]),
        choices.ChoiceInspectRoom('Fight the Gargoyle', scene='fight2'),
        choices.ChoiceNavigate('Leave room', level='level_2', room='grande_hall'),
    ],
    screens={
        'clear': scene.Screen(
            title='Statue Room',
            text='You go through the passage and enter an oval room filled with statues.\n'
                 'at the end is a stone archway and a staircase leading down.',
            choices=[
                choices.ChoiceNavigate('Descend through the stone arch', level='level_3', room='temple_room'),
                choices.ChoiceNavigate('Go back to the Grande Hall', level='level_2', room='grande_hall'),
            ],
        )
    },
    scenes={
        'head': interactions.thing.Thing(
            name='Mirror',
コード例 #3
0
ファイル: closet_room.py プロジェクト: ziv/adventure-poc
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)
            ])
    })
コード例 #4
0
ファイル: temple_room.py プロジェクト: ziv/adventure-poc
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions, scene
from game_code.objects import item, entry

temple_room = interactions.room.Room(
    name='Temple Room',
    opening_text=
    'The stairs open to a large hall. In the center is a dark altar, a headless body rots on top.\n'
    'Several pillars sorround the altar and at the far end are large stone steps\n'
    'leading up to a decorated door, a few burning brassiers light the room.\n'
    'Scattered on the steps are several demonic imps, biding their time. Probably "guard dogs".',
    # todo: @alon should there be sort of extra "room" for the steps,
    # todo: where you can go to the steps to interact with the imps later?
    choices=[
        # todo: @alon if not approach the imps, go back?
        choices.ChoiceInspectRoom('Approach the imps.', 'imps'),
        # choices.ChoiceInspectRoom('Attack Ghoul', 'attack'),
    ],
    scenes={
        'imps':
        interactions.thing.Thing(
            name='Temple Room',
            opening_text=
            'As you come closer the imps all band together to face you.\n'
            'They are cowardly creatures, full of greed and sin.',
            # todo: @alon can we only haggle if we got the coins from the treasure before?
            choices=[
                choices.ChoiceInspectRoom('Offer a gold coin', 'haggle'),
                choices.ChoiceInspectRoom('Destroy the foul beasts!',
                                          'fight_imps'),
            ],
コード例 #5
0
ファイル: grande_hall.py プロジェクト: ziv/adventure-poc
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions, scene
from game_code.objects import item, entry

grande_hall = interactions.room.Room(
    name='Grande Hall',
    opening_text=
    'You descend down the stairs into a grande hall. Before you stands a well dressed ghoul.\n'
    'He is busy sweeping the floor when he lifts his gaze and notices you.\n'
    'His croaking voice mutters: "ah, a visitor."',
    choices=[
        choices.ChoiceInspectRoom('Speak with the Ghoul', 'speak'),
        choices.ChoiceInspectRoom('Attack Ghoul', 'attack'),
    ],
    room_flags={'clock_changed': False},
    screens={
        'grande_hall':
        scene.Screen(
            title='Grande Hall',
            text=
            'Four doors lead away from the chamber, there is an old wooden clock standing on the left.',
            choices=[
                choices.ChoiceNavigate('Dining Room',
                                       level='level_2',
                                       room='dining_room'),
                choices.ChoiceNavigate('Library',
                                       level='level_2',
                                       room='library'),
                choices.ChoiceNavigate('Laboratory',
                                       level='level_2',
                                       room='laboratory'),
コード例 #6
0
ファイル: bedroom.py プロジェクト: ziv/adventure-poc
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions, scene
from game_code.objects import item, entry

bedroom = interactions.room.Room(
    name='Bedroom',
    opening_text=
    'You enter a lavish bedroom, but instead of a bed there is a large and beautiful coffin.\n'
    'A vampire must certainly live here, the velvet lining on the coffin makes you certain.\n'
    'A towering mirror is attached to the wall.',
    choices=[
        choices.ChoiceInspectRoom(text='Examine the mirror', scene='mirror'),
        choices.ChoiceNavigate('Leave room',
                               level='level_2',
                               room='grande_hall'),
    ],
    screens={
        'revealed':
        scene.Screen(
            title='Bedroom',
            text=
            'You enter a lavish bedroom, but instead of a bed there is a large and beautiful coffin.\n'
            'A vampire must certainly live here, the velvet lining on the coffin makes you certain.\n'
            'A stone passage leads to a Statue Room where a mirror used to be',
            choices=[
                choices.ChoiceNavigate('Enter the Statue room',
                                       level='level_2',
                                       room='statue_room'),
                choices.ChoiceNavigate('Leave room',
                                       level='level_2',
                                       room='grande_hall'),
コード例 #7
0
ファイル: laboratory.py プロジェクト: ziv/adventure-poc
from game_code.interactions.lib import choices, events, conditions, scene
from game_code.objects import item, entry

laboratory = interactions.room.Room(
    name='Laboratory',
    opening_text=
    'As you enter the room it seems different. This room has seen recent use.\n'
    'A number of pipes and cauldrons are placed on burning coals.\n'
    'A chemistry apparatus next to the door is boiling strange fluids. This is a laboratory.',
    room_flags={
        'lock_box_broken': False,
        'made_nitro': False
    },
    choices=[
        choices.ChoiceInspectRoom(
            text='Chemistry Apparatus',
            scene='apparatus',
            conditions=[conditions.RoomFlagFalse('made_nitro')]),
        choices.ChoiceInspectRoom(
            text='Little Lock Box',
            scene='lock_box',
            conditions=[conditions.RoomFlagFalse('lock_box_broken')]),
        choices.ChoiceNavigate('Leave room',
                               level='level_2',
                               room='grande_hall'),
    ],
    scenes={
        'apparatus':
        interactions.thing.Thing(
            name='Chemistry Apparatus',
            opening_text=
            'On the main stone table there is an elaborate chemistry apparatus.\n'
コード例 #8
0
         text='You walk into what used to be a marvelous kitchen.\n'
         'Cobwebs and dust cover every part of the room.\n'
         'On the floor before you lies pile of ashes where a zombie used to be.'
     ),
     'gore':
     scene.Screen(
         title='Kitchen',
         text='You walk into what used to be a marvelous kitchen.\n'
         'Cobwebs and dust cover every part of the room.\n'
         'On the floor before you lies a zombie with its guts everywhere.'),
 },
 room_flags={'zombie_dead': False},
 choices=[
     choices.ChoiceInspectRoom(text='Kneel next to the zombie and listen.',
                               scene='listen_to_zombie_1',
                               conditions=[
                                   conditions.OnlyOnce(),
                                   conditions.RoomFlagFalse('zombie_dead')
                               ]),
     choices.ChoiceInspectRoom(
         text='Destroy this creature and relieve him from his torment.',
         scene='destroy_zombie',
         conditions=[
             conditions.OnlyOnce(),
             conditions.RoomFlagFalse('zombie_dead')
         ]),
     choices.ChoiceNavigate('Leave room',
                            level='level_1',
                            room='entrance_hall'),
 ],
 scenes={
     'destroy_zombie':
コード例 #9
0
ファイル: dining_room.py プロジェクト: ziv/adventure-poc
from game_code import interactions
from game_code.interactions.lib import choices, events, conditions
from game_code.objects import item, entry


dining_room = interactions.room.Room(
    name='Dining Room',
    opening_text='You enter the dining room. A long marble table runs the length of the decorated chamber.\n'
                 'Carved wooden chairs surround the table on both sides.',
    room_flags={'found_treasure': False, 'door_open': False, 'shoot': False, 'water': False},
    choices=[
        choices.ChoiceInspectRoom('Examine the Table', 'table'),
        choices.ChoiceInspectRoom('Hidden Door', 'hidden_door',
                                  conditions=[conditions.RoomFlagTrue('door_open'),
                                              conditions.RoomFlagFalse('found_treasure')]),
        choices.ChoiceNavigate('Leave room', level='level_2', room='grande_hall'),
    ],
    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=[
コード例 #10
0
 'You walk up the stone steps towards the decorated door. the source of this evil lurks so closely.\n'
 'You push the heavy iron door and enter the inner cloister.\n'
 'The room is smaller than the temple but is full of lavish items and beautiful paintings.\n'
 'various pagan emblems are hanging from the walls.In the center of the room,\n'
 'on a royal throne sits mistress. A lofty smirk curves on her decaying face.\n'
 '"Welcome... Holy man.."',
 room_flags={
     'speak_robert': False,
     'speak_zombie': False,
     'speak_mistress': False,
     'speak_curse': False,
     'crossbow_loaded': True,
     'shots_fired': False
 },
 choices=[
     choices.ChoiceInspectRoom('mistress', 'mistress'),
 ],
 scenes={
     'mistress':
     interactions.thing.Thing(
         name='Mistress',
         opening_text=
         'Her long black hair is perfectly brushed, yellow slit eyes softly glow as she measures you.\n'
         'A tight velvet dress clings to her frail stature. Her beauty is unquesitonable,\n'
         'But you know better than to lower your guard before a vampire.',
         choices=[
             choices.ChoiceInspectRoom('Vanquish evil! Fight mistress',
                                       'fight'),
             choices.ChoiceInspectRoom(
                 'there must be more to this...Speak with mistress',
                 'speak'),