#NEWLINE# def affect( target , effect_spec ) : #NEWLINE# #INDENT# '\n    Triggers an effect on target\n\n    :param target: target of the effect\n    :type target: Character\n    :param effect_spec: effect specification\n    :type effect_spec: {}\n    ' #NEWLINE# effect_type = effect_spec [ 'effect_type' ] #NEWLINE# del effect_type [ 'effect_type' ] #NEWLINE# effect_spec [ 'target' ] = target #NEWLINE# new_effect = effect_type ( ** effect_spec ) #NEWLINE# add_history_value ( target , 'hit_points' ) #NEWLINE# new_effect . trigger ( Dying ( ) )