//------- Begin of function Town::think_build_inn -------// // int Town::think_build_inn() { Nation* ownNation = nation_array[nation_recno]; if( ownNation->ai_inn_count < ownNation->ai_supported_inn_count() ) { return think_build_firm( FIRM_INN, 1 ); } return 0; }
//------- Begin of function Nation::process_ai_main --------// // void Nation::process_ai_main() { #if defined(DEBUG) && defined(ENABLE_LOG) String debugStr; debugStr = "Nation "; debugStr += nation_recno; #endif static short intervalDaysArray[] = { 90, 30, 15, 15 }; int intervalDays = intervalDaysArray[config.ai_aggressiveness-OPTION_LOW]; if( game.game_mode == GAME_TUTORIAL ) intervalDays = 120; switch( (info.game_date-nation_recno*4) % intervalDays ) { case 0: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_build_firm"; #endif think_build_firm(); break; case 1: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_trading"; #endif think_trading(); break; case 2: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_capture"; #endif think_capture(); break; case 3: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_explore"; #endif think_explore(); break; case 4: // think about expanding its military force #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_military"; #endif think_military(); break; case 5: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_secret_attack"; #endif think_secret_attack(); break; case 6: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_attack_monster"; #endif think_attack_monster(); break; case 7: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_diplomacy"; #endif think_diplomacy(); break; case 8: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_marine"; #endif think_marine(); break; case 9: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_grand_plan"; #endif think_grand_plan(); break; case 10: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_reduce_expense"; #endif think_reduce_expense(); break; case 11: #if defined(DEBUG) && defined(ENABLE_LOG) debugStr += " think_town"; #endif think_town(); break; } LOG_MSG(debugStr); LOG_MSG(misc.get_random_seed()); }