Freeciv21
Develop your civilization from humble roots to a global empire
advgoto.h File Reference
#include "path_finding.h"
+ Include dependency graph for advgoto.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adv_risk_cost
 

Macros

#define NORMAL_STACKING_FEARFULNESS   ((double) PF_TURN_FACTOR / 36.0)
 

Functions

bool adv_follow_path (struct unit *punit, const PFPath &path, struct tile *ptile)
 Move a unit along a path without disturbing its activity, role or assigned destination Return FALSE iff we died. More...
 
bool adv_unit_execute_path (struct unit *punit, const PFPath &path)
 This is a function to execute paths returned by the path-finding engine, for units controlled by advisors. More...
 
int adv_could_unit_move_to_tile (struct unit *punit, struct tile *dst_tile)
 returns: 0 if can't move 1 if zoc_ok -1 if zoc could be ok? More...
 
bool adv_danger_at (struct unit *punit, struct tile *ptile)
 Are there dangerous enemies at or adjacent to the tile 'ptile'? More...
 
void adv_avoid_risks (struct pf_parameter *parameter, struct adv_risk_cost *risk_cost, struct unit *punit, const double fearfulness)
 Set PF callbacks to favour paths that do not create tall stacks or cross dangerous tiles. More...
 
int adv_unittype_att_rating (const struct unit_type *punittype, int veteran, int moves_left, int hp)
 Attack rating of this kind of unit. More...
 
int adv_unit_att_rating (const struct unit *punit)
 Attack rating of this particular unit assuming that it has a complete move left. More...
 
int adv_unit_def_rating_basic (const struct unit *punit)
 Basic (i.e. More...
 
int adv_unit_def_rating_basic_squared (const struct unit *punit)
 Square of the previous function - used in actual computations. More...
 

Macro Definition Documentation

◆ NORMAL_STACKING_FEARFULNESS

#define NORMAL_STACKING_FEARFULNESS   ((double) PF_TURN_FACTOR / 36.0)

Definition at line 20 of file advgoto.h.

Function Documentation

◆ adv_avoid_risks()

void adv_avoid_risks ( struct pf_parameter parameter,
struct adv_risk_cost risk_cost,
struct unit punit,
const double  fearfulness 
)

Set PF callbacks to favour paths that do not create tall stacks or cross dangerous tiles.

Definition at line 490 of file advgoto.cpp.

Referenced by dai_fill_unit_param(), and explorer_goto().

◆ adv_could_unit_move_to_tile()

int adv_could_unit_move_to_tile ( struct unit punit,
struct tile dest_tile 
)

returns: 0 if can't move 1 if zoc_ok -1 if zoc could be ok?

see also unithand can_unit_move_to_tile_with_notify()

Definition at line 252 of file advgoto.cpp.

Referenced by dai_manage_barbarian_leader(), and remove_city().

◆ adv_danger_at()

bool adv_danger_at ( struct unit punit,
struct tile ptile 
)

Are there dangerous enemies at or adjacent to the tile 'ptile'?

Definition at line 317 of file advgoto.cpp.

Referenced by adv_unit_move(), city_desirability(), and dai_unit_move().

◆ adv_follow_path()

bool adv_follow_path ( struct unit punit,
const PFPath path,
struct tile ptile 
)

Move a unit along a path without disturbing its activity, role or assigned destination Return FALSE iff we died.

Definition at line 43 of file advgoto.cpp.

Referenced by auto_settler_setup_work(), dai_manage_airunit(), dai_manage_barbarian_leader(), dai_military_attack(), dai_unit_goto_constrained(), explorer_goto(), and player_restore_units().

◆ adv_unit_att_rating()

int adv_unit_att_rating ( const struct unit punit)

Attack rating of this particular unit assuming that it has a complete move left.

Definition at line 288 of file advgoto.cpp.

Referenced by adv_danger_at(), assess_danger_unit(), dai_consider_tile_dangerous(), dai_gothere_bodyguard(), find_something_to_kill(), kill_something_with(), reinforcements_cost_and_value(), and unit_att_rating_squared().

◆ adv_unit_def_rating_basic()

int adv_unit_def_rating_basic ( const struct unit punit)

Basic (i.e.

not taking attacker specific corections into account) defense rating of this particular unit.

Definition at line 298 of file advgoto.cpp.

Referenced by adv_unit_def_rating_basic_squared(), and dai_military_findjob().

◆ adv_unit_def_rating_basic_squared()

int adv_unit_def_rating_basic_squared ( const struct unit punit)

Square of the previous function - used in actual computations.

Definition at line 307 of file advgoto.cpp.

Referenced by adv_danger_at(), dai_consider_tile_dangerous(), and look_for_charge().

◆ adv_unit_execute_path()

bool adv_unit_execute_path ( struct unit punit,
const PFPath path 
)

This is a function to execute paths returned by the path-finding engine, for units controlled by advisors.

Brings our bodyguard along. Returns FALSE only if died.

Definition at line 78 of file advgoto.cpp.

Referenced by adv_follow_path(), dai_diplomat_bribe_nearby(), dai_find_boat_for_unit(), dai_hunter_manage(), dai_manage_diplomat(), and dai_military_rampage().

◆ adv_unittype_att_rating()

int adv_unittype_att_rating ( const struct unit_type punittype,
int  veteran,
int  moves_left,
int  hp 
)

Attack rating of this kind of unit.

Definition at line 277 of file advgoto.cpp.

Referenced by adv_unit_att_rating(), dai_gothere_bodyguard(), process_attacker_want(), and unit_att_rating_now().