Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ai.c File Reference

#include "conq.h"
#include "kpublic.h"
#include "aiutil.h"
#include "ai.h"
#include "aiscore.h"
#include "aiunit.h"
#include "aiunit2.h"
#include "aioprt.h"
#include "goal.def"

Include dependency graph for ai.c:

Include dependency graph

Defines

#define DEF_GOAL(NAME, DNAME, code, ARGTYPES)   { NAME, DNAME, ARGTYPES },

Functions

void register_mplayer (AI_ops *ops)
void force_replan (Unit *unit)
int ai_go_after_victim (Unit *unit, int range, int broadcast)
void init_ai_types (void)
int find_ai_type (char *aitype)
char * ai_type_name (int n)
char * next_ai_type_name (char *aitype)
char * ai_type_help (int n)
void init_ai (Side *side)
void set_side_ai (Side *side, char *aitype)
void run_ai_plan_adjust (Side *side)
int run_local_ai (int when, int maxplanning)
void ai_react_to_new_side (Side *side, Side *side2)
void add_goal (Side *side, Goal *goal)
Goalhas_goal (Side *side, GoalType goaltype)
Goalhas_unsatisfied_goal (Side *side, GoalType goaltype)
void ai_receive_message (Side *side, Side *sender, char *str)
void ai_save_state (Side *side)
int ai_region_at (Side *side, int x, int y)
char * ai_at_desig (Side *side, int x, int y)
void try_to_draw (Side *side, int flag, char *ainame)
void give_up (Side *side, char *ainame)
Goalcreate_goal (GoalType type, Side *side, int tf)
int goal_truth (Side *side, Goal *goal)
char * goal_desig (Goal *goal)
GameClass find_game_class (void)
void update_unit_plans (Side *side)
void update_unit_plans_randomly (Side *side)
void set_hit_unit_task (Unit *unit, int id, int hitmethod, int n)
void set_move_to_task (Unit *unit, int x, int y, int dist)
void push_move_to_task (Unit *unit, int x, int y, int dist)
void set_capture_task (Unit *unit, int id, int capmethod, int n)
void ai_pick_side_research (Side *side)
int need_this_type_to_collect (Side *side, int u, int m)
void assign_to_collection (Side *side, Unit *unit, int m)
void assign_to_improve (Side *side, Unit *unit)
void assign_to_defense (Side *side, Unit *unit)
void assign_to_defend_unit (Unit *unit, Unit *unit2)
int compare_weights (CONST void *w1, CONST void *w2)
void assign_to_exploration (Side *side, Unit *unit)
void assign_explorer_to_theater (Side *side, Unit *unit, Theater *theater)
void assign_to_explorer_construction (Side *side, Unit *unit)
void assign_to_offense (Side *side, Unit *unit)
void assign_to_offense_support (Side *side, Unit *unit)
void assign_to_defense_support (Side *side, Unit *unit)
int suitable_port (Unit *unit)
int preferred_build_type (Side *side, Unit *unit, int plantype)
int need_more_transportation (Side *side)
int need_explorers (Side *side)
int build_depot_for_self (Unit *unit)
int can_develop_on (int u, int u2)
int needs_develop (Side *side, int u)
int assign_to_develop_on (Side *side, Unit *unit, int u2)
int desired_direction_impassable (Unit *unit, int x, int y)
int could_be_ferried (Unit *unit, int x, int y)
int blocked_by_enemy (Unit *unit, int x, int y, int shortest)
int attack_blockage (Side *side, Unit *unit, int x, int y, int shortest)
int enemy_close_by (Side *side, Unit *unit, int dist, int *xp, int *yp)
int accelerable (int u)
int accelerator (int u1, int u2)
void ai_init_shared ()

Variables

int taskexecs
int need_ai_init_turn
int need_ai_planning
int need_ai_action_reaction
int need_ai_for_new_side
int need_ai_finish_movement
int latest_action_x
int latest_action_y
GameClass game_class = gc_none
int bhw_max = 0
GoalDefn goaldefns []
 Goal definition array.

char * goalbuf = NULL
int victim_id
int victim_x
int victim_y
int victim_rating
int victim_utype
int victim_sidenum
OccStatus victim_occstatus
int victim_flags
int victim_dmgtypes
int bhwtab = -1
int bfwtab = -1
int bcwtab = -1
int btwtab = -1

Define Documentation

#define DEF_GOAL NAME,
DNAME,
code,
ARGTYPES   )     { NAME, DNAME, ARGTYPES },
 


