#NEWLINE# def sell_item_from_inventory( self ) : #NEWLINE# #INDENT# '\n        Allow player to sell item to shop.\n        ' #NEWLINE# item_price = self . item_to_be_sold [ 'price' ] #NEWLINE# item_name = self . item_to_be_sold [ 'type' ] #NEWLINE# if ( item_name in self . weapon_list ) : #NEWLINE# #INDENT# if ( item_name == self . game_data [ 'player inventory' ] [ 'equipped weapon' ] ) : #NEWLINE# #INDENT# self . state = 'cantsellequippedweapon' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . notify ( c . CLOTH_BELT ) #NEWLINE# self . sell_inventory_data_adjust ( item_price , item_name ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( item_name in self . armor_list ) : #NEWLINE# #INDENT# if ( item_name in self . game_data [ 'player inventory' ] [ 'equipped armor' ] ) : #NEWLINE# #INDENT# self . state = 'cantsellequippedarmor' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . notify ( c . CLOTH_BELT ) #NEWLINE# self . sell_inventory_data_adjust ( item_price , item_price ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . notify ( c . CLOTH_BELT ) #NEWLINE# self . sell_inventory_data_adjust ( item_price , item_name )