Logo Search packages:      
Sourcecode: 7kaa version File versions  Download package

Public Types | Public Member Functions | Public Attributes

Nation Class Reference

Inheritance diagram for Nation:
Inheritance graph
Collaboration diagram for Nation:
Collaboration graph

List of all members.

Public Types

enum  { NATION_NAME_LEN = 50 }

Public Member Functions

int action_count ()
void action_failure (WORD aiActionId, short unitRecno=0)
void action_finished (WORD aiActionId, short unitRecno=0, int actionFailure=0)
int add_action (ActionNode *actionNode, int immediateProcess=0)
int add_action (short xLoc, short yLoc, short refXLoc, short refYLoc, int actionType, int actionPara, int instanceCount=1, int unitRecno=0, int actionPara2=0, short *groupUnitArray=NULL)
void add_caravan_info (short unitRecno)
void add_cheat (float cheatAmt)
void add_expense (int expenseType, float expenseAmt, int fixedExpense=0)
void add_firm_info (char firmId, short firmRecno)
void add_food (float)
void add_general_info (short unitRecno)
void add_income (int incomeType, float incomeAmt, int fixedIncome=0)
void add_ship_info (short unitRecno)
void add_town_info (short townRecno)
int ai_assign_construction_worker (ActionNode *)
int ai_assign_overseer (ActionNode *)
int ai_assign_spy (int targetXLoc, int targetYLoc, int spyRaceId, int mobileOnly)
int ai_assign_spy (ActionNode *)
int ai_assign_spy_to_firm (int firmRecno)
int ai_assign_spy_to_town (int townRecno, int raceId=0)
int ai_assign_worker (ActionNode *)
int ai_attack_order_nearby_mobile (int targetXLoc, int targetYLoc, int targetCombatLevel)
int ai_attack_target (int targetXLoc, int targetYLoc, int targetCombatLevel, int defenseMode=0, int justMoveToFlag=0, int attackerMinCombatLevel=0, int attackerCampRecno=0, int useAllCamp=0)
void ai_attack_target_execute (int directAttack)
void ai_attack_target_sync ()
void ai_attack_unit_in_area (int xLoc1, int yLoc1, int xLoc2, int yLoc2)
int ai_build_camp_town_next_to (int xLoc1, int yLoc1, int xLoc2, int yLoc2)
int ai_build_firm (ActionNode *)
int ai_build_harbor (int landRegionId, int seaRegionId)
int ai_build_ship (int seaRegionId, int preferXLoc, int preferYLoc, int needTransportUnit)
int ai_defend (int attackerUnitRecno)
void ai_end_treaty (int nationRecno)
Spyai_find_spy (int targetXLoc, int targetYLoc, int targetRaceId, int mobileOnly)
int ai_find_transport_ship (int seaRegionId, int unitXLoc, int unitYLoc, int findBest=1)
int ai_has_enough_food ()
int ai_has_should_close_camp (int regionId)
int ai_has_too_many_camp ()
void ai_improve_relation ()
int ai_is_sea_travel_safe ()
int ai_is_troop_need_new_camp ()
void ai_notify_reply (int talkMsgRecno)
int ai_overall_relation_rating (int withNationRecno)
int ai_patrol_to_region (int destXLoc, int destYLoc, int seaActionId)
int ai_process_talk_msg (ActionNode *actionNode)
int ai_request_military_aid ()
int ai_scout (ActionNode *)
int ai_sea_attack_target (int targetXLoc, int targetYLoc)
int ai_sea_travel (ActionNode *actionNode)
int ai_sea_travel2 (ActionNode *actionNode)
int ai_sea_travel3 (ActionNode *actionNode)
int ai_settle_to_other_town (ActionNode *)
int ai_settle_to_region (int destXLoc, int destYLoc, int seaActionId)
int ai_should_attack_friendly (int friendlyNationRecno, int attackTemptation)
int ai_should_build_mine ()
int ai_should_expand_military ()
int ai_should_hire_unit (int considerProfit)
int ai_should_sail_to_rating (int regionStatId)
int ai_should_spend (int importanceRating, float spendAmt=0)
int ai_should_spend_war (int enemyMilitaryRating, int considerCeaseFire=0)
int ai_supported_inn_count ()
int ai_surrender_to_rating (int nationRecno)
int ai_trade_with_rating (int withNationRecno)
int all_population ()
void assign_firm_overseer (char firm_id, short firm_recno, short overseerUnitRecno)
int attack_enemy_town_defense (Town *targetTown, int useAllCamp=0)
void auto_next_action (ActionNode *actionNode)
int base_town_count_in_region (int regionId)
void being_attacked (int attackNationRecno)
void cal_location_score (short x1, short y1, short width, short height, int &weight)
int can_ai_build (int firmId)
int capture_build_camp (int townRecno, int raceId)
int capture_expected_resistance (int townRecno)
char * cash_str ()
void change_ai_relation_level (short nationRecno, int levelChange)
void change_all_people_loyalty (int loyaltyChange, int raceId=0)
void change_reputation (float)
float cheat_365days ()
int check_firm_ready (short xLoc, short yLoc, int firmId=0)
void check_lose ()
int check_town_ready (short xLoc, short yLoc)
void check_win ()
void civilian_killed (int civilianRaceId, int isAttacker)
virtual void clear_ptr ()
void close_all_firm ()
int closest_enemy_firm_distance (int firmId, int xLoc, int yLoc)
int consider_accept_surrender_request (TalkMsg *talkMsg)
int consider_alliance_rating (int nationRecno)
int consider_alliance_treaty (int withNationRecno)
int consider_cease_war (int withNationRecno)
int consider_declare_war (TalkMsg *talkMsg)
int consider_friendly_treaty (int withNationRecno)
int consider_give_aid (TalkMsg *talkMsg)
int consider_give_tech (TalkMsg *talkMsg)
int consider_give_tribute (TalkMsg *talkMsg)
int consider_military_aid (TalkMsg *talkMsg)
int consider_sell_food (TalkMsg *talkMsg)
int consider_take_aid (TalkMsg *talkMsg)
int consider_take_tech (TalkMsg *talkMsg)
int consider_take_tribute (TalkMsg *talkMsg)
int consider_talk_msg (TalkMsg *talkMsg)
int consider_trade_embargo (TalkMsg *talkMsg)
int consider_trade_treaty (int withNationRecno)
void consume_food (float)
virtual UCHAR crc8 ()
void defeated ()
void deinit ()
void deinit_all_ai_info ()
void deinit_all_unit ()
void del_action (int actionRecno)
void del_caravan_info (short unitRecno)
void del_firm_info (char firmId, short firmRecno)
void del_general_info (short unitRecno)
void del_ship_info (short unitRecno)
void del_town_info (short townRecno)
void disp_nation_color (int x, int y)
int economic_rank_rating ()
void enable_should_attack_on_target (int targetXLoc, int targetYLoc)
void end_treaty (int endTreatyNationRecno, int newStatus)
int enemy_firm_combat_level (Firm *targetFirm, int returnIfWar, int hasWar)
 return -1 if there is war and returnIfWar is 1
