Commit graph

473 commits

Author SHA1 Message Date
NHOrus
d6dab20801 Removed line as redundant
As of 8675c4facd lines 612-613 in main.c unreachable due to earlier
dispatch at line 1132 that redirects all find/inventory verbs into actions.c
Message NEARBY fires from YAML link to those verbs.
Also, reduced signature of playermove() to motion only.
2017-06-30 13:28:29 -04:00
Eric S. Raymond
51a4d7bd3a Remove gaps from arbitrary_messages, there are no more number sependencies.
Some spans within the list may still rely on contiguity.
2017-06-30 11:27:15 -04:00
Eric S. Raymond
46185a6e88 Magic-number elimination. 2017-06-30 11:03:57 -04:00
Eric S. Raymond
50e059eff8 Start another round of magic_number removal, this time for motions. 2017-06-29 16:41:49 -04:00
NHOrus
0f15c9e0f3 Breaking one-line conditionals 2017-06-29 22:51:30 +03:00
Eric S. Raymond
3001fb1dc1 Re-indented. 2017-06-29 15:45:59 -04:00
Aaron Traas
e7d1388c42 Updated documentation 2017-06-29 15:30:22 -04:00
NHOrus
97f307c912 k2 is dead 2017-06-29 21:35:44 +03:00
NHOrus
d48504f22f Untangling variable reuse 2017-06-29 21:35:44 +03:00
NHOrus
bf2fa227f0 Unshadowed k2 into k3 in main.c
Reindented everything
2017-06-29 20:11:53 +03:00
Eric S. Raymond
2b8b1b0130 Comment polishing. 2017-06-29 12:18:55 -04:00
Jason S. Ninneman
1ee0e5c7b0 Finish newdb -> dungeon renaming. 2017-06-29 08:54:55 -07: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
d43854f0f6 Simplify conditional evaluation when processing travel opcodes. 2017-06-29 08:46:29 -04:00
Jason S. Ninneman
50435465a6 Completely wire vocab words in YAML to the code.
This massive patch:
* Finishes working all the vocab words into YAML structures.
* Adds vocab ID generator functions.
* Redoes the input-getting system, removing the need for GETIN(),
  GETTXT(), etc.
* Changes advent<->ascii mapping to avoid the special 'shift'
  character.
* Works around some bad behavior in the dragon attack logic.
* Handles the reservoir magic word without changing the database
  contents.
2017-06-29 01:59:37 -07:00
Eric S. Raymond
9d918edeaa Eliminate some promiscuous variable reuse.
This was making the opcode-conditional evaluation logic much more
difficult to read than it needed to be.
2017-06-28 21:06:36 -04:00
Eric S. Raymond
7281c39807 Improve documentation if the *most* obscure span of code. 2017-06-28 20:24:29 -04:00
Eric S. Raymond
b5260417dd Magic-number elimination. 2017-06-28 17:07:15 -04:00
Aaron Traas
6521d49c07 Test coverage: make LCOV ignore bug() and all calls to BUG()
In theory, these should be unreachable, so they shouldn't be covered
with testing.
2017-06-28 13:23:34 -04:00
Aaron Traas
94aca03203 Test coverage: make LCOV ignore sig_handler and OOM check 2017-06-28 13:23:34 -04:00
Eric S. Raymond
f5719f1aba Magic-number elimination. 2017-06-28 11:45:53 -04:00
Eric S. Raymond
ceb5c27218 Comment polishing. 2017-06-28 10:51:47 -04: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
d53f125555 All travel[] references are now wrapped in extractor/predicate macros.
This is a step toward pulling the magic numbers apart into data structures
so there will be fewer magic numbers in the code.
2017-06-27 21:55:29 -04:00
Eric S. Raymond
f6cd34f778 Begin abstracting out the magic properties of travel-array opcodes. 2017-06-27 21:46:07 -04:00
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