From: NHOrus Date: Thu, 6 Jul 2017 15:23:07 +0000 (+0300) Subject: Clear login in bvreak X-Git-Tag: 2017-07-10~44 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=cca3686f2f5ab3f5a5bf17d2e56560aad2c55c0f;p=open-adventure.git Clear login in bvreak Test double-breaking of vase --- diff --git a/actions.c b/actions.c index ab3ccda..5cf1fae 100644 --- a/actions.c +++ b/actions.c @@ -248,23 +248,26 @@ static void blast(void) static int vbreak(vocab_t verb, obj_t obj) /* Break. Only works for mirror in repository and, of course, the vase. */ { - if (obj == MIRROR) { + switch (obj) { + case MIRROR: if (game.closed) { rspeak(BREAK_MIRROR); return GO_DWARFWAKE; } else { rspeak(TOO_FAR); - return GO_CLEAROBJ; + break; } + case VASE: + if (game.prop[VASE] == VASE_WHOLE) { + if (TOTING(VASE)) + drop(VASE, game.loc); + state_change(VASE, VASE_BROKEN); + game.fixed[VASE] = IS_FIXED; + break; + } + default: + speak(actions[verb].message); } - if (obj == VASE && game.prop[VASE] == VASE_WHOLE) { - if (TOTING(VASE)) - drop(VASE, game.loc); - state_change(VASE, VASE_BROKEN); - game.fixed[VASE] = IS_FIXED; - return GO_CLEAROBJ; - } - speak(actions[verb].message); return (GO_CLEAROBJ); } diff --git a/tests/breakvase.chk b/tests/breakvase.chk index 34f510a..c1adb27 100644 --- a/tests/breakvase.chk +++ b/tests/breakvase.chk @@ -1298,6 +1298,10 @@ OK You have taken the vase and hurled it delicately to the ground. +> break vase + +It is beyond your power to do that. + > quit Do you really want to quit now? @@ -1306,7 +1310,7 @@ Do you really want to quit now? OK -You scored 139 out of a possible 430, using 211 turns. +You scored 139 out of a possible 430, using 212 turns. You have achieved the rating: "Experienced Adventurer". diff --git a/tests/breakvase.log b/tests/breakvase.log index 1db9957..d55c439 100644 --- a/tests/breakvase.log +++ b/tests/breakvase.log @@ -216,5 +216,6 @@ s # Previous was just setup - this is the real test take vase break vase +break vase quit yes