int enemy_town_combat_level (Town *targetTown, int returnIfWar, int hasWar)
 return -1 if there is war and returnIfWar is 1
void establish_contact (int nationRecno)
float expense_365days ()
float expense_365days (int expenseType)
int find_best_capturer (int townRecno, int raceId, int &bestResistanceReduce)
int find_best_firm_loc (short firmId, short refXLoc, short refYLoc, short &resultXLoc, short &resultYLoc)
Unitfind_skilled_unit (int skillId, int raceId, short destX, short destY, char &resultFlag, int actionId=0)
float fixed_expense_365days ()
float fixed_income_365days ()
float fixed_profit_365days ()
float food_change_365days ()
char * food_str ()
void form_alliance_treaty (int nationRecno)
void form_friendly_treaty (int nationRecno)
ActionNodeget_action (int recNo)
ActionNodeget_action_based_on_id (int actionId)
AIRegionget_ai_region (int regionId)
int get_economic_rating ()
int get_overall_rating ()
int get_population_rating ()
NationRelationget_relation (int nationRecno)
char get_relation_passable (short nationRecno)
char get_relation_should_attack (short nationRecno)
char get_relation_status (short nationRecno)
Unitget_skilled_unit (int skillId, int raceId, ActionNode *actionNode)
void give_tech (int toNationRecno, int techId, int techVersion)
void give_tribute (int toNationRecno, int tributeAmt)
int goal_destroy_monster_achieved ()
int goal_destroy_nation_achieved ()
int goal_economic_score_achieved ()
int goal_population_achieved ()
int goal_total_score_achieved ()
void hand_over_to (int handoverNationRecno)
int has_base_town_in_region (int regionId)
int has_people ()
int has_trade_ship (int firmRecno1, int firmRecno2)
int hire_best_capturer (int townRecno, int raceId)
int hire_unit (int skillId, int raceId, short destX, short destY)
void import_goods (int importType, int nationRecno, float importAmt)
float income_365days (int incomeType)
float income_365days ()
void init (int nationType, int raceId, int colorSchemeId, DWORD playerId)
void init_ai_info (short **aiInfoArray, short &aiInfoCount, short &aiInfoSize, int arrayInitSize)
void init_all_ai_info ()
void init_personalty ()
void init_relation (int relationNationRecno)
int is_action_exist (int actionType, int actionPara, int regionId=0)
int is_action_exist (short actionXLoc, short actionYLoc, short refXLoc, short refYLoc, int actionType, int actionPara, int unitRecno=0, int checkMode=0)
int is_ai ()
int is_at_war ()
int is_build_action_exist (int firmId, int xLoc, int yLoc)
int is_caravan_exist (int firstMarket, int secondMarket, int setStopInternal=0)
int is_own ()
int is_remote ()
int kill_monster_rank_rating ()
const char * king_name (int firstWordOnly=0)
int max_human_battle_ship_count ()
int military_rank_rating ()
int mobile_defense_combat_level (int targetXLoc, int targetYLoc, int targetNationRecno, int returnIfWar, int &hasWar)
int mobilize_capturer (int unitRecno)
char * nation_name ()
void next_day ()
void next_month ()
void next_year ()
void notify_talk_msg (TalkMsg *talkMsg)
void optimize_town_race ()
void optimize_town_race_region (int regionId)
int overall_rank_rating ()
char * peace_duration_str ()
int peaceful_days ()
int population_rank_rating ()
int process_action (int priorityActionRecno=0, int processActionMode=0)
int process_action_id (int actionId)
void process_ai ()
void process_ai_main ()
void process_on_going_action ()
float profit_365days ()
int read_file (File *filePtr)
int recruit_jobless_worker (Firm *firmPtr, int preferedRaceId=0)
int recruit_on_job_worker (Firm *firmPtr, int preferedRaceId=0)
void remove_firm_overseer (char firm_id, short firm_recno)
float reputation_change_365days ()
int reputation_rank_rating ()
void reset_ai_attack_target ()
int revealed_by_phoenix (int xLoc, int yLoc)
void seek_best_build_mine_location (short &xLoc, short &yLoc, short mapXLoc, short mapYLoc)
int seek_mine (short &xLoc, short &yLoc, short &refXLoc, short &refYLoc)
void set_at_war_today (int attackerUnitRecno=0)
void set_auto_collect_tax_loyalty (int loyaltyLevel)
void set_auto_grant_loyalty (int loyaltyLevel)
void set_king (int kingUnitRecno, int firstKing)
void set_relation_passable (short nationRecno, char status)
void set_relation_should_attack (short nationRecno, char newValue, char remoteAction)
void set_relation_status (short nationRecno, char newStatus, char recursiveCall=0)
void set_trade_treaty (int nationRecno, char allowFlag)
void settle_to_other_town ()
int should_consider_friendly (int withNationRecno)
int should_diplomacy_retry (int talkId, int nationRecno)
int should_use_cash_to_capture ()
int start_capture (int townRecno)
void stop_unit_action (short unitRecno)
void succeed_king (int kingUnitRecno)
int surplus_supply_rating ()
void surrender (int toNationRecno)
int think_against_mine_monopoly ()
int think_ally_against_big_enemy ()
int think_assign_spy_own_town (int raceId, int regionId)
int think_assign_spy_target_camp (int raceId, int regionId)
int think_assign_spy_target_town (int raceId, int regionId)
int think_attack_enemy_firm (int enemyNationRecno, int firmId)
int think_attack_monster ()
int think_attack_town ()
void think_build_firm ()
int think_build_harbor_network ()
int think_build_mine ()
int think_capture ()
Townthink_capture_enemy_town_target (Town *capturerTown)
int think_capture_independent ()
int think_capture_new_enemy_town (Town *capturerTown, int useAllCamp=0)
void think_capturing_enemy_town ()
int think_close_camp ()
void think_deal_with_all_enemy ()
void think_deal_with_one_enemy (int enemyNationRecno)
int think_declare_war ()
int think_demand_tech ()
int think_demand_tribute_aid ()
int think_destroy_raw_site_guard ()
void think_diplomacy ()
int think_eliminate_enemy_firm (int enemyNationRecno)
int think_eliminate_enemy_town (int enemyNationRecno)
int think_eliminate_enemy_unit (int enemyNationRecno)
int think_end_treaty ()
void think_explore ()
int think_give_tech ()
int think_give_tribute_aid (TalkMsg *rejectedMsg)
void think_grand_plan ()
void think_marine ()
void think_military ()
int think_monster_target (int &targetCombatLevel)
int think_move_between_region ()
int think_move_people_between_region ()
int think_move_to_region_with_mine ()
int think_move_troop_between_region ()
int think_propose_alliance_treaty ()
int think_propose_friendly_treaty ()
void think_reduce_expense ()
int think_request_buy_food ()
int think_request_cease_war ()
int think_request_surrender ()
int think_sea_attack_enemy ()
int think_secret_attack ()
void think_spy ()
int think_succeed_king ()
int think_surrender ()
void think_town ()
int think_trade_treaty ()
void think_trading ()
int think_unite_against_big_enemy ()
int total_alliance_military ()
int total_enemy_count ()
int total_enemy_military ()
int total_tech_level (int unitClass=0)
float total_year_trade (int nationRecno)
int trade_rating (int nationRecno)
int train_unit (int skillId, int raceId, short destX, short destY, int &trainTownRecno, int actionId=0)
float true_income_365days ()
float true_profit_365days ()
short * update_ai_array (short &aiInfoCount, short &aiInfoSize, short **aiInfoArray, int arrayIncSize, int actionType, int actionRecno)
short * update_ai_firm_array (int firmId, int actionType, int actionRecno, int &arrayCount)
void update_ai_region ()
void update_nation_rating ()
int write_file (File *filePtr)
int yearly_food_change ()
int yearly_food_consumption ()
int yearly_food_production ()

