Freeciv-3.1
Loading...
Searching...
No Matches
Functions
daidiplomacy.h File Reference
#include "fc_types.h"
#include "ai.h"

Go to the source code of this file.

Functions

void dai_diplomacy_begin_new_phase (struct ai_type *ait, struct player *pplayer)
 
void dai_diplomacy_actions (struct ai_type *ait, struct player *pplayer)
 
void dai_treaty_evaluate (struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
 
void dai_treaty_accepted (struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
 
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)
 
bool dai_on_war_footing (struct ai_type *ait, struct player *pplayer)
 
void dai_diplomacy_first_contact (struct ai_type *ait, struct player *pplayer, struct player *aplayer)
 

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 1544 of file daidiplomacy.c.

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 1005 of file daidiplomacy.c.

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 951 of file daidiplomacy.c.

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 1934 of file daidiplomacy.c.

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 1919 of file daidiplomacy.c.

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 731 of file daidiplomacy.c.

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 611 of file daidiplomacy.c.

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