Freeciv-3.3
|
#include "bitvector.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "timing.h"
#include "actions.h"
#include "city.h"
#include "combat.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "movement.h"
#include "nation.h"
#include "packets.h"
#include "player.h"
#include "research.h"
#include "unit.h"
#include "unitlist.h"
#include "aiactions.h"
#include "pf_tools.h"
#include "barbarian.h"
#include "citytools.h"
#include "cityturn.h"
#include "diplomats.h"
#include "maphand.h"
#include "srv_log.h"
#include "unithand.h"
#include "unittools.h"
#include "advbuilding.h"
#include "advdata.h"
#include "advgoto.h"
#include "handicaps.h"
#include "aiguard.h"
#include "aihand.h"
#include "daiactions.h"
#include "daicity.h"
#include "daidata.h"
#include "dailog.h"
#include "daimilitary.h"
#include "daiplayer.h"
#include "daitools.h"
#include "daiunit.h"
#include "aidiplomat.h"
Go to the source code of this file.
Macros | |
#define | LOG_DIPLOMAT LOG_DEBUG |
#define | LOG_DIPLOMAT_BUILD LOG_DEBUG |
#define | DIPLO_DEFENSE_WANT 3000 |
#define DIPLO_DEFENSE_WANT 3000 |
Definition at line 82 of file aidiplomat.c.
Definition at line 77 of file aidiplomat.c.
Definition at line 78 of file aidiplomat.c.
Number of techs that we don't have and the enemy (tplayer) does.
Definition at line 94 of file aidiplomat.c.
Referenced by dai_diplomat_city().
void dai_choose_diplomat_defensive | ( | struct ai_type * | ait, |
struct player * | pplayer, | ||
struct city * | pcity, | ||
struct adv_choice * | choice, | ||
int | def | ||
) |
Calculates our need for diplomats as defensive units. May replace values in choice. The values 16000 and 3000 used below are totally arbitrary but seem to work.
Definition at line 115 of file aidiplomat.c.
Referenced by military_advisor_choose_build().
void dai_choose_diplomat_offensive | ( | struct ai_type * | ait, |
struct player * | pplayer, | ||
struct city * | pcity, | ||
struct adv_choice * | choice | ||
) |
Calculates our need for diplomats as offensive units. May replace values in choice.
Definition at line 166 of file aidiplomat.c.
Referenced by military_advisor_choose_build().
|
static |
Find units that we can reach, and bribe them. Returns TRUE if survived the ordeal, FALSE if not or we expended all our movement. Will try to bribe a ship on the coast as well as land stuff.
Definition at line 588 of file aidiplomat.c.
Referenced by dai_manage_diplomat().
|
static |
Check if something is on our receiving end for some nasty diplomat business! Note that punit may die or be moved during this function. We must be adjacent to target city.
We try to make embassy first, and abort if we already have one and target is allied. Then we steal, incite, sabotage or poison the city, in that order of priority.
Definition at line 327 of file aidiplomat.c.
Referenced by dai_manage_diplomat().
|
static |
Go to nearest/most threatened city (can be the current city too).
Definition at line 520 of file aidiplomat.c.
Referenced by dai_manage_diplomat().
If we are the only diplomat in a threatened city, defend against enemy actions. The passive defense is set by game.diplchance. The active defense is to bribe units which end their move nearby. Our next trick is to look for enemy cities on our continent and do our diplomat things.
FIXME: It is important to establish contact with all civilizations, so we should send diplomats by boat eventually. I just don't know how that part of the code works, yet - Per
Definition at line 723 of file aidiplomat.c.
Referenced by dai_manage_unit().
|
static |
Returns (in ctarget) the closest city to send diplomats against, or NULL if none available on this continent. punit can be virtual.
Definition at line 441 of file aidiplomat.c.
Referenced by dai_choose_diplomat_offensive(), and dai_manage_diplomat().
|
static |
Check if we have a diplomat / spy near a given city. This is used to prevent a stack of such units next to a foreign city.
Definition at line 417 of file aidiplomat.c.
Referenced by find_city_to_diplomat().