Freeciv-3.3: /fast/freeciv/nightly/main/ai/default/aidiplomat.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Functions
aidiplomat.h File Reference
`#include "fc_types.h"`

Go to the source code of this file.

## Functions

void | dai_manage_diplomat (struct ai_type *ait, struct player *pplayer, struct unit *punit)
void | dai_choose_diplomat_defensive (struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, int def)
void | dai_choose_diplomat_offensive (struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice)

## Function Documentation

## ◆ dai_choose_diplomat_defensive()

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().

## ◆ dai_choose_diplomat_offensive()

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().

## ◆ dai_manage_diplomat()

void dai_manage_diplomat | ( | struct ai_type * | ait,
|  | struct player * | pplayer,
|  | struct unit * | punit
| ) |  |

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().