From: Eric S. Raymond Date: Mon, 19 Jun 2017 12:37:19 +0000 (-0400) Subject: Magic number elimination, repair some careless replace damage. X-Git-Tag: 1.1~224 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=98b02eeeb1021b24ad477a2180e323984c36c588 Magic number elimination, repair some careless replace damage. --- diff --git a/actions.c b/actions.c index 4798d7d..e90cf19 100644 --- a/actions.c +++ b/actions.c @@ -578,7 +578,7 @@ static int find(token_t verb, token_t obj) obj == LIQLOC(game.loc) || (obj == DWARF && ATDWRF(game.loc) > 0)) spk = YOU_HAVEIT; - if (game.closed)spk = NEEDED_NEreplace; + if (game.closed)spk = NEEDED_NEARBY; if (TOTING(obj))spk = ALREADY_CARRYING; RSPEAK(spk); return GO_CLEAROBJ; diff --git a/adventure.yaml b/adventure.yaml index b740a47..a1abc62 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -804,7 +804,7 @@ arbitrary_messages: !!omap - FUTILE_CRAWL: 'You have crawled around in some little holes and wound up back in the\nmain passage.' - FOLLOW_STREAM: 'I don''t know where the cave is, but hereabouts no stream can run on\nthe surface for long. I would try the stream.' - NEED_DETAIL: 'I need more detailed instructions to do that.' -- NEreplace: 'I can only tell you what you see as you move about and manipulate\nthings. I cannot tell you where remote things are.' +- NEARBY: 'I can only tell you what you see as you move about and manipulate\nthings. I cannot tell you where remote things are.' - OGRE_SNARL: 'The ogre snarls and shoves you back.' - HUH_MAN: 'Huh?' - ENTRY_QUERY: 'Are you trying to get into the cave?' @@ -883,7 +883,7 @@ arbitrary_messages: !!omap - SPLATTER_MESSAGE: 'There is a loud explosion, and you are suddenly splashed across the\nwalls of the room.' - DWARVES_AWAKEN: 'The resulting ruckus has awakened the dwarves. There are now several\nthreatening little dwarves in the room with you! Most of them throw\nknives at you! All of them get you!' - UNHAPPY_BIRD: 'Oh, leave the poor unhappy bird alone.' -- NEEDED_NEreplace: 'I daresay whatever you want is around here somewhere.' +- NEEDED_NEARBY: 'I daresay whatever you want is around here somewhere.' - STOP_UNKNOWN: 'I don''t know the word "stop". Use "quit" if you want to give up.' - NOT_CONNECTED: 'You can''t get there from here.' - TAME_BEAR: 'You are being followed by a very large, tame bear.' diff --git a/main.c b/main.c index e341d8f..16d8f91 100644 --- a/main.c +++ b/main.c @@ -451,7 +451,7 @@ static bool dwarfmove(void) if (game.dtotal == 0) return true; SETPRM(1, game.dtotal, 0); - RSPEAK(DWARF_PACK + 1 / game.dtotal); /* FIXME: Arithmetic on message number */ + RSPEAK(game.dtotal == 1 ? DWARF_SINGLE : DWARF_PACK); if (attack == 0) return true; if (game.dflag == 2)game.dflag = 3; @@ -606,7 +606,7 @@ static bool playermove(token_t verb, int motion) if (motion == 29 || motion == 30)spk = BAD_DIRECTION; if (motion == 7 || motion == 36 || motion == 37)spk = UNSURE_FACING; if (motion == 11 || motion == 19)spk = NO_INOUT_HERE; - if (verb == FIND || verb == INVENT)spk = NEreplace; + if (verb == FIND || verb == INVENT)spk = NEARBY; if (motion == 62 || motion == 65)spk = NOTHING_HAPPENS; if (motion == 17)spk = WHICH_WAY; RSPEAK(spk);