Commit graph

106 commits

Author SHA1 Message Date
Eric S. Raymond
829c13d1d5 Fix some screwy formatting of conditionals...
...probably by the original FOTRAN-to-C translator.
2023-04-06 21:29:39 -04:00
Eric S. Raymond
25230068fe Partial REUSE cmpliance. 2023-04-03 11:25:11 -04:00
Eric S. Raymond
786832210e Magic-number elimination. 2023-03-14 14:58:26 -04:00
Eric S. Raymond
67a887f432 Magic-number elimination. 2022-04-19 17:07:46 -04:00
Eric S. Raymond
6dd37a6ec3 Namespace splittiing to prune the maze graph. No eeffect on gameplay. 2022-04-06 18:59:14 -04:00
Eric S. Raymond
81af59974b The FORTRAN-derived longs were semantically ints. Make it so.
Note. because we used fixed-length declrations in the right places, this
shouldn't break saves.

(Besides being right, this will someday make a port to Go a touch easier,
if we decide to do that.)
2019-02-28 05:58:16 -05:00
Eric S. Raymond
782c5c3f29 SPDXify the code. 2018-03-08 20:56:21 -05:00
NHOrus
9e2cb3c191 Put some of important parameters into fixed width signed integers
Massaged test files. Fixes issue #41
2017-09-11 00:58:13 +03:00
Jason S. Ninneman
0e540429b0 Working but unpolished refactor of bigwords(). 2017-07-05 14:02:52 -07:00
NHOrus
63152e6714 Broke all logical or into multiline statement to show lcov's lies
Results are weird, some things that need to be checked aren't and
at least my local lcov doesn't show them as unchecked
2017-07-03 07:20:37 +03:00
Eric S. Raymond
e712f4c0e0 Magic-number elimination. 2017-07-02 14:47:21 -04:00
Jason S. Ninneman
6af38a92f6 Eliminate the global game.blklin. 2017-07-02 10:37:10 -07:00
Eric S. Raymond
346bcf9458 Magic-number elimination. 2017-07-02 13:22:50 -04:00
Aaron Traas
7eaefce61d Moved application settings to settings_t struct
Since logfp, oldstyle, and prompt were application settings, rather than
have them all as global vars, move them to a single global var, seperate
from game state, as they aren't, technically, game state, but are
application settings.
2017-07-02 12:52:17 -04:00
Aaron Traas
85f8334e17 centralize calls to make_zzword()
make_zzword() now called in set_seed(), because the only times it was
called in the entire application is after every invocation of set_seed().
2017-07-02 02:02:09 -04:00
Aaron Traas
f815299a2a make_zzword() moved to initialize. Pruned unused stuff from cheat.c 2017-07-02 01:07:53 -04:00
NHOrus
8cc5ee5412 Put stuff back in init, C-style 2017-07-01 16:45:42 +03:00
Eric S. Raymond
065caace64 Move PRNG initialization to simplify cheat.c 2017-07-01 08:59:45 -04:00
NHOrus
0a87fc9f78 Spread documentation from init.c It was empty without anything to document. Reindented, too 2017-07-01 08:53:03 -04:00
NHOrus
7f2c118e56 Cut initialize in favor of implicit/default initialization where possible 2017-07-01 08:53:03 -04:00
NHOrus
bf2fa227f0 Unshadowed k2 into k3 in main.c
Reindented everything
2017-06-29 20:11:53 +03:00
Jason S. Ninneman
83fb64b5a8 Jettison MAKEWD(), GETTXT(), vocab(), GETIN(), and the old db compiler. 2017-06-29 08:54:35 -07:00
Eric S. Raymond
27bc9f3bd2 De-macroize references to travel opcode fields we won't unpack further. 2017-06-28 09:21:41 -04:00
Eric S. Raymond
aace0b1359 More macro abstraction of the travel opcodes. 2017-06-28 08:26:36 -04:00
Eric S. Raymond
fb35c34171 After splitting out the stop field, nothing ever negates a travel opcode...
...so all those labs() calls can go away.
2017-06-27 22:15:22 -04:00
Eric S. Raymond
8560122f01 Break travel opcodes into a two-element structure. 2017-06-27 22:11:58 -04:00
Eric S. Raymond
894b3de949 Travel tables are all done from YAML now.
Leaves only Section 4 from asventure.text still relevant.
2017-06-27 16:11:13 -04:00
Jason S. Ninneman
7dc8839249 Abolish VOCWRD().
Action word mnemonics are now enums from adventure.yaml.
2017-06-26 22:07:24 -07:00
Jason S. Ninneman
f9edfc5151 Reexpress the motion words in adventure.yaml. 2017-06-26 22:22:51 -04:00
Jason S. Ninneman
6ac098170c Use enums for object number mnemonics instead of VOCWRD() calls. 2017-06-26 11:27:27 -07:00
Jason S. Ninneman
2fac8d1aef object_descriptions[] is now objects[]. 2017-06-26 09:43:11 -07:00
Eric S. Raymond
d612b0e6ca Change the name of the KEY array to avoid an upcoming macro clash. 2017-06-26 10:44:19 -04:00
Eric S. Raymond
59243cf8bc Take FORTRANish upper-case function names to C-style lowercase...
...except for a few we're planning to get rid of.  This will avoid some
upcoming collisions with macros defined from YAML.
2017-06-26 10:19:33 -04:00
Eric S. Raymond
d809974479 Dix off-by-one errors induced by tightening some array bounds. 2017-06-25 13:17:35 -04:00
Eric S. Raymond
8a6e6aae7d Fully subsume section 7 into YAML. 2017-06-24 20:28:22 -04:00
Eric S. Raymond
5ba7973ca7 Improve comments, eliminate magic numbers. 2017-06-24 12:22:25 -04:00
Eric S. Raymond
3e19c39f57 Give generate constant arrays the const specifier.
Also, move the adventure.txt format documentation to dungeon.c to be
removed when that file is.
2017-06-24 11:07:07 -04:00
Eric S. Raymond
c3a2816821 Replace magic MINTRS/MAXTRS with a treasure attribute in YAML. 2017-06-24 10:47:59 -04:00
Eric S. Raymond
25077d0b4e LOCSIZ -> NLOCATIONS, finishing limit-name cleanup. 2017-06-24 10:20:36 -04:00
Eric S. Raymond
64035d0026 More fixed limits (NOBJECTS, LOCSIZ) stop being fixed. 2017-06-24 10:18:33 -04:00
Eric S. Raymond
985137d9c7 Rationalize names of structure array sizes.
Everything that camn be #define become one, in all caps to signify that
it's a constant.
2017-06-24 09:55:32 -04:00
Eric S. Raymond
3a93b2b5f0 Elimination of OBJSND. 2017-06-24 09:08:48 -04:00
Eric S. Raymond
f47dc9f447 Location sounds are now declared by YAML. 2017-06-23 10:10:48 -04:00
Eric S. Raymond
44abab29e3 Toss unused parts of dungeon.c and init.c 2017-06-22 22:33:24 -04:00
Eric S. Raymond
6c6c72f327 Replace macros with condition bits. 2017-06-22 18:41:25 -04:00
Eric S. Raymond
51494657fd Give the FORCED property a real cond bit. Delete some unused code. 2017-06-22 17:49:06 -04:00
Eric S. Raymond
7f7f49b739 Switch fully over to YAML generation of condition bits. COND is gone. 2017-06-22 17:28:39 -04:00
Jason S. Ninneman
79ffdb36f0 Switch to 0-indexing for hint handling code. 2017-06-21 10:26:23 -07:00
Jason S. Ninneman
c8f6ff3701 Abolish HNTMAX and HNTSIZ in favor of HINT_COUNT.
This change necessitated include guards on newdb.h.
2017-06-21 10:25:12 -07:00
Jason S. Ninneman
1e59d6b476 Clean out some disused variables. 2017-06-20 19:26:55 -04:00