Freeciv-3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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 "tech.h"
#include "terrain.h"
#include "unitlist.h"
#include "aiiface.h"
#include "citytools.h"
#include "diplhand.h"
#include "gamehand.h"
#include "maphand.h"
#include "notify.h"
#include "plrhand.h"
#include "srv_main.h"
#include "stdinhand.h"
#include "techtools.h"
#include "unithand.h"
#include "unittools.h"
#include "advdata.h"
#include "difficulty.h"
#include "barbarian.h"
Go to the source code of this file.
Macros | |
#define | BARBARIAN_INITIAL_VISION_RADIUS 3 |
#define | BARBARIAN_INITIAL_VISION_RADIUS_SQ 9 |
Functions | |
bool | is_land_barbarian (struct player *pplayer) |
bool | is_sea_barbarian (struct player *pplayer) |
struct player * | create_barbarian_player (enum barbarian_type type) |
static void | init_dir_checked_status (bool *checked, enum terrain_class *terrainc, enum terrain_class tclass) |
static int | random_unchecked_direction (int possibilities, const bool *checked) |
static void | unit_move_pay (struct unit *punit, struct tile *pdesttile) |
bool | unleash_barbarians (struct tile *ptile) |
static bool | is_near_land (struct tile *tile0) |
static struct tile * | find_empty_tile_nearby (struct tile *ptile) |
static void | try_summon_barbarians (void) |
void | summon_barbarians (void) |
void | barbarian_initial_wars (struct player *barbarians) |
#define BARBARIAN_INITIAL_VISION_RADIUS 3 |
Definition at line 69 of file barbarian.c.
#define BARBARIAN_INITIAL_VISION_RADIUS_SQ 9 |
Definition at line 70 of file barbarian.c.
Set new barbarian player to war with everyone.
Definition at line 765 of file barbarian.c.
Referenced by create_animals(), and create_barbarian_player().
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().
Return this or a neighboring tile that is free of any units
Definition at line 504 of file barbarian.c.
Referenced by try_summon_barbarians().
|
static |
(Re)initialize direction checked status array based on terrain class.
Definition at line 207 of file barbarian.c.
Referenced by unleash_barbarians().
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 not further than a couple of tiles away from land?
Definition at line 490 of file barbarian.c.
Referenced by try_summon_barbarians().
Is player a sea barbarian?
Definition at line 84 of file barbarian.c.
Referenced by create_barbarian_player().
Return random directory from not yet checked ones.
Definition at line 225 of file barbarian.c.
Referenced by unleash_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 738 of file barbarian.c.
Referenced by end_turn().
The barbarians are summoned at a randomly chosen place if:
Definition at line 533 of file barbarian.c.
Referenced by summon_barbarians().
Move to the tile pdesttile.
Definition at line 245 of file barbarian.c.
Referenced by unleash_barbarians().
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().