Freeciv-3.1
Loading...
Searching...
No Matches
aidata.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2002 - The Freeciv Project
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__AIDATA_H
14#define FC__AIDATA_H
15
16/* utility */
17#include "support.h"
18
19/* common */
20#include "fc_types.h"
21#include "tech.h"
22
23/* server */
24#include "srv_main.h" /* bv_id */
25
26/* server/advisors */
27#include "advtools.h"
28
29struct player;
30
32 WIN_OPEN, /* still undetermined */
33 WIN_WAR, /* we have no other choice than to crush all opposition */
34 WIN_SPACE, /* we will race for space, peace very important */
35 WIN_CAPITAL /* we cannot win unless we take war_target's capital */
36};
37
38#define SPECENUM_NAME war_reason
39#define SPECENUM_VALUE0 DAI_WR_BEHAVIOUR
40#define SPECENUM_VALUE0NAME "Behaviour"
41#define SPECENUM_VALUE1 DAI_WR_SPACE
42#define SPECENUM_VALUE1NAME "Space"
43#define SPECENUM_VALUE2 DAI_WR_EXCUSE
44#define SPECENUM_VALUE2NAME "Excuse"
45#define SPECENUM_VALUE3 DAI_WR_HATRED
46#define SPECENUM_VALUE3NAME "Hatred"
47#define SPECENUM_VALUE4 DAI_WR_ALLIANCE
48#define SPECENUM_VALUE4NAME "Alliance"
49#define SPECENUM_VALUE5 DAI_WR_NONE
50#define SPECENUM_VALUE5NAME "None"
51#include "specenum_gen.h"
52
54 /* Remember one example of each for text spam purposes. */
58
59 signed char spam; /* timer to avoid spamming a player with chat */
60 int distance; /* average distance to that player's cities */
61 int countdown; /* we're on a countdown to war declaration */
62 enum war_reason war_reason; /* why we declare war */
63 signed char ally_patience; /* we EXPECT our allies to help us! */
64 signed char asked_about_peace; /* don't ask again */
65 signed char asked_about_alliance; /* don't nag! */
66 signed char asked_about_ceasefire; /* don't ... you get the point */
67 signed char warned_about_space;
68};
69
70struct ai_plr
71{
73
76
77 struct {
78 int passengers; /* number of passengers waiting for boats */
79 int boats;
81
82 int *workers; /* cities to workers on continent */
84
87
88 /* AI diplomacy and opinions on other players */
89 struct {
92 int timer; /* pursue our goals with some stubbornness, in turns */
93 char love_coeff; /* Reduce love with this % each turn */
94 char love_incr; /* Modify love with this fixed amount */
98
99 /* Cache map for AI settlers; defined in daisettler.c. */
101
102 /* The units of tech_want seem to be shields */
104};
105
106void dai_data_init(struct ai_type *ait, struct player *pplayer);
107void dai_data_close(struct ai_type *ait, struct player *pplayer);
108
109void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer,
110 bool is_new_phase);
111void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer);
112bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer);
113
114struct ai_plr *dai_plr_data_get(struct ai_type *ait, struct player *pplayer,
115 bool *caller_closes);
116
117struct ai_dip_intel *dai_diplomacy_get(struct ai_type *ait,
118 const struct player *plr1,
119 const struct player *plr2);
120
121void dai_gov_value(struct ai_type *ait, struct player *pplayer, struct government *gov,
122 adv_want *val, bool *override);
123
124void dai_adjust_policies(struct ai_type *ait, struct player *pplayer);
125
126#endif /* FC__AIDATA_H */
winning_strategy
Definition aidata.h:31
@ WIN_SPACE
Definition aidata.h:34
@ WIN_CAPITAL
Definition aidata.h:35
@ WIN_OPEN
Definition aidata.h:32
@ WIN_WAR
Definition aidata.h:33
bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer)
Definition aidata.c:132
void dai_gov_value(struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition aidata.c:524
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
Definition aidata.c:308
void dai_adjust_policies(struct ai_type *ait, struct player *pplayer)
Definition aidata.c:442
struct ai_dip_intel * dai_diplomacy_get(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition aidata.c:402
void dai_data_init(struct ai_type *ait, struct player *pplayer)
Definition aidata.c:59
void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer, bool is_new_phase)
Definition aidata.c:142
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition aidata.c:285
void dai_data_close(struct ai_type *ait, struct player *pplayer)
Definition aidata.c:104
float adv_want
Definition fc_types.h:1206
struct player * at_war_with_ally
Definition aidata.h:56
signed char asked_about_alliance
Definition aidata.h:65
enum war_reason war_reason
Definition aidata.h:62
signed char spam
Definition aidata.h:59
signed char asked_about_peace
Definition aidata.h:64
int distance
Definition aidata.h:60
struct player * is_allied_with_ally
Definition aidata.h:57
signed char warned_about_space
Definition aidata.h:67
int countdown
Definition aidata.h:61
signed char ally_patience
Definition aidata.h:63
struct player * is_allied_with_enemy
Definition aidata.h:55
signed char asked_about_ceasefire
Definition aidata.h:66
int passengers
Definition aidata.h:78
int * ocean_workers
Definition aidata.h:83
int last_num_oceans
Definition aidata.h:75
int * workers
Definition aidata.h:82
int last_num_continents
Definition aidata.h:74
struct ai_plr::@268 diplomacy
bool phase_initialized
Definition aidata.h:72
struct ai_plr::@267 stats
int boats
Definition aidata.h:79
struct ai_settler * settler
Definition aidata.h:100
adv_want tech_want[A_LAST+1]
Definition aidata.h:103
int req_love_for_alliance
Definition aidata.h:96
int timer
Definition aidata.h:92
char love_incr
Definition aidata.h:94
char love_coeff
Definition aidata.h:93
bv_id diplomat_reservations
Definition aidata.h:85
const struct ai_dip_intel ** player_intel_slots
Definition aidata.h:90
int available_boats
Definition aidata.h:80
int req_love_for_peace
Definition aidata.h:95
enum winning_strategy strategy
Definition aidata.h:91
Definition ai.h:50
#define A_LAST
Definition tech.h:45