diff options
author | reaverb <reaverb.Crawl@gmail.com> | 2014-06-23 17:45:40 -0400 |
---|---|---|
committer | reaverb <reaverb.Crawl@gmail.com> | 2014-08-09 21:02:11 -0400 |
commit | 4bd060a9edfad801ae0c7abd331b60b5e7bd6c89 (patch) | |
tree | 0e0b309ae12f8129333939116a6036feece0d915 | |
parent | d2305cce9048369e1b11b8ad42d8b8d0039accd6 (diff) | |
download | crawl-ref-4bd060a9edfad801ae0c7abd331b60b5e7bd6c89.tar.gz crawl-ref-4bd060a9edfad801ae0c7abd331b60b5e7bd6c89.zip |
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.
-rw-r--r-- | crawl-ref/source/main.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/player-reacts.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 1 |
3 files changed, 17 insertions, 0 deletions
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; |