|
Galactic Bloodshed
|
#include "gb/racegen.h"#include <unistd.h>#include <cmath>#include <cstdarg>#include <cstdio>#include <cstdlib>#include <cstring>#include "gb/enroll.h"#include "gb/game_info.h"Go to the source code of this file.
Macros | |
| #define | ROUND(f) ((int)(0.5 + (f))) |
| #define | FPRINTF if (f != nullptr) fprintf |
| #define | FSCANF(file, format, variable) if (EOF == fscanf((file), (format), (variable))) goto premature_end_of_file |
| #define | FPRINTF if (verbose) fprintf |
| #define | INPUTSIZE 512 |
| #define | BUFSIZE 512 |
Functions | |
| static int | do_racegen () |
| static int | critique_modification () |
| static void | execute (int argc, char **argv) |
| static void | fix_up_iq () |
| static void | initialize () |
| static void | help (int, char *[]) |
| static void | load (int, char *[]) |
| static void | metamorph () |
| static int | modify (int argc, char *argv[]) |
| static void | normal () |
| static void | print (int argc, char *argv[]) |
| static void | save (int argc, char *argv[]) |
| static void | send2 (int argc, char *argv[]) |
| static void | quit (int argc, char **argv) |
| int | main () |
| int | cost_of_race () |
| int | critique_to_file (FILE *f, int rigorous_checking, int is_player_race) |
| int | load_from_file (FILE *g) |
| static int | load_from_filename (const char *filename) |
| void | print_to_file (FILE *f, int verbose) |
| static int | print_to_filename (const char *filename, int verbose) |
| static void | send2 (int, char **) |
| int | Dialogue (const char *prompt,...) |
| void | modify_print_loop (int) |
Variables | |
| static int | fd |
| static int | isserver = 0 |
| static attribute | attr [N_ATTRIBUTES] |
| const char * | planet_print_name [N_HOME_PLANET_TYPES] |
| const int | planet_cost [N_HOME_PLANET_TYPES] = {75, 50, 50, 50, -25, -25, 600} |
| const char * | race_print_name [N_RACE_TYPES] = {"Normal", "Metamorph"} |
| const int | race_cost [N_RACE_TYPES] = {0, 0} |
| const char * | priv_print_name [N_PRIV_TYPES] = {"God", "Guest", "Normal"} |
| const char * | sector_print_name [N_SECTOR_TYPES] |
| const int | blah [N_SECTOR_TYPES] = {-1, 0, 50, 100, 200, 300, 400, 500} |
| const double | compat_cov [N_SECTOR_TYPES][N_SECTOR_TYPES] |
| const double | planet_compat_cov [N_HOME_PLANET_TYPES][N_SECTOR_TYPES] |
| struct x race_info cost_info | last |
| int | npoints = STARTING_POINTS |
| int | last_npoints = STARTING_POINTS |
| int | altered = 0 |
| int | changed = 1 |
| int | please_quit = 0 |
| #define BUFSIZE 512 |
| #define FPRINTF if (f != nullptr) fprintf |
| #define FPRINTF if (verbose) fprintf |
| #define FSCANF | ( | file, | |
| format, | |||
| variable | |||
| ) | if (EOF == fscanf((file), (format), (variable))) goto premature_end_of_file |
| #define INPUTSIZE 512 |
| #define ROUND | ( | f | ) | ((int)(0.5 + (f))) |
| int cost_of_race | ( | ) |
Definition at line 332 of file racegen.cc.
References attr, x::attr, blah, x::compat, compat_cov, attribute::cov, attribute::e_factor, attribute::e_fudge, attribute::e_hinge, x::home_planet_type, attribute::l_factor, attribute::l_fudge, x::n_sector_types, planet_compat_cov, planet_cost, race_cost, and x::race_type.
Referenced by initialize(), modify_print_loop(), and process().
|
static |
Definition at line 614 of file racegen.cc.
References altered, changed, critique_to_file(), x::rejection, and x::status.
Referenced by modify().
| int critique_to_file | ( | FILE * | f, |
| int | rigorous_checking, | ||
| int | is_player_race | ||
| ) |
Definition at line 440 of file racegen.cc.
References x::address, attr, x::attr, x::compat, x::home_planet_type, attribute::is_integral, attribute::maximum, attribute::minimum, x::n_sector_types, npoints, x::password, planet_compat_cov, attribute::print_name, priv_print_name, x::priv_type, x::race_type, x::rejection, and x::status.
Referenced by critique_modification(), enroll(), enroll_player_race(), and send2().
| int Dialogue | ( | const char * | prompt, |
| ... | |||
| ) |
Definition at line 1213 of file racegen.cc.
Referenced by do_racegen(), enroll_player_race(), load(), and quit().
|
static |
Definition at line 1371 of file racegen.cc.
References Dialogue(), initialize(), and modify_print_loop().
Referenced by main().
|
static |
Definition at line 1282 of file racegen.cc.
References help(), load(), modify(), print(), quit(), save(), and send2().
Referenced by modify_print_loop().
|
static |
Definition at line 425 of file racegen.cc.
References attr, x::attr, and attribute::print_name.
Referenced by load_from_file(), and modify().
|
static |
Definition at line 661 of file racegen.cc.
References attr, x::filename, planet_print_name, attribute::print_name, race_print_name, and sector_print_name.
Referenced by execute(), and modify().
|
static |
Definition at line 631 of file racegen.cc.
References x::address, attr, x::attr, x::compat, cost_of_race(), x::home_planet_type, attribute::init, attribute::l_fudge, x::n_sector_types, x::name, normal(), x::password, x::priv_type, and x::race_type.
Referenced by do_racegen().
|
static |
Definition at line 900 of file racegen.cc.
References altered, changed, Dialogue(), x::filename, and load_from_filename().
Referenced by execute().
| int load_from_file | ( | FILE * | g | ) |
Definition at line 843 of file racegen.cc.
References x::address, x::attr, x::compat, fix_up_iq(), x::home_planet_type, metamorph(), x::name, normal(), x::password, x::priv_type, x::race_type, and x::status.
Referenced by load_from_filename(), and process().
|
static |
Definition at line 887 of file racegen.cc.
References load_from_file().
Referenced by load().
| int main | ( | ) |
Definition at line 45 of file racegen.cc.
References do_racegen().
|
static |
Morphs are not born, they hatch. THus the mass limitation is smaller:
Morphs are naturally adept at fertilization.
Due to general squishiness, this effect is not as strong for mesos.
IQ represents max IQ, thus, no go.
Definition at line 374 of file racegen.cc.
References attr, attribute::cov, and attribute::print_name.
Referenced by load_from_file(), and modify().
|
static |
Definition at line 924 of file racegen.cc.
References x::address, attr, x::attr, x::compat, critique_modification(), fix_up_iq(), help(), x::home_planet_type, attribute::is_integral, metamorph(), x::name, normal(), x::password, and x::race_type.
Referenced by execute().
| void modify_print_loop | ( | int | ) |
Definition at line 1329 of file racegen.cc.
References changed, cost_of_race(), execute(), last_npoints, npoints, please_quit, and print_to_file().
Referenced by do_racegen(), and enroll_player_race().
|
static |
Definition at line 401 of file racegen.cc.
References attr, attribute::cov, and attribute::print_name.
Referenced by initialize(), load_from_file(), and modify().
|
static |
Definition at line 1153 of file racegen.cc.
References print_to_file(), and print_to_filename().
Referenced by execute().
| void print_to_file | ( | FILE * | f, |
| int | verbose | ||
| ) |
Definition at line 1061 of file racegen.cc.
References x::address, attr, x::attr, x::compat, x::home_planet_type, attribute::is_integral, last_npoints, x::n_sector_types, x::name, npoints, x::password, planet_compat_cov, planet_print_name, attribute::print_name, x::priv_type, race_print_name, x::race_type, and sector_print_name.
Referenced by enroll_player_race(), modify_print_loop(), print(), print_to_filename(), and send2().
|
static |
Definition at line 1141 of file racegen.cc.
References print_to_file().
Referenced by print(), and save().
|
static |
Definition at line 1256 of file racegen.cc.
References altered, Dialogue(), fd, isserver, please_quit, and save().
Referenced by execute().
|
static |
Definition at line 1160 of file racegen.cc.
References altered, x::filename, and print_to_filename().
Referenced by execute(), and quit().
|
static |
|
static |
Definition at line 1171 of file racegen.cc.
References x::address, critique_to_file(), x::password, and print_to_file().
Referenced by execute().
| int altered = 0 |
Definition at line 323 of file racegen.cc.
Referenced by critique_modification(), load(), quit(), and save().
|
static |
Definition at line 116 of file racegen.cc.
Referenced by cost_of_race(), critique_to_file(), fix_up_iq(), help(), initialize(), metamorph(), modify(), normal(), and print_to_file().
| const int blah[N_SECTOR_TYPES] = {-1, 0, 50, 100, 200, 300, 400, 500} |
Definition at line 262 of file racegen.cc.
Referenced by cost_of_race().
| int changed = 1 |
Definition at line 324 of file racegen.cc.
Referenced by critique_modification(), load(), and modify_print_loop().
| const double compat_cov[N_SECTOR_TYPES][N_SECTOR_TYPES] |
Definition at line 264 of file racegen.cc.
Referenced by cost_of_race().
|
static |
Definition at line 28 of file racegen.cc.
Referenced by quit().
|
static |
Definition at line 29 of file racegen.cc.
Referenced by quit().
| struct x race_info cost_info last |
Definition at line 319 of file racegen.cc.
| int last_npoints = STARTING_POINTS |
Definition at line 322 of file racegen.cc.
Referenced by modify_print_loop(), print_to_file(), and process().
| int npoints = STARTING_POINTS |
Definition at line 321 of file racegen.cc.
Referenced by critique_to_file(), modify_print_loop(), print_to_file(), and process().
| const double planet_compat_cov[N_HOME_PLANET_TYPES][N_SECTOR_TYPES] |
Definition at line 299 of file racegen.cc.
Referenced by cost_of_race(), critique_to_file(), and print_to_file().
| const int planet_cost[N_HOME_PLANET_TYPES] = {75, 50, 50, 50, -25, -25, 600} |
Definition at line 252 of file racegen.cc.
Referenced by cost_of_race().
| const char* planet_print_name[N_HOME_PLANET_TYPES] |
Definition at line 250 of file racegen.cc.
Referenced by help(), and print_to_file().
| int please_quit = 0 |
Definition at line 325 of file racegen.cc.
Referenced by enroll_player_race(), modify_print_loop(), and quit().
| const char* priv_print_name[N_PRIV_TYPES] = {"God", "Guest", "Normal"} |
Definition at line 257 of file racegen.cc.
Referenced by critique_to_file().
| const int race_cost[N_RACE_TYPES] = {0, 0} |
Definition at line 255 of file racegen.cc.
Referenced by cost_of_race().
| const char* race_print_name[N_RACE_TYPES] = {"Normal", "Metamorph"} |
Definition at line 254 of file racegen.cc.
Referenced by help(), and print_to_file().
| const char* sector_print_name[N_SECTOR_TYPES] |
Definition at line 259 of file racegen.cc.
Referenced by help(), and print_to_file().
1.8.13