Commit graph

318 commits

Author SHA1 Message Date
John "Elwin" Edwards
92d1275f42 UltraRogue: flush output when exiting. 2017-02-26 14:58:49 -05:00
John "Elwin" Edwards
bde89e33f7 Merge the UltraRogue branch. 2017-02-19 19:56:43 -05:00
John "Elwin" Edwards
4182f3b4eb Mention UltraRogue in the top-level README. 2017-02-19 19:54:17 -05:00
John "Elwin" Edwards
8690ea40f3 UltraRogue: add location for character files.
When using the -n option, UltraRogue will look for character files in a
single location, similar to save files.

The location is chosen by defining CHRDIR in getplay.c, at least until
UltraRogue gets integrated with the build systems.
2017-02-19 19:47:09 -05:00
John "Elwin" Edwards
d309fcdd46 UltraRogue: make scorefile location configurable. 2017-02-15 20:38:12 -05:00
John "Elwin" Edwards
a8a6e1ce7a UltraRogue: fix a segfault related to restoring monsters.
The functions for restoring saved games failed to properly correct the
t_chasee pointer of monsters chasing the player.  Such monsters would
attempt to chase NULL instead, with predictable results.
2017-02-14 20:42:33 -05:00
John "Elwin" Edwards
fc0b18d304 UltraRogue: restrict changing name and save file.
When the -n option is in use, player name and save file location cannot
be changed.  The score file is also restricted.
2017-02-12 20:16:57 -05:00
John "Elwin" Edwards
67e9cff868 Merge the bugfix branch, which had missed an update. 2017-02-10 09:06:50 -05:00
John "Elwin" Edwards
7eeb9ddcb6 Add some braces to a loop in parse_opts().
A for loop had no braces around its body, which was a single if-else
statement.  In Advanced Rogue 5, another statement had been added,
accidentally removing the if-else from the loop.  This could have
resulted in an out-of-bounds access to the options array.

In the other games, the added braces are only for clarity.
2017-02-10 09:02:58 -05:00
John "Elwin" Edwards
7b42d453f0 UltraRogue: don't overwrite the savefile name when restoring. 2017-02-09 20:13:25 -05:00
John "Elwin" Edwards
403d9ec171 UltraRogue: add the -n option. 2017-02-09 16:29:45 -05:00
John "Elwin" Edwards
ed27d7a24f UltraRogue: fix crash when restoring.
The r_flags field in struct room was being written as an int and read
as a short.  This caused the restore functions to receive the wrong
data, usually an impossible string length, and abort.

This breaks save compatibility, though the save files had problems
anyway: the r_fires field should have been used, instead of reading and
writing r_flags twice.
2017-02-08 19:50:36 -05:00
John "Elwin" Edwards
b100b40846 UltraRogue: fix various build failures. 2017-01-31 20:33:49 -05:00
John "Elwin" Edwards
11c74c273d Import UltraRogue from the Roguelike Restoration Project (r1490) 2017-01-31 19:56:04 -05:00
John "Elwin" Edwards
c346921c68 Update the fallback install script. 2017-01-31 18:59:38 -05:00
John "Elwin" Edwards
62047972cc Use more portable random seed generation.
The new function md_random_seed() has replaced time() + getpid() and
similar methods.  Putting everything in mdport.c slightly reduces the
warnings and workarounds.
2017-01-28 15:49:41 -05:00
John "Elwin" Edwards
c194ec3dc9 Fix the perpetual haste cheat.
Rogue V3 allowed the player to gain perpetual haste by quaffing a
potion of haste while already hasted.  This is supposed to remove the
haste effect and cause temporary paralysis.

Super-Rogue removed haste correctly, but gave confusing messages.
2017-01-28 11:45:36 -05:00
John "Elwin" Edwards
714bad8c3c Rogue V5: fix save/restore making levitation, hallucination permanent.
Like an earlier bug with detecting monsters, the fuses responsible for
ending levitation and hallucination were not recognized by
rs_write_daemons().  They got left out of the savefile, so after
restoring, the effect never wore off.

I think this is the first bugfix I've ever made that reduced the game's
difficulty.
2016-07-20 20:44:41 -04:00
John "Elwin" Edwards
eabbd3e1a1 Added tag rel2016.06 for changeset 182e26224f92 2016-06-01 20:16:23 -04:00
John "Elwin" Edwards
c65d17136d README.txt: additions and clarifications. 2016-05-29 17:05:38 -04:00
John "Elwin" Edwards
63b2707739 Enable the logfile on 64-bit Windows.
It seems to work without any problems.

