def death():
	_player = LIFE[SETTINGS['controlling']]
	
	maps.reset_lights()
	FADE_TO_WHITE[0] += .5
	
	_time_since_death = FADE_TO_WHITE[0]
	_time_alive = round(numbers.clip((_player['time_of_death']-_player['created'])/float(WORLD_INFO['length_of_day']), 0.1, 9999), 2)
	_string = 'You die.'
	_sub_string = _player['cause_of_death']
	_col = int(round(255*numbers.clip((_time_since_death/100.0)-random.uniform(0, 0.15), 0, 1)))
	
	
	if _time_alive == 1:
		_sub_sub_string = 'Lived 1 day'
	else:
		if _time_alive < 1:
			_sub_sub_string = 'Lived less than a day'
		else:
			_sub_sub_string = 'Lived %0.1f days' % (_time_alive)
	
	gfx.fade_to_black(1)	
	
	gfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_string)/2,
	                MAP_WINDOW_SIZE[1]/2,
	                _string,
	                'map',
	                fore_color=tcod.Color(_col, 0, 0),
	                back_color=tcod.Color(0, 0, 0))
	
	gfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_sub_string)/2,
	                (MAP_WINDOW_SIZE[1]/2)+2,
	                _sub_string,
	                'map',
	                fore_color=tcod.Color(int(round(_col*.75)), int(round(_col*.75)), int(round(_col*.75))),
	                back_color=tcod.Color(0, 0, 0))
	
	gfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_sub_sub_string)/2,
	                (MAP_WINDOW_SIZE[1]/2)+4,
	                _sub_sub_string,
	                'map',
	                fore_color=tcod.Color(int(round(_col*.75)), int(round(_col*.75)), int(round(_col*.75))),
	                back_color=tcod.Color(0, 0, 0))
	
	if _time_since_death>=350:
		worldgen.save_world()
		worldgen.reset_world()

		gfx.clear_scene()
		
		SETTINGS['running'] = 1
		return False
	
	return True
dataset/ETHPy150Open flags/Reactor-3/reactor-3.py/death/original