コード例 #1
0
ファイル: statue_room.py プロジェクト: ziv/adventure-poc
                                          conditions=[conditions.PlayerHasItem(item.nitro)]),
                choices.ChoiceNavigate('Retreat to the Grande Hall', level='level_2', room='grande_hall',
                                       scene='gargoyle_fight')
            ],
            events=[events.RemoveItem(item.flammable_oil)]
        ),
        'fight_nitro': interactions.thing.Thing(
            name='Gargoyle attacks!',
            opening_text='You toss the vial of nitroglycerin and duck for cover\n'
                         'as a large explosion sends debris in all directions.',
            choices=[
                choices.ChoiceInspectRoom('Wait for the dust to settle', scene='gargoyle_defeated'),
            ],
            events=[events.RemoveItem(item.nitro)]
        ),
        'gargoyle_defeated': interactions.thing.Thing(
            name='Gargoyle Defeated!',
            opening_text='When the dust settles, where the gargoyle once was there but a pile of rubble.\n'
                         'The path is cleared.',
            choices=[
                choices.ChoiceNavigate('Descend through the stone arch', level='level_3', room='temple_room',
                                       conditions=[conditions.RoomFlagFalse('retreated')]),
                choices.ChoiceNavigate('Go back to the Grande Hall', level='level_2', room='grande_hall',
                                       conditions=[conditions.RoomFlagFalse('retreated')]),
                choices.ChoiceBackToRoom('Back to the Statue Room', conditions=[conditions.RoomFlagTrue('retreated')]),
            ],
            events=[events.SetRoomScreen('clear')]
        )
    }
)
コード例 #2
0
ファイル: living_room.py プロジェクト: ziv/adventure-poc
 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',
         scene='iron_gate',
コード例 #3
0
ファイル: grande_hall.py プロジェクト: ziv/adventure-poc
             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'),
             choices.ChoiceNavigate('Bedroom',
                                    level='level_2',
                                    room='bedroom'),
             choices.ChoiceInspectRoom(
                 'Wooden Clock',
                 'clock',
                 conditions=[conditions.RoomFlagFalse('clock_changed')]),
             choices.ChoiceInspectRoom(
                 'Wooden Clock',
                 'clock_changed',
                 conditions=[conditions.RoomFlagTrue('clock_changed')]),
             choices.ChoiceNavigate('Go back to the living room',
                                    level='level_1',
                                    room='living_room'),
         ]),
 },
 scenes={
     # ghoul scenes
     'attack':
     interactions.thing.Thing(
         name='Combat with Ghoul',
         opening_text='Choose your weapon',
コード例 #4
0
ファイル: laboratory.py プロジェクト: ziv/adventure-poc
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'
            'Various glass pipes dripping along and mixing slowly.',
コード例 #5
0
         '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':
     interactions.thing.Thing(
コード例 #6
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=[
コード例 #7
0
 'speak':
 interactions.thing.Thing(
     name='Mistress',
     opening_text=
     'You bow gracefully while maintaining eye contact. Mistress nods politely.\n'
     '"I assume you slaughtered my minions on your way here?"\n'
     '"Yes I have."\n'
     '"Even my pets?"\n'
     '"If you mean the imps, they have been sent back from whence they came."\n'
     '"Yet you stand before me looking for answers. What is it then?"',
     prompt='What do you wish to ask?',
     choices=[
         choices.ChoiceInspectRoom(
             'Tell about robert',
             'speak_robert',
             conditions=[conditions.RoomFlagFalse('speak_robert')]),
         choices.ChoiceInspectRoom(
             'Iv encountered a zombie up in the kitchen',
             'speak_zombie',
             conditions=[conditions.RoomFlagFalse('speak_zombie')]),
         choices.ChoiceInspectRoom(
             'What do you hope to achieve?',
             'speak_mistress',
             conditions=[conditions.RoomFlagFalse('speak_mistress')]),
         choices.ChoiceInspectRoom(
             'Iv been told that this place is cursed',
             'speak_curse',
             conditions=[conditions.RoomFlagFalse('speak_curse')]),
     ],
 ),
 'speak_robert':