X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=72c40f39f2ce3aeea0679d8d45258c3f8e028bb5;hb=d6dab20801dc0df6c998df927ae325a3dc34fee7;hp=0a2ed9a0828b99405a30e8690c36666fdc3e6cb6;hpb=0f15c9e0f35dbaeeebf74445ae641401fc631416;p=open-adventure.git diff --git a/main.c b/main.c index 0a2ed9a..72c40f3 100644 --- a/main.c +++ b/main.c @@ -521,7 +521,7 @@ static void croak(void) * him, so we need game.oldlc2, which is the last place he was * safe.) */ -static bool playermove(token_t verb, int motion) +static bool playermove( int motion) { int scratchloc, travel_entry = tkey[game.loc]; game.newloc = game.loc; @@ -598,23 +598,20 @@ static bool playermove(token_t verb, int motion) if (T_TERMINATE(travel[travel_entry]) || travel[travel_entry].motion == motion) break; if (travel[travel_entry].stop) { - /* FIXME: Magic numbers! */ /* Couldn't find an entry matching the motion word passed * in. Various messages depending on word given. */ int spk = CANT_APPLY; - if (motion >= 43 && motion <= 50) + if (motion >= EAST && motion <= NW) spk = BAD_DIRECTION; - if (motion == 29 || motion == 30) + if (motion == UP || motion == DOWN) spk = BAD_DIRECTION; - if (motion == 7 || motion == 36 || motion == 37) + if (motion == FORWARD || motion == LEFT || motion == RIGHT) spk = UNSURE_FACING; - if (motion == 11 || motion == 19) + if (motion == OUTSIDE || motion == INSIDE) spk = NO_INOUT_HERE; - if (verb == FIND || verb == INVENTORY) - spk = NEARBY; - if (motion == 62 || motion == 65) + if (motion == XYZZY || motion == PLUGH) spk = NOTHING_HAPPENS; - if (motion == 17) + if (motion == CRAWL) spk = WHICH_WAY; rspeak(spk); return true; @@ -998,7 +995,7 @@ static bool do_command() rspeak(TAME_BEAR); speak(msg); if (FORCED(game.loc)) { - if (playermove(command.verb, 1)) + if (playermove(MOT_1)) return true; else continue; /* back to top of main interpreter loop */ @@ -1132,7 +1129,7 @@ Lookup: kmod = MOD(defn, 1000); switch (defn / 1000) { case 0: - if (playermove(command.verb, kmod)) + if (playermove(kmod)) return true; else continue; /* back to top of main interpreter loop */ @@ -1156,7 +1153,7 @@ Laction: case GO_TERMINATE: return true; case GO_MOVE: - playermove(command.verb, NUL); + playermove(NUL); return true; case GO_TOP: continue; /* back to top of main interpreter loop */