Freeciv-3.3
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)
 
void dai_revolution_start (struct ai_type *ait, struct player *pplayer)
 

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

Referenced by cai_diplomacy_actions(), and texwai_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 1018 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 964 of file daidiplomacy.c.

Referenced by cai_diplomacy_first_contact(), and texwai_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 1986 of file daidiplomacy.c.

Referenced by cai_incident(), and texwai_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 1971 of file daidiplomacy.c.

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

◆ dai_revolution_start()

void dai_revolution_start ( struct ai_type ait,
struct player pplayer 
)

Revolution start callback for default AI.

Parameters
aitAI type of the player revolting
pplayerPlayer revolting

Definition at line 1445 of file daidiplomacy.c.

Referenced by cai_revolution_start(), and texwai_revolution_start().

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

Referenced by cai_treaty_accepted(), and texwai_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 624 of file daidiplomacy.c.

Referenced by cai_treaty_evaluate(), and texwai_treaty_evaluate().