From ef22d87e26cbf5bcda596cc234783629443b5f09 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 14 Oct 2023 01:13:24 -0700 Subject: [PATCH] github pull request #1107 - flipping coins Pull request from NullCGT: applying gold from inventory will flip one coin and report "heads" or "tails". If impaired, that coin will be dropped, otherwise it will remain part of the stack in inventory. Can be done via 'a $' or with context-senstive item action via 'i $ a'. I've used 'git merge --squash' and 'git commit -C ' to flatten four commits into one and it seems to have accomplished what I wanted, including retaining the log message from . I also changed |You flip a gold piece. The gold pieces slips between your fingers. to |You flip a gold piece. It slips between your fingers. when impaired and applying one from a stack. Closes #1107 --- doc/fixes3-7-0.txt | 2 ++ src/apply.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 9833ccde8..f37232824 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2271,6 +2271,8 @@ answering '?' at the "genocide what?" prompt (for either monster class monsters have already been genocided and then re-prompts throwing the silver bell (or other invocation item, or the Amulet) to the quest leader will identify it instead of being treated as an attack +applying gold pieces will flip one and report "heads" or "tails"; with a stack + of more than one, normally the flipped coin will rejoin the stack Platform- and/or Interface-Specific New Features diff --git a/src/apply.c b/src/apply.c index a3c3e1f27..6051b6a64 100644 --- a/src/apply.c +++ b/src/apply.c @@ -4327,13 +4327,13 @@ flip_coin(struct obj *obj) struct obj *otmp = obj; boolean lose_coin = FALSE; - You("flip %s.", an(cxname_singular(obj))); + You("flip %s.", an(singular(obj, xname))); if (Underwater) { - pline_The("%s floats away.", xname(obj)); + pline("It tumbles away."); lose_coin = TRUE; - } else if (Glib || Fumbling || (ACURR(A_DEX) < 10 && !rn2(ACURR(A_DEX)))) { - pline_The("%s slips between your %s.", xname(obj), - fingers_or_gloves(FALSE)); + } else if (Glib || Fumbling + || (ACURR(A_DEX) < 10 && !rn2(ACURR(A_DEX)))) { + pline("It slips between your %s.", fingers_or_gloves(FALSE)); lose_coin = TRUE; }