Commit graph

345 commits

Author SHA1 Message Date
Eric S. Raymond
d891b883b9 Minor refactoring step. 2017-06-27 19:44:20 -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
fe46e5ab0c Squash a compiler warning. 2017-06-26 12:15:55 -04: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
e424588682 Unsnarl the motion code some more. 2017-06-25 20:50:41 -04:00
Eric S. Raymond
0c54875118 Begin toounsnarl the way the TRAVEL array is used. 2017-06-25 19:22:46 -04:00
Eric S. Raymond
6d571c18b8 Magic-number elimination. 2017-06-25 19:22:46 -04:00
Eric S. Raymond
8a6e6aae7d Fully subsume section 7 into YAML. 2017-06-24 20:28:22 -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
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
0c2803638f Correct buggy behavior of sign in endgame. Add a test for this. 2017-06-24 09:30:15 -04:00
Eric S. Raymond
3a93b2b5f0 Elimination of OBJSND. 2017-06-24 09:08:48 -04:00
Eric S. Raymond
ea70341cfe Eliminate setting of OBJTXT sell for oyster - OBJTXT is now static.
A necessary step towards getting rid of it.
2017-06-23 15:50:15 -04:00
Eric S. Raymond
ecff53d3a8 Name the lamp, grate, and bird states. 2017-06-23 14:59:32 -04:00
Eric S. Raymond
2848494a01 Proof of cobcept for state defines.
It is now possible in the YAML to declare defines for all state values
associated with an object.  This are visible in the C code and can be used
to replace magic numbers.
2017-06-23 14:07:44 -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
Eric S. Raymond
9c7c23b75a Improve namespace hygiene. 2017-06-22 08:58:11 -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
Peje Nilsson
deb61e3dcd Replace SETPRM/[PR]SPEAK with variadic [pr]speak
Rename/rewrite old speak to vspeak and take a va_list
Add new speak that takes variadic parameters

Remove SETPRM & PARMS[]
2017-06-21 13:14:53 -04:00
Eric S. Raymond
ddb0df85b3 YAMLify section 11 (hints). 2017-06-21 11:22:18 -04:00
Eric S. Raymond
9437ccca36 WD* globals abolished. They're now members of the command block. 2017-06-20 20:06:32 -04:00
Jason S. Ninneman
9714c9fc2a Fix another ob1 error. 2017-06-20 19:26:55 -04:00
Jason S. Ninneman
1e59d6b476 Clean out some disused variables. 2017-06-20 19:26:55 -04:00
Jason S. Ninneman
acc07e1287 Fix off-by-one error. 2017-06-20 19:26:55 -04:00
Jason S. Ninneman
d029b08ad1 Refactor how turn threshold penalties are accounted for. 2017-06-20 19:26:55 -04:00
Eric S. Raymond
7a3f3ec7a6 Introduce command encapsulation structure. 2017-06-20 17:40:41 -04:00
Eric S. Raymond
e37f858b08 Comment polishing. 2017-06-20 13:38:11 -04:00
Eric S. Raymond
521033165b Polish help text. 2017-06-20 08:41:06 -04:00
Peje Nilsson
c84d370918 Merge branch 'master' into magic-number 2017-06-19 23:44:48 +02:00
Peje Nilsson
f9be57a9f9 Cleanup Arithmetic on message number 2017-06-19 23:44:03 +02:00
Eric S. Raymond
a678b68b39 Mostly confine assumptions about what token_t is to misc.c
The token_t things like WD* are presently longs and will someday be
char[6].  By introducing some trivial functions - wordeq(),
wordempty(), and wordclear() - we mostly hide the difference.

All runtime knowledge about packing now lives only in misc.c and the
list of magic WORD_* defines in advent.h.  Outside this, literals are
now accessed through #define names that could expand to either longs
or strings.

Still to be done: WD* values are sometiimes compated to zero in
ways implying they can be negative. Must figure out wat thus means.
2017-06-19 17:21:45 -04:00
Eric S. Raymond
87961483a2 Concentrate all magic-number values for packed-string constants in one place. 2017-06-19 16:53:55 -04:00
Eric S. Raymond
79f5701e07 More semantic typing - a step towards eliminating packing. 2017-06-19 14:20:45 -04:00
Eric S. Raymond
0eb85f233a Boolify some logical variables. 2017-06-19 13:21:15 -04:00
NHOrus
e9aff2568f Even less magic 2017-06-19 20:18:20 +03:00
NHOrus
a8a7c50691 -r doesn't show with NOSAVE build 2017-06-19 19:29:00 +03:00
NHOrus
93a76e9d2f No need to tease with excluded options 2017-06-19 19:11:07 +03:00
Eric S. Raymond
4c100261c4 Magic-number elimination. 2017-06-19 11:09:24 -04:00
Eric S. Raymond
d46407d327 Magic-number elimination. Fix possible glitch in troll-bridge death. 2017-06-19 11:00:23 -04:00
Eric S. Raymond
98b02eeeb1 Magic number elimination, repair some careless replace damage. 2017-06-19 08:37:19 -04:00
Peje Nilsson
2fe36df4e2 Remove goto L12 - take two
On't know if you let me near this code again but here is a second
stab at removing "goto L12"

Previous attempt failed because of trying to continue the outer
do{}while(false)
Adding an extra for(;;) loop where the only repeat is the former
"goto L12" is replaced by continue. All other exits are returns
and a break;
2017-06-19 07:33:40 -04:00
Jason S. Ninneman
06e8d5a83e Abolish MAXDIE in favor of maximum_deaths. 2017-06-18 20:02:03 -07:00
Jason S. Ninneman
fecc48e6e5 Remove message pointer math in croak(). 2017-06-18 19:54:48 -07:00
Jason S. Ninneman
624ba16aad Change YES() to take const char* arguments. 2017-06-18 19:51:59 -07:00