Freeciv21
Develop your civilization from humble roots to a global empire
daidiplomacy.h File Reference
#include "fc_types.h"
#include "ai.h"
+ Include dependency graph for daidiplomacy.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void dai_diplomacy_begin_new_phase (struct ai_type *ait, struct player *pplayer)
 Calculate our diplomatic predispositions here. More...
 
void dai_diplomacy_actions (struct ai_type *ait, struct player *pplayer)
 Do diplomatic actions. More...
 
void dai_treaty_evaluate (struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
 pplayer is AI player, aplayer is the other player involved, treaty is the treaty being considered. More...
 
void dai_treaty_accepted (struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
 This function is called when a treaty has been concluded, to deal with followup issues like comments and relationship (love) changes. More...
 
void dai_incident (struct ai_type *ait, enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)
 Handle incident caused by violator. More...
 
bool dai_on_war_footing (struct ai_type *ait, struct player *pplayer)
 Are we going to be declaring war in a few turns time? If so, go on a war footing, and try to buy out as many units as possible. More...
 
void dai_diplomacy_first_contact (struct ai_type *ait, struct player *pplayer, struct player *aplayer)
 What to do when we first meet. More...
 

Function Documentation

◆ dai_diplomacy_actions()

void dai_diplomacy_actions ( struct ai_type ait,
struct player pplayer 
)

Do diplomatic actions.

Must be called only after calculate function above has been run for all AI players.

Only ever called for AI players.

Definition at line 1547 of file daidiplomacy.cpp.

Referenced by cai_diplomacy_actions(), texwai_diplomacy_actions(), and twai_diplomacy_actions().

◆ dai_diplomacy_begin_new_phase()

void dai_diplomacy_begin_new_phase ( struct ai_type ait,
struct player pplayer 
)

Calculate our diplomatic predispositions here.

Don't do anything.

Only ever called for AI players and never for barbarians.

This is called at the start of a new AI phase. It's not called when a game is loaded. So everything calculated here should be put into the savegame.

Definition at line 1010 of file daidiplomacy.cpp.

Referenced by dai_data_phase_begin().

◆ dai_diplomacy_first_contact()

void dai_diplomacy_first_contact ( struct ai_type ait,
struct player pplayer,
struct player aplayer 
)

What to do when we first meet.

pplayer is the AI player.

Definition at line 957 of file daidiplomacy.cpp.

Referenced by cai_diplomacy_first_contact(), texwai_diplomacy_first_contact(), and twai_diplomacy_first_contact().

◆ dai_incident()

void dai_incident ( struct ai_type ait,
enum incident_type  type,
enum casus_belli_range  scope,
const struct action paction,
struct player receiver,
struct player violator,
struct player victim 
)

Handle incident caused by violator.

Definition at line 1958 of file daidiplomacy.cpp.

Referenced by cai_incident(), texwai_incident(), and twai_incident().

◆ dai_on_war_footing()

bool dai_on_war_footing ( struct ai_type ait,
struct player pplayer 
)

Are we going to be declaring war in a few turns time? If so, go on a war footing, and try to buy out as many units as possible.

Definition at line 1941 of file daidiplomacy.cpp.

Referenced by dai_city_choose_build(), dai_manage_cities(), dai_manage_taxes(), and dai_spend_gold().

◆ dai_treaty_accepted()

void dai_treaty_accepted ( struct ai_type ait,
struct player pplayer,
struct player aplayer,
struct Treaty ptreaty 
)

This function is called when a treaty has been concluded, to deal with followup issues like comments and relationship (love) changes.

pplayer is AI player, aplayer is the other player involved, ptreaty is the treaty accepted.

Definition at line 720 of file daidiplomacy.cpp.

Referenced by cai_treaty_accepted(), texwai_treaty_accepted(), and twai_treaty_accepted().

◆ dai_treaty_evaluate()

void dai_treaty_evaluate ( struct ai_type ait,
struct player pplayer,
struct player aplayer,
struct Treaty ptreaty 
)

pplayer is AI player, aplayer is the other player involved, treaty is the treaty being considered.

It is all a question about money :-)

Definition at line 598 of file daidiplomacy.cpp.

Referenced by cai_treaty_evaluate(), texwai_treaty_evaluate(), and twai_treaty_evaluate().