Freeciv-3.2: /fast/freeciv/nightly/S3_2/ai/handicaps.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Functions
handicaps.c File Reference
`#include "shared.h"`
`#include "player.h"`
`#include "handicaps.h"`

Go to the source code of this file.

## Functions

void | handicaps_init (struct player *pplayer)
void | handicaps_close (struct player *pplayer)
void | handicaps_set (struct player *pplayer, bv_handicap handicaps)
bool | has_handicap (const struct player *pplayer, enum handicap_type htype)
const char * | handicap_desc (enum handicap_type htype, bool *inverted)

## Function Documentation

## ◆ handicap_desc()

const char * handicap_desc | ( | enum handicap_type | htype,
|  | bool * | inverted
| ) |  |

Return a short (translated) string describing the handicap, for help. In some cases it's better to describe what happens if the handicap is absent; 'inverted' is set TRUE in these cases.

Definition at line 80 of file handicaps.c.

Referenced by ai_level_help().

## ◆ handicaps_close()

void handicaps_close | ( | struct player * | pplayer | ) |

Free resources associated with player handicaps.

Definition at line 42 of file handicaps.c.

Referenced by server_remove_player().

## ◆ handicaps_init()

void handicaps_init | ( | struct player * | pplayer | ) |

Initialize handicaps for player

Definition at line 29 of file handicaps.c.

Referenced by server_player_init().

## ◆ handicaps_set()

void handicaps_set | ( | struct player * | pplayer,
|  | bv_handicap | handicaps
| ) |  |

Set player handicaps

Definition at line 55 of file handicaps.c.

Referenced by set_ai_level_directer().

## ◆ has_handicap()

bool has_handicap | ( | const struct player * | pplayer,
|  | enum handicap_type | htype
| ) |  |

AI players may have handicaps - allowing them to cheat or preventing them from using certain algorithms. This function returns whether the player has the given handicap. Human players are assumed to have no handicaps.

Definition at line 66 of file handicaps.c.

Referenced by adjust_improvement_wants_by_effects(), adv_best_government(), adv_data_phase_init(), adv_settler_safe_tile(), assess_danger(), auto_settler_setup_work(), calculate_city_clusters(), change_build_target(), city_desirability(), cityresult_fill(), dai_choose_attacker_air(), dai_choose_diplomat_offensive(), dai_city_choose_build(), dai_consider_tile_dangerous(), dai_diplomacy_first_contact(), dai_diplomat_bribe_nearby(), dai_effect_value(), dai_fill_unit_param(), dai_find_strategic_airbase(), dai_goldequiv_clause(), dai_hunter_choice(), dai_hunter_manage(), dai_hunter_try_launch(), dai_manage_barbarian_leader(), dai_manage_caravan(), dai_manage_diplomat(), dai_manage_government(), dai_manage_military(), dai_manage_paratrooper(), dai_manage_taxes(), dai_share(), dai_unit_can_strike_my_unit(), dai_war_desire(), dai_wonder_city_distance(), explorer_desirable(), explorer_goto(), find_best_city_placement(), find_best_tile_to_paradrop_to(), find_nearest_airbase(), find_nearest_safe_city(), find_rampage_target(), find_something_to_bomb(), find_something_to_kill(), handle_player_change_government(), immediate_destination(), is_city_surrounded_by_our_spies(), look_for_charge(), player_limit_to_max_rates(), player_restore_units(), process_attacker_want(), settler_evaluate_city_requests(), settler_evaluate_improvements(), and unit_enter_hut().