#NEWLINE# def generate_world( source_map , dynamic_spawns = 'Sparse' , wildlife_spawns = 'Sparse' , simulate_ticks = 1000 , combat_test = False , save = True , thread = True ) : #NEWLINE# #INDENT# WORLD_INFO [ 'inittime' ] = time . time ( ) #NEWLINE# WORLD_INFO [ 'start_age' ] = simulate_ticks #NEWLINE# WORLD_INFO [ 'dynamic_spawns' ] = dynamic_spawns #NEWLINE# WORLD_INFO [ 'wildlife_spawns' ] = wildlife_spawns #NEWLINE# WORLD_INFO [ 'real_time_of_day' ] = int ( round ( ( WORLD_INFO [ 'length_of_day' ] * 0.1 ) ) ) #NEWLINE# WORLD_INFO [ 'seed' ] = time . time ( ) #NEWLINE# WORLD_INFO [ 'combat_test' ] = combat_test #NEWLINE# WORLD_INFO [ 'title' ] = ( 'Operation %s' % language . generate_scheme_title ( ) . title ( ) ) #NEWLINE# random . seed ( WORLD_INFO [ 'seed' ] ) #NEWLINE# if ( WORLD_INFO [ 'dynamic_spawns' ] == 'Sparse' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'dynamic_spawn_interval' ] = [ 350 , ( 1000 , 1200 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( WORLD_INFO [ 'dynamic_spawns' ] == 'Medium' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'dynamic_spawn_interval' ] = [ 350 , ( 800 , 999 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( WORLD_INFO [ 'dynamic_spawns' ] == 'Heavy' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'dynamic_spawn_interval' ] = [ 350 , ( 600 , 799 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# WORLD_INFO [ 'dynamic_spawn_interval' ] = [ ( - 1 ) , ( 600 , 799 ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( WORLD_INFO [ 'wildlife_spawns' ] == 'Sparse' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'wildlife_spawn_interval' ] = [ 2500 , ( 770 , 990 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( WORLD_INFO [ 'wildlife_spawns' ] == 'Medium' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'wildlife_spawn_interval' ] = [ 2500 , ( 550 , 700 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( WORLD_INFO [ 'wildlife_spawns' ] == 'Heavy' ) : #NEWLINE# #INDENT# WORLD_INFO [ 'wildlife_spawn_interval' ] = [ 2500 , ( 250 , 445 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# WORLD_INFO [ 'wildlife_spawn_interval' ] = [ ( - 1 ) , ( 250 , 445 ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# weather . change_weather ( ) #NEWLINE# create_region_spawns ( ) #NEWLINE# randomize_item_spawns ( ) #NEWLINE# lfe . focus_on ( create_player ( ) ) #NEWLINE# alife . camps . create_all_camps ( ) #NEWLINE# if thread : #NEWLINE# #INDENT# tcod . console_rect ( 0 , 0 , 0 , WINDOW_SIZE [ 0 ] , WINDOW_SIZE [ 1 ] , True , flag = tcod . BKGND_DEFAULT ) #NEWLINE# _r = Runner ( simulate_ticks ) #NEWLINE# _r . start ( ) #NEWLINE# while _r . running : #NEWLINE# #INDENT# draw_world_stats ( ) #NEWLINE# if ( not SETTINGS [ 'running' ] ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# simulate_life ( simulate_ticks ) #NEWLINE# #UNINDENT# WORLD_INFO [ 'id' ] = 0 #NEWLINE# if save : #NEWLINE# #INDENT# WORLD_INFO [ 'id' ] = profiles . create_world ( ) #NEWLINE# save_world ( create = True ) #NEWLINE# #UNINDENT# logging . info ( ( 'World generation complete (took %.2fs)' % ( time . time ( ) - WORLD_INFO [ 'inittime' ] ) ) )