Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions
daiactions.c File Reference
#include "city.h"
#include "metaknowledge.h"
#include "movement.h"
#include "player.h"
#include "research.h"
#include "tech.h"
#include "unit.h"
#include "cityturn.h"
#include "diplomats.h"
#include "srv_log.h"
#include "aihand.h"
#include "daiactions.h"

Go to the source code of this file.

Macros

#define LOG_DIPLOMAT   LOG_DEBUG
 

Functions

static int count_sabotagable_improvements (struct city *pcity)
 
static Tech_type_id choose_tech_to_steal (const struct player *actor_player, const struct player *target_player)
 
adv_want dai_action_value_unit_vs_city (struct action *paction, struct unit *actor_unit, struct city *target_city, int sub_tgt_id, int count_tech)
 
int dai_action_choose_sub_tgt_unit_vs_city (struct action *paction, struct unit *actor_unit, struct city *target_city)
 

Macro Definition Documentation

◆ LOG_DIPLOMAT

#define LOG_DIPLOMAT   LOG_DEBUG

Definition at line 39 of file daiactions.c.

Function Documentation

◆ choose_tech_to_steal()

static Tech_type_id choose_tech_to_steal ( const struct player actor_player,
const struct player target_player 
)
static

Pick a tech for actor_player to steal from target_player.

TODO: Make a smarter choice than picking the first stealable tech found.

Definition at line 63 of file daiactions.c.

Referenced by dai_action_choose_sub_tgt_unit_vs_city().

◆ count_sabotagable_improvements()

static int count_sabotagable_improvements ( struct city pcity)
static

Number of improvements that can be sabotaged in pcity.

Definition at line 44 of file daiactions.c.

Referenced by dai_action_value_unit_vs_city().

◆ dai_action_choose_sub_tgt_unit_vs_city()

int dai_action_choose_sub_tgt_unit_vs_city ( struct action paction,
struct unit actor_unit,
struct city target_city 
)

Returns the sub target id of the sub target chosen for the specified action performed by the specified unit to the specified target city.

Definition at line 310 of file daiactions.c.

Referenced by dai_diplomat_city().

◆ dai_action_value_unit_vs_city()

adv_want dai_action_value_unit_vs_city ( struct action paction,
struct unit actor_unit,
struct city target_city,
int  sub_tgt_id,
int  count_tech 
)

Returns the utility of having the specified unit perform the specified action to the specified city target with the specified sub target. The sub target id is encoded like it is in the network protocol.

Definition at line 96 of file daiactions.c.

Referenced by dai_diplomat_city().