Example #1
0
 def drop(self, inventory, owner, mes=True):
     # add to the map and remove from the owners inventory.
     # also, place it at the owners coordinates
     self.owner.objects.append(self.owner)
     inventory.remove(self.owner)
     self.owner.x = owner.x
     self.owner.y = owner.y
     # only display a message if the player dropped it, or if its special
     if mes:
         msg = menu.color_text("%s dropped a " % owner.name.capitalize(), libtcod.yellow)
         msg += menu.color_text(self.owner.name, self.owner.color)
         msg += menu.color_text(".", libtcod.yellow)
         self.owner.message.message(msg, 0)  # owner.name.capitalize()+' dropped a ' + self.owner.name + '.',3)
Example #2
0
 def drop(self,inventory,owner,mes=True):
     #add to the map and remove from the owners inventory. 
     #also, place it at the owners coordinates
     self.owner.objects.append(self.owner)
     inventory.remove(self.owner)
     self.owner.x = owner.x
     self.owner.y = owner.y
     #only display a message if the player dropped it, or if its special
     if mes:
         msg = menu.color_text('%s dropped a '%owner.name.capitalize(),libtcod.yellow)
         msg+= menu.color_text(self.owner.name,self.owner.color)
         msg+= menu.color_text('.',libtcod.yellow)
         self.owner.message.message(msg,0)#owner.name.capitalize()+' dropped a ' + self.owner.name + '.',3)
Example #3
0
 def pick_up(self,inventory):
     #add to the player's inventory and remove from the map
     if not self.owner.misc:
         if len(inventory) >= 26:
             msg = menu.color_text('Your inventory is full, cannot pick up ',libtcod.yellow)
             msg+= menu.color_text(self.owner.name,self.owner.color)
             msg+= menu.color_text('.',libtcod.yellow)
             self.owner.message.message(msg,0)#'Your inventory is full, cannot pick up ' + self.owner.name + '.', 3)
         else:
             inventory.append(self.owner)
             self.owner.objects.remove(self.owner)
             msg = menu.color_text('You picked up a ',libtcod.yellow)
             msg+= menu.color_text(self.owner.name,self.owner.color)
             msg+= menu.color_text('!',libtcod.yellow)
             self.owner.message.message(msg,0)#'You picked up a ' + self.owner.name + '!',3)
Example #4
0
 def pick_up(self, inventory):
     # add to the player's inventory and remove from the map
     if not self.owner.misc:
         if len(inventory) >= 26:
             msg = menu.color_text("Your inventory is full, cannot pick up ", libtcod.yellow)
             msg += menu.color_text(self.owner.name, self.owner.color)
             msg += menu.color_text(".", libtcod.yellow)
             self.owner.message.message(
                 msg, 0
             )  #'Your inventory is full, cannot pick up ' + self.owner.name + '.', 3)
         else:
             inventory.append(self.owner)
             self.owner.objects.remove(self.owner)
             msg = menu.color_text("You picked up a ", libtcod.yellow)
             msg += menu.color_text(self.owner.name, self.owner.color)
             msg += menu.color_text("!", libtcod.yellow)
             self.owner.message.message(msg, 0)  #'You picked up a ' + self.owner.name + '!',3)