From 2aa047a8a3a6ce4ff16d8d309d91eb36b05b6048 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 23 Jul 2009 11:05:37 +0000 Subject: * Prompt before moving while confused and next to lava/deep water. * Change Portal Projectile range to LOS. * Fix crash with Summon Horrible Things if there's not enough space. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10380 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 24 ++++++++++++++++++++++++ crawl-ref/source/spells3.cc | 10 +++------- crawl-ref/source/spl-data.h | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 62c7127b33..d325db5194 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3656,6 +3656,30 @@ static void _move_player(coord_def move) // When confused, sometimes make a random move if (you.confused()) { + dungeon_feature_type dangerous = DNGN_FLOOR; + for (adjacent_iterator ai(you.pos(), false); ai; ++ai) + { + if (is_grid_dangerous(grd(*ai)) + && (dangerous == DNGN_FLOOR || grd(*ai) == DNGN_LAVA)) + { + dangerous = grd(*ai); + } + } + if (dangerous != DNGN_FLOOR) + { + std::string prompt = "Are you sure you want to move while confused " + "and next to "; + prompt += (dangerous == DNGN_LAVA ? "lava" + : "deep water"); + prompt += "? "; + + if (!yesno(prompt.c_str(), false, 'n')) + { + canned_msg(MSG_OK); + return; + } + } + if (!one_chance_in(3)) { move.x = random2(3) - 1; diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index cd5913a85e..143c9555a0 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -603,11 +603,11 @@ bool cast_summon_horrible_things(int pow, god_type god) // No more than 8 summons. how_many_small = std::min(8, how_many_small); - how_many_big = std::min(8, how_many_big); + how_many_big = std::min(8, how_many_big); int count = 0; - while (how_many_big > 0) + while (how_many_big-- > 0) { const int monster = create_monster( @@ -619,13 +619,11 @@ bool cast_summon_horrible_things(int pow, god_type god) if (monster != -1) { count++; - how_many_big--; - player_angers_monster(&menv[monster]); } } - while (how_many_small > 0) + while (how_many_small-- > 0) { const int monster = create_monster( @@ -637,8 +635,6 @@ bool cast_summon_horrible_things(int pow, god_type god) if (monster != -1) { count++; - how_many_small--; - player_angers_monster(&menv[monster]); } } diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h index 099bd3b2c2..5c64fbe6b4 100644 --- a/crawl-ref/source/spl-data.h +++ b/crawl-ref/source/spl-data.h @@ -2192,7 +2192,7 @@ SPFLAG_TARGET | SPFLAG_BATTLE, 2, 50, - 4, 8, + LOS_RADIUS, LOS_RADIUS, 0, NULL, false, -- cgit v1.2.3-54-g00ecf