Пример #1
0
def impl(context, item_name, location_name):
    if 'inventory' in location_name:
        (word1, word2, character_name) = location_name.split(' ')
        item = get_item(context, item_name)
        character = get_character(context, character_name)

        assert item not in character.inventory
    else:
        item = get_item(context, item_name)
        room = get_location(context, location_name)

        assert item.level != room
Пример #2
0
def impl(context, item_name, location_name):
    if 'inventory' in location_name:
        (word1, word2, character_name) = location_name.split(' ')
        item = get_item(context, item_name)
        character = get_character(context, character_name)

        assert item not in character.inventory
    else:
        item = get_item(context, item_name)
        room = get_location(context, location_name)

        assert item.level != room
Пример #3
0
def impl(context, character_name, location_name):
    character = get_character(context, character_name)
    place = get_location(context, location_name)

    path, connections, updated = a_star(whole_level,
                                        character.location, #TODO: adjacent nodes as first param
                                        place.location,
                                        character.level)
    assert len(path) > 1

    for tile in path[1:]:
        direction = find_direction(character.location,
                                   tile)
        pyherc.vtable['\ufdd0:move'](character,
                                     direction)
Пример #4
0
def impl(context, character_name, place_name):
    character = get_character(context, character_name)
    place = get_location(context, place_name)

    assert_that(character, is_not(is_in(place['\ufdd0:characters'])))
Пример #5
0
def impl(context, portal_name, location_name):
    place = get_location(context, location_name)
    portal = get_location(context, portal_name)

    add_portal(place, (2, 2), portal, None)
Пример #6
0
def impl(context, portal_name):
    portal = get_location(context, portal_name)

    portal.exits_dungeon = True