コード例 #1
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)
            ])
    })
コード例 #2
0
ファイル: living_room.py プロジェクト: ziv/adventure-poc
     opening_text=
     's soon as you raise the cross the ghast darts away from its light.\n'
     'You continue reciting prayer as you advance at the ever shrinking cloud of evil.\n'
     'As you finish the prayer the cross lets out a blinding light,\n'
     'the ghast shrieks and vanishes into thin air.',
     choices=[
         choices.ChoiceInspectRoom(
             text=
             'Move towards the iron gate at the far end of the room',
             scene='iron_gate'),
         choices.ChoiceNavigate('Go back to Entrance Hall',
                                level='level_1',
                                room='entrance_hall'),
     ],
     events=[
         events.UnlockJournal(entry.destroy_ghast),
         events.SetRoomFlagTrue('ghast_dead')
     ]),
 'ghast_illusion':
 interactions.thing.Thing(
     name='Ghast Illusion',
     opening_text=
     'The ghast charges at you yet you stand firmly, staring into its glowing eyes.\n'
     'As it reaches you it disperses into thin air. Nothing but an illusion.',
     choices=[
         choices.ChoiceInspectRoom(
             text=
             'Move towards the iron gate at the far end of the room',
             scene='iron_gate'),
         choices.ChoiceNavigate('Go back to Entrance Hall',
                                level='level_1',
コード例 #3
0
ファイル: grande_hall.py プロジェクト: ziv/adventure-poc
         choices.ChoiceInspectRoom(
             'burn with oil',
             'burn',
             conditions=[conditions.PlayerHasItem(item.flammable_oil)]),
     ],
 ),
 'cross':
 interactions.thing.Thing(
     name='Combat with Ghoul',
     opening_text='You raise you cross before the ghoul.\n'
     'He hisses and cowers away from the light.\n'
     'You advance towards him as his skin melts away,\n'
     'then this flesh until he crumbles into a pile of bones.',
     events=[
         events.SetRoomScreen('grande_hall'),
         events.UnlockJournal(entry.ghoul_defeated)
     ],
     choices=[choices.ChoiceBackToRoom('Observe the Grande Hall')],
 ),
 'crossbow':
 interactions.thing.Thing(
     name='Combat with Ghoul',
     opening_text=
     'Without hesitation you raise your crossbow and shoot a bolt straight into the gouls heart.\n'
     'The power of the blow sends him flying to his back where he lies motionless.',
     events=[
         events.SetRoomScreen('grande_hall'),
         events.UnlockJournal(entry.ghoul_defeated)
     ],
     choices=[choices.ChoiceBackToRoom('Observe the Grande Hall')],
 ),
コード例 #4
0
ファイル: laboratory.py プロジェクト: ziv/adventure-poc
 interactions.thing.Thing(
     name='Chemistry Apparatus',
     opening_text=
     'You turn a couple of valves and the fluids flow faster, filling up the end vial.\n'
     'You recognise the smell. This is nitroglycerin. You pocket the vial.',
     choices=[
         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'),
     ],
     events=[
         events.UnlockJournal(entry.make_nitro),
         events.AddItem(item.nitro),
         events.SetRoomFlagTrue('made_nitro'),
     ]),
 'lock_box':
 interactions.thing.Thing(
     name='Small Lock Box',
     opening_text=
     'You notice a small lock box sitting on a table. You rattle it and hear something inside.\n'
     'You smash the box open using the stock of your crossbow.\n'
     'Inside is a beautifully cut ruby the size of your fist.',
     choices=[
         choices.ChoiceInspectRoom(
             text='Chemistry Apparatus',
             scene='apparatus',
             conditions=[conditions.RoomFlagFalse('made_nitro')]),
コード例 #5
0
     ],
     events=[events.SetRoomScreen('Ashes')]),
 'ashes':
 interactions.thing.Thing(
     name='Pile of Ashes',
     opening_text=
     'You swipe the ashes with your boot and find what seems to be an engagement ring.\n'
     'It looks very valuable.',
     choices=[
         choices.ChoiceNavigate('Leave room',
                                level='level_1',
                                room='entrance_hall')
     ],
     events=[
         events.AddItem(item.engagement_ring),
         events.UnlockJournal(entry.acquired_ring)
     ]),
 'listen_to_zombie_1':
 interactions.thing.Thing(
     name='Listen To Zombie',
     opening_text=
     'As you come closer to the zombie his mumbles become clearer:\n'
     '"Mistress... Im sorry. I tried to run away... I shouldn\'t have tried to run away".\n'
     'He has two bite marks on his neck.',
     choices=[
         choices.ChoiceInspectRoom(
             text='Ask why he tried to run away',
             scene='listen_to_zombie_2',
         ),
         choices.ChoiceInspectRoom(
             text='Destroy zombie',
コード例 #6
0
ファイル: dining_room.py プロジェクト: ziv/adventure-poc
 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=[
             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'
コード例 #7
0
from game_code import interactions
from game_code.interactions.lib import choices, events
from game_code.objects import entry

entrance_hall = interactions.room.Room(
    name='Entrance Hall',
    opening_text='beyond the door is a circular wide room.\n'
    'The air is moldy and the floor is covered with dust.\n'
    'There are three doors leading away from the hall.',
    choices=[
        choices.ChoiceNavigate('Left Door',
                               level='level_1',
                               room='closet_room'),
        choices.ChoiceNavigate('Front Door',
                               level='level_1',
                               room='living_room'),
        choices.ChoiceNavigate('Right Door', level='level_1', room='kitchen'),
    ],
    events=[events.UnlockJournal(entry.cursed_dungeon)],
)