summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/direct.cc10
-rw-r--r--crawl-ref/source/libutil.cc6
-rw-r--r--crawl-ref/source/libutil.h3
-rw-r--r--crawl-ref/source/mon-util.cc5
-rw-r--r--crawl-ref/source/spl-cast.cc2
5 files changed, 15 insertions, 11 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index d38f9dcbac..b260f14dc7 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -103,7 +103,9 @@ static command_type read_direction_key(bool just_looking = false)
{
flush_input_buffer( FLUSH_BEFORE_COMMAND );
- int key = unmangle_direction_keys(getchm(KC_TARGETING),KC_TARGETING);
+ const int key =
+ unmangle_direction_keys(
+ getchm(KC_TARGETING), KC_TARGETING, false, false);
switch ( key )
{
@@ -131,9 +133,9 @@ static command_type read_direction_key(bool just_looking = false)
case 'p': case 'f': case 't': return CMD_TARGET_PREV_TARGET;
case '-': return CMD_TARGET_CYCLE_BACK;
- case '+': case '=': return CMD_TARGET_CYCLE_FORWARD;
- case ';': case '/': return CMD_TARGET_OBJ_CYCLE_BACK;
- case '*': return CMD_TARGET_OBJ_CYCLE_FORWARD;
+ case '+': case '=': return CMD_TARGET_CYCLE_FORWARD;
+ case ';': case '/': return CMD_TARGET_OBJ_CYCLE_BACK;
+ case '*': case '\'': return CMD_TARGET_OBJ_CYCLE_FORWARD;
case 'b': return CMD_TARGET_DOWN_LEFT;
case 'h': return CMD_TARGET_LEFT;
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index c7e057a9e0..010602dfca 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -58,7 +58,7 @@ static keycode_type numpad2vi(keycode_type key)
}
#endif
-int unmangle_direction_keys(int keyin, int km)
+int unmangle_direction_keys(int keyin, int km, bool fake_ctrl, bool fake_shift)
{
const KeymapContext keymap = static_cast<KeymapContext>(km);
#ifdef UNIX
@@ -69,13 +69,13 @@ int unmangle_direction_keys(int keyin, int km)
// will hopefully be easy.
/* can we say yuck? -- haranp */
- if (keyin == '*')
+ if (fake_ctrl && keyin == '*')
{
keyin = getchm(keymap);
// return control-key
keyin = CONTROL(toupper(numpad2vi(keyin)));
}
- else if (keyin == '/')
+ else if (fake_shift && keyin == '/')
{
keyin = getchm(keymap);
// return shift-key
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index c790705b7d..3cd5c6c5c9 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -24,7 +24,8 @@ void cursorxy(int x, int y);
// Converts a key to a direction key, converting keypad and other sequences
// to vi key sequences (shifted/control key directions are also handled). Non
// direction keys (hopefully) pass through unmangled.
-int unmangle_direction_keys(int keyin, int keymap = 0);
+int unmangle_direction_keys(int keyin, int keymap = 0,
+ bool fake_ctrl = true, bool fake_shift = true);
void lowercase(std::string &s);
void uppercase(std::string &s);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 11db414ebf..cd273cb0d2 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -700,7 +700,7 @@ int mons_resist_magic( const monsters *mon )
// negative values get multiplied with mhd
if (u < 0)
- u = mon->hit_dice * -u;
+ u = mon->hit_dice * -u * 4 / 3;
u += scan_mon_inv_randarts( mon, RAP_MAGIC );
@@ -2421,7 +2421,8 @@ monsters::monsters(const monsters &mon)
monsters &monsters::operator = (const monsters &mon)
{
- init_with(mon);
+ if (this != &mon)
+ init_with(mon);
return (*this);
}
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 1ca538d0cf..97107db571 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1710,7 +1710,7 @@ spret_type your_spells( int spc2, int powc, bool allow_fail )
break;
case SPELL_SLEEP:
- zapping(ZAP_SLEEP, powc, beam);
+ zapping(ZAP_SLEEP, powc * 83 / 100, beam);
break;
case SPELL_MASS_SLEEP: