diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-25 23:29:20 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-25 23:29:20 -0700 |
commit | 0a05dcac42b8f2d854583b11e71ec28f187006ac (patch) | |
tree | 11662ea18f83154e0f5ed7922772cb504980af16 /crawl-ref/source/player.cc | |
parent | ae8f746483fe990343dfce5eff8617221b327e5e (diff) | |
download | crawl-ref-0a05dcac42b8f2d854583b11e71ec28f187006ac.tar.gz crawl-ref-0a05dcac42b8f2d854583b11e71ec28f187006ac.zip |
Prompt when swapping allies onto zot traps
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 65b2627301..a234f1737b 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -363,6 +363,16 @@ bool swap_check(monster* mons, coord_def &loc, bool quiet) return false; } + // prompt when swapping into known zot traps + string prompt = make_stringf("Do you really want to swap %s into the Zot trap?", + mons->name(DESC_YOUR).c_str()); + if (!quiet && find_trap(loc) && find_trap(loc)->type == TRAP_ZOT + && env.grid(loc) != DNGN_UNDISCOVERED_TRAP + && !yes_or_no(prompt.c_str())) + { + return false; + } + // First try: move monster onto your position. bool swap = !monster_at(loc) && monster_habitable_grid(mons, grd(loc)); |