1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00
Commit Graph

294 Commits

Author SHA1 Message Date
John Zaitseff
c6007be5aa Move background setting and box drawing into newtxwin()
Setting the background and drawing a box is almost always the first thing
done after window creation.
2011-07-20 11:41:46 +10:00
John Zaitseff
ee259b8a83 Add a few more function comments 2011-07-20 10:50:18 +10:00
John Zaitseff
da7477dc28 Compensate for the POSIX locale not having a currency symbol
The function l_strfmon() will insert MOD_POSIX_CURRENCY_SYMBOL in the
appropriate place when used with the POSIX ("C") locale.
2011-07-20 10:44:44 +10:00
John Zaitseff
e56247b1b4 Bug fix: company share prices CAN be zero, if company does not exist 2011-07-19 23:31:20 +10:00
John Zaitseff
ee37b4d210 Add the --no-encrypt command-line option 2011-07-19 23:24:17 +10:00
John Zaitseff
cdb98dbedb Make slight corrections to the help text 2011-07-19 23:19:08 +10:00
John Zaitseff
d47848850f Clean up help.c and help.h: remove superfluous lines, add comments 2011-07-19 23:07:26 +10:00
John Zaitseff
b10b4c21ed Clean up the system.h header file 2011-07-19 22:53:06 +10:00
John Zaitseff
fdd53e94ba Add an "end of file" comment 2011-07-19 22:30:26 +10:00
John Zaitseff
e7208c72db Implement the --max-turn command line option 2011-07-19 22:29:36 +10:00
John Zaitseff
fe65657eda Move function comments to start of file; remove unneeded parentheses 2011-07-19 22:07:15 +10:00
John Zaitseff
8725983d94 Update header comments 2011-07-19 21:47:19 +10:00
John Zaitseff
c3d265a9ff Clean up utils.c and utils.h
Move all function interface comments to the header file (where they
should have been in the first place), remove superfluous parentheses
where allowed by the precedence of C operators.
2011-07-19 21:38:27 +10:00
John Zaitseff
c19feab652 Clean up various comments, etc, in header files 2011-07-19 20:32:00 +10:00
John Zaitseff
13c6353dd2 Replace all visible mentions of <ESC> with <CTRL><C>
Note that pressing <ESC> will often generate up to one second's worth of
delay, whereas <CTRL><C> causes no delay.
2011-07-19 19:45:42 +10:00
John Zaitseff
fcffaa5860 Add checks for KEY_EXIT: same functionality as pressing CTRL-C 2011-07-19 19:22:20 +10:00
John Zaitseff
ccbe7405f8 Replace "out of memory" errors with calls to err_exit_nomem() 2011-07-19 19:16:34 +10:00
John Zaitseff
7bfdcff969 Minor (cosmetic) changes to the ordering of elements in some files 2011-07-19 19:09:59 +10:00
John Zaitseff
04879e376e Replace obsoleted vwprintw() with vw_printw() 2011-07-19 15:36:22 +10:00
John Zaitseff
8165785fc0 Handle rounding of input amounts a little better 2011-07-19 15:04:39 +10:00
John Zaitseff
5e15e2a197 Bug fix: only remove thousands separators if present in the locale 2011-07-19 14:54:38 +10:00
John Zaitseff
ef83258e2b Make file saving and loading locale-independent for numbers 2011-07-19 14:47:18 +10:00
John Zaitseff
7eafa205e7 Minor bug fix: the done variable must be initialised before use 2011-07-19 14:36:00 +10:00
John Zaitseff
625f265108 Allow the player to buy and sell shares
This function, trade_shares(), is the last function needed for Star
Traders: the game is now complete.

The current line count is 6667 lines of C code (src/*.[ch]), as compared
with 1657 lines in the CP/M-80 version, 1674 lines in CP/M-86, 4266 lines
in DOS (2225 in the main program) and 4580 lines in Windows 16-bit.
2011-07-19 14:21:32 +10:00
John Zaitseff
dc14a0e633 Implement the gettxlong() function to input an integer 2011-07-19 14:15:33 +10:00
John Zaitseff
26436c08dd Rearrange the Stock Exchange display
The Stock Exchange display now mimics the Stock Portfolio page a little
more.  Also allow more keys to exit parts of the Stock Exchange.
2011-07-19 11:10:09 +10:00
John Zaitseff
e38c151752 Implement the visit_bank() function 2011-07-19 00:38:06 +10:00
John Zaitseff
8b504b645d Implement the gettxdouble() function to input a floating point number 2011-07-19 00:37:10 +10:00
John Zaitseff
c3097e7f6f Fix a long-standing bug: don't impound more cash than the debt amount! 2011-07-19 00:03:34 +10:00
John Zaitseff
937fea4ccb Make company letters stand out more on the map in --no-color mode 2011-07-18 20:55:47 +10:00
John Zaitseff
ccd451cf5c Implement the main part of exchange_stock() 2011-07-18 20:16:55 +10:00
John Zaitseff
c686d2f548 Rename sel_val_t to selection_t; add values useful for exchange_stock() 2011-07-18 20:16:24 +10:00
John Zaitseff
84b4972f93 Remove a superfluous call to wrefresh() in show_map() 2011-07-18 17:21:54 +10:00
John Zaitseff
1beb2003ef Remove the global variables selection, credit_limit and bid_used 2011-07-18 16:22:24 +10:00
John Zaitseff
c123a87cc3 Move common bankruptcy code to a separate function, bankrupt_player() 2011-07-18 15:34:57 +10:00
John Zaitseff
2ec1c7faa9 Check if a player's debt is too large 2011-07-18 15:03:07 +10:00
John Zaitseff
5fca151b60 Add the function adjust_values() 2011-07-18 14:05:22 +10:00
John Zaitseff
4ecb40fe27 Complete the implementation of the process_move() function
This includes the functions try_start_new_company(), merge_companies(),
include_outpost() and inc_share_price().
2011-07-16 19:23:12 +10:00
John Zaitseff
c182f9df6f Increase the size of Game Winner window at the end of the game 2011-07-16 19:20:50 +10:00
John Zaitseff
a75ec7479d Add center3(): centre three strings 2011-07-16 15:47:05 +10:00
John Zaitseff
885b49f19d Allow a player to declare themselves bankrupt 2011-07-16 14:37:29 +10:00
John Zaitseff
e2dbe549b2 Implement the "Save game" player choice; start coding process_move() 2011-07-16 13:34:13 +10:00
John Zaitseff
6c708d6f83 Add more control keys handled by various input routines for consistency 2011-07-16 13:32:02 +10:00
John Zaitseff
ac6e432c18 Add the ax_append_flag Autoconf macro
This macro is taken from the GNU Autoconf Archive
(http://www.gnu.org/software/autoconf/).
2011-07-16 10:52:36 +10:00
John Zaitseff
7d4bff8799 Update the ax_cflags_warn_all Autoconf macro
This macro is taken from the latest version available from the GNU
Autoconf Archive (http://www.gnu.org/software/autoconf/).
2011-07-16 10:43:56 +10:00
John Zaitseff
2c65c5be4a Move the stock exchange and bank functions (to be written) to exch.c 2011-07-16 10:43:19 +10:00
John Zaitseff
ddb214c5fb Move the selection and processing of game moves to move.c 2011-07-16 10:30:58 +10:00
John Zaitseff
eb2fe45beb Reorganise the information in src/README 2011-07-16 10:10:36 +10:00
John Zaitseff
dd40b94301 Move game_load() and game_save() functions to their own source file 2011-07-16 09:58:53 +10:00
John Zaitseff
36c9a57db0 Implement the end_game() function: display the winner of the game 2011-07-15 23:37:56 +10:00