예제 #1
0
 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")
예제 #2
0
 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)
예제 #3
0
 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")
예제 #4
0
 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))
예제 #5
0
 def inventory(player: Player) -> Result:
     return Result(f'You are carrying: {player.inventory_list_text}')
예제 #6
0
 def drop(player: Player) -> Result:
     player.drop(item)
     return Result(
         f'The {item.name} is on the {player.location.name} floor')
예제 #7
0
 def get(player: Player) -> Result:
     player.get(item)
     return Result(f'OK, you got the {item.name}')