1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-07-07 15:54:14 -04:00

Add the help text, including all appropriate formatting

This commit is contained in:
John Zaitseff 2011-07-14 19:27:57 +10:00
parent 92a95b253f
commit 3093e2cfd3

View File

@ -35,36 +35,113 @@
* Help text definition *
************************************************************************/
#define HELP_TEXT_PAGES (3)
const char *help_text[HELP_TEXT_PAGES] = {
"^BStar Traders^N help text, page 1."
const char *help_text[] = {
"^BStar Traders^N is a simple game of interstellar trading. The object of the\n"
"game is to amass the greatest amount of wealth possible. This is done by\n"
"creating interstellar shipping lanes, expanding them and buying shares in\n"
"the companies controlling them. Shares appreciate in value as company\n"
"operations expand. In addition, the return on each share (as a percentage)\n"
"also changes. Players may also borrow from the Interstellar Trading Bank to\n"
"finance additional purchases on the Stock Exchange.\n"
"\n"
"The map of the galaxy is represented by a ^B~x^N x ^B~y^N grid. A typical section\n"
"of it may be:\n"
"\n"
" ^e . . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . . . . . . . . . ^N ^e . ^N represents ^Bempty space^N,\n"
" ^e . ^s*^e . . . . . . . ^N ^s * ^N represents a ^Bstar^N.\n"
" ^e . . . . . . . ^s*^e . ^N\n"
" ^e . . . . ^s*^e . . . . ^N\n"
,
"Page 2. Test of ^B~~^N constants and ^B^^^N attributes.\n"
"MAX_X = ~x\n"
"MAX_Y = ~y\n"
"NUMBER_MOVES = ~m (~1, ~2, ~3, ~4, ~5, ~6, ~7, ~8, ~9, ... ~M)\n"
"MAX_COMPANIES = ~c\n"
"DEFAULT_MAX_TURN = ~t\n"
"The computer selects ^B~m^N moves (labeled ^k~1^N to ^k~M^N) at random, and places these\n"
"on the map. To select any of the highlighted positions, press that letter.\n"
"As an example, some of the moves on the map may be:\n"
"\n"
"^BBold text^N\n"
"^HHighlight text^N\n"
"^KKeycode string^N, for example, \"Press ^K<ESC>^N to quit\".\n"
"Map: ^eempty space^N as in ^e . ^N\n"
"Map: ^ooutpost^N as in ^o + ^N\n"
"Map: ^sstar^N as in ^s * ^N\n"
"Map: ^ccompany^N as in ^c ~A ~B ~C ~D ~E ~F ~G ~H ^N\n"
"Map: ^kkey choice^N as in ^k~1^N, ^k~2^N, ^k~3^N, up to ^k~M^N.\n"
"\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . . . ^k~3^e . . . . . ^N\n"
" ^e . ^s*^e . . . . ^k~5^e . . ^N Moves ^k~1^N to ^k~5^N shown.\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e . ^N\n"
" ^e . . . . ^s*^e . . . . ^N\n"
"\n"
"\n"
"Selecting a position that is ^Bnot^N next to a star (such as moves ^k~1^N, ^k~3^N or ^k~5^N)\n"
"will set up an ^Boutpost^N, not belonging to any company. Thus, if move ^k~3^N was\n"
"selected on the above map, a ^o + ^N would be placed at that position.\n"
,
"Page 3. Test map\n"
"If, on the other hand, a position next to a star (or another outpost) was\n"
"selected, a ^Bcompany^N would be formed and its first letter would appear on the\n"
"map. As a reward for creating the company, you are granted the first five\n"
"shares. Up to ^B~c^N companies can be created in this way.\n"
"\n"
" ^c~A^e . . ^o+^e ^o+^e . ^s*^e .^N\n"
" ^c~A^e ^s*^e ^s*^e . . . . .^N\n"
" ^c~A^e ^c~A^e . . . ^s*^e ^c~C^e .^N\n"
" ^e. . ^k~2^e ^s*^e . . ^k~3^e .^N\n"
" ^e. ^k~1^e . ^c~B^e ^c~B^e . . .^N\n"
"If a position next to an existing company is selected, the company would\n"
"expand its operations by one square. This increases the cost of its shares\n"
"and hence your return. Thus, if the map was as shown below, selecting ^k~6^N\n"
"or ^k~8^N increases Company ^B~B^N's shipping lane:\n"
"\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . . . ^o+^e . . ^k~6^e . . ^N\n"
" ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N or ^k~8^N increases Company ^B~B^N.\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n"
" ^e . . . . ^s*^e . . . ^k~8^e ^N\n"
,
"Selecting positions next to stars increases the value of your stock by about\n"
"five times as much as an extension not next to a star. Thus move ^k~6^N should\n"
"be preferred to move ^k~8^N.\n"
"\n"
" ^e ^c~C^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e ^k~1^e ^o+^e . ^o+^e . . ^k~6^e . . ^N\n"
" ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N is preferred to ^k~8^N.\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n"
" ^e . . . . ^s*^e . . . ^k~8^e ^N\n"
"\n"
"You can also expand any company by selecting positions next to outposts.\n"
"Such outposts will be swallowed up by that company. Thus, move ^k~1^N will\n"
"extend Company ^BC^N by ^Btwo^N squares. As a bonus, outposts next to stars are\n"
"more valuable: the company's share price will increase by a greater amount\n"
"than it would for outposts not next to stars.\n"
,
"If two companies are separated on the map by only one square, then they can\n"
"be ^Bmerged^N into one company by selecting that position (if available). For\n"
"example, on the map below, companies ^B~A^N and ^B~B^N can be merged by selecting ^k~5^N.\n"
"When this occurs, the company with the greater assets value takes over the\n"
"other one. Here, Company ^B~B^N might take over Company ^B~A^N. Company ^B~A^N ceases to\n"
"exist, although it may reappear as an entirely new company at a later stage.\n"
"\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . . . ^c~A^e ^c~A^e ^k~5^e ^c~B^e . . ^N\n"
" ^e . ^s*^e . . ^c~A^e . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~5^N merges companies ^B~A^N and ^B~B^N.\n"
" ^e . ^k~2^e . . . . . ^s*^e ^c~B^e ^N\n"
" ^e . . . . ^s*^e . ^o+^e . . ^N\n"
"\n"
"When companies merge, players are granted shares in the dominant company\n"
"proportional to the amount owned in the old company. As well, a cash bonus\n"
"is also paid, proportional to the percentage of the old company owned.\n"
,
"Once you select your move, you enter the ^BInterstellar Stock Exchange^N. Here\n"
"you can purchase shares, sell them, borrow from the Trading Bank or repay\n"
"some of your debt (if applicable). Note that each company issues a limited\n"
"amount of shares --- you cannot go on buying for ever! You can, however,\n"
"bid for more shares to be issued. You have a better chance of succeeding if\n"
"you own a larger proportion of the company.\n"
"\n"
"The game usually ends after ^B~t^N turns. However, you can end the game sooner\n"
"by pressing ^K<ESC>^N when asked to select a move. As well, individual players\n"
"can declare themselves bankrupt at any time. If your debt is large enough,\n"
"the Bank may do this for you! If you do not complete your game in the time\n"
"you have available, you may save the game and continue it later.\n"
"\n"
"\n"
"The ^Bwinner of the game^N is the person with the greatest net worth (total\n"
"value of cash, stock and debt). ^HGood luck^N and may the best person win!\n"
,
NULL
};
@ -75,9 +152,18 @@ const char *help_text[HELP_TEXT_PAGES] = {
void show_help (void)
{
int curpage = 0;
int numpages;
bool done = false;
for (numpages = 0; help_text[numpages] != NULL; numpages++) {
;
}
if (numpages == 0) {
return;
}
newtxwin(23, 80, LINE_OFFSET+1, COL_CENTER(80));
while (! done) {
@ -88,7 +174,7 @@ void show_help (void)
box(curwin, 0, 0);
center(curwin, 1, ATTR_WINDOW_TITLE, " How to Play ");
center(curwin, 2, ATTR_NORMAL_WINDOW, "Page %d of %d",
curpage + 1, HELP_TEXT_PAGES);
curpage + 1, numpages);
wmove(curwin, 4, 2);
// Process the help text string
@ -271,7 +357,7 @@ void show_help (void)
default:
curpage++;
done = (curpage == HELP_TEXT_PAGES);
done = (curpage == numpages);
}
}