#NEWLINE# @ log_debug #NEWLINE# def check_dying( self , character ) : #NEWLINE# #INDENT# '\n        Check if character dies and process it\n        ' #NEWLINE# if ( not character . level ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( character . hit_points <= 0 ) : #NEWLINE# #INDENT# for item in character . inventory : #NEWLINE# #INDENT# character . inventory . remove ( item ) #NEWLINE# add_item ( character . level , character . location , item ) #NEWLINE# character . raise_event ( new_drop_event ( character , item ) ) #NEWLINE# #UNINDENT# if ( character . inventory . weapon is not None ) : #NEWLINE# #INDENT# add_item ( character . level , character . location , character . inventory . weapon ) #NEWLINE# character . raise_event ( new_drop_event ( character , item ) ) #NEWLINE# character . inventory . weapon = None #NEWLINE# #UNINDENT# if ( character == character . model . player ) : #NEWLINE# #INDENT# character . model . end_condition = DIED_IN_DUNGEON #NEWLINE# #UNINDENT# character . raise_event ( new_death_event ( deceased = character ) ) #NEWLINE# remove_character ( character . level , character )