From 38970a1c98b3b9cd3e74c240e6662f090849758a Mon Sep 17 00:00:00 2001 From: NHOrus Date: Mon, 3 Jul 2017 06:12:19 +0300 Subject: [PATCH] Unspk'd pour command --- actions.c | 13 +++++-------- cheat.c | 4 ++-- main.c | 4 ++-- misc.c | 12 ++++++------ 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/actions.c b/actions.c index 5dfb987..52c0417 100644 --- a/actions.c +++ b/actions.c @@ -873,33 +873,30 @@ static int pour(token_t verb, token_t obj) /* Pour. If no object, or object is bottle, assume contents of bottle. * special tests for pouring water or oil on plant or rusty door. */ { - int spk = actions[verb].message; if (obj == BOTTLE || obj == NO_OBJECT) obj = LIQUID(); if (obj == NO_OBJECT) return GO_UNKNOWN; if (!TOTING(obj)) { - rspeak(spk); + rspeak(actions[verb].message); return GO_CLEAROBJ; } - spk = CANT_POUR; + if (obj != OIL && obj != WATER) { - rspeak(spk); + rspeak(CANT_POUR); return GO_CLEAROBJ; } if (HERE(URN) && game.prop[URN] == URN_EMPTY) return fill(verb, URN); game.prop[BOTTLE] = EMPTY_BOTTLE; game.place[obj] = LOC_NOWHERE; - spk = GROUND_WET; if (!(AT(PLANT) || AT(DOOR))) { - rspeak(spk); + rspeak(GROUND_WET); return GO_CLEAROBJ; } if (!AT(DOOR)) { - spk = SHAKING_LEAVES; if (obj != WATER) { - rspeak(spk); + rspeak(SHAKING_LEAVES); return GO_CLEAROBJ; } pspeak(PLANT, look, game.prop[PLANT] + 3, true); diff --git a/cheat.c b/cheat.c index c8eae38..b07b102 100644 --- a/cheat.c +++ b/cheat.c @@ -19,8 +19,8 @@ int main(int argc, char *argv[]) // Initialize game variables initialise(); - - /* we're generating a saved game, so saved once by default, + + /* we're generating a saved game, so saved once by default, * unless overridden with command-line options below. */ game.saved = 1; diff --git a/main.c b/main.c index 8dcaa52..53da082 100644 --- a/main.c +++ b/main.c @@ -689,7 +689,7 @@ static bool playermove( int motion) * entries check for game.prop(TROLL)=0.) Special * stuff for bear. */ if (game.prop[TROLL] == TROLL_PAIDONCE) { - pspeak(TROLL, look, TROLL_PAIDONCE, true); + pspeak(TROLL, look, TROLL_PAIDONCE, true); game.prop[TROLL] = TROLL_UNPAID; move(TROLL2, 0); move(TROLL2 + NOBJECTS, 0); @@ -1006,7 +1006,7 @@ L2600: * tick game.clock1 unless well into cave (and not at Y2). */ if (game.closed) { if (game.prop[OYSTER] < 0 && TOTING(OYSTER)) - pspeak(OYSTER, look, 1, true); + pspeak(OYSTER, look, 1, true); for (size_t i = 1; i <= NOBJECTS; i++) { if (TOTING(i) && game.prop[i] < 0) game.prop[i] = -1 - game.prop[i]; diff --git a/misc.c b/misc.c index dc6cec5..3d306b6 100644 --- a/misc.c +++ b/misc.c @@ -166,7 +166,7 @@ void vspeak(const char* msg, bool blank, va_list ap) return; if (blank == true) - printf("\n"); + printf("\n"); int msglen = strlen(msg); @@ -267,19 +267,19 @@ void pspeak(vocab_t msg, enum speaktype mode, int skip, bool blank, ...) va_start(ap, blank); switch (mode) { case touch: - vspeak(objects[msg].inventory, blank, ap); + vspeak(objects[msg].inventory, blank, ap); break; case look: - vspeak(objects[msg].descriptions[skip], blank, ap); + vspeak(objects[msg].descriptions[skip], blank, ap); break; case hear: - vspeak(objects[msg].sounds[skip], blank, ap); + vspeak(objects[msg].sounds[skip], blank, ap); break; case study: - vspeak(objects[msg].texts[skip], blank, ap); + vspeak(objects[msg].texts[skip], blank, ap); break; case change: - vspeak(objects[msg].changes[skip], blank, ap); + vspeak(objects[msg].changes[skip], blank, ap); break; } va_end(ap); -- 2.31.1