2011-06-14 22:55:19 -04:00
|
|
|
/************************************************************************
|
|
|
|
* *
|
|
|
|
* Star Traders: A Game of Interstellar Trading *
|
2013-02-01 18:48:43 -05:00
|
|
|
* Copyright (C) 1990-2013, John Zaitseff *
|
2011-06-14 22:55:19 -04:00
|
|
|
* *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
Author: John Zaitseff <J.Zaitseff@zap.org.au>
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
This file, globals.c, contains the actual global variables and
|
|
|
|
structures used in Star Traders.
|
|
|
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published by the
|
|
|
|
Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-08-01 05:43:55 -04:00
|
|
|
#include "system.h"
|
2011-06-14 22:55:19 -04:00
|
|
|
#include "globals.h"
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* Constant definitions *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
// Company names
|
2011-07-04 04:19:10 -04:00
|
|
|
const char *company_name[MAX_COMPANIES] = {
|
2011-08-16 23:26:55 -04:00
|
|
|
/* TRANSLATORS: The eight company names do NOT have to be literal
|
|
|
|
translations of the English names. In fact, if possible, the
|
|
|
|
names should start with successive letters of your alphabet (in
|
2012-03-27 20:45:17 -04:00
|
|
|
English, for example, "A" to "H"), and, ideally, be related to
|
|
|
|
constellations or stars in our galaxy. No company name should be
|
|
|
|
more than 24 characters (column positions, to be precise) long. */
|
2011-08-01 05:30:19 -04:00
|
|
|
N_("Altair Starways"),
|
|
|
|
N_("Betelgeuse, Ltd"),
|
|
|
|
N_("Capella Freight Co"),
|
|
|
|
N_("Denebola Shippers"),
|
|
|
|
N_("Eridani Expediters"),
|
|
|
|
N_("Fornax Express"),
|
|
|
|
N_("Gemeni Inc"),
|
|
|
|
N_("Hercules and Co")
|
2011-06-14 22:55:19 -04:00
|
|
|
};
|
|
|
|
|
2011-07-19 06:32:00 -04:00
|
|
|
|
2011-08-17 22:10:33 -04:00
|
|
|
// Default keycodes (keyboard input characters) for each company
|
|
|
|
const char *default_keycode_company =
|
|
|
|
/* TRANSLATORS: This string specifies the keycodes (keyboard input
|
|
|
|
codes) used to enter the Stock Transaction window for each
|
|
|
|
company. There must be exactly eight characters, one for each
|
|
|
|
company in order, before the ASCII vertical line "|"; these must
|
|
|
|
be EITHER all in upper-case or all in lower-case. If at all
|
|
|
|
possible, these should be successive letters in your alphabet (in
|
|
|
|
English, "A" to "H"). Do NOT use digits or control characters.
|
|
|
|
Do not change or translate anything after the vertical line. */
|
|
|
|
N_("ABCDEFGH|input|Companies");
|
|
|
|
|
|
|
|
|
|
|
|
// Default keycodes (keyboard input characters) for each move
|
|
|
|
const char *default_keycode_game_move =
|
|
|
|
/* TRANSLATORS: This string specifies the keycodes used to select a
|
|
|
|
game move. There must be exactly 20 characters, one for each
|
|
|
|
move, before the ASCII vertical line "|"; these must be EITHER all
|
|
|
|
in upper-case or all in lower-case. If at all possible, these
|
|
|
|
should be successive letters in your alphabet. Do NOT use digits
|
|
|
|
or control characters. Do not change or translate anything after
|
|
|
|
the vertical line. */
|
|
|
|
N_("ABCDEFGHIJKLMNOPQRST|input|GameMoves");
|
|
|
|
|
|
|
|
|
|
|
|
// Default printable output representations for each map element
|
|
|
|
const char *default_printable_map_val =
|
|
|
|
/* TRANSLATORS: This string is used to display the galaxy map to
|
|
|
|
screen. There must be exactly 11 characters before the ASCII
|
|
|
|
vertical line. The first ("." in English) is used for empty
|
|
|
|
space, the second ("+") for outposts, the third ("*") for stars,
|
|
|
|
the remaining for the eight companies. Do not change or translate
|
2012-03-15 19:13:53 -04:00
|
|
|
anything after the vertical line. Double-width characters ARE
|
|
|
|
handled correctly. */
|
2011-08-17 22:10:33 -04:00
|
|
|
N_(".+*ABCDEFGH|output|MapVals");
|
|
|
|
|
|
|
|
|
|
|
|
// Default printable output representations for each move
|
|
|
|
const char *default_printable_game_move =
|
|
|
|
/* TRANSLATORS: This string is used to display the game moves
|
2011-08-25 00:48:31 -04:00
|
|
|
(choices). There must be exactly 20 characters (NUMBER_MOVES)
|
|
|
|
before the ASCII vertical line. The first character corresponds
|
|
|
|
to the first character in the "input|GameMoves" string, and so on.
|
2012-03-15 19:13:53 -04:00
|
|
|
Do not change or translate anything after the vertical line.
|
|
|
|
Double-width characters ARE handled correctly. */
|
2011-08-17 22:10:33 -04:00
|
|
|
N_("abcdefghijklmnopqrst|output|GameMoves");
|
|
|
|
|
|
|
|
|
2011-07-15 09:37:56 -04:00
|
|
|
// Ordinal strings
|
|
|
|
const char *ordinal[MAX_PLAYERS + 1] = {
|
2011-08-16 23:26:55 -04:00
|
|
|
"",
|
|
|
|
/* TRANSLATORS: The ordinal strings "1st" to "8th" are used in the
|
|
|
|
Game Winner dialog box at the end of the game. If ordinals depend
|
|
|
|
on the gender of the player, it may be simpler to list cardinal
|
|
|
|
numbers instead (eg, "No. 1"). Up to five characters are allowed
|
|
|
|
(see ORDINAL_COLS in src/intf.h). */
|
2011-08-01 05:30:19 -04:00
|
|
|
N_("1st"),
|
|
|
|
N_("2nd"),
|
|
|
|
N_("3rd"),
|
|
|
|
N_("4th"),
|
|
|
|
N_("5th"),
|
|
|
|
N_("6th"),
|
|
|
|
N_("7th"),
|
|
|
|
N_("8th")
|
2011-07-15 09:37:56 -04:00
|
|
|
};
|
|
|
|
|
2011-06-14 22:55:19 -04:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* Global variable definitions *
|
|
|
|
************************************************************************/
|
|
|
|
|
2011-06-14 23:05:14 -04:00
|
|
|
company_info_t company[MAX_COMPANIES]; // Array of companies
|
|
|
|
player_info_t player[MAX_PLAYERS]; // Array of players
|
|
|
|
map_val_t galaxy_map[MAX_X][MAX_Y]; // Map of the galaxy
|
|
|
|
move_rec_t game_move[NUMBER_MOVES]; // Current moves
|
2011-06-14 22:55:19 -04:00
|
|
|
|
2011-06-28 23:09:40 -04:00
|
|
|
int max_turn; // Max. number of turns in game
|
2011-07-19 06:32:00 -04:00
|
|
|
int turn_number; // Current turn (1 to max_turn)
|
|
|
|
int number_players; // Number of players
|
|
|
|
int current_player; // Current player (0 to number_players-1)
|
2011-06-14 22:55:19 -04:00
|
|
|
int first_player; // Who WAS the first player to go?
|
2011-06-28 23:09:40 -04:00
|
|
|
|
2011-07-11 09:25:13 -04:00
|
|
|
double interest_rate; // Current interest rate
|
|
|
|
|
2011-07-19 06:32:00 -04:00
|
|
|
bool game_loaded = false; // True if game was loaded from disk
|
|
|
|
int game_num = 0; // Game number (1-9)
|
2011-07-04 04:24:10 -04:00
|
|
|
|
2011-07-19 06:32:00 -04:00
|
|
|
bool quit_selected = false; // Is a player trying to quit the game?
|
2011-08-09 09:20:56 -04:00
|
|
|
bool abort_game = false; // Abort game without declaring winner?
|
2011-07-14 06:19:04 -04:00
|
|
|
|
2011-07-21 22:20:58 -04:00
|
|
|
bool option_no_color = false; // True if --no-color was specified
|
|
|
|
bool option_dont_encrypt = false; // True if --dont-encrypt was specified
|
|
|
|
int option_max_turn = 0; // Max. turns if --max-turn was specified
|
2011-07-19 08:29:36 -04:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************/
|
|
|
|
// End of file
|