summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-13 14:46:23 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-13 14:46:23 +0000
commit74114bc4feef8e1edcea61cc836b9f4946b17223 (patch)
tree9e09f207b2bc2782a8950a5e469f5cd032292de9 /crawl-ref
parent42fe04c5774e1abb0c25de0aed269f0f5546e9d9 (diff)
downloadcrawl-ref-74114bc4feef8e1edcea61cc836b9f4946b17223.tar.gz
crawl-ref-74114bc4feef8e1edcea61cc836b9f4946b17223.zip
Add confirmation before stepping on known magical traps.
(part of FR 1793669). Added description for reaching ego (bug 1792851). Added sorting statement before showing item knowledge, so items of the same class now are sorted alphabetically. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2081 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/debug.cc8
-rw-r--r--crawl-ref/source/describe.cc4
-rw-r--r--crawl-ref/source/itemname.cc8
-rw-r--r--crawl-ref/source/player.cc52
-rw-r--r--crawl-ref/source/religion.cc2
5 files changed, 55 insertions, 19 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 7e2ba2701b..6deb102853 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -2357,16 +2357,24 @@ void debug_card()
msg::streams(MSGCH_PROMPT) << "Which card? " << std::endl;
char buf[80];
if (cancelable_get_line(buf, sizeof buf))
+ {
+ mpr("Unknown card.");
return;
+ }
+
+ bool found_card = false;
for ( int i = 0; i < NUM_CARDS; ++i )
{
const card_type c = static_cast<card_type>(i);
if ( strstr(card_name(c), buf) != NULL )
{
card_effect(c, DECK_RARITY_LEGENDARY);
+ found_card = true;
break;
}
}
+ if (!found_card)
+ mpr("Unknown card.");
}
static void debug_uptick_xl(int newxl)
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index f6c02817f8..4282ee5660 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1180,6 +1180,10 @@ static std::string describe_weapon( const item_def &item, bool verbose)
case SPWPN_REACHING:
description += "It can be evoked to extend its reach. ";
break;
+ case SPWPN_RETURNING:
+ description += "It is enchanted to return to its owner "
+ "when thrown.";
+ break;
}
}
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index ee02552c5d..d8f7aa3030 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1625,6 +1625,13 @@ static MenuEntry *discoveries_item_mangle(MenuEntry *me)
return (newme);
}
+bool item_names( const item_def *it1,
+ const item_def *it2 )
+{
+ return it1->name(DESC_PLAIN, false, false, false)
+ < it2->name(DESC_PLAIN, false, false, false);
+}
+
void check_item_knowledge()
{
std::vector<const item_def*> items;
@@ -1657,6 +1664,7 @@ void check_item_knowledge()
mpr("You don't recognise anything yet!");
else
{
+ std::sort(items.begin(), items.end(), item_names);
InvMenu menu;
menu.set_title("You recognise:");
menu.load_items(items, discoveries_item_mangle);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 7b2cab6c3a..7fd0040a06 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -170,31 +170,47 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
// return (false);
// if we're walking along, give a chance to avoid trap
- if (stepped
- && !force
- && new_grid == DNGN_UNDISCOVERED_TRAP)
+ if (stepped && !force)
{
- const int skill = 4 + you.skills[SK_TRAPS_DOORS]
- + you.mutation[MUT_ACUTE_VISION]
- - 2 * you.mutation[MUT_BLURRY_VISION];
-
- if (random2( skill ) > 6)
+ if (new_grid == DNGN_UNDISCOVERED_TRAP)
{
- mprf( MSGCH_WARN,
- "Wait a moment, %s! Do you really want to step there?",
- you.your_name );
+ const int skill = 4 + you.skills[SK_TRAPS_DOORS]
+ + you.mutation[MUT_ACUTE_VISION]
+ - 2 * you.mutation[MUT_BLURRY_VISION];
- more();
+ if (random2( skill ) > 6)
+ {
+ mprf( MSGCH_WARN,
+ "Wait a moment, %s! Do you really want to step there?",
+ you.your_name );
- exercise( SK_TRAPS_DOORS, 3 );
+ more();
- you.turn_is_over = false;
+ exercise( SK_TRAPS_DOORS, 3 );
- id = trap_at_xy( x, y );
- if (id != -1)
- grd[x][y] = trap_category( env.trap[id].type );
+ you.turn_is_over = false;
- return (false);
+ id = trap_at_xy( x, y );
+ if (id != -1)
+ grd[x][y] = trap_category( env.trap[id].type );
+
+ return (false);
+ }
+ } // unknown trap
+ else if (new_grid == DNGN_TRAP_MAGICAL)
+ {
+ std::string prompt = "Really step onto that "; // preposition?
+ prompt += feature_description(new_grid, trap_type_at_xy(x,y),
+ DESC_PLAIN, false);
+ prompt += '?';
+
+ // Zot traps require capital confirmation
+ bool harmless = (trap_type_at_xy(x,y) != TRAP_ZOT);
+ if (!yesno(prompt.c_str(), harmless, 'n'))
+ {
+ you.turn_is_over = false;
+ return (false);
+ }
}
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 00de2c7425..22426c71a8 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2880,7 +2880,7 @@ void god_pitch(god_type which_god)
snprintf( info, INFO_SIZE, "Do you wish to %sjoin this religion?",
(you.worshipped[which_god]) ? "re" : "" );
- if (!yesno( info, false, 'n' ) || !yesno("Are you sure?", false, 'n'))
+ if (!yesno( info, true, 'n' ) || !yesno("Are you sure?", false, 'n'))
{
redraw_screen();
return;