Freeciv21
Develop your civilization from humble roots to a global empire
advgoto.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 #pragma once
12 
13 /* common/aicore */
14 #include "path_finding.h"
15 
16 /*
17  * WAGs: how hard to avoid tall stacks of units.
18  * Pass as fearfulness values to adv_avoid_risks.
19  */
20 #define NORMAL_STACKING_FEARFULNESS ((double) PF_TURN_FACTOR / 36.0)
21 
22 struct adv_risk_cost {
23  double base_value;
24  double fearfulness;
26 };
27 
28 bool adv_follow_path(struct unit *punit, const PFPath &path,
29  struct tile *ptile);
30 
31 bool adv_unit_execute_path(struct unit *punit, const PFPath &path);
32 
33 int adv_could_unit_move_to_tile(struct unit *punit, struct tile *dst_tile);
34 
35 bool adv_danger_at(struct unit *punit, struct tile *ptile);
36 
37 void adv_avoid_risks(struct pf_parameter *parameter,
38  struct adv_risk_cost *risk_cost, struct unit *punit,
39  const double fearfulness);
40 
41 int adv_unittype_att_rating(const struct unit_type *punittype, int veteran,
42  int moves_left, int hp);
43 int adv_unit_att_rating(const struct unit *punit);
44 int adv_unit_def_rating_basic(const struct unit *punit);
45 int adv_unit_def_rating_basic_squared(const struct unit *punit);
int adv_unit_def_rating_basic_squared(const struct unit *punit)
Square of the previous function - used in actual computations.
Definition: advgoto.cpp:307
int adv_unit_def_rating_basic(const struct unit *punit)
Basic (i.e.
Definition: advgoto.cpp:298
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 advi...
Definition: advgoto.cpp:78
bool adv_danger_at(struct unit *punit, struct tile *ptile)
Are there dangerous enemies at or adjacent to the tile 'ptile'?
Definition: advgoto.cpp:317
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: advgoto.cpp:277
int adv_unit_att_rating(const struct unit *punit)
Attack rating of this particular unit assuming that it has a complete move left.
Definition: advgoto.cpp:288
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?
Definition: advgoto.cpp:252
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 i...
Definition: advgoto.cpp:43
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: advgoto.cpp:490
double enemy_zoc_cost
Definition: advgoto.h:25
double base_value
Definition: advgoto.h:23
double fearfulness
Definition: advgoto.h:24
Definition: tile.h:42
Definition: unit.h:134