Freeciv-3.2
Loading...
Searching...
No Matches
daidata.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__DAIDATA_H
14#define FC__DAIDATA_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 */
99
100 /* Cache map for AI settlers; defined in daisettler.c. */
102
103 /* The units of tech_want seem to be shields */
105};
106
107void dai_data_init(struct ai_type *ait, struct player *pplayer);
108void dai_data_close(struct ai_type *ait, struct player *pplayer);
109
110void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer,
111 bool is_new_phase);
112void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer);
113bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer);
114
115struct ai_plr *dai_plr_data_get(struct ai_type *ait, struct player *pplayer,
116 bool *caller_closes);
117
118struct ai_dip_intel *dai_diplomacy_get(struct ai_type *ait,
119 const struct player *plr1,
120 const struct player *plr2);
121
122void dai_gov_value(struct ai_type *ait, struct player *pplayer,
123 struct government *gov,
124 adv_want *val, bool *override);
125
126void dai_adjust_policies(struct ai_type *ait, struct player *pplayer);
127
128#endif /* FC__DAIDATA_H */
char * incite_cost
Definition comments.c:75
winning_strategy
Definition daidata.h:31
@ WIN_SPACE
Definition daidata.h:34
@ WIN_CAPITAL
Definition daidata.h:35
@ WIN_OPEN
Definition daidata.h:32
@ WIN_WAR
Definition daidata.h:33
bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:132
void dai_gov_value(struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition daidata.c:524
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
Definition daidata.c:308
void dai_adjust_policies(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:442
struct ai_dip_intel * dai_diplomacy_get(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition daidata.c:402
void dai_data_init(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:59
void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer, bool is_new_phase)
Definition daidata.c:142
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:285
void dai_data_close(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:104
float adv_want
Definition fc_types.h:1354
struct player * at_war_with_ally
Definition daidata.h:56
signed char asked_about_alliance
Definition daidata.h:65
enum war_reason war_reason
Definition daidata.h:62
signed char spam
Definition daidata.h:59
signed char asked_about_peace
Definition daidata.h:64
int distance
Definition daidata.h:60
struct player * is_allied_with_ally
Definition daidata.h:57
signed char warned_about_space
Definition daidata.h:67
int countdown
Definition daidata.h:61
signed char ally_patience
Definition daidata.h:63
struct player * is_allied_with_enemy
Definition daidata.h:55
signed char asked_about_ceasefire
Definition daidata.h:66
int passengers
Definition daidata.h:78
int * ocean_workers
Definition daidata.h:83
int last_num_oceans
Definition daidata.h:75
int * workers
Definition daidata.h:82
int last_num_continents
Definition daidata.h:74
bool phase_initialized
Definition daidata.h:72
struct ai_plr::@253 stats
int boats
Definition daidata.h:79
struct ai_settler * settler
Definition daidata.h:101
adv_want tech_want[A_LAST+1]
Definition daidata.h:104
struct ai_plr::@254 diplomacy
int req_love_for_alliance
Definition daidata.h:96
int timer
Definition daidata.h:92
char love_incr
Definition daidata.h:94
char love_coeff
Definition daidata.h:93
bv_id diplomat_reservations
Definition daidata.h:85
const struct ai_dip_intel ** player_intel_slots
Definition daidata.h:90
struct player * war_target
Definition daidata.h:97
int available_boats
Definition daidata.h:80
int req_love_for_peace
Definition daidata.h:95
enum winning_strategy strategy
Definition daidata.h:91
Definition ai.h:50
#define A_LAST
Definition tech.h:45