Function Documentation

int accelerable int  u  ) 
 

int accelerator int  u1,
int  u2
 

void add_goal Side side,
Goal goal
 

char* ai_at_desig Side side,
int  x,
int  y
 

int ai_go_after_victim Unit unit,
int  range,
int  broadcast
 

void ai_init_shared void   ) 
 

void ai_pick_side_research Side side  ) 
 

void ai_react_to_new_side Side side,
Side side2
 

void ai_receive_message Side side,
Side sender,
char *  str
 

int ai_region_at Side side,
int  x,
int  y
 

void ai_save_state Side side  ) 
 

char* ai_type_help int  n  ) 
 

char* ai_type_name int  n  ) 
 

void assign_explorer_to_theater Side side,
Unit unit,
Theater theater
 

void assign_to_collection Side side,
Unit unit,
int  m
 

void assign_to_defend_unit Unit unit,
Unit unit2
 

void assign_to_defense Side side,
Unit unit
 

void assign_to_defense_support Side side,
Unit unit
 

int assign_to_develop_on Side side,
Unit unit,
int  u2
 

void assign_to_exploration Side side,
Unit unit
 

void assign_to_explorer_construction Side side,
Unit unit
 

void assign_to_improve Side side,
Unit unit
 

void assign_to_offense Side side,
Unit unit
 

void assign_to_offense_support Side side,
Unit unit
 

int attack_blockage Side side,
Unit unit,
int  x,
int  y,
int  shortest
 

int blocked_by_enemy Unit unit,
int  x,
int  y,
int  shortest
 

int build_depot_for_self Unit unit  ) 
 

int can_develop_on int  u,
int  u2
 

int compare_weights CONST void *  w1,
CONST void *  w2
 

int could_be_ferried Unit unit,
int  x,
int  y
 

Goal* create_goal GoalType  type,
Side side,
int  tf
 

int desired_direction_impassable Unit unit,
int  x,
int  y
 

int enemy_close_by Side side,
Unit unit,
int  dist,
int *  xp,
int *  yp
 

int find_ai_type char *  aitype  ) 
 

GameClass find_game_class void   ) 
 

void force_replan Unit unit  ) 
 

void give_up Side side,
char *  ainame
 

char* goal_desig Goal goal  ) 
 

int goal_truth Side side,
Goal goal
 

Goal* has_goal Side side,
GoalType  goaltype
 

Goal* has_unsatisfied_goal Side side,
GoalType  goaltype
 

void init_ai Side side  ) 
 

void init_ai_types void   ) 
 

int need_explorers Side side  ) 
 

int need_more_transportation Side side  ) 
 

int need_this_type_to_collect Side side,
int  u,
int  m
 

int needs_develop Side side,
int  u
 

char* next_ai_type_name char *  aitype  ) 
 

int preferred_build_type Side side,
Unit unit,
int  plantype
 

void push_move_to_task Unit unit,
int  x,
int  y,
int  dist
 

void register_mplayer AI_ops ops  ) 
 

void run_ai_plan_adjust Side side  ) 
 

int run_local_ai int  when,
int  maxplanning
 

void set_capture_task Unit unit,
int  id,
int  capmethod,
int  n
 

void set_hit_unit_task Unit unit,
int  id,
int  hitmethod,
int  n
 

void set_move_to_task Unit unit,
int  x,
int  y,
int  dist
 

void set_side_ai Side side,
char *  aitype
 

int suitable_port Unit unit  ) 
 

void try_to_draw Side side,
int  flag,
char *  ainame
 

void update_unit_plans Side side  ) 
 

void update_unit_plans_randomly Side side  ) 
 


Variable Documentation

int bcwtab = -1
 

int bfwtab = -1
 

int bhw_max = 0
 

int bhwtab = -1
 

int btwtab = -1
 

GameClass game_class = gc_none
 

char* goalbuf = NULL
 

GoalDefn goaldefns[]
 

Goal definition array.

int latest_action_x
 

int latest_action_y
 

int need_ai_action_reaction
 

int need_ai_finish_movement
 

int need_ai_for_new_side
 

int need_ai_init_turn
 

int need_ai_planning
 

int taskexecs
 

int victim_dmgtypes
 

int victim_flags
 

int victim_id
 

OccStatus victim_occstatus
 

int victim_rating
 

int victim_sidenum
 

int victim_utype
 

int victim_x
 

int victim_y
 


Generated on Sat Sep 17 10:28:55 2005 for XconqKernel by doxygen 1.3.6