From 4bd060a9edfad801ae0c7abd331b60b5e7bd6c89 Mon Sep 17 00:00:00 2001 From: reaverb Date: Mon, 23 Jun 2014 17:45:40 -0400 Subject: Add a prompt if a player tries to move with the Barbs status Multiple people have died due to mindlessly moving and getting damaged. Currently, you get the prompt once, and then a prop is set which suppresses it in the future, so if you want to move a few squares to a stairway you aren't spammed. This prop resets whenever the Barbs status expires, so answering it affirmatively once won't affect another fight later. --- crawl-ref/source/main.cc | 14 ++++++++++++++ crawl-ref/source/player-reacts.cc | 2 ++ crawl-ref/source/player.h | 1 + 3 files changed, 17 insertions(+) diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index 7c99c4dc55..02316dc486 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -3375,6 +3375,20 @@ static void _move_player(coord_def move) return; } + if (you.duration[DUR_BARBS] && !you.props.exists(BARBS_MOVE_KEY)) + { + string prompt = "The barbs in your skin will harm you if you move." + " Continue?"; + if (!yesno(prompt.c_str(), false, 'n')) + { + canned_msg(MSG_OK); + you.turn_is_over = false; + return; + } + + you.props[BARBS_MOVE_KEY] = true; + } + if (!you.attempt_escape()) // false means constricted and did not escape return; diff --git a/crawl-ref/source/player-reacts.cc b/crawl-ref/source/player-reacts.cc index 010d5bec35..50f41bb2b5 100644 --- a/crawl-ref/source/player-reacts.cc +++ b/crawl-ref/source/player-reacts.cc @@ -1306,5 +1306,7 @@ void extract_manticore_spikes(const char* endmsg) // Otherwise, this prevents the damage. you.attribute[ATTR_BARBS_POW] = 0; + + you.props.erase(BARBS_MOVE_KEY); } } diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index eb9f3301fd..e2da239e95 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -26,6 +26,7 @@ #define ICY_ARMOUR_KEY "ozocubu's_armour_pow" #define STONESKIN_KEY "stoneskin_pow" #define TRANSFORM_POW_KEY "transform_pow" +#define BARBS_MOVE_KEY "moved_with_barbs_status" class targetter; -- cgit v1.2.3-54-g00ecf