Freeciv-3.1
Loading...
Searching...
No Matches
aiactions.c
Go to the documentation of this file.
1/**********************************************************************
2 Freeciv - Copyright (C) 2020 - The Freeciv Project contributors.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common */
19#include "unittype.h"
20
21
22#include "aiactions.h"
23
24
25/**********************************************************************/
30{
31 return (utype_can_do_action_result(putype, ACTRES_SPY_POISON)
32 || utype_can_do_action_result(putype, ACTRES_SPY_SPREAD_PLAGUE)
33 || utype_can_do_action_result(putype, ACTRES_SPY_SABOTAGE_CITY)
35 ACTRES_SPY_TARGETED_SABOTAGE_CITY)
37 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION)
38 || utype_can_do_action_result(putype, ACTRES_SPY_INCITE_CITY)
39 || utype_can_do_action_result(putype, ACTRES_ESTABLISH_EMBASSY)
40 || utype_can_do_action_result(putype, ACTRES_SPY_STEAL_TECH)
42 ACTRES_SPY_TARGETED_STEAL_TECH)
43 || utype_can_do_action_result(putype, ACTRES_SPY_INVESTIGATE_CITY)
44 || utype_can_do_action_result(putype, ACTRES_SPY_STEAL_GOLD)
45 || utype_can_do_action_result(putype, ACTRES_STEAL_MAPS)
46 || utype_can_do_action_result(putype, ACTRES_SPY_NUKE));
47}
48
49/**********************************************************************/
53bool aia_utype_is_considered_spy(const struct unit_type *putype)
54{
57 ACTRES_SPY_ATTACK)
59 ACTRES_SPY_BRIBE_UNIT)
61 ACTRES_SPY_SABOTAGE_UNIT));
62}
63
64/**********************************************************************/
69{
70 return (utype_can_do_action_result(putype,
71 ACTRES_TRADE_ROUTE)
73 ACTRES_MARKETPLACE));
74}
75
76/**********************************************************************/
81{
84 ACTRES_HELP_WONDER));
85}
86
87/**********************************************************************/
91bool aia_utype_is_considered_worker(const struct unit_type *putype)
92{
93 return (utype_can_do_action_result(putype, ACTRES_TRANSFORM_TERRAIN)
94 || utype_can_do_action_result(putype, ACTRES_CULTIVATE)
95 || utype_can_do_action_result(putype, ACTRES_PLANT)
96 || utype_can_do_action_result(putype, ACTRES_ROAD)
97 || utype_can_do_action_result(putype, ACTRES_BASE)
98 || utype_can_do_action_result(putype, ACTRES_MINE)
99 || utype_can_do_action_result(putype, ACTRES_IRRIGATE)
100 || utype_can_do_action_result(putype, ACTRES_CLEAN_POLLUTION)
101 || utype_can_do_action_result(putype, ACTRES_CLEAN_FALLOUT));
102}
bool aia_utype_is_considered_caravan_trade(const struct unit_type *putype)
Definition aiactions.c:68
bool aia_utype_is_considered_spy_vs_city(const struct unit_type *putype)
Definition aiactions.c:29
bool aia_utype_is_considered_spy(const struct unit_type *putype)
Definition aiactions.c:53
bool aia_utype_is_considered_caravan(const struct unit_type *putype)
Definition aiactions.c:80
bool aia_utype_is_considered_worker(const struct unit_type *putype)
Definition aiactions.c:91
bool utype_can_do_action_result(const struct unit_type *putype, enum action_result result)
Definition unittype.c:459