Unspk'd pour command

This commit is contained in:
NHOrus 2017-07-03 06:12:19 +03:00
parent 5613b0ce36
commit 38970a1c98
4 changed files with 15 additions and 18 deletions

View file

@ -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);

View file

@ -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;

4
main.c
View file

@ -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];

12
misc.c
View file

@ -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);