summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-18 23:59:46 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-18 23:59:46 -0800
commitfeb0e449b8b1d1d5da3a8150d29a857e7d3c1165 (patch)
tree88b91395f2d739ac0cfac95479537b9d70a7543b /crawl-ref/source/tilereg.cc
parent266c17af69abc9f38ada518af5a490fd823eadd6 (diff)
downloadcrawl-ref-feb0e449b8b1d1d5da3a8150d29a857e7d3c1165.tar.gz
crawl-ref-feb0e449b8b1d1d5da3a8150d29a857e7d3c1165.zip
tiles: spell cast tip, no walk with mod-keys
Add in the "Ctrl-L-Click" tip for casting spells. Don't walk if you shift/ctrl/alt-click a monster or cell, since that likely happened because you were trying to fire/cast/evoke when you didn't have anything appropriate.
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc26
1 files changed, 21 insertions, 5 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 2e19c06e85..30767d268a 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -1615,6 +1615,11 @@ int DungeonRegion::handle_mouse(MouseEvent &event)
return (CK_MOUSE_CMD);
}
+ // Don't move if we've tried to fire/cast/evoke when there's nothing
+ // available.
+ if (event.mod & (MOD_SHIFT | MOD_CTRL | MOD_ALT))
+ return (CK_MOUSE_CMD);
+
return _click_travel(gc, event);
}
@@ -1776,12 +1781,23 @@ bool DungeonRegion::update_tip_text(std::string& tip)
}
const actor* target = actor_at(m_cursor[CURSOR_MOUSE]);
- if (target && you.can_see(target)
- && _have_appropriate_evokable(target))
+ if (target && you.can_see(target))
{
- if (m_cursor[CURSOR_MOUSE] == you.pos())
- tip += "\n";
- tip += "[Alt-L-Click] Wand\n";
+ std::string str = "";
+
+ if (_have_appropriate_spell(target))
+ str += "[Ctrl-L-Click] Cast spell\n";
+
+ if (_have_appropriate_evokable(target))
+ str += "[Alt-L-Click] Zap wand\n";
+
+ if (!str.empty())
+ {
+ if (m_cursor[CURSOR_MOUSE] == you.pos())
+ tip += "\n";
+
+ tip += str;
+ }
}
if (m_cursor[CURSOR_MOUSE] != you.pos())