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

conq.h

Go to the documentation of this file.
00001 /* Main include file for Xconq.
00002    Copyright (C) 1991-2000 Stanley T. Shebs.
00003    Copyright (C) 2003-2005 Eric A. McDonald.
00004 
00005 Xconq is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2, or (at your option)
00008 any later version.  See the file COPYING.  */
00009 
00019 /* Elements of bitmask controlling display updates. */
00020 
00023 #define UPDATE_ALWAYS 1
00024 
00027 #define UPDATE_ADJ 2
00028 
00031 #define UPDATE_COVER 4
00032 
00035 #define UPDATE_TEMP 8
00036 
00039 #define UPDATE_CLOUDS 16
00040 
00043 #define UPDATE_WINDS 32
00044 
00045 /* The top-level Xconq namespace. */
00046 namespace Xconq {}
00047 
00048 #include "config.h"
00049 #include "parambox.h"
00050 #include "misc.h"
00051 #include "dir.h"
00052 #include "lisp.h"
00053 #include "module.h"
00054 #include "game.h"
00055 #include "player.h"
00056 #include "side.h"
00057 #include "unit.h"
00058 #include "world.h"
00059 #include "history.h"
00060 #include "score.h"
00061 #include "help.h"
00062 #include "tp.h"
00063 #include "system.h"
00064 
00065 /* Some globals. */
00066 #ifndef UNIX
00067 extern FILE *xcq_fstdout;
00068 #endif
00069 
00070 /* The several stages of game setup. */
00071 
00075 enum setup_stage {
00076     initial_stage,                      
00077     game_load_stage,            
00078     variant_setup_stage,        
00079     player_pre_setup_stage,     
00080     player_setup_stage,         
00081     game_ready_stage            
00082 };
00083 
00085 extern enum setup_stage current_stage;
00086 
00087 /* Declarations of globally visible globals. */
00088 
00090 extern int gamedefined;
00092 extern int gameinited;
00094 extern int compromised;
00096 extern int beforestart;
00098 extern int endofgame;
00100 extern int gamestatesafe;
00102 extern int any_post_action_scores;
00104 extern short any_people_side_changes;
00106 extern int max_zoc_range;
00108 extern int warnings_suppressed;
00110 extern time_t game_start_in_real_time;
00112 extern time_t turn_play_start_in_real_time;
00114 extern short *u_possible;
00116 extern int want_checkpoints;
00118 extern int checkpoint_interval;
00120 extern int statistics_wanted;
00122 extern int numsoundplays;
00124 extern int allbedesigners;
00126 extern int tmphevtdata1;
00128 extern int max_detonate_on_approach_range;
00130 extern int max_t_detonate_effect_range;
00132 extern int xmalloc_warnings;
00134 extern int memory_exhausted;
00136 extern Feature *featurelist;
00138 extern Doctrine *doctrine_list;
00139 /* \brief Current date string. */
00140 extern char *curdatestr;
00141 
00143 extern int sunx;
00145 extern int suny;
00146 
00148 extern int daynight;
00150 extern int area_lighting;
00151 
00153 extern int warnings_logged;
00154 
00155 /* Task Management Flags */
00157 #define ADD_TO_AGENDA_AS_LIFO   0
00158 
00159 #define ADD_TO_AGENDA_AS_FIFO   1
00160 
00161 #define CLEAR_AGENDA            99
00162 
00163 /* Declarations of functions that must be supplied by an interface. */
00164 
00165 extern void announce_read_progress(void);
00166 extern void announce_lengthy_process(char *msg);
00167 extern void announce_progress(int pctdone);
00168 extern void finish_lengthy_process(void);
00169 
00170 extern Player *add_default_player(void);
00171 
00172 extern UnitVector *get_selected_units(Side *side);
00173 
00174 extern void init_ui(Side *side);
00175 
00176 extern int active_display(Side *side);
00177 
00178 extern void run_ui_idler(void);
00179 
00180 extern void update_turn_display(Side *side, int rightnow);
00181 extern void update_area_display(Side *side);
00182 extern void update_action_display(Side *side, int rightnow);
00183 extern void update_action_result_display(Side *side, Unit *unit, int rslt, int rightnow);
00184 extern void update_event_display(Side *side, HistEvent *hevt, int rightnow);
00185 extern void update_fire_at_display(Side *side, Unit *unit, Unit *unit2, int m, int rightnow);
00186 extern void update_fire_into_display(Side *side, Unit *unit, int x, int y, int z, int m, int rightnow);
00187 extern void update_clock_display(Side *side, int rightnow);
00188 extern void update_side_display(Side *side, Side *side2, int rightnow);
00189 extern void update_unit_display(Side *side, Unit *unit, int rightnow);
00190 extern void update_unit_acp_display(Side *side, Unit *unit, int rightnow);
00191 extern void update_message_display(Side *side, Side *side2, char *str, int rightnow);
00192 extern void update_cell_display(Side *side, int x, int y, int flags);
00193 extern void update_all_progress_displays(char *str, int s);
00194 extern void update_research_display(Side *side);
00195 extern void update_everything(void);
00196 extern void flush_display_buffers(Side *side);
00197 
00198 extern int schedule_movie(Side *side, char *movie, ...);
00199 extern void play_movies(SideMask sidemask);
00200 
00201 extern void action_point(Side *side, int x, int y);
00202 
00203 extern void notify_all(char *str, ...);
00204 extern void notify(Side *side, char *str, ...);
00205 extern void vnotify(Side *side, char *fmt, va_list ap);
00206 extern void cmd_error(Side *side, char *fmt, ...);
00207 extern void low_notify(Side *side, char *str);
00208 
00209 extern void init_warning(char *str, ...);
00210 extern void low_init_warning(char *str);
00211 extern void init_error(char *str, ...);
00212 extern void low_init_error(char *str);
00213 extern void run_warning(char *str, ...);
00214 extern void low_run_warning(char *str);
00215 extern void run_error(char *str, ...);
00216 extern void low_run_error(char *str);
00217 
00218 extern void print_form(Obj *form);
00219 extern void end_printing_forms(void);
00220 
00221 extern void unit_research_dialog(Unit *unit);
00222 
00223 extern void place_legends(Side *side);
00224 
00225 /* Declarations of functions not elsewhere declared. */
00226 
00227 /* actions.c */
00228 
00229 namespace Xconq {
00231     typedef Z64u    ActionMask;
00232 }
00234 #define ACTM_CANNOT_TOOLUP          0x1
00235 
00236 #define ACTM_CANNOT_CREATE          0x2
00237 
00238 #define ACTM_CANNOT_BUILD           0x4
00239 
00240 #define ACTM_CANNOT_REPAIR          0x8
00241 // TODO: Define more.
00242 
00243 extern void init_actions(void);
00244 extern int transfer_supply(Unit *from, Unit *to, int m, int amount);
00245 extern void garrison_unit(Unit *unit, Unit *unit2);
00246 extern void make_unit_complete(Unit *unit);
00247 extern int execute_action(Unit *unit, Action *action);
00248 extern int can_have_enough_acp(Unit *unit, int acp);
00249 extern int type_can_have_enough_acp(int u, int acp);
00250 extern int has_enough_acp(Unit *unit, int acp);
00251 
00252 /* Treasury Access Checking Functions */
00254 extern int could_take_from_treasury(int u, int m);
00256 extern int could_take_from_treasury(int u, Side *side, int m);
00258 extern int could_take_directly_from_treasury(int u, int m);
00260 extern int could_take_directly_from_treasury(int u, Side *side, int m);
00262 extern int could_give_to_treasury(int u, int m);
00264 extern int could_give_to_treasury(int u, Side *side, int m);
00266 extern int could_give_directly_to_treasury(int u, int m);
00268 extern int could_give_directly_to_treasury(int u, Side *side, int m);
00269 
00270 /* Materials Request/Availability Flags */
00272 #define MReq_AGENT_TREASURY     1
00273 /* Materials Request/Availability Functions */
00275 extern void get_materials_availability(
00276     Unit *actor, Unit *agent, long *p_mavail, long *p_mavailmax, int flags = 0);
00278 extern int can_meet_materials_requirement(
00279     long *p_mreq, long *p_mavail, long *p_mavailmax);
00281 
00289 extern void consume_materials(
00290     Unit *actor, Unit *consumer, int (*getter)(int u, int m), 
00291     int u3 = NONUTYPE, int mult = 1);
00293 extern void consume_materials(Unit *actor, Unit *consumer, long *p_mreq);
00294 
00295 extern int has_supply_to_act(Unit *unit);
00296 extern void use_up_acp(Unit *unit, int acp);
00297 extern int construction_possible(int u2);
00298 extern int any_construction_possible(void);
00299 extern int storage_possible(int m);
00300 extern int any_storage_possible(void);
00301 extern char *action_desig(Action *act);
00302 extern int type_max_night_acp_from_any_terrains(int u);
00303 extern int type_max_acp_from_any_occs(int u);
00304 extern int type_max_acp(int u);
00305 extern int type_max_speed_from_any_occs(int u);
00306 extern int type_max_speed(int u);
00307 extern int can_act(Unit *actor, Unit *agent);
00308 
00310 extern int has_enough_tooling(Unit *constructor, int u2);
00312 extern int could_toolup_for(int u, int u2);
00314 extern int could_toolup_for_any(int u);
00316 extern int can_toolup_for(Unit *actor, Unit *constructor, int u3);
00317 
00319 extern int could_create(int u, int u2);
00321 extern int could_create_any(int u);
00323 extern int can_create_common(
00324     Unit *actor, Unit *creator, int u3, int x, int y,
00325     int could = 0, int acpcost_spcl = -1, long *p_mreq_spcl = NULL);
00326 
00328 extern int could_build(int u, int u2);
00330 extern int could_build_any(int u);
00332 extern int can_build(Unit *actor, Unit *builder, int u3);
00334 extern int can_build(
00335     Unit *actor, Unit *builder, Unit *buildee,
00336     int could = 0, int acpcost_spcl = -1, long *p_mreq_spcl = NULL);
00337 
00339 
00340 extern int could_auto_repair(int u, int u2);
00342 
00343 extern int can_auto_repair(Unit *repairer, Unit *repairee);
00345 extern int could_repair(int u, int u2);
00347 extern int can_repair(Unit *actor, Unit *repairer, int u3);
00349 extern int can_repair(Unit *actor, Unit *repairer, Unit *repairee);
00350 
00351 extern int can_change_type_to(int u, int u2, Side *side);
00352 extern int can_change_type_to(Unit *actor, Unit *morpher, int u3);
00353 extern int should_play_movies(void);
00354 
00355 extern int *cache__type_max_night_acp_from_any_terrains;
00356 extern int *cache__type_max_acp_from_any_occs;
00357 extern int *cache__type_max_acp;
00358 extern int *cache__type_max_speed_from_any_occs;
00359 extern int *cache__type_max_speed;
00360 
00361 /* ai.c */
00362 
00363 extern void init_ai(Side *side);
00364 extern void init_ai_types(void);
00365 extern void ai_init_shared(void);
00366 extern int find_ai_type(char *aitype);
00367 extern void set_side_ai(Side *side, char *aitype);
00368 extern int run_local_ai(int when, int maxplanning);
00369 extern char *ai_type_name(int n);
00370 extern char *next_ai_type_name(char *aitype);
00371 extern char *ai_type_help(int n);
00372 extern void ai_react_to_new_side(Side *side, Side *side2);
00373 extern void ai_receive_message(Side *side, Side *sender, char *str);
00374 extern void ai_save_state(Side *side);
00375 extern int ai_region_at(Side *side, int x, int y);
00376 extern char *ai_at_desig(Side *side, int x, int y);
00377 extern Goal *create_goal(GoalType type, Side *side, int tf);
00378 extern char *goal_desig(Goal *goal);
00379 
00380 extern void ai_pick_side_research(Side *side);
00381 
00382 /* combat.c */
00383 
00385 extern int fire_hit_chance(int u, int u2);
00387 extern int fire_damage(int u, int u2);
00388 
00390 extern int indep_capture_chance(int u, int u2);
00392 extern int capture_chance(int u, int u2, Side *side2);
00393 
00395 extern int could_fire_at(int u, int u2);
00397 extern int could_fire_at_any(int u);
00399 extern int fire_range(int u, int u2);
00401 extern int fire_range_best(int u, int u2);
00403 extern int fire_range_max(int u);
00405 extern int can_fire(Unit *acpsrc, Unit *firer);
00407 extern int can_fire_at(Unit *acpsrc, Unit *firer, int u);
00409 extern int can_fire_at_any(Unit *actor, Unit *firer);
00410 
00412 extern int could_attack(int u, int u2);
00414 extern int could_attack_any(int u);
00416 extern int attack_range(int u, int u2);
00418 extern int attack_range_max(int u);
00420 extern int can_attack(Unit *actor, Unit *attacker, int u3);
00422 extern int can_attack_any(Unit *actor, Unit *attacker);
00423 
00425 extern int could_detonate(int u);
00427 extern int could_damage_by_0dist_detonation(int u, int u2);
00429 extern int could_damage_by_ranged_detonation(int u, int u2);
00431 extern int could_damage_by_detonation(int u, int u2);
00433 extern int detonate_urange(int u, int u2);
00435 extern int detonate_urange_max(int u);
00437 extern int detonate_urange_max(void);
00439 /* \todo Remove ACP restrictions. */
00440 extern int can_detonate(Unit *acpsrc, Unit *detonator);
00441 
00443 extern int could_hit(int u, int u2);
00445 extern int hit_range(int u, int u2);
00447 extern int hit_range_max(int u);
00449 extern int hit_range_max(void);
00450 
00452 extern int could_capture_by_fire(int u, int u2, Side *oside);
00454 extern int could_capture_by_attacks(int u, int u2, Side *oside);
00456 extern int could_capture_by_capture(int u, int u2, Side *oside);
00458 extern int could_capture(int u, int u2, Side *oside);
00460 extern int could_capture_any(int u);
00462 extern int direct_capture_range(int u, int u2, Side *side2);
00464 extern int can_capture(Unit *acpsrc, Unit *captor, int u3, Side *eside);
00465 
00466 extern int defended_by_occupants(Unit *unit);
00467 extern int occ_can_defend_transport(int o, int t);
00468 extern int enough_to_garrison(Unit *unit, int defenders);
00469 
00470 /* init.c */
00471 
00472 extern int G_advances_graph_has_cycles;
00473 extern PackedBoolTable *G_advances_synopsis;
00474 
00475 extern void init_library_path(char *path);
00476 extern void add_library_path(char *path);
00477 extern void init_data_structures(void);
00478 extern void start_game_load_stage(void);
00479 extern void start_variant_setup_stage(void);
00480 extern void start_player_pre_setup_stage(void);
00481 extern void start_player_setup_stage(void);
00482 extern void start_game_ready_stage(void);
00483 extern void check_game_validity(void);
00484 extern void calculate_globals(void);
00485 extern void make_trial_assignments(void);
00486 extern Side *make_up_a_side(void);
00487 extern int add_side_and_player(void);
00488 extern int remove_side_and_player(int s);
00489 extern void run_synth_methods(void);
00490 extern void final_init(void);
00491 extern void init_supply(Unit *unit);
00492 extern void assign_players_to_sides(void);
00493 extern char *version_string(void);
00494 extern char *copyright_string(void);
00495 extern char *license_string(void);
00496 extern int already_seen_chance(Side *side, Unit *unit);
00497 extern int get_synth_method_uses(int methkey, int *calls, int *runs);
00498 extern int indepside_needed(void);
00499 
00500 /* mknames.c */
00501 
00502 extern Obj *make_namer(Obj *sym, Obj *meth);
00503 extern void init_namers(void);
00504 extern void make_up_side_name(Side *side);
00505 extern int name_in_use(Side *side, char *str);
00506 extern int name_units_randomly(int calls, int runs);
00507 extern char *unit_namer(Unit *unit);
00508 extern char *propose_unit_name(Unit *unit);
00509 extern void make_up_unit_name(Unit *unit);
00510 extern void assign_unit_number(Unit *unit);
00511 extern char *run_namer(Obj *namer);
00512 
00513 /* mkrivers.c */
00514 
00515 extern int make_rivers(int calls, int runs);
00516 
00517 /* mkroads.c */
00518 
00519 extern int make_roads(int calls, int runs);
00520 
00521 /* mkterr.c */
00522 
00523 extern int make_fractal_terrain(int calls, int runs);
00524 extern int make_random_terrain(int calls, int runs);
00525 extern int make_earthlike_terrain(int calls, int runs);
00526 extern int make_maze_terrain(int calls, int runs);
00527 extern int name_geographical_features(int calls, int runs);
00528 extern void add_edge_terrain(void);
00529 
00530 /* mkunits.c */
00531 
00532 extern int make_countries(int calls, int runs);
00533 extern int make_independent_units(int calls, int runs);
00534 
00535 /* move.c */
00536 
00537 extern int total_move_cost(int u, int u2, int x1, int y1, int z1, int x2, int y2, int z2);
00538 extern int zoc_move_cost(Unit *unit, int ox, int oy, int oz);
00539 extern int zoc_range(Unit *unit, int u2);
00540 extern int unit_blockable_by(Unit *unit, Unit *unit2);
00541 extern int sides_allow_entry(Unit *unit, Unit *transport);
00542 extern int in_blocking_zoc(Unit *unit, int x, int y, int z);
00543 extern int can_move_at_all(Unit *unit);
00544 extern int can_move_via_conn(Unit *unit, int nx, int ny);
00545 extern int unit_speed(Unit *unit, int nx, int ny);
00546 extern int terrain_always_impassable(int u, int t);
00547 extern int type_can_move_in_terrain(int u, int t);
00548 extern int type_can_have_enough_mp(int u, int mp);
00549 extern int could_move(int uactor, int umover);
00550 extern int can_move(Unit *actor, Unit *mover);
00551 
00552 /* nlang.c */
00553 
00554 extern void init_nlang(void);
00555 extern char *short_side_title(Side *side);
00556 extern char *shortest_side_title(Side *side2, char *buf);
00557 extern char *long_player_title(char *buf, Player *player,
00558                                char *thisdisplayname);
00559 extern char *short_player_title(char *buf, Player *player,
00560                                 char *thisdisplayname);
00561 extern char *simple_player_title(char *buf, Player *player);
00562 extern char *simple_player_name(char *buf, Player *player);
00563 extern char *unit_handle(Side *side, Unit *unit);
00564 extern char *short_unit_handle(Unit *unit);
00565 extern char *medium_long_unit_handle(Unit *unit);
00566 extern void name_or_number(Unit *unit, char *buf);
00567 extern char *apparent_unit_handle(Side *side, Unit *unit, Side *side2);
00568 extern void construction_desc(char *buf, Unit *unit, int u);
00569 extern void research_desc(char *buf, Unit *unit, int a);
00570 extern void researchible_desc(char *buf, Unit *unit, int a);
00571 extern void constructible_desc(char *buf, Side *side, int u, Unit *unit);
00572 extern void historical_event_desc(Side *side, HistEvent *hevt, char *buf);
00573 extern char *action_result_desc(int rslt);
00574 extern void advance_failure_desc(char *buf, Unit *unit, HistEventType reason);
00575 extern char *feature_desc(Feature *feature, char *buf);
00576 extern void size_desc(char *buf, Unit *unit, int label);
00577 extern void hp_desc(char *buf, Unit *unit, int label);
00578 extern void acp_desc(char *buf, Unit *unit, int label);
00579 extern void cxp_desc(char *buf, Unit *unit, int label);
00580 extern void morale_desc(char *buf, Unit *unit, int label);
00581 extern void point_value_desc(char *buf, Unit *unit, int label);
00582 extern void plan_desc(char *buf, Unit *unit);
00583 extern void task_desc(char *buf, Side *side, Unit *unit, Task *task);
00584 extern void action_desc(char *buf, Action *action, Unit *unit);
00585 extern void time_desc(char *buf, int seconds, int maxtime);
00586 extern void notify_doctrine(Side *side, char *spec);
00587 extern void report_combat(Unit *unit, Unit *atker, char *str);
00588 extern void report_give(Side *side, Unit *unit, Unit *unit2, short *rslts);
00589 extern void report_take(Side *side, Unit *unit, int needed, short *rslts);
00590 extern char *ordinal_suffix(int n);
00591 extern char *plural_form(char *word);
00592 extern char *capitalize(char *buf);
00593 extern char *all_capitals(char *buf);
00594 extern char *absolute_date_string(int date);
00595 extern void write_unit_record(FILE *fp, Side *side);
00596 extern void write_side_results(FILE *fp, Side *side);
00597 extern void write_combat_results(FILE *fp, Side *side);
00598 extern void record_missing_image(int typtyp, char *str);
00599 extern int missing_images(char *buf);
00600 extern void notify_all_of_resignation(Side *side, Side *side2);
00601 extern int short_side_title_plural_p(Side *side);
00602 extern char *side_score_desc(char *buf, Side *side, Scorekeeper *sk);
00603 extern void location_desc(char *buf, Side *side, Unit *unit, int u,
00604                           int x, int y);
00605 extern void destination_desc(char *buf, Side *side, Unit *unit,
00606                              int x, int y, int z);
00607 extern int supply_desc(char *buf, Unit *unit, int mrow);
00608 extern int tooling_desc(char *buf, Unit *unit);
00609 extern char *sidemask_desc(char *buf, SideMask sidemask);
00610 extern void latlong_desc(char *buf, int x, int y, int xf, int yf, int which);
00611 extern void others_here_desc(char *buf, Unit *unit);
00612 extern void occupants_desc(char *buf, Unit *unit);
00613 extern void set_initial_date(char *str);
00614 extern int find_event_type(Obj *sym);
00615 extern int pattern_matches_event(Obj *pattern, HistEvent *hevt);
00616 extern void event_desc_from_list(Side *side, Obj *lis, HistEvent *hevt,
00617                                  char *buf);
00618 extern int turns_between(char *str1, char *str2);
00619 extern char *goal_desc(char *buf, Goal *goal);
00620 extern char *feature_name_at(int x, int y);
00621 extern void linear_desc(char *buf, int x, int y);
00622 extern void elevation_desc(char *buf, int x, int y);
00623 extern void temperature_desc(char *buf, int x, int y);
00624 extern char *format_number(char *buf, int value);
00625 
00626 /* plan.c */
00627 
00628         /* called by ais - should not be in plan.c. */
00629 
00630 extern int ai_victim_here(int x, int y, int *numvictims);
00631 extern int target_here(int x, int y);
00632 extern int useful_captureable_here(int x, int y);
00633 extern int est_completion_time(Unit *unit, int u2);
00634 extern char *plan_desig(Plan *plan);
00635 extern int low_on_supplies_one(Unit *unit);
00636 extern int low_on_ammo_one(Unit *unit);
00637 
00638         /* called by take_supplies in ui.c (should not be in ui.c). */
00639 
00640 extern int past_halfway_point(Unit *unit);
00641 
00642         /* called by skelconq which should not do that. */
00643 
00644 extern void make_plausible_random_args(char *argtypestr, int i, int *args, Unit *unit);
00645 
00646 /* read.c */
00647 
00648 extern void type_error(Obj *x, char *msg);
00649 extern void interp_form(Module *module, Obj *form);
00650 extern void interp_game_module(Obj *form, Module *module);
00651 extern void fill_in_side(Side *side, Obj *props, int userdata);
00652 extern void read_warning(char *str, ...);
00653 extern int utype_from_name(char *str);
00654 extern int utype_from_symbol(Obj *sym);
00655 extern int mtype_from_name(char *str);
00656 extern int ttype_from_name(char *str);
00657 extern int atype_from_name(char *str);
00658 extern int lookup_task_type(char *name);
00659 
00660 /* run.c */
00661 
00662 extern void init_run(void);
00663 extern int run_game(int maxactions);
00664 extern int realtime_game(void);
00665 extern int all_others_willing_to_save(Side *side);
00666 extern int all_others_willing_to_quit(Side *side);
00667 extern void end_the_game(void);
00668 extern void update_canresearch_vector(Side *side);
00669 extern void update_side_research_goal_availability(Side *side);
00670 extern void update_canbuild_vector(Side *side);
00671 extern void update_cancarry_vector(Side *side);
00672 extern void kick_out_enemy_users(Side *side, int x, int y);
00673 extern void set_play_rate(int slow, int fast);
00674 extern int production_at(int x, int y, int m);
00675 extern void auto_pick_unit_research(Unit *unit);
00676 extern void auto_pick_side_research(Side *side);
00677 
00678 /* run2.c */
00679 
00680 extern int new_acp_for_turn(Unit *unit);
00681 extern int new_acp_for_turn_if_at(Unit *unit, int x, int y);
00682 extern int people_surrender_chance(int u, int x, int y);
00683 extern void update_cell_display_all_sides(int x, int y, int flags);
00684 extern void try_sharing(Unit *from, Unit *to, int m);
00685 extern int damaged_acp(Unit *unit, Obj *effect);
00686 extern void set_unit_acp_for_turn(Unit *unit);
00687 extern int people_surrender_chance(int u, int x, int y);
00688 extern int choose_move_direction(Unit *unit, int x, int y, int range);
00689 extern int choose_move_dirs(Unit *unit, int tx, int ty, int shortest, int (*dirtest)(Unit *, int), void (*dirsort)(Unit *, int *, int), int *dirs);
00690 extern int plausible_move_dir(Unit *unit, int dir);
00691 extern void parse_player_spec(Player *player, char *spec);
00692 
00693 /* side.c */
00694 
00695 extern UnitView *find_unit_view(Side *side, Unit *unit);
00696 extern Obj * choose_side_research_goal_from_weighted_list(Obj *lis, 
00697                                                           int *totalweightp,
00698                                                           Side *side);
00699 
00700 /* supply.c */
00701 
00702 extern void run_supply(void);
00703 extern int supply_system_in_use(void);
00704 
00705 /* task.c */
00706 
00708 #define HIT_METHOD_NONE         0x0
00709 
00710 #define HIT_METHOD_ATTACK       0x1
00711 
00712 #define HIT_METHOD_FIRE         0x2
00713 
00714 #define HIT_METHOD_DETONATE     0x4
00715 
00716 #define HIT_METHOD_TRANSPORT    0x8
00717 
00718 #define HIT_METHOD_OCCUPANT     0x10
00719 
00721 #define HIT_METHOD_ANY  \
00722     (HIT_METHOD_ATTACK | HIT_METHOD_FIRE | HIT_METHOD_DETONATE \
00723      | HIT_METHOD_TRANSPORT | HIT_METHOD_OCCUPANT)
00724 
00726 #define HIT_TRIES_DFLT  3
00727 
00729 #define CAPTURE_METHOD_NONE             0x0
00730 
00731 #define CAPTURE_METHOD_CAPTURE          0x1
00732 
00733 #define CAPTURE_METHOD_ATTACK           0x2
00734 
00735 #define CAPTURE_METHOD_FIRE             0x4
00736 
00737 #define CAPTURE_METHOD_DETONATE         0x8
00738 
00739 #define CAPTURE_METHOD_TRANSPORT        0x16
00740 
00741 #define CAPTURE_METHOD_OCCUPANT         0x32
00742 
00744 #define CAPTURE_METHOD_ANY      \
00745     (CAPTURE_METHOD_CAPTURE \
00746      | CAPTURE_METHOD_ATTACK | CAPTURE_METHOD_FIRE | CAPTURE_METHOD_DETONATE \
00747      | CAPTURE_METHOD_TRANSPORT | CAPTURE_METHOD_OCCUPANT)
00748 
00750 #define CAPTURE_TRIES_DFLT      3
00751 
00752         /* called by the ais - should not be in task.c. */
00753 
00754 extern Unit *find_unit_to_complete(Unit *unit, Task *task);
00755 
00756         /* called by skelconq - which should not do that. */
00757 
00758 extern Task *create_task(TaskType type);
00759 
00760 /* tp.c */
00761 
00762 extern void dump_checksums(char *str);
00763 
00764 /* write.c */
00765 
00766 extern void init_write(void);
00767 extern int write_game_module(Module *module, char *fname);

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