79 int target_id,
struct unit *target)
93 EFT_ACTION_SUCCESS_TARGET_MOVE_COST);
114 struct player *victim_player,
115 const bool int_outrage)
124 if (oplayer != offender) {
129 }
else if (victim_player && offender != victim_player) {
151 struct player *victim_player,
152 const struct tile *victim_tile,
153 const char *victim_link,
157 const enum effect_type eft)
159 enum casus_belli_range cbr;
162 eft, paction, victim_tile);
164 if (cbr >= CBR_VICTIM_ONLY) {
170 const bool int_outrage = (cbr == CBR_INTERNATIONAL_OUTRAGE);
173 notify_actor(offender, paction, offender, victim_player,
174 victim_tile, victim_link);
175 notify_victim(victim_player, paction, offender, victim_player,
176 victim_tile, victim_link);
182 notify_global(oplayer, paction, offender,
183 victim_player, victim_tile, victim_link);
196 if (victim_player != NULL && victim_player != offender) {
209 const struct action *paction,
211 struct player *victim_player,
212 const struct tile *victim_tile,
213 const char *victim_link)
215 if (!victim_player || offender == victim_player) {
226 _(
"You have caused an diplomatic incident getting caught"
227 " trying to do %s to %s."),
236 _(
"You have caused an diplomatic incident getting caught"
237 " trying to do %s to %s %s."),
247 _(
"You have caused an diplomatic incident getting caught"
248 " trying to do %s at %s."),
266 const struct action *paction,
268 struct player *victim_player,
269 const struct tile *victim_tile,
270 const char *victim_link)
272 if (!victim_player || offender == victim_player) {
283 _(
"The %s have caused an diplomatic incident getting caught"
284 " trying to do %s to %s."),
294 _(
"The %s have caused an diplomatic incident getting caught"
295 " trying to do %s to your %s."),
305 _(
"The %s have caused an diplomatic incident getting caught"
306 " trying to do %s at %s."),
325 const struct action *paction,
327 struct player *victim_player,
328 const struct tile *victim_tile,
329 const char *victim_link)
331 if (receiver == offender) {
335 _(
"Getting caught while trying to do %s gives "
336 "everyone a casus belli against you."),
338 }
else if (receiver == victim_player) {
342 _(
"Getting caught while trying to do %s to you gives "
343 "everyone a casus belli against the %s."),
346 }
else if (victim_player == NULL) {
350 _(
"You now have a casus belli against the %s. "
351 "They got caught trying to do %s."),
358 _(
"You now have a casus belli against the %s. "
359 "They got caught trying to do %s to the %s."),
375 struct player *victim_player,
376 const struct tile *victim_tile,
377 const char *victim_link)
380 victim_player, victim_tile, victim_link,
384 EFT_CASUS_BELLI_CAUGHT);
392 const struct action *paction,
394 struct player *victim_player,
395 const struct tile *victim_tile,
396 const char *victim_link)
398 if (!victim_player || offender == victim_player) {
409 _(
"You have caused an diplomatic incident doing %s to %s."),
418 _(
"You have caused an diplomatic incident doing %s to %s %s."),
428 _(
"You have caused an diplomatic incident doing %s at %s."),
446 const struct action *paction,
448 struct player *victim_player,
449 const struct tile *victim_tile,
450 const char *victim_link)
452 if (!victim_player || offender == victim_player) {
463 _(
"The %s have caused an diplomatic incident doing %s to %s."),
473 _(
"The %s have caused an diplomatic incident doing "
484 _(
"The %s have caused an diplomatic incident doing %s at %s."),
503 const struct action *paction,
505 struct player *victim_player,
506 const struct tile *victim_tile,
507 const char *victim_link)
509 if (receiver == offender) {
513 _(
"Doing %s gives everyone a casus belli against you."),
515 }
else if (receiver == victim_player) {
519 _(
"Doing %s to you gives everyone a casus belli against "
523 }
else if (victim_player == NULL) {
527 _(
"You now have a casus belli against the %s. "
535 _(
"You now have a casus belli against the %s. "
536 "They did %s to the %s."),
552 struct player *victim_player,
553 const struct tile *victim_tile,
554 const char *victim_link)
557 victim_player, victim_tile, victim_link,
561 EFT_CASUS_BELLI_SUCCESS);
573 struct player *victim_player,
574 const struct tile *victim_tile,
575 const char *victim_link)
578 victim_player, victim_tile, victim_link,
582 EFT_CASUS_BELLI_COMPLETE);
598 bool accept_all_actions)
602 if (
actor == NULL || target == NULL) {
639 bool accept_all_actions)
664 bool accept_all_actions)
668 if (
actor == NULL || target == NULL) {
706 bool accept_all_actions)
734 bool accept_all_actions)
738 if (
actor == NULL || target == NULL) {
800 const struct tile *tgt_tile,
802 bool accept_all_actions)
806 if (
actor == NULL || tgt_tile == NULL || tgt_extra == NULL) {
828 tgt_tile, tgt_extra))) {
872 bool accept_all_actions)
876 accept_all_actions)) {
913 case ASTK_EXTRA_NOT_THERE:
921 if (pextra != NULL) {
927 tgt_tile, tgt_extra))) {
952 const struct player *other_player,
954 const struct action *eval_action)
961 .output = eval_output,
962 .action = eval_action,
969 return autoperformer;
977#define action_auto_perf_acquire_targets(_target_extra_) \
978 tgt_city = (target_city ? target_city \
979 : action_tgt_city(actor, unit_tile(actor), \
981 tgt_tile = (target_tile ? target_tile \
982 : action_tgt_tile(actor, unit_tile(actor), \
985 tgt_unit = (target_unit ? target_unit \
986 : action_tgt_unit(actor, unit_tile(actor), \
1000 const struct player *other_player,
1002 const struct action *eval_action,
1010 const struct city *tgt_city;
1011 const struct tile *tgt_tile;
1012 const struct unit *tgt_unit;
1017 eval_output, eval_action);
1033#define perform_action_to(act, actor, tgtid, tgt_extra) \
1034 if (unit_perform_action(unit_owner(actor), \
1035 actor->id, tgtid, tgt_extra, \
1036 NULL, act, ACT_REQ_RULES)) { \
1037 return action_by_number(act); \
1102 const struct player *other_player,
1104 const struct action *eval_action,
1112 const struct city *tgt_city;
1113 const struct tile *tgt_tile;
1114 const struct unit *tgt_unit;
1119 eval_output, eval_action);
1193 const struct unit *act_unit,
1194 const struct city *tgt_city,
1195 const struct player *tgt_player,
1196 const struct action *paction)
1199 tgt_city, tgt_player,
const char * action_name_translation(const struct action *action)
bool action_prob_possible(const struct act_prob probability)
int action_dice_roll_odds(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
struct act_prob action_prob_vs_tile(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
bool is_action_enabled_unit_on_units(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
struct act_prob action_prob_vs_extras(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
enum unit_activity actres_get_activity(enum action_result result)
struct act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id)
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
struct act_prob action_prob_vs_units(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
bool is_action_enabled_unit_on_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
struct act_prob action_prob_vs_city(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct city *target_city)
enum action_target_kind action_get_target_kind(const struct action *paction)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
bool action_id_is_rare_pop_up(action_id act_id)
struct act_prob action_prob_vs_unit(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct unit *target_unit)
bool is_action_enabled_unit_on_extras(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
#define action_auto_perf_by_cause_iterate(_cause_, _act_perf_)
#define action_auto_perf_actions_iterate_end
#define action_auto_perf_by_cause_iterate_end
#define action_has_result(_act_, _res_)
#define action_auto_perf_actions_iterate(_autoperf_, _act_id_)
#define action_iterate_end
#define action_id_get_actor_kind(act_id)
#define ACTPROB_IMPOSSIBLE
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_id_has_complex_target(act_id)
void call_incident(enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *violator, struct player *victim)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
struct unit struct city struct unit struct tile * target_tile
struct unit struct city * target_city
struct unit struct city struct unit struct tile struct extra_type * target_extra
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
const struct ft_color ftc_server
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
enum casus_belli_range casus_belli_range_for(const struct player *offender, const struct unit_type *off_ut, const struct player *tgt_plr, const enum effect_type outcome, const struct action *paction, const struct tile *tgt_tile)
#define players_iterate_end
#define players_iterate(_pplayer)
void send_player_all_c(struct player *src, struct conn_list *dest)
void player_update_last_war_action(struct player *pplayer)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
enum action_auto_perf_cause cause
enum action_result result
enum act_tgt_compl target_complexity
char has_reason_to_cancel
const struct player * player
struct city * tile_city(const struct tile *ptile)
bool unit_is_alive(int id)
int unit_pays_mp_for_action(const struct action *paction, const struct unit *punit)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool utype_is_consumed_by_action(const struct action *paction, const struct unit_type *utype)