Galactic Bloodshed
Classes | Macros | Functions | Variables
enrol.cc File Reference
#include <unistd.h>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "gb/GB_server.h"
#include "gb/buffers.h"
#include "gb/build.h"
#include "gb/files_shl.h"
#include "gb/globals.h"
#include "gb/map.h"
#include "gb/max.h"
#include "gb/perm.h"
#include "gb/races.h"
#include "gb/shipdata.h"
#include "gb/ships.h"
#include "gb/sql/sql.h"
#include "gb/tweakables.h"
#include "gb/utils/rand.h"
#include "gb/vars.h"
Include dependency graph for enrol.cc:

Go to the source code of this file.

Classes

struct  stype
 

Macros

#define RACIAL_TYPES   10
 
#define RMass(x)   (db_Mass[(x)] + .001 * (double)int_rand(-25, 25))
 
#define Birthrate(x)   (db_Birthrate[(x)] + .01 * (double)int_rand(-10, 10))
 
#define Fighters(x)   (db_Fighters[(x)] + int_rand(-1, 1))
 
#define Intelligence(x)   (db_Intelligence[(x)] + int_rand(-10, 10))
 
#define Adventurism(x)   (db_Adventurism[(x)] + 0.01 * (double)int_rand(-10, 10))
 
#define Sexes(x)   (int_rand(Min_Sexes[(x)], int_rand(Min_Sexes[(x)], Max_Sexes[(x)])))
 
#define Metabolism(x)   (db_Metabolism[(x)] + .01 * (double)int_rand(-15, 15))
 
#define STRSIZE   100
 

Functions

static char desshow (const int x, const int y, SectorMap &)
 
int main ()
 
bool notify (const player_t, const governor_t, const std::string &)
 
void warn (const player_t, const governor_t, const std::string &)
 

Variables

static int Thing [RACIAL_TYPES] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0}
 
static double db_Mass [RACIAL_TYPES]
 
static double db_Birthrate [RACIAL_TYPES]
 
static int db_Fighters [RACIAL_TYPES] = {9, 10, 11, 2, 3, 4, 5, 6, 7, 8}
 
static int db_Intelligence [RACIAL_TYPES]
 
static double db_Adventurism [RACIAL_TYPES]
 
static int Min_Sexes [RACIAL_TYPES] = {1, 1, 1, 2, 2, 2, 2, 2, 2, 2}
 
static int Max_Sexes [RACIAL_TYPES] = {1, 1, 1, 2, 2, 4, 4, 4, 4, 4}
 
static double db_Metabolism [RACIAL_TYPES]
 

Macro Definition Documentation

◆ Adventurism

#define Adventurism (   x)    (db_Adventurism[(x)] + 0.01 * (double)int_rand(-10, 10))

Definition at line 64 of file enrol.cc.

◆ Birthrate

#define Birthrate (   x)    (db_Birthrate[(x)] + .01 * (double)int_rand(-10, 10))

Definition at line 61 of file enrol.cc.

◆ Fighters

#define Fighters (   x)    (db_Fighters[(x)] + int_rand(-1, 1))

Definition at line 62 of file enrol.cc.

◆ Intelligence

#define Intelligence (   x)    (db_Intelligence[(x)] + int_rand(-10, 10))

Definition at line 63 of file enrol.cc.

◆ Metabolism

#define Metabolism (   x)    (db_Metabolism[(x)] + .01 * (double)int_rand(-15, 15))

Definition at line 67 of file enrol.cc.

◆ RACIAL_TYPES

#define RACIAL_TYPES   10

Definition at line 36 of file enrol.cc.

◆ RMass

#define RMass (   x)    (db_Mass[(x)] + .001 * (double)int_rand(-25, 25))

Definition at line 60 of file enrol.cc.

◆ Sexes

#define Sexes (   x)    (int_rand(Min_Sexes[(x)], int_rand(Min_Sexes[(x)], Max_Sexes[(x)])))

Definition at line 65 of file enrol.cc.

◆ STRSIZE

#define STRSIZE   100

Function Documentation

◆ desshow()

static char desshow ( const int  x,
const int  y,
SectorMap smap 
)
static

Definition at line 466 of file enrol.cc.

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( )

Definition at line 69 of file enrol.cc.

References stype::count, desshow(), getplanet(), getsdata(), getsmap(), getstar(), Getxysect(), stype::here, maxsupport(), Numraces(), Numships(), PermuteSects(), putplanet(), putrace(), putsector(), putship(), putstar(), Thing, stype::x, and stype::y.

Here is the call graph for this function:

◆ notify()

bool notify ( const player_t  ,
const governor_t  ,
const std::string &   
)

Definition at line 497 of file enrol.cc.

◆ warn()

void warn ( const player_t  ,
const governor_t  ,
const std::string &   
)

Definition at line 503 of file enrol.cc.

Variable Documentation

◆ db_Adventurism

double db_Adventurism[RACIAL_TYPES]
static
Initial value:
= {0.89, 0.89, 0.89, .6, .65,
.7, .7, .75, .75, .8}

Definition at line 52 of file enrol.cc.

◆ db_Birthrate

double db_Birthrate[RACIAL_TYPES]
static
Initial value:
= {0.9, 0.85, 0.8, 0.5, 0.55,
0.6, 0.65, 0.7, 0.75, 0.8}

Definition at line 46 of file enrol.cc.

◆ db_Fighters

int db_Fighters[RACIAL_TYPES] = {9, 10, 11, 2, 3, 4, 5, 6, 7, 8}
static

Definition at line 48 of file enrol.cc.

◆ db_Intelligence

int db_Intelligence[RACIAL_TYPES]
static
Initial value:
= {0, 0, 0, 190, 180,
170, 160, 150, 140, 130}

Definition at line 49 of file enrol.cc.

◆ db_Mass

double db_Mass[RACIAL_TYPES]
static
Initial value:
= {.1, .15, .2, .125, .125,
.125, .125, .125, .125, .125}

Definition at line 44 of file enrol.cc.

◆ db_Metabolism

double db_Metabolism[RACIAL_TYPES]
static
Initial value:
= {3.0, 2.7, 2.4, 1.0, 1.15,
1.30, 1.45, 1.6, 1.75, 1.9}

Definition at line 57 of file enrol.cc.

◆ Max_Sexes

int Max_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 4, 4, 4, 4, 4}
static

Definition at line 56 of file enrol.cc.

◆ Min_Sexes

int Min_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 2, 2, 2, 2, 2}
static

Definition at line 55 of file enrol.cc.

◆ Thing

int Thing[RACIAL_TYPES] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0}
static

Definition at line 42 of file enrol.cc.

Referenced by main().