One use of a non-portable function was corrected in the process.
2016-05-17 21:28:34 -04:00
John "Elwin" Edwards
c5f4f359ea Rogue V5: don't limit the high score list to 1 on Windows.
The Visual Studio project file failed to define ALLSCORES, causing the
score file to be limited to one entry per UID.  Since the UID is always
set to 42 on Windows, only one entry could ever appear in the list.
2016-05-15 19:04:46 -04:00
John "Elwin" Edwards
ca1c442db2 Rogue V[345], Super-Rogue: Fix violet fungi/venus flytraps.
Violet fungi (renamed venus flytraps in Rogue V5) do an increasing
amount of damage each time they hit.  If they miss, you still suffer
the same number of HP.  This worked by keeping a counter and printing
new damage strings into monsters[5].m_stats.s_dmg, which is the
"prototype" of that particular monster.

Each individual monster has its own damage string.  Apparently these
were once char *, pointing to the same string as the prototype.  When
the s_dmg member was changed to be an internal char array, changing the
prototype's damage string no longer had any effect on actual monsters.

As a result, flytraps did no damage on a hit, or only one point in V5.
The mechanism for doing damage on a miss continued to work.

This has been fixed by overwriting the individual monster's damage
string instead of the prototype's.  It is now no longer necessary to
reset the damage string when the flytrap is killed.  The method for
resetting it when the hero teleports away had to be modified.  Comments
referencing the long-unused xstr have been removed.
2016-05-01 19:39:56 -04:00
John "Elwin" Edwards
718c807339 Rogue V4, V5: fix messages when viewing the identified items.
The functions for displaying the list of identified items begin by
prompting for the category of item, using msg().  Rogue V4 left this
prompt on the screen after displaying the discovery list.  Rogue V5
erased the message window even if the process of printing the list
created another message which the player had not read.

Messages are now cleared in endline(), which is capable of checking
whether clearing should be done.
2016-04-24 13:33:17 -04:00
John "Elwin" Edwards
de0518b00e Remove old installation instructions. 2016-03-19 16:42:03 -04:00
John "Elwin" Edwards
2d4a66298a Fix some functions not returning the right type. 2016-03-19 16:18:58 -04:00
John "Elwin" Edwards
2e20820d1b README.txt: remove outdated information. 2016-03-12 14:36:25 -05:00
John "Elwin" Edwards
84db7dbc2a Super-Rogue: fix saving and restoring on Windows.
The problem turned out to be that the save file wasn't being deleted
because it was still open.
2016-03-12 14:29:07 -05:00
John "Elwin" Edwards
8df0a6308d Merge the GCC5 and build fix branches.
This fixes all warnings produced by GCC 5, except the ones related to
system functions.  Those could be fixed by including the proper headers,
but it would be better to replace the system-dependent code with
functions from mdport.c.
2016-03-11 19:47:52 -05:00
John "Elwin" Edwards
758c6b1bf0 arogue7, xrogue: improve the handling of the arguments to fuses.
fuse() now expects a pointer as the argument to a fuse function.  If
this is one of the functions that takes int, fuse() follows the pointer
and stores that value in the f_list slot, in the integer field of the
argument union.  When the fuse goes off, do_fuses() recognizes the
function and passes it the integer field instead of the pointer.

This has the disadvantage of hard-coding the functions that require int
in daemon.c, but since the int is copied into f_list, it no longer has
to be in static or global memory, which simplifies several files.
2016-03-11 17:40:00 -05:00
John "Elwin" Edwards
dafa5cc722 XRogue: fix some uses of entire structs instead of their members.
Some calls to runto() were given a pointer to the player struct instead
of to the player's coordinates.  A call to death() was passed a pointer
to a monster instead of the monster's type number.
2016-03-08 20:47:57 -05:00
John "Elwin" Edwards
e30aa0e491 Makefiles: don't rely on built-in implicit rules.
Not all make implementations will use CPPFLAGS when compiling C files.
2016-03-08 19:45:41 -05:00
John "Elwin" Edwards
e9c84b2637 XRogue: get rid of VOID as an alias for long.
Maybe some compilers in 1986 didn't handle void pointers well, but they
are no longer a concern.
2016-03-07 20:44:01 -05:00
John "Elwin" Edwards
090622896b Rogue V4: add two more function declarations.
Though it was called with different numbers of arguments, add_line()
does not need to be a variadic function.  Making the second argument
mandatory is a better solution.
2016-03-07 19:26:08 -05:00
John "Elwin" Edwards
a6c73eb65a Fix various overlooked causes of warnings.
GCC5 now produces under 300 lines of warnings, but the remaining ones
will require more complex solutions.
2016-03-06 21:02:59 -05:00
John "Elwin" Edwards
5cf0194676 Declare some function arguments as const.
Some functions, mostly in fight.c, declared variables as pointers to
const char but passed them to functions that took pointers to ordinary
char.  The strings did not actually get modified, so adding 'const' to
the function definitions removed the warnings.
2016-03-06 19:32:47 -05:00
John "Elwin" Edwards
fece552183 Don't force the use of GCC.
Due to incomplete autoconfiscation, most of the Makefiles ignored the
C compiler found by 'configure' and always used 'gcc'.
2016-03-06 17:09:17 -05:00
John "Elwin" Edwards
5738b681d8 Rogue V5: prevent error messages from 'make clean'.
Using 'rm -f' will not cause an error if the file to be removed is
already gone.
2016-03-06 17:03:47 -05:00
John "Elwin" Edwards
35bea2ba0d Use uniform return types for functions related to options.
Functions for printing options now return void.  Functions for setting
options now return int.  Argument types still vary, though converting
all the option pointers to void* would be possible.
2016-03-06 14:45:18 -05:00
John "Elwin" Edwards
0a354903e0 Daemons and fuses now return void.
Functions for starting and stopping daemons and fuses now expect the
type 'void (*func)()'.  Only a few functions in XRogue needed to be
modified to fit.  Determining the type of the argument is left for a
later date.

