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
def impl(context, character_name, delta, armour_name): character = get_character(context, character_name) armour = get_item(context, armour_name) if delta == 'slower': assert_that(character.tick, is_(greater_than(character.speed * Duration.fast))) elif delta == 'faster': assert_that(character.tick, is_(less_than(character.speed * Duration.fast))) else: assert False
def impl(context, character_name, weapon_name): character = get_character(context, character_name) weapon = get_item(context, weapon_name) assert_that(character.tick, is_(greater_than(character.speed * Duration.normal)))
def step_impl(context, caster_name, item_name, domain_name): caster = get_character(context, caster_name) item = get_item(context, item_name) make(caster, gain_domain_(item=item, domain=domain_name))
def impl(context, item_name, character_name): item = get_item(context, item_name) character = get_character(context, character_name) assert item.location == character.location
def impl(context, character_name, item_name): character = get_character(context, character_name) item = get_item(context, item_name) make(character, drop(item))