![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fcintl.h"#include "log.h"#include "rand.h"#include "support.h"#include "effects.h"#include "events.h"#include "game.h"#include "government.h"#include "map.h"#include "movement.h"#include "nation.h"#include "research.h"#include "terrain.h"#include "aiiface.h"#include "citytools.h"#include "maphand.h"#include "notify.h"#include "plrhand.h"#include "srv_main.h"#include "techtools.h"#include "unithand.h"#include "unittools.h"#include "advdata.h"#include "difficulty.h"#include "barbarian.h"
Include dependency graph for barbarian.cpp:Go to the source code of this file.
Macros | |
| #define | BARBARIAN_INITIAL_VISION_RADIUS 3 |
| Functions for creating barbarians in huts, land and sea Started by Jerzy Klek jekl@altavista.net with more ideas from Falk Hueffner. More... | |
| #define | BARBARIAN_INITIAL_VISION_RADIUS_SQ 9 |
Functions | |
| bool | is_land_barbarian (struct player *pplayer) |
| Is player a land barbarian? More... | |
| bool | is_sea_barbarian (struct player *pplayer) |
| Is player a sea barbarian? More... | |
| struct player * | create_barbarian_player (enum barbarian_type type) |
| Creates the land/sea barbarian player and inits some stuff. More... | |
| static void | init_dir_checked_status (bool *checked, enum terrain_class *terrainc, enum terrain_class tclass) |
| (Re)initialize direction checked status array based on terrain class. More... | |
| static int | random_unchecked_direction (int possibilities, const bool *checked) |
| Return random directory from not yet checked ones. More... | |
| bool | unleash_barbarians (struct tile *ptile) |
| Unleash barbarians means give barbarian player some units and move them out of the hut, unless there's no place to go. More... | |
| static bool | is_near_land (struct tile *tile0) |
| Is sea not further than a couple of tiles away from land? More... | |
| static struct tile * | find_empty_tile_nearby (struct tile *ptile) |
| Return this or a neighbouring tile that is free of any units. More... | |
| static void | try_summon_barbarians () |
| The barbarians are summoned at a randomly chosen place if: More... | |
| void | summon_barbarians () |
| Summon barbarians out of the blue. More... | |
| #define BARBARIAN_INITIAL_VISION_RADIUS 3 |
Functions for creating barbarians in huts, land and sea Started by Jerzy Klek jekl@altavista.net with more ideas from Falk Hueffner.
Definition at line 54 of file barbarian.cpp.
| #define BARBARIAN_INITIAL_VISION_RADIUS_SQ 9 |
Definition at line 55 of file barbarian.cpp.
| struct player* create_barbarian_player | ( | enum barbarian_type | type | ) |
Creates the land/sea barbarian player and inits some stuff.
If barbarian player already exists, return player pointer. If barbarians are dead, revive them with a new leader :-)
Dead barbarians forget the map and lose the money.
Definition at line 82 of file barbarian.cpp.
Referenced by kill_player(), try_summon_barbarians(), and unleash_barbarians().
Return this or a neighbouring tile that is free of any units.
Definition at line 477 of file barbarian.cpp.
Referenced by try_summon_barbarians().
|
static |
(Re)initialize direction checked status array based on terrain class.
Definition at line 203 of file barbarian.cpp.
Referenced by unleash_barbarians().
| bool is_land_barbarian | ( | struct player * | pplayer | ) |
Is player a land barbarian?
Definition at line 60 of file barbarian.cpp.
Referenced by create_barbarian_player(), dai_military_findjob(), raze_city(), and try_summon_barbarians().
|
static |
Is sea not further than a couple of tiles away from land?
Definition at line 461 of file barbarian.cpp.
Referenced by try_summon_barbarians().
| bool is_sea_barbarian | ( | struct player * | pplayer | ) |
Is player a sea barbarian?
Definition at line 69 of file barbarian.cpp.
Referenced by create_barbarian_player().
|
static |
Return random directory from not yet checked ones.
Definition at line 221 of file barbarian.cpp.
Referenced by unleash_barbarians().
| void summon_barbarians | ( | ) |
Summon barbarians out of the blue.
Try more times for more difficult levels - which means there can be more than one uprising in one year!
Definition at line 710 of file barbarian.cpp.
Referenced by end_turn().
|
static |
The barbarians are summoned at a randomly chosen place if:
Definition at line 508 of file barbarian.cpp.
Referenced by summon_barbarians().
| bool unleash_barbarians | ( | struct tile * | ptile | ) |
Unleash barbarians means give barbarian player some units and move them out of the hut, unless there's no place to go.
Barbarian unit deployment algorithm: If enough free land around, deploy on land, if not enough land but some sea free, load some of them on boats, otherwise (not much land and no sea) kill enemy unit and stay in a village. The return value indicates if the explorer survived entering the vilage.
Definition at line 248 of file barbarian.cpp.
Referenced by api_edit_unleash_barbarians().