Freeciv21
Develop your civilization from humble roots to a global empire
actiontools.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 
12 #pragma once
13 
14 // common
15 #include "actions.h"
16 #include "player.h"
17 #include "tile.h"
18 #include "unit.h"
19 
20 void action_consequence_caught(const struct action *paction,
21  struct player *offender,
22  struct player *victim_player,
23  const struct tile *victim_tile,
24  const char *victim_link);
25 
26 void action_consequence_success(const struct action *paction,
27  struct player *offender,
28  struct player *victim_player,
29  const struct tile *victim_tile,
30  const char *victim_link);
31 
32 void action_consequence_complete(const struct action *paction,
33  struct player *offender,
34  struct player *victim_player,
35  const struct tile *victim_tile,
36  const char *victim_link);
37 
38 void action_success_target_pay_mp(struct action *paction, int target_id,
39  struct unit *target);
40 
41 void action_success_actor_price(struct action *paction, int actor_id,
42  struct unit *actor);
43 
44 int action_sub_target_id_for_action(const struct action *paction,
45  struct unit *actor_unit);
46 
48  const enum action_auto_perf_cause cause, const struct unit *actor,
49  const struct player *other_player, const struct output_type *output);
50 
51 const struct action *action_auto_perf_unit_do(
52  const enum action_auto_perf_cause cause, struct unit *actor,
53  const struct player *other_player, const struct output_type *output,
54  const struct tile *target_tile, const struct city *target_city,
55  const struct unit *target_unit, const struct extra_type *target_extra);
56 
58  const enum action_auto_perf_cause cause, struct unit *actor,
59  const struct player *other_player, const struct output_type *output,
60  const struct tile *target_tile, const struct city *target_city,
61  const struct unit *target_unit, const struct extra_type *target_extra);
62 
63 bool action_failed_dice_roll(const struct player *act_player,
64  const struct unit *act_unit,
65  const struct city *tgt_city,
66  const struct player *tgt_player,
67  const struct action *paction);
void action_consequence_success(const struct action *paction, struct player *offender, struct player *victim_player, const struct tile *victim_tile, const char *victim_link)
Take care of any consequences (like casus belli) of successfully performing the given action.
struct act_prob action_auto_perf_unit_prob(const enum action_auto_perf_cause cause, struct unit *actor, const struct player *other_player, const struct output_type *output, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit, const struct extra_type *target_extra)
Returns the probability for the specified actor unit to be forced to perform an action by the specifi...
void action_consequence_caught(const struct action *paction, struct player *offender, struct player *victim_player, const struct tile *victim_tile, const char *victim_link)
Take care of any consequences (like casus belli) of getting caught while trying to perform the given ...
void action_success_target_pay_mp(struct action *paction, int target_id, struct unit *target)
Pay the movement point price of being the target of an action.
Definition: actiontools.cpp:70
const struct action * action_auto_perf_unit_do(const enum action_auto_perf_cause cause, struct unit *actor, const struct player *other_player, const struct output_type *output, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit, const struct extra_type *target_extra)
Make the specified actor unit perform an action because of cause.
void action_success_actor_price(struct action *paction, int actor_id, struct unit *actor)
Make the actor that successfully performed the action pay the price.
Definition: actiontools.cpp:88
void action_consequence_complete(const struct action *paction, struct player *offender, struct player *victim_player, const struct tile *victim_tile, const char *victim_link)
Take care of any consequences (like casus belli) of successfully completing the given action.
bool action_failed_dice_roll(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
Returns TRUE iff the spy/diplomat was caught outside of a diplomatic battle.
int action_sub_target_id_for_action(const struct action *paction, struct unit *actor_unit)
Find an sub target for the specified action.
const struct action_auto_perf * action_auto_perf_unit_sel(const enum action_auto_perf_cause cause, const struct unit *actor, const struct player *other_player, const struct output_type *output)
Returns the action auto performer that the specified cause can force the specified actor to perform.
enum action_auto_perf_cause cause
Definition: actions.h:457
union action::@10 actor
Definition: city.h:291
Definition: player.h:231
Definition: tile.h:42
Definition: unit.h:134