Freeciv-3.2
Loading...
Searching...
No Matches
aitools.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__AITOOLS_H
14#define FC__AITOOLS_H
15
16/* utility */
17#include "support.h" /* bool type */
18
19/* server/advisors */
20#include "advchoice.h"
21
22/* ai/default */
23#include "daiunit.h" /* enum ai_unit_task */
24
25struct pf_path;
26struct pf_parameter;
27struct pft_amphibious;
28
29struct adv_risk_cost;
30
31#define DAI_WANT_BELOW_MIL_EMERGENCY (1000.0)
32#define DAI_WANT_MILITARY_EMERGENCY (DAI_WANT_BELOW_MIL_EMERGENCY + 0.1)
33#define DAI_WANT_DOMESTIC_MAX (DAI_WANT_MILITARY_EMERGENCY / 4 * 3)
34
35const char *dai_unit_task_rule_name(const enum ai_unit_task task);
36
37adv_want military_amortize(struct player *pplayer, struct city *pcity,
38 adv_want value, int delay, int build_cost);
39int stack_cost(struct unit *pattacker, struct unit *pdefender);
40
41void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit,
42 struct tile *ptile, struct pf_path *path,
43 int step);
44
45void dai_fill_unit_param(struct ai_type *ait,
46 struct pf_parameter *parameter,
48 struct unit *punit, struct tile *ptile);
49bool dai_gothere(struct ai_type *ait, struct player *pplayer,
50 struct unit *punit, struct tile *dst_tile);
51struct tile *immediate_destination(struct unit *punit,
52 struct tile *dest_tile);
53void dai_log_path(struct unit *punit,
54 struct pf_path *path, struct pf_parameter *parameter);
55bool dai_unit_goto_constrained(struct ai_type *ait, struct unit *punit,
56 struct tile *ptile,
57 struct pf_parameter *parameter);
58bool dai_unit_goto(struct ai_type *ait, struct unit *punit, struct tile *ptile);
59bool goto_is_sane(struct unit *punit, struct tile *ptile);
60
61void dai_unit_new_task(struct ai_type *ait, struct unit *punit,
62 enum ai_unit_task task, struct tile *ptile);
63void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit,
64 enum adv_unit_task task, struct tile *ptile);
65bool dai_unit_make_homecity(struct unit *punit, struct city *pcity);
66bool dai_unit_attack(struct ai_type *ait, struct unit *punit,
67 struct tile *ptile);
68bool dai_unit_move(struct ai_type *ait, struct unit *punit, struct tile *ptile);
69
70void dai_government_change(struct player *pplayer, struct government *gov);
71int dai_gold_reserve(struct player *pplayer);
72
73void adjust_choice(int pct, struct adv_choice *choice);
74
75bool dai_choose_role_unit(struct ai_type *ait, struct player *pplayer,
76 struct city *pcity, struct adv_choice *choice,
77 enum choice_type type, int role, int want,
78 bool need_boat);
79void dai_build_adv_override(struct ai_type *ait, struct city *pcity,
80 struct adv_choice *choice);
82 struct city *pcity);
83
84void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1,
85 struct player *plr2,
86 enum override_bool *result);
87
88#endif /* FC__AITOOLS_H */
choice_type
Definition advchoice.h:36
void dai_government_change(struct player *pplayer, struct government *gov)
Definition aitools.c:1308
void dai_fill_unit_param(struct ai_type *ait, struct pf_parameter *parameter, struct adv_risk_cost *risk_cost, struct unit *punit, struct tile *ptile)
Definition aitools.c:470
int stack_cost(struct unit *pattacker, struct unit *pdefender)
Definition aitools.c:1282
bool dai_gothere(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile *dst_tile)
Definition aitools.c:245
bool goto_is_sane(struct unit *punit, struct tile *ptile)
Definition aitools.c:430
struct tile * immediate_destination(struct unit *punit, struct tile *dest_tile)
Definition aitools.c:303
void dai_build_adv_override(struct ai_type *ait, struct city *pcity, struct adv_choice *choice)
Definition aitools.c:1369
bool dai_unit_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition aitools.c:818
bool dai_unit_goto(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition aitools.c:606
bool dai_unit_goto_constrained(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_parameter *parameter)
Definition aitools.c:379
void dai_log_path(struct unit *punit, struct pf_path *path, struct pf_parameter *parameter)
Definition aitools.c:357
void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1, struct player *plr2, enum override_bool *result)
Definition aitools.c:142
void dai_unit_new_task(struct ai_type *ait, struct unit *punit, enum ai_unit_task task, struct tile *ptile)
Definition aitools.c:644
int dai_gold_reserve(struct player *pplayer)
Definition aitools.c:1327
bool dai_assess_military_unhappiness(const struct civ_map *nmap, struct city *pcity)
Definition aitools.c:1417
void adjust_choice(int pct, struct adv_choice *choice)
Definition aitools.c:1337
bool dai_unit_make_homecity(struct unit *punit, struct city *pcity)
Definition aitools.c:756
bool dai_choose_role_unit(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, enum choice_type type, int role, int want, bool need_boat)
Definition aitools.c:1346
const char * dai_unit_task_rule_name(const enum ai_unit_task task)
Definition aitools.c:77
adv_want military_amortize(struct player *pplayer, struct city *pcity, adv_want value, int delay, int build_cost)
Definition aitools.c:118
bool dai_unit_move(struct ai_type *ait, struct unit *punit, struct tile *ptile)
Definition aitools.c:1085
void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition aitools.c:620
void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition aitools.c:1067
char * incite_cost
Definition comments.c:75
ai_unit_task
Definition daiunit.h:27
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
float adv_want
Definition fc_types.h:1354
adv_unit_task
Definition fc_types.h:370
override_bool
Definition fc_types.h:94
GType type
Definition repodlgs.c:1313
int step
Definition specpq.h:92
Definition ai.h:50
Definition city.h:320
Definition tile.h:50
Definition unit.h:138