def hit_with(player, item): if player.location.has(self): if item.name == 'Axe' and player.has( item) and not self.game.has_item('Wooden Stakes'): player.location.add_item(WoodenStakes(self.game)) player.location.remove_item(self) return Result(player.location.do('look')) return Result('Nothing happened\n') return Result("I don't see any Crate")
def look(player: Player) -> Result: if item is None: description = player.location.description else: description = item.description if description is None: description = 'You see nothing special' return Result(description)
def hit(player): if player.location.has(self): return Result(' -- With what? ', next_action=Action(hit_with)) else: return Result("I don't see any Crate")
def push(player): player.location.connect_to( player.game.places.lookup('Hidden Corridor'), direction=directions.down) return CompoundResult(Result('Aha! - You have revealed a Doorway'), LookAction().execute(player))
def inventory(player: Player) -> Result: return Result(f'You are carrying: {player.inventory_list_text}')
def drop(player: Player) -> Result: player.drop(item) return Result( f'The {item.name} is on the {player.location.name} floor')
def get(player: Player) -> Result: player.get(item) return Result(f'OK, you got the {item.name}')