summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-20 09:37:00 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-20 09:37:00 +0000
commitbb3b8b8286b84de95546d1121d0c305bbdc85851 (patch)
treec56eaeeca56855ac86631fa37b2b3128784f7fc1
parent6452e938ce43d8447bba63a5fcfbaee5e4673baa (diff)
downloadcrawl-ref-bb3b8b8286b84de95546d1121d0c305bbdc85851.tar.gz
crawl-ref-bb3b8b8286b84de95546d1121d0c305bbdc85851.zip
* Fix non-prompting when firing through allies.
* Don't autopickup chunks if starving. (Yes, I died because of that. Xom was very much amused...) * Some spacing fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9668 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc22
-rw-r--r--crawl-ref/source/abyss.cc20
-rw-r--r--crawl-ref/source/acr.cc34
-rw-r--r--crawl-ref/source/beam.cc217
-rw-r--r--crawl-ref/source/beam.h9
-rw-r--r--crawl-ref/source/delay.cc12
-rw-r--r--crawl-ref/source/directn.cc1
-rw-r--r--crawl-ref/source/item_use.cc7
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/spells3.cc10
-rw-r--r--crawl-ref/source/xom.cc2
11 files changed, 179 insertions, 157 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index fd2fd3abd5..061aa25cf0 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1615,7 +1615,7 @@ static bool _do_ability(const ability_def& abil)
case 1: beam.range = 8; zapping(ZAP_PAIN, power, beam); break;
case 2: beam.range = 5; zapping(ZAP_STONE_ARROW, power, beam); break;
case 3: beam.range = 13; zapping(ZAP_ELECTRICITY, power, beam); break;
- case 4: beam.range = 8; zapping(ZAP_BREATHE_ACID, power/2, beam); break;
+ case 4: beam.range = 8; zapping(ZAP_BREATHE_ACID, power/2, beam); break;
}
exercise(SK_INVOCATIONS, 1);
@@ -1644,12 +1644,12 @@ static bool _do_ability(const ability_def& abil)
zap_type ztype = ZAP_DEBUGGING_RAY;
switch (random2(7))
{
- case 0: beam.range = 6; ztype = ZAP_FIRE; break;
- case 1: beam.range = 6; ztype = ZAP_FIREBALL; break;
+ case 0: beam.range = 6; ztype = ZAP_FIRE; break;
+ case 1: beam.range = 6; ztype = ZAP_FIREBALL; break;
case 2: beam.range = 10; ztype = ZAP_LIGHTNING; break;
- case 3: beam.range = 5; ztype = ZAP_STICKY_FLAME; break;
- case 4: beam.range = 5; ztype = ZAP_IRON_BOLT; break;
- case 5: beam.range = 6; ztype = ZAP_NEGATIVE_ENERGY; break;
+ case 3: beam.range = 5; ztype = ZAP_STICKY_FLAME; break;
+ case 4: beam.range = 5; ztype = ZAP_IRON_BOLT; break;
+ case 5: beam.range = 6; ztype = ZAP_NEGATIVE_ENERGY; break;
case 6: beam.range = 20; ztype = ZAP_ORB_OF_ELECTRICITY; break;
}
zapping(ztype, power, beam);
@@ -2053,8 +2053,8 @@ std::vector<talent> your_talents(bool check_confused)
if (you.species == SP_MUMMY && you.experience_level >= 13)
_add_talent(talents, ABIL_MUMMY_RESTORATION, check_confused);
- if (you.species == SP_DEEP_DWARF)
- _add_talent(talents, ABIL_RECHARGING, check_confused);
+ if (you.species == SP_DEEP_DWARF)
+ _add_talent(talents, ABIL_RECHARGING, check_confused);
// Spit Poison. Nontransformed nagas can upgrade to Breathe Poison.
// Transformed nagas, or non-nagas, can only get Spit Poison.
@@ -2402,9 +2402,9 @@ static int _find_ability_slot(ability_type which_ability)
// No requested slot, find new one and make it preferred.
- // Skip over a-e (invocations).
+ // Skip over a-e (invocations), or a-g for Elyvilon.
const int first_slot = (you.religion == GOD_ELYVILON ? 7 : 5);
- for (int slot = first_slot; slot < 52; slot++)
+ for (int slot = first_slot; slot < 52; ++slot)
{
if (you.ability_letter_table[slot] == ABIL_NON_ABILITY)
{
@@ -2414,7 +2414,7 @@ static int _find_ability_slot(ability_type which_ability)
}
// If we can't find anything else, try a-e.
- for (int slot = first_slot - 1; slot >= 0; slot--)
+ for (int slot = first_slot - 1; slot >= 0; --slot)
{
if (you.ability_letter_table[slot] == ABIL_NON_ABILITY)
{
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index a7b866dfe3..b5f3b36c49 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -92,7 +92,7 @@ void generate_abyss()
"generate_abyss(); turn_on_level: %d", env.turns_on_level);
#endif
- for ( rectangle_iterator ri(5); ri; ++ri )
+ for (rectangle_iterator ri(5); ri; ++ri)
{
grd(*ri) =
static_cast<dungeon_feature_type>(
@@ -212,14 +212,16 @@ static void _generate_area(const coord_def& topleft,
bool room_ok = true;
// Check if the room is taken.
- for ( rectangle_iterator ri(tl, br); ri && room_ok; ++ri )
+ for (rectangle_iterator ri(tl, br); ri && room_ok; ++ri)
if (grd(*ri) != DNGN_UNSEEN)
room_ok = false;
// Make the room.
if (room_ok)
- for ( rectangle_iterator ri(tl,br); ri; ++ri )
+ {
+ for (rectangle_iterator ri(tl,br); ri; ++ri)
grd(*ri) = DNGN_FLOOR;
+ }
}
}
@@ -232,7 +234,7 @@ static void _generate_area(const coord_def& topleft,
items_level = 0;
}
- for ( rectangle_iterator ri(topleft, bottomright); ri; ++ri )
+ for (rectangle_iterator ri(topleft, bottomright); ri; ++ri)
{
if (grd(*ri) == DNGN_UNSEEN && x_chance_in_y(thickness + 1, 100))
{
@@ -268,7 +270,7 @@ static void _generate_area(const coord_def& topleft,
int exits_wanted = 0;
int altars_wanted = 0;
- for ( rectangle_iterator ri(topleft, bottomright); ri; ++ri )
+ for (rectangle_iterator ri(topleft, bottomright); ri; ++ri)
{
if (grd(*ri) == DNGN_UNSEEN)
grd(*ri) = replaced[random2(5)];
@@ -449,7 +451,7 @@ void area_shift(void)
_abyss_lose_monster(m);
}
- for (rectangle_iterator ri(5); ri; ++ri )
+ for (rectangle_iterator ri(5); ri; ++ri)
{
// Don't modify terrain by player.
if (grid_distance(*ri, you.pos()) <= 10)
@@ -509,7 +511,7 @@ void area_shift(void)
if (env.cloud[i].type == CLOUD_NONE)
continue;
- if ( grid_distance(abyss_center, env.cloud[i].pos) > 10 )
+ if (grid_distance(abyss_center, env.cloud[i].pos) > 10)
delete_cloud( i );
}
@@ -614,7 +616,7 @@ void abyss_teleport( bool new_area )
for (int i = 0; i < MAX_CLOUDS; i++)
delete_cloud( i );
- for ( rectangle_iterator ri(10); ri; ++ri )
+ for (rectangle_iterator ri(10); ri; ++ri)
{
grd(*ri) = DNGN_UNSEEN; // So generate_area will pick it up.
igrd(*ri) = NON_ITEM;
@@ -868,7 +870,7 @@ static void _corrupt_level_features(const crawl_environment &oenv)
for (int i = 0, size = corrupt_markers.size(); i < size; ++i)
corrupt_seeds.push_back(corrupt_markers[i]->pos);
- for ( rectangle_iterator ri(MAPGEN_BORDER); ri; ++ri )
+ for (rectangle_iterator ri(MAPGEN_BORDER); ri; ++ri)
{
int distance = GXM * GXM + GYM * GYM;
for (int i = 0, size = corrupt_seeds.size(); i < size; ++i)
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 3951610e5b..d9c1d70bf0 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -318,7 +318,7 @@ static void _show_commandline_options_help()
static void _wanderer_startup_message()
{
int skill_levels = 0;
- for (int i = 0; i < NUM_SKILLS; i++)
+ for (int i = 0; i < NUM_SKILLS; ++i)
skill_levels += you.skills[ i ];
if (skill_levels <= 2)
@@ -592,10 +592,10 @@ static void _handle_wizard_command( void )
if (!you.wizard)
{
- mpr( "WARNING: ABOUT TO ENTER WIZARD MODE!", MSGCH_WARN );
+ mpr("WARNING: ABOUT TO ENTER WIZARD MODE!", MSGCH_WARN);
#ifndef SCORE_WIZARD_MODE
- mpr( "If you continue, your game will not be scored!", MSGCH_WARN );
+ mpr("If you continue, your game will not be scored!", MSGCH_WARN);
#endif
if (!yesno( "Do you really want to enter wizard mode?", false, 'n' ))
@@ -614,7 +614,7 @@ static void _handle_wizard_command( void )
}
}
- mpr( "Enter Wizard Command (? - help): ", MSGCH_PROMPT );
+ mpr("Enter Wizard Command (? - help): ", MSGCH_PROMPT);
wiz_command = getch();
if (crawl_state.cmd_repeat_start)
@@ -1205,8 +1205,8 @@ static void _go_downstairs()
{
ASSERT(!crawl_state.arena && !crawl_state.arena_suspended);
- bool shaft = (get_trap_type(you.pos()) == TRAP_SHAFT
- && grd(you.pos()) != DNGN_UNDISCOVERED_TRAP);
+ const bool shaft = (get_trap_type(you.pos()) == TRAP_SHAFT
+ && grd(you.pos()) != DNGN_UNDISCOVERED_TRAP);
if (_stairs_check_mesmerised())
return;
@@ -1985,7 +1985,7 @@ static void _prep_input()
// At midpoint (defined by get_expiration_threshold() in player.cc)
// print midmsg and decrease duration by midloss (a randomized amount so as
// to make it impossible to know the exact remaining duration for sure).
-// NOTE: The maximum possible midloss should be greater than midpoint,
+// NOTE: The maximum possible midloss should be smaller than midpoint,
// otherwise the duration may end in the same turn the warning
// message is printed which would be a bit late.
static bool _decrement_a_duration(duration_type dur, const char* endmsg = NULL,
@@ -2010,7 +2010,7 @@ static bool _decrement_a_duration(duration_type dur, const char* endmsg = NULL,
}
}
- // In case midloss caused the duration to end prematurely.
+ // No "else", in case midloss caused the duration to end prematurely.
// (This really shouldn't happen, else the whole point of the
// "begins to time out" message is lost!)
if (you.duration[dur] <= 1)
@@ -2478,7 +2478,7 @@ static void _check_banished()
static void _check_shafts()
{
- for (int i = 0; i < MAX_TRAPS; i++)
+ for (int i = 0; i < MAX_TRAPS; ++i)
{
trap_def &trap = env.trap[i];
@@ -2905,9 +2905,9 @@ static int _check_adjacent(dungeon_feature_type feat, coord_def& delta)
{
int num = 0;
- for ( adjacent_iterator ai(you.pos(), false); ai; ++ai )
+ for (adjacent_iterator ai(you.pos(), false); ai; ++ai)
{
- if ( grd(*ai) == feat )
+ if (grd(*ai) == feat)
{
num++;
delta = *ai - you.pos();
@@ -3307,13 +3307,13 @@ static bool _initialise(void)
msg::initialise_mpr_streams();
// Init item array.
- for (int i = 0; i < MAX_ITEMS; i++)
+ for (int i = 0; i < MAX_ITEMS; ++i)
init_item(i);
// Empty messaging string.
info[0] = 0;
- for (int i = 0; i < MAX_MONSTERS; i++)
+ for (int i = 0; i < MAX_MONSTERS; ++i)
menv[i].reset();
igrd.init(NON_ITEM);
@@ -3604,7 +3604,7 @@ static void _move_player(coord_def move)
monsters *beholder = NULL;
if (you.duration[DUR_MESMERISED] && !you.confused())
{
- for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); ++i)
{
monsters& mon = menv[you.mesmerised_by[i]];
int olddist = grid_distance(you.pos(), mon.pos());
@@ -3705,14 +3705,14 @@ static void _move_player(coord_def move)
#if DEBUG_DIAGNOSTICS
mpr( "Shifting.", MSGCH_DIAGNOSTICS );
int j = 0;
- for (int i = 0; i < MAX_ITEMS; i++)
+ for (int i = 0; i < MAX_ITEMS; ++i)
if (is_valid_item( mitm[i] ))
++j;
mprf( MSGCH_DIAGNOSTICS, "Number of items present: %d", j );
j = 0;
- for (int i = 0; i < MAX_MONSTERS; i++)
+ for (int i = 0; i < MAX_MONSTERS; ++i)
if (menv[i].type != -1)
++j;
@@ -4068,6 +4068,6 @@ static void _compile_time_asserts()
// Also some runtime stuff; I don't know if the order of branches[]
// needs to match the enum, but it currently does.
- for (int i = 0; i < NUM_BRANCHES; i++)
+ for (int i = 0; i < NUM_BRANCHES; ++i)
ASSERT(branches[i].id == i);
}
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 22f2ca83b4..2110903319 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -189,7 +189,6 @@ static void _ench_animation( int flavour, const monsters *mon, bool force )
bool zapping(zap_type ztype, int power, bolt &pbolt,
bool needs_tracer, const char* msg)
{
-
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "zapping: power=%d", power );
#endif
@@ -1397,7 +1396,7 @@ static void _munge_bounced_bolt(bolt &old_bolt, bolt &new_bolt,
for (int tries = 0; tries < 20; tries++)
{
shift = (double) random_range((int)(min * 10000),
- (int)(max * 10000)) / 10000.0;
+ (int)(max * 10000)) / 10000.0;
if (new_deg < old_deg)
shift = -shift;
@@ -1477,11 +1476,10 @@ void bolt::initialize_fire()
std::string item_name = item ? item->name(DESC_PLAIN, false, true)
: "none";
+
std::string source_name = "unknown";
if (beam_source == NON_MONSTER && source == you.pos())
- {
source_name = "player";
- }
else if (!invalid_monster_index(beam_source))
source_name = menv[beam_source].name(DESC_PLAIN, true);
@@ -1532,7 +1530,7 @@ void bolt::initialize_fire()
draw_delay /= 600;
}
-#if DEBUG_DIAGNOSTICS
+#ifdef DEBUG_DIAGNOSTICS
mprf( MSGCH_DIAGNOSTICS, "%s%s%s [%s] (%d,%d) to (%d,%d): "
"ty=%d col=%d flav=%d hit=%d dam=%dd%d range=%d",
(is_beam) ? "beam" : "missile",
@@ -1603,9 +1601,9 @@ void bolt::draw(const coord_def& p)
{
#ifndef USE_TILE
cgotoxy(drawpos.x, drawpos.y);
- put_colour_ch(
- colour == BLACK ? random_colour() : element_colour(colour),
- type);
+ put_colour_ch(colour == BLACK ? random_colour()
+ : element_colour(colour),
+ type);
#endif
// Get curses to update the screen so we can see the beam.
update_screen();
@@ -1620,13 +1618,15 @@ void bolt::bounce()
bolt old_bolt = *this;
do
{
- do {
+ do
ray.regress();
- } while (grid_is_solid(grd(ray.pos())));
+ while (grid_is_solid(grd(ray.pos())));
+
bounce_pos = ray.pos();
ray.advance_and_bounce();
range_used += 2;
- } while (range_used < range && grid_is_solid(grd(ray.pos())));
+ }
+ while (range_used < range && grid_is_solid(grd(ray.pos())));
if (!grid_is_solid(grd(ray.pos())))
_munge_bounced_bolt(old_bolt, *this, old_ray, ray);
@@ -1803,9 +1803,10 @@ void bolt::hit_wall()
if (pos() != source
&& ((is_explosion && !in_explosion_phase) || drop_item))
{
- do {
+ do
ray.regress();
- } while (ray.pos() != source && grid_is_solid(ray.pos()));
+ while (ray.pos() != source && grid_is_solid(ray.pos()));
+
// target is where the explosion is centered, so update it.
if (is_explosion && !is_tracer)
target = ray.pos();
@@ -1862,15 +1863,16 @@ void bolt::affect_cell()
bool bolt::apply_hit_funcs(actor* victim, int dmg, int corpse)
{
bool affected = false;
- for (unsigned int i = 0; i < hit_funcs.size(); i++)
+ for (unsigned int i = 0; i < hit_funcs.size(); ++i)
affected = (*hit_funcs[i])(*this, victim, dmg, corpse) || affected;
+
return (affected);
}
bool bolt::apply_dmg_funcs(actor* victim, int &dmg,
std::vector<std::string> &messages)
{
- for (unsigned int i = 0; i < damage_funcs.size(); i++)
+ for (unsigned int i = 0; i < damage_funcs.size(); ++i)
{
std::string dmg_msg;
@@ -2449,7 +2451,7 @@ bool mass_enchantment( enchant_type wh_enchant, int pow, int origin,
const kill_category kc = (origin == MHITYOU ? KC_YOU : KC_OTHER);
- for (int i = 0; i < MAX_MONSTERS; i++)
+ for (int i = 0; i < MAX_MONSTERS; ++i)
{
monsters* const monster = &menv[i];
@@ -2718,7 +2720,7 @@ void mimic_alert(monsters *mimic)
return;
bool should_id = !testbits(mimic->flags, MF_KNOWN_MIMIC)
- && you.can_see(mimic);
+ && you.can_see(mimic);
// If we got here, we at least got a resists message, if not
// a full wounds printing. Thus, might as well id the mimic.
@@ -3107,7 +3109,7 @@ void bolt::affect_place_explosion_clouds()
(crawl_state.is_god_acting()) ? crawl_state.which_god_acting()
: GOD_NO_GOD;
const beh_type att =
- whose_kill() == KC_OTHER ? BEH_HOSTILE : BEH_FRIENDLY;
+ (whose_kill() == KC_OTHER ? BEH_HOSTILE : BEH_FRIENDLY);
mons_place(
mgen_data(MONS_FIRE_VORTEX, att, 2, SPELL_FIRE_STORM, p,
@@ -3384,7 +3386,7 @@ void bolt::tracer_affect_player()
apply_dmg_funcs(&you, dummy, messages);
- for (unsigned int i = 0; i < messages.size(); i++)
+ for (unsigned int i = 0; i < messages.size(); ++i)
mpr(messages[i].c_str(), MSGCH_WARN);
range_used += range_used_on_hit(&you);
@@ -3675,7 +3677,7 @@ void bolt::affect_player_enchantment()
break;
}
- mpr( "You convulse!" );
+ mpr("You convulse!");
if (aux_source.empty())
aux_source = "by dispel undead";
@@ -3952,7 +3954,7 @@ void bolt::affect_player()
if (hurted > 0)
{
- for (unsigned int i = 0; i < messages.size(); i++)
+ for (unsigned int i = 0; i < messages.size(); ++i)
mpr(messages[i].c_str(), MSGCH_WARN);
}
@@ -4048,7 +4050,7 @@ bool bolt::determine_damage(monsters* mon, int& preac, int& postac, int& final,
{
// The beam will pass overhead unless it's aimed at them.
if (!aimed_at_spot)
- return false;
+ return (false);
// Electricity is ineffective.
if (flavour == BEAM_ELECTRICITY)
@@ -4056,7 +4058,7 @@ bool bolt::determine_damage(monsters* mon, int& preac, int& postac, int& final,
if (!is_tracer && see_grid(mon->pos()))
mprf("The %s arcs harmlessly into the water.", name.c_str());
finish_beam();
- return false;
+ return (false);
}
// Otherwise, 1/3 damage reduction.
@@ -4085,8 +4087,8 @@ void bolt::handle_stop_attack_prompt(monsters* mon)
if ((thrower == KILL_YOU_MISSILE || thrower == KILL_YOU)
&& !is_harmless(mon))
{
- if ((friend_info.count == 1 && !friend_info.dont_stop)
- || (foe_info.count == 1 && !foe_info.dont_stop))
+ if (friend_info.count == 1 && !friend_info.dont_stop
+ || foe_info.count == 1 && !foe_info.dont_stop)
{
const bool on_target = (target == mon->pos());
if (stop_attack_prompt(mon, true, on_target))
@@ -4109,12 +4111,7 @@ void bolt::tracer_nonenchantment_affect_monster(monsters* mon)
{
std::vector<std::string> messages;
int preac, post, final;
- if ( !determine_damage(mon, preac, post, final, messages) )
- return;
-
- // Maybe the user wants to cancel at this point.
- handle_stop_attack_prompt(mon);
- if (beam_cancelled)
+ if (!determine_damage(mon, preac, post, final, messages))
return;
// Check only if actual damage.
@@ -4137,8 +4134,17 @@ void bolt::tracer_nonenchantment_affect_monster(monsters* mon)
friend_info.power += 2 * final * mons_power(mon->type) / preac;
friend_info.count++;
}
+ }
- for (unsigned int i = 0; i < messages.size(); i++)
+ // Maybe the user wants to cancel at this point.
+ handle_stop_attack_prompt(mon);
+ if (beam_cancelled)
+ return;
+
+ // Check only if actual damage.
+ if (final > 0)
+ {
+ for (unsigned int i = 0; i < messages.size(); ++i)
mpr(messages[i].c_str(), MSGCH_MONSTER_DAMAGE);
}
@@ -4542,7 +4548,7 @@ void bolt::affect_monster(monsters* mon)
if (final > 0)
{
- for (unsigned int i = 0; i < messages.size(); i++)
+ for (unsigned int i = 0; i < messages.size(); ++i)
mpr(messages[i].c_str(), MSGCH_MONSTER_DAMAGE);
}
@@ -5011,7 +5017,7 @@ int bolt::range_used_on_hit(const actor* victim) const
if (in_explosion_phase)
return (used);
- for (unsigned int i = 0; i < range_funcs.size(); i++)
+ for (unsigned int i = 0; i < range_funcs.size(); ++i)
{
if ( (*range_funcs[i])(*this, victim, used) )
break;
@@ -5143,7 +5149,7 @@ void bolt::refine_for_explosion()
if (seeMsg == NULL)
{
seeMsg = "The beam explodes into a cloud of software bugs!";
- hearMsg = "You hear the sound of one hand!";
+ hearMsg = "You hear the sound of one hand clapping!";
}
@@ -5320,9 +5326,8 @@ void bolt::explosion_draw_cell(const coord_def& p)
if (in_los_bounds(drawpos))
{
cgotoxy(drawpos.x, drawpos.y, GOTO_DNGN);
- put_colour_ch(
- colour == BLACK ? random_colour() : colour,
- dchar_glyph(DCHAR_EXPLOSION));
+ put_colour_ch(colour == BLACK ? random_colour() : colour,
+ dchar_glyph(DCHAR_EXPLOSION));
}
#endif
}
@@ -5381,7 +5386,7 @@ void bolt::determine_affected_cells(explosion_map& m, const coord_def& delta,
m(delta + centre) = std::min(count, m(delta + centre));
// Now recurse in every direction.
- for (int i = 0; i < 8; i++)
+ for (int i = 0; i < 8; ++i)
{
const coord_def new_delta = delta + Compass[i];
@@ -5614,78 +5619,78 @@ std::string beam_type_name(beam_type type)
{
switch (type)
{
- case BEAM_NONE: return("none");
- case BEAM_MISSILE: return("missile");
- case BEAM_MMISSILE: return("magic missile");
+ case BEAM_NONE: return("none");
+ case BEAM_MISSILE: return("missile");
+ case BEAM_MMISSILE: return("magic missile");
- case BEAM_POTION_FIRE:
- case BEAM_FIRE: return("fire");
+ case BEAM_POTION_FIRE: // fall through
+ case BEAM_FIRE: return("fire");
- case BEAM_POTION_COLD:
- case BEAM_COLD: return("cold");
+ case BEAM_POTION_COLD: // fall through
+ case BEAM_COLD: return("cold");
- case BEAM_MAGIC: return("magic");
- case BEAM_ELECTRICITY: return("electricity");
+ case BEAM_MAGIC: return("magic");
+ case BEAM_ELECTRICITY: return("electricity");
case BEAM_POTION_STINKING_CLOUD:
- case BEAM_POTION_POISON:
- case BEAM_POISON: return("poison");
-
- case BEAM_NEG: return("negative energy");
- case BEAM_ACID: return("acid");
-
- case BEAM_MIASMA:
- case BEAM_POTION_MIASMA: return("miasma");
-
- case BEAM_SPORE: return("spores");
- case BEAM_POISON_ARROW: return("poison arrow");
- case BEAM_HELLFIRE: return("hellfire");
- case BEAM_NAPALM: return("sticky fire");
-
- case BEAM_POTION_STEAM:
- case BEAM_STEAM: return("steam");
-
- case BEAM_ENERGY: return("energy");
- case BEAM_HOLY: return("holy energy");
- case BEAM_FRAG: return("fragments");
- case BEAM_LAVA: return("magma");
- case BEAM_ICE: return("ice");
- case BEAM_NUKE: return("nuke");
- case BEAM_RANDOM: return("random");
- case BEAM_CHAOS: return("chaos");
- case BEAM_SLOW: return("slow");
- case BEAM_HASTE: return("haste");
- case BEAM_HEALING: return("healing");
- case BEAM_PARALYSIS: return("paralysis");
- case BEAM_CONFUSION: return("confusion");
- case BEAM_INVISIBILITY: return("invisibility");
- case BEAM_DIGGING: return("digging");
- case BEAM_TELEPORT: return("teleportation");
- case BEAM_POLYMORPH: return("polymorph");
- case BEAM_CHARM: return("enslave");
- case BEAM_BANISH: return("banishment");
- case BEAM_DEGENERATE: return("degeneration");
- case BEAM_ENSLAVE_UNDEAD: return("enslave undead");
- case BEAM_ENSLAVE_SOUL: return("enslave soul");
- case BEAM_PAIN: return("pain");
- case BEAM_DISPEL_UNDEAD: return("dispel undead");
- case BEAM_DISINTEGRATION: return("disintegration");
- case BEAM_ENSLAVE_DEMON: return("enslave demon");
- case BEAM_BLINK: return("blink");
- case BEAM_PETRIFY: return("petrify");
- case BEAM_BACKLIGHT: return("backlight");
- case BEAM_SLEEP: return("sleep");
- case BEAM_POTION_BLACK_SMOKE: return("black smoke");
- case BEAM_POTION_GREY_SMOKE: return("grey smoke");
- case BEAM_POTION_BLUE_SMOKE: return("blue smoke");
- case BEAM_POTION_PURP_SMOKE: return("purple smoke");
- case BEAM_POTION_RANDOM: return("random potion");
- case BEAM_VISUAL: return ("visual effects");
- case BEAM_TORMENT_DAMAGE: return("torment damage");
- case BEAM_STEAL_FOOD: return("steal food");
- case NUM_BEAMS:
- DEBUGSTR("invalid beam type");
- return("INVALID");
+ case BEAM_POTION_POISON: // fall through
+ case BEAM_POISON: return("poison");
+
+ case BEAM_NEG: return("negative energy");
+ case BEAM_ACID: return("acid");
+
+ case BEAM_MIASMA: // fall through
+ case BEAM_POTION_MIASMA: return("miasma");
+
+ case BEAM_SPORE: return("spores");
+ case BEAM_POISON_ARROW: return("poison arrow");
+ case BEAM_HELLFIRE: return("hellfire");
+ case BEAM_NAPALM: return("sticky fire");
+
+ case BEAM_POTION_STEAM: // fall through
+ case BEAM_STEAM: return("steam");
+
+ case BEAM_ENERGY: return("energy");
+ case BEAM_HOLY: return("holy energy");
+ case BEAM_FRAG: return("fragments");
+ case BEAM_LAVA: return("magma");
+ case BEAM_ICE: return("ice");
+ case BEAM_NUKE: return("nuke");
+ case BEAM_RANDOM: return("random");
+ case BEAM_CHAOS: return("chaos");
+ case BEAM_SLOW: return("slow");
+ case BEAM_HASTE: return("haste");
+ case BEAM_HEALING: return("healing");
+ case BEAM_PARALYSIS: return("paralysis");
+ case BEAM_CONFUSION: return("confusion");
+ case BEAM_INVISIBILITY: return("invisibility");
+ case BEAM_DIGGING: return("digging");
+ case BEAM_TELEPORT: return("teleportation");
+ case BEAM_POLYMORPH: return("polymorph");
+ case BEAM_CHARM: return("enslave");
+ case BEAM_BANISH: return("banishment");
+ case BEAM_DEGENERATE: return("degeneration");
+ case BEAM_ENSLAVE_UNDEAD: return("enslave undead");
+ case BEAM_ENSLAVE_SOUL: return("enslave soul");
+ case BEAM_PAIN: return("pain");
+ case BEAM_DISPEL_UNDEAD: return("dispel undead");
+ case BEAM_DISINTEGRATION: return("disintegration");
+ case BEAM_ENSLAVE_DEMON: return("enslave demon");
+ case BEAM_BLINK: return("blink");
+ case BEAM_PETRIFY: return("petrify");
+ case BEAM_BACKLIGHT: return("backlight");
+ case BEAM_SLEEP: return("sleep");
+ case BEAM_POTION_BLACK_SMOKE: return("black smoke");
+ case BEAM_POTION_GREY_SMOKE: return("grey smoke");
+ case BEAM_POTION_BLUE_SMOKE: return("blue smoke");
+ case BEAM_POTION_PURP_SMOKE: return("purple smoke");
+ case BEAM_POTION_RANDOM: return("random potion");
+ case BEAM_VISUAL: return ("visual effects");
+ case BEAM_TORMENT_DAMAGE: return("torment damage");
+ case BEAM_STEAL_FOOD: return("steal food");
+
+ case NUM_BEAMS: DEBUGSTR("invalid beam type");
+ return("INVALID");
}
DEBUGSTR("unknown beam type");
return("UNKNOWN");
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h
index 6b7bd85ff8..a95dc38280 100644
--- a/crawl-ref/source/beam.h
+++ b/crawl-ref/source/beam.h
@@ -268,15 +268,6 @@ dice_def calc_dice( int num_dice, int max_damage );
// Test if the to-hit (attack) beats evasion (defence).
bool test_beam_hit(int attack, int defence);
-/* FIXME: remove this
-int explosion( bolt &pbolt, bool hole_in_the_middle = false,
- bool explode_in_wall = false,
- bool stop_at_statues = true,
- bool stop_at_walls = true,
- bool show_more = true,
- bool affect_items = true);
-*/
-
int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted,
bool doFlavouredEffects = true);
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index f28cc5c3d5..fe5610e65e 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1292,18 +1292,26 @@ static void _finish_delay(const delay_queue_item &delay)
// Don't autopickup chunks/potions if there's still another
// delay (usually more corpses to butcher or a weapon-swap)
// waiting to happen.
+ // Also, don't waste time picking up chunks if you're already
+ // starving. (jpeg)
if ((Options.chunks_autopickup
|| delay.type == DELAY_BOTTLE_BLOOD)
&& you.delay_queue.size() == 1)
{
- autopickup();
+ if (you.hunger_state > HS_STARVING || you.species == SP_VAMPIRE)
+ autopickup();
}
// If we were interrupted while butchering (by poisoning, for
// example) then resumed butchering and finished, swap back from
// butchering tool if appropriate.
- if (you.delay_queue.size() == 1)
+ // Again, not if starving. (jpeg)
+ if (you.delay_queue.size() == 1
+ && (you.hunger_state > HS_STARVING
+ || you.species == SP_VAMPIRE))
+ {
handle_interrupted_swap(true);
+ }
}
else
{
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 62af5d962a..0376d69563 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -522,7 +522,6 @@ void full_describe_view()
InvMenu desc_menu(MF_SINGLESELECT | MF_ANYPRINTABLE
| MF_ALLOW_FORMATTING | MF_SELECT_BY_PAGE);
-// desc_menu.set_highlighter(NULL);
// FIXME: Need different title for the opposite toggle:
// "Visible Monsters/Items (select for more detail, '!' to examine):"
std::string title = "";
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 9e57ea98e6..19d7fda3af 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2360,6 +2360,11 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Don't do the tracing when using Portaled Projectile, or when confused.
if (!teleport && !you.confused())
{
+ // Set values absurdly high to make sure the tracer will
+ // complain if we're attempting to fire through allies.
+ pbolt.hit = 100;
+ pbolt.damage = dice_def(1, 100);
+
// Init tracer variables.
pbolt.foe_info.reset();
pbolt.friend_info.reset();
@@ -2378,6 +2383,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
delete pbolt.special_explosion;
return (false);
}
+ pbolt.hit = 0;
+ pbolt.damage = dice_def();
}
pbolt.is_tracer = false;
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 5bb8f85e37..cfbd60814f 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4496,8 +4496,10 @@ bool monsters::drop_item(int eslot, int near)
pitem->flags |= ISFLAG_DROPPED_BY_ALLY;
if (need_message(near))
+ {
mprf("%s drops %s.", name(DESC_CAP_THE).c_str(),
pitem->name(DESC_NOCAP_A).c_str());
+ }
dungeon_feature_type feat = grd(pos());
if (grid_destroys_items(feat))
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index c0c963b25e..2eea4855ff 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -925,7 +925,15 @@ int animate_remains(const coord_def &a, corpse_type class_allowed,
{
// Ignore quiet.
if (was_butchering)
- mpr("The corpse you are butchering rises to attack!");
+ {
+ if (beha == BEH_HOSTILE)
+ mpr("The corpse you are butchering rises to attack!");
+ else
+ {
+ mpr("The corpse you are butchering rises to join "
+ "your ranks!");
+ }
+ }
if (!quiet && see_grid(a))
mpr("The dead are walking!");
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 9e0dba7e50..72e8ae3f51 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -286,7 +286,7 @@ void xom_tick()
you.piety = HALF_MAX_PIETY + (good ? size : -size);
}
-#ifdef DEBUG_XOM
+#ifdef DEBUG_DIAGNOSTICS
snprintf(info, INFO_SIZE, "xom_tick(), delta: %d, piety: %d",
delta, you.piety);
take_note(Note(NOTE_MESSAGE, 0, 0, info), true);