summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc8
-rw-r--r--crawl-ref/source/monstuff.cc23
2 files changed, 15 insertions, 16 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 2386659f0c..79d5709bdf 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -5750,14 +5750,14 @@ void monsters::apply_enchantment(const mon_enchant &me)
int dam = (poisonval >= 4) ? 1 : 0;
if (coinflip())
- dam += roll_dice( 1, poisonval + 1 );
+ dam += roll_dice(1, poisonval + 1);
if (mons_res_poison(this) < 0)
- dam += roll_dice( 2, poisonval ) - 1;
+ dam += roll_dice(2, poisonval) - 1;
if (dam > 0)
{
- hurt_monster( this, dam );
+ hurt_monster(this, dam);
#if DEBUG_DIAGNOSTICS
// For debugging, we don't have this silent.
@@ -5798,7 +5798,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
if (dam > 0)
{
- hurt_monster( this, dam );
+ hurt_monster(this, dam);
simple_monster_message(this, " burns!");
#if DEBUG_DIAGNOSTICS
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 25619a5d74..d8aabd843f 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -756,8 +756,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
you.duration[DUR_MIGHT] += bonus;
haste_player( bonus );
- mpr( "You feel the power of Trog in you as your rage grows.",
- MSGCH_GOD, GOD_TROG );
+ mpr("You feel the power of Trog in you as your rage grows.",
+ MSGCH_GOD, GOD_TROG);
}
else if (wearing_amulet( AMU_RAGE ) && one_chance_in(30))
{
@@ -767,7 +767,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
you.duration[DUR_MIGHT] += bonus;
haste_player( bonus );
- mpr( "Your amulet glows a violent red." );
+ mpr("Your amulet glows a violent red.");
}
}
@@ -1308,13 +1308,13 @@ void monster_cleanup(monsters *monster)
you.pet_target = MHITNOT;
}
-static bool _jelly_divide(monsters * parent)
+static bool _jelly_divide(monsters *parent)
{
int jex = 0, jey = 0; // loop variables {dlb}
bool foundSpot = false; // to rid code of hideous goto {dlb}
monsters *child = NULL; // value determined with loop {dlb}
- if (!mons_class_flag( parent->type, M_SPLITS ) || parent->hit_points == 1)
+ if (!mons_class_flag(parent->type, M_SPLITS) || parent->hit_points == 1)
return (false);
// First, find a suitable spot for the child {dlb}:
@@ -7502,24 +7502,23 @@ static void _mons_in_cloud(monsters *monster)
behaviour_event(monster, ME_DISTURB, MHITNOT, monster->x, monster->y);
}
- if (hurted < 0)
- hurted = 0;
- else if (hurted > 0)
+ hurted = std::max(0, hurted);
+
+ if (hurted > 0)
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "%s takes %d damage from cloud.",
- monster->name(DESC_CAP_THE).c_str(),
- hurted);
+ monster->name(DESC_CAP_THE).c_str(), hurted);
#endif
hurt_monster(monster, hurted);
if (monster->hit_points < 1)
{
- mon_enchant death_ench( ENCH_NONE, 0, cloud.whose );
+ mon_enchant death_ench(ENCH_NONE, 0, cloud.whose);
monster_die(monster, death_ench.killer(), death_ench.kill_agent());
}
}
-} // end mons_in_cloud()
+}
bool monster_descriptor(int which_class, unsigned char which_descriptor)
{