Freeciv-3.2
|
Go to the source code of this file.
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 * | eval_output, | ||
const struct action * | eval_action, | ||
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.
Returns the action the actor unit was forced to perform. Returns NULL if that didn't happen.
Note that the return value doesn't say anything about survival.
Definition at line 1000 of file actiontools.c.
Referenced by diplomat_bribe(), kill_unit(), occupy_move(), remove_city(), unit_survive_autoattack(), and upkeep_kill_unit().
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 * | eval_output, | ||
const struct action * | eval_action, | ||
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 specified cause.
Definition at line 1102 of file actiontools.c.
Referenced by unit_survive_autoattack().
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 * | eval_output, | ||
const struct action * | eval_action | ||
) |
Returns the action auto performer that the specified cause can force the specified actor to perform. Returns NULL if no such action auto performer exists.
Definition at line 952 of file actiontools.c.
Referenced by action_auto_perf_unit_do(), action_auto_perf_unit_prob(), and upkeep_kill_unit().
void action_consequence_caught | ( | const struct action * | paction, |
struct player * | offender, | ||
const struct unit_type * | offender_utype, | ||
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 action.
victim_player can be NULL
Definition at line 374 of file actiontools.c.
Referenced by diplomat_get_tech(), diplomat_incite(), diplomat_infiltrate_tile(), diplomat_sabotage(), do_paradrop(), spy_nuke_city(), spy_poison(), spy_spread_plague(), spy_steal_gold(), spy_steal_some_maps(), and unit_nuke().
void action_consequence_complete | ( | const struct action * | paction, |
struct player * | offender, | ||
const struct unit_type * | offender_utype, | ||
struct player * | victim_player, | ||
const struct tile * | victim_tile, | ||
const char * | victim_link | ||
) |
Definition at line 572 of file actiontools.c.
Referenced by update_unit_activity().
void action_consequence_success | ( | const struct action * | paction, |
struct player * | offender, | ||
const struct unit_type * | offender_utype, | ||
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.
victim_player can be NULL
Definition at line 551 of file actiontools.c.
Referenced by city_add_unit(), city_build(), diplomat_bribe(), diplomat_embassy(), diplomat_get_tech(), diplomat_incite(), diplomat_investigate(), diplomat_sabotage(), do_attack(), do_capture_units(), do_conquer_extras(), do_expel_unit(), do_heal_unit(), do_paradrop(), do_unit_conquer_city(), do_unit_establish_trade(), do_unit_strike_city_building(), do_unit_strike_city_production(), do_wipe_units(), spy_attack(), spy_escape(), spy_nuke_city(), spy_poison(), spy_sabotage_unit(), spy_spread_plague(), spy_steal_gold(), spy_steal_some_maps(), unit_activity_targeted_internal(), unit_bombard(), unit_do_destroy_city(), unit_do_help_build(), unit_do_regular_move(), and unit_nuke().
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.
Definition at line 1194 of file actiontools.c.
Referenced by diplomat_get_tech(), diplomat_incite(), diplomat_sabotage(), do_unit_strike_city_building(), do_unit_strike_city_production(), spy_nuke_city(), spy_poison(), spy_spread_plague(), spy_steal_gold(), and spy_steal_some_maps().
Find an sub target for the specified action.
Definition at line 889 of file actiontools.c.
Referenced by execute_orders(), and unit_perform_action().
Make the actor that successfully performed the action pay the price.
Definition at line 105 of file actiontools.c.
Pay the movement point price of being the target of an action.
Definition at line 80 of file actiontools.c.
struct city * action_tgt_city | ( | struct unit * | actor, |
struct tile * | target_tile, | ||
bool | accept_all_actions | ||
) |
Find a city to target for an action on the specified tile.
Returns NULL if no proper target is found.
If the only action(s) that can be performed against a target has the rare_pop_up property the target will only be considered valid if the accept_all_actions argument is TRUE.
Definition at line 640 of file actiontools.c.
Referenced by handle_unit_get_actions(), unit_move(), and unit_move_handling().
struct tile * action_tgt_tile | ( | struct unit * | actor, |
struct tile * | target, | ||
const struct extra_type * | target_extra, | ||
bool | accept_all_actions | ||
) |
Returns the tile iff it, from the point of view of the owner of the actor unit, looks like a target tile.
Returns NULL if the player knows that the actor unit can't do any action (that specifies its target as a tile) to the tile.
If the owner of the actor unit doesn't have the knowledge needed to know for sure if the unit can act the tile will be returned.
If the only action(s) that can be performed against a target has the rare_pop_up property the target will only be considered valid if the accept_all_actions argument is TRUE.
Definition at line 733 of file actiontools.c.
Referenced by unit_move_handling().
struct extra_type * action_tgt_tile_extra | ( | const struct unit * | actor, |
const struct tile * | target_tile, | ||
bool | accept_all_actions | ||
) |
Find an extra to target for an action at the specified tile.
Returns the first extra found that the actor may act against at the tile or NULL if no proper target is found. (Note that some actions requires the absence of an extra since they result in its creation while other requires its presence.)
If the only action(s) that can be performed against a target has the rare_pop_up property the target will only be considered valid if the accept_all_actions argument is TRUE.
Definition at line 872 of file actiontools.c.
Referenced by handle_unit_get_actions(), and unit_move_handling().
struct unit * action_tgt_unit | ( | struct unit * | actor, |
struct tile * | target_tile, | ||
bool | accept_all_actions | ||
) |
Find a unit to target for an action at the specified tile.
Returns the first unit found at the tile that the actor may act against or NULL if no proper target is found.
If the only action(s) that can be performed against a target has the rare_pop_up property the target will only be considered valid if the accept_all_actions argument is TRUE.
Definition at line 707 of file actiontools.c.
Referenced by execute_orders(), handle_unit_get_actions(), and unit_move_handling().