Public Attributes

DynArray action_array
short ai_attack_target_nation_recno
short ai_attack_target_x_loc
short ai_attack_target_y_loc
short * ai_base_array
short ai_base_count
short ai_base_size
short ai_base_town_count
short * ai_camp_array
short ai_camp_count
short ai_camp_size
int ai_capture_enemy_town_plan_date
short ai_capture_enemy_town_recno
int ai_capture_enemy_town_start_attack_date
char ai_capture_enemy_town_use_all_camp
short * ai_caravan_array
short ai_caravan_count
short ai_caravan_size
short * ai_factory_array
short ai_factory_count
short ai_factory_size
short * ai_general_array
short ai_general_count
short ai_general_size
short * ai_harbor_array
short ai_harbor_count
short ai_harbor_size
short * ai_inn_array
short ai_inn_count
short ai_inn_size
int ai_last_defend_action_date
short * ai_market_array
short ai_market_count
short ai_market_size
short * ai_mine_array
short ai_mine_count
short ai_mine_size
AIRegion ai_region_array [MAX_AI_REGION]
char ai_region_count
short * ai_research_array
short ai_research_count
short ai_research_size
short * ai_ship_array
short ai_ship_count
short ai_ship_size
short * ai_town_array
short ai_town_count
short ai_town_size
short * ai_war_array
short ai_war_count
short ai_war_size
AttackCamp attack_camp_array [MAX_SUITABLE_ATTACK_CAMP]
short attack_camp_count
short auto_collect_tax_loyalty
short auto_grant_loyalty
char base_count_array [MAX_RACE]
float cash
char cheat_enabled_flag
char color_scheme_id
float cur_year_cheat
float cur_year_expense
float cur_year_expense_array [EXPENSE_TYPE_COUNT]
float cur_year_fixed_expense
float cur_year_fixed_income
float cur_year_food_change
float cur_year_food_in
float cur_year_food_out
float cur_year_income
float cur_year_income_array [INCOME_TYPE_COUNT]
float cur_year_profit
float cur_year_reputation_change
int economic_rating
int enemy_civilian_killed
int enemy_firm_destroyed
int enemy_ship_destroyed
int enemy_soldier_killed
int enemy_weapon_destroyed
short firm_should_close_array [MAX_FIRM_TYPE]
float food
char is_allied_with_player
char is_at_war_today
char is_at_war_yesterday
float kill_monster_score
char king_leadership
short king_unit_recno
char know_base_array [MAX_RACE]
short largest_town_pop
short largest_town_recno
WORD last_action_id
short last_attacker_unit_recno
int last_build_firm_date
short last_caravan_id
int last_independent_unit_join_date
short last_unit_name_id_array [MAX_UNIT_TYPE]
int last_war_date
float last_year_cheat
float last_year_expense
float last_year_expense_array [EXPENSE_TYPE_COUNT]
float last_year_fixed_expense
float last_year_fixed_income
float last_year_food_change
float last_year_food_in
float last_year_food_out
float last_year_income
float last_year_income_array [INCOME_TYPE_COUNT]
float last_year_profit
float last_year_reputation_change
short lead_attack_camp_recno
int military_rating
char nation_color
short nation_firm_count
int nation_name_id
char nation_name_str [NATION_NAME_LEN+1]
short nation_recno
char nation_type
char next_frame_ready
int overall_rating
int own_civilian_killed
int own_firm_destroyed
int own_ship_destroyed
int own_soldier_killed
int own_weapon_destroyed
DWORD player_id
int population_rating
char pref_allying_tendency
char pref_attack_monster
char pref_cash_reserve
char pref_collect_tax
char pref_counter_spy
char pref_diplomacy_retry
char pref_economic_development
char pref_food_reserve
char pref_force_projection
char pref_forgiveness
char pref_hire_unit
char pref_honesty
char pref_inc_pop_by_capture
char pref_inc_pop_by_growth
char pref_keep_general
char pref_keep_skilled_unit
char pref_loyalty_concern
char pref_military_courage
char pref_military_development
char pref_peacefulness
char pref_repair_concern
char pref_scout
char pref_spy
char pref_territorial_cohesiveness
char pref_town_harmony
char pref_trading_tendency
char pref_unit_chase_distance
char pref_use_marine
char pref_use_weapon
char race_id
short raw_count_array [MAX_RAW]
NationRelation relation_array [MAX_NATION]
char relation_passable_array [MAX_NATION]
char relation_should_attack_array [MAX_NATION]
char relation_status_array [MAX_NATION]
float reputation
int total_firm_count
int total_general_count
int total_human_count
int total_jobless_population
int total_population
int total_ship_combat_level
int total_ship_count
int total_spy_count
int total_unit_count
int total_weapon_count

Detailed Description

Definition at line 177 of file ONATION.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index