Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions
barbarian.h File Reference
#include "support.h"
#include "fc_types.h"

Go to the source code of this file.

Macros

#define MIN_UNREST_DIST   5
 
#define MAX_UNREST_DIST   8
 
#define UPRISE_CIV_SIZE   10
 
#define MAP_FACTOR   2000 /* adjust this to get a good uprising frequency */
 
#define BARBARIAN_MIN_LIFESPAN   5
 

Functions

bool unleash_barbarians (struct tile *ptile)
 
void summon_barbarians (void)
 
bool is_land_barbarian (struct player *pplayer)
 
bool is_sea_barbarian (struct player *pplayer)
 
struct playercreate_barbarian_player (enum barbarian_type type)
 
void barbarian_initial_wars (struct player *barbarians)
 

Macro Definition Documentation

◆ BARBARIAN_MIN_LIFESPAN

#define BARBARIAN_MIN_LIFESPAN   5

Definition at line 30 of file barbarian.h.

◆ MAP_FACTOR

#define MAP_FACTOR   2000 /* adjust this to get a good uprising frequency */

Definition at line 28 of file barbarian.h.

◆ MAX_UNREST_DIST

#define MAX_UNREST_DIST   8

Definition at line 24 of file barbarian.h.

◆ MIN_UNREST_DIST

#define MIN_UNREST_DIST   5

Definition at line 23 of file barbarian.h.

◆ UPRISE_CIV_SIZE

#define UPRISE_CIV_SIZE   10

Definition at line 26 of file barbarian.h.

Function Documentation

◆ barbarian_initial_wars()

void barbarian_initial_wars ( struct player barbarians)

Set new barbarian player to war with everyone.

Definition at line 765 of file barbarian.c.

Referenced by create_animals(), and create_barbarian_player().

◆ create_barbarian_player()

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 97 of file barbarian.c.

Referenced by kill_player(), try_summon_barbarians(), and unleash_barbarians().

◆ is_land_barbarian()

bool is_land_barbarian ( struct player pplayer)

Is player a land barbarian?

Definition at line 75 of file barbarian.c.

Referenced by create_barbarian_player(), dai_military_findjob(), raze_city(), and try_summon_barbarians().

◆ is_sea_barbarian()

bool is_sea_barbarian ( struct player pplayer)

Is player a sea barbarian?

Definition at line 84 of file barbarian.c.

Referenced by create_barbarian_player().

◆ summon_barbarians()

void summon_barbarians ( void  )

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 738 of file barbarian.c.

Referenced by end_turn().

◆ unleash_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 272 of file barbarian.c.

Referenced by api_edit_unleash_barbarians().