Commit Graph

28 Commits

Author SHA1 Message Date
jsm
5fd015d6f6 In cypher(), don't attempt to make sense of words other than VERBs or
KNIFE when a verb is required.  Add AUXVERB for "make", "move",
"climb" (as in "make love", "climb up") and ignore AUXVERB as a verb,
going on to the next word, instead of treating these words as
adjectives.  When creating new verbs from "put on", "put down", "take
off", mark them as type VERB.  Mostly from Paul Janzen
<pjanzen@foatdi.harvard.edu>.
2000-09-25 19:37:58 +00:00
jsm
ca0c4d77e3 Add new flags OBJ_PERSON and OBJ_NONOBJ to the objflags array. 2000-09-25 14:44:59 +00:00
jsm
e2872de219 Add OBJ_AN flag to objflags so as to use "a" or "an" appropriately in
messages; avoids "a amulet", "a Elf".  Define and use macros to use
"a", "an", "the", "is", "are" appropriately.  Partly based on OpenBSD.
2000-09-25 14:08:08 +00:00
jsm
579d7e283b Make hash table static in parse.c. 2000-09-24 14:11:09 +00:00
jsm
44c05578b0 Make functions local to parse.c static. 2000-09-24 09:46:28 +00:00
jsm
6e6404a77d Clean up fly.c by making local variables and functions static and
removing abs() macro.
2000-09-24 09:44:28 +00:00
jsm
d3579258c9 Use a lookup table to identify whether objects are plural or singular,
instead of testing the final character against 's' in each place.
Avoids oddities about "pot of jewels" and "compass".
2000-09-23 19:23:57 +00:00
jsm
1fc5d09e80 Various improvements to parsing in battlestar, mostly from OpenBSD.
Define a constant WORDLEN.  Always use this constant and NWORD where
appropriate.

Use NWORD - 1 in battlestar.c to avoid off-by-one error.

Increment wordnumber after the INVEN verb to allow it to be followed
by a comma and other actions.

Avoid overflowing elements of the words array if input words are too
long.

Parse "," as AND except when followed by a verb, to allow such
constructions as "take foo, bar, and baz".  Trim AND AND which may
occur from the ", and" in such a list.

Avoid crashes from EVERYTHING in the wrong place by moving it to the
start of OBJECT AND EVERYTHING and NOUNS AND EVERYTHING sequences, and
trimming EVERYTHING AND EVERYTHING.
2000-09-21 17:44:34 +00:00
jsm
31b523eee5 Patches from OpenBSD: add verbs "open"/"unlock" (essentially a no-op),
and "verbose"/"brief" (in verbose mode, always show long room
descriptions), and synonyms "papaya" for "papayas" and "coconut" for
"coconuts".
2000-09-17 23:03:43 +00:00
jsm
c6bbb5288d Store copy of username with strdup rather than using a fixed length
buffer.  Also make initialization functions and arrays static.
2000-09-09 09:37:58 +00:00
jsm
ce85e35a32 Put prototypes in alphabetical order. 2000-09-09 09:36:23 +00:00
jsm
af3dee978f Make code clearer; add a macro ROOMDESC for the number of times a room
should be visited for the short description only to be used, and don't
increment beenthere[position] beyond this value.  From OpenBSD.
2000-09-08 17:22:01 +00:00
mycroft
15b7289f72 Rename move() to moveplayer() to avoid clashing with libcurses. 2000-07-23 23:57:23 +00:00
jsm
5e8cc984ee Declare variables in extern.h as extern, and add non-extern
declarations to globals.c.
1999-09-14 19:54:47 +00:00
jsm
5b8f738447 Use time() instead of gettimeofday(). 1999-09-14 18:08:46 +00:00
jsm
a1038d000e Fix uses of names of library functions for other purposes. 1999-09-13 17:18:56 +00:00
hubertf
6c243d931c This patch improves the handling of save files in battlestar(6), by
allowing the user to choose the name of the save file and specify it
on the command line when restoring.  It also eliminates a buffer
overrun in determining the path to the save file, and any particular
arbitrary limit on the name length.  In the name of a tidier home
directory, the default name is changed from "Bstar" to ".Bstar".

Patch supplied in PR 8085 by Joseph Myers <jsm28@cam.ac.uk>
Minor modification (s/startup/filename/ in initialize()) by me.
1999-07-28 01:45:41 +00:00
hubertf
054e79fedd Drop setgid privileges early. Derived from OpenBSD and sent in as PR 5970
by Joseph Myers <jsm28@cam.ac.uk>.
1999-07-21 03:56:53 +00:00
hubertf
bd8be7848a Const poisoning, per PR 6660 by Joseph Myers <jsm28@cam.ac.uk> 1999-02-10 01:36:50 +00:00
hubertf
1c9494f62b mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:27:25 +00:00
mrg
7ed858277a - really make extern char's extern. 1998-03-29 04:46:40 +00:00
perry
75a6e03535 change includes to fix compiler warning 1998-02-03 04:55:59 +00:00
lukem
31c7a7bec5 KNFify (with indent) 1997-10-11 02:06:55 +00:00
lukem
b6068ea04b WARNSify 1997-10-10 11:39:08 +00:00
tls
52e0d8714d sigh, fix RCS ID again 1997-01-07 12:41:18 +00:00
tls
82c018889c RCS ID Police 1997-01-07 12:35:42 +00:00
tls
34cd8f5bdf Sync to 4.4BSD-Lite2 1997-01-07 11:56:32 +00:00
tls
bd34844797 Import from 4.4BSD-Lite2 1996-12-28 19:09:10 +00:00