summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/misc.cc16
-rw-r--r--crawl-ref/source/misc.h4
-rw-r--r--crawl-ref/source/mon-util.cc4
-rw-r--r--crawl-ref/source/mstuff2.cc2
5 files changed, 17 insertions, 13 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 43fe5e3307..66e13428d9 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2814,7 +2814,7 @@ bool melee_attack::apply_damage_brand()
break;
case SPWPN_ORC_SLAYING:
- if (is_orckind(defender, def))
+ if (is_orckind(defender))
{
special_damage = 1 + random2(3*damage_done/2);
if (defender_visible)
@@ -2830,7 +2830,7 @@ bool melee_attack::apply_damage_brand()
break;
case SPWPN_DRAGON_SLAYING:
- if (is_dragonkind(defender, def))
+ if (is_dragonkind(defender))
{
special_damage = 1 + random2(3*damage_done/2);
if (defender_visible)
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index dd5765ecf3..65ad96c77b 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -3154,22 +3154,25 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack,
return (retval);
}
-bool is_orckind(const actor *act, const monsters *mon)
+bool is_orckind(const actor *act)
{
if (mons_genus(act->mons_species()) == MONS_ORC)
return (true);
- if (act->atype() == ACT_MONSTER
- && mons_is_zombified(mon)
- && mons_genus(mon->base_monster) == MONS_ORC)
+ if (act->atype() == ACT_MONSTER)
{
- return (true);
+ const monsters* mon = dynamic_cast<const monsters*>(act);
+ if (mons_is_zombified(mon)
+ && mons_genus(mon->base_monster) == MONS_ORC)
+ {
+ return (true);
+ }
}
return (false);
}
-bool is_dragonkind(const actor *act, const monsters *mon)
+bool is_dragonkind(const actor *act)
{
if (mons_genus(act->mons_species()) == MONS_DRAGON
|| mons_genus(act->mons_species()) == MONS_DRACONIAN)
@@ -3183,6 +3186,7 @@ bool is_dragonkind(const actor *act, const monsters *mon)
|| you.attribute[ATTR_TRANSFORMATION] == TRAN_SERPENT_OF_HELL);
}
// else the actor is a monster
+ const monsters* mon = dynamic_cast<const monsters*>(act);
if (mon->type == MONS_SERPENT_OF_HELL)
return (true);
diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h
index 9eb46eaf11..10ac17ed89 100644
--- a/crawl-ref/source/misc.h
+++ b/crawl-ref/source/misc.h
@@ -116,8 +116,8 @@ std::string your_hand(bool plural);
bool stop_attack_prompt(const monsters *mon, bool beam_attack,
bool beam_target);
-bool is_orckind(const actor *act, const monsters *mon);
+bool is_orckind(const actor *act);
-bool is_dragonkind(const actor *act, const monsters *mon);
+bool is_dragonkind(const actor *act);
#endif
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index b508a3a54b..b22ebf5ccd 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3905,11 +3905,11 @@ bool monsters::could_wield(const item_def &item, bool ignore_brand,
const int brand = get_weapon_brand(item);
// Draconians won't use dragon slaying weapons.
- if (brand == SPWPN_DRAGON_SLAYING && is_dragonkind(this, this))
+ if (brand == SPWPN_DRAGON_SLAYING && is_dragonkind(this))
return (false);
// Orcs won't use orc slaying weapons.
- if (brand == SPWPN_ORC_SLAYING && is_orckind(this, this))
+ if (brand == SPWPN_ORC_SLAYING && is_orckind(this))
return (false);
// Demonic/undead monsters won't use holy weapons.
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index af671e5f06..28bb03ab6b 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -2201,7 +2201,7 @@ bolt mons_spells( monsters *mons, spell_type spell_cast, int power )
// FIXME: This effect is not yet implemented for player draconians
// or characters in dragon form breathing at monsters wielding a
// weapon with this brand.
- if (is_dragonkind(mons, mons))
+ if (is_dragonkind(mons))
{
if (actor *foe = mons->get_foe())
{