def get_target(self):
		for x in game_map.getEntitiesInPositions(game_map.getAdjacentTiles(self, self.vision)):
			if type(x) is Player:
				self.target = Vector(x.x, x.y)

		for x in game_map.getEntitiesInPositions(game_map.getAdjacentTiles(self, 2)):
			if type(x) is Player:
				self.attack(x)
    def get_target(self):
        for x in game_map.getEntitiesInPositions(
                game_map.getAdjacentTiles(self, self.vision)):
            if type(x) is Player:
                self.target = Vector(x.x, x.y)

        for x in game_map.getEntitiesInPositions(
                game_map.getAdjacentTiles(self, 2)):
            if type(x) is Player:
                self.attack(x)
	def update(self):
		self.get_target()

		if self.SP > 16:
			self.move()

		self.SP += 3
		print('rat SP:', self.SP)
		
		for x in game_map.getEntitiesInTiles(game_map.getAdjacentTiles(self, 1)):
			if type(x) is Player:
				self.attack(x)

			if hasattr(x, 'edible') and self.hunger > 5:
				self.eat(x)
    def update(self):
        self.get_target()

        if self.SP > 16:
            self.move()

        self.SP += 3
        print('rat SP:', self.SP)

        for x in game_map.getEntitiesInTiles(game_map.getAdjacentTiles(
                self, 1)):
            if type(x) is Player:
                self.attack(x)

            if hasattr(x, 'edible') and self.hunger > 5:
                self.eat(x)
 def lookForFood(self):
     for x in game_map.getEntitiesInTiles(
             game_map.getAdjacentTiles(self, self.vision)):
         if hasattr(x, 'edible'):
             self.target = x
	def lookForFood(self):
		for x in game_map.getEntitiesInTiles(game_map.getAdjacentTiles(self, self.vision)):
			if hasattr(x, 'edible'):
				self.target = x