Building with GCC5 should now produce less than 200 lines of warnings
per game.
2016-03-05 20:49:37 -05:00
John "Elwin" Edwards
6dfde944f0 Rogue V4, V5: disable a cheat granting permanent monster detection.
In these two games, a potion of monster detection turns on the player's
SEEMONST flag.  A fuse is set to call turn_see() to turn the flag back
off.  But the save and restore functions do not recognize turn_see() and
fail to set the fuse up again.

When restoring, Rogue V4 merely sets the fuse's function to NULL and
leaves it burning.  When it goes off, a segfault results.  Rogue V5
clears all the fuse's fields, and the player retains the ability to see
all monsters on the level.

The save and restore code can now handle the fuse.  The function used is
a new wrapper, turn_see_off(), which should lead to less problems with
daemons being multiple incompatible types.

Also, Rogue V4 and Super-Rogue now properly clear unrecognized daemon
and fuse slots when restoring a saved game.
2016-03-05 12:10:20 -05:00
John "Elwin" Edwards
cfda1f88e8 Super-Rogue: begin fixing restore failures on Windows.
Start to solve the problem by calling md_init() to set _fmode.  Now
reading a savefile only triggers an error handler and causes an abort
instead of a crash.
2016-03-03 21:30:38 -05:00
John "Elwin" Edwards
8bf09d3064 Merge the GCC5 and build fix branches. 2016-03-02 21:28:34 -05:00
John "Elwin" Edwards
2853120387 XRogue: convert to ANSI-style function declarations. 2016-03-02 21:13:26 -05:00
John "Elwin" Edwards
f5c2898524 Makefile fixes related to installation.
'make install' and 'make uninstall' should now work correctly, placing
the documentation in the proper places.  Any directories needed will be
created.
2016-02-26 17:30:30 -05:00
John "Elwin" Edwards
c6f7d67623 Generate text documentation from the troff source files.
This is done by make, in the 'docs' target, which is now part of the
normal build process.

Unfortunately, not all the games include troff sources.  Getting decent
HTML output from groff is still a difficult process which will not be
attempted at this time.  There are a few bugs in the 'install' and
'uninstall' rules.

Not to mention that the documentation is sometimes inaccurate.
2016-02-21 20:47:12 -05:00
John "Elwin" Edwards
e8e6e604c3 Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
2016-02-19 21:02:28 -05:00
John "Elwin" Edwards
eab5aa2ec4 Fix curses library detection.
A custom autoconf macro searched for the curses library, and provided an
option to use ncurses instead of a (presumably deficient) curses
implementation.  Unfortunately, some of the Makefiles ignored the
search's results.

Now that this is fixed, building against pdcurses should be easier too.
2016-02-12 15:12:37 -05:00
John "Elwin" Edwards
c4365554c4 Rogue V5: remove troublesome automatic platform detection.
configure.ac used AC_CANONICAL_SYSTEM to guess the GNU system
description triplets.  The target description was substituted into the
Makefile and formatted into the filename for the binary distribution
tarball.  But 'target' is only intended for cross-compilers.  'host_os'
might have been a better choice.

The tarball filename can still be changed manually, by running make with
an argument of 'DESTSYS=systemname'.

Cross-compiling may be more difficult now, but I am not certain that it
worked properly previously, and due to pending autoconf changes, it was
likely to break anyway.

The top-level config.guess and config.sub are no longer needed, but they
may reappear if better support for cross-compilation is added.
2016-02-12 14:25:47 -05:00
John "Elwin" Edwards
f38b2223c8 Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
2016-02-07 14:39:21 -05:00