summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-24 06:12:43 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-24 06:12:43 +0000
commitee53c253f44622190c9981c17e7efe66d15ddfc8 (patch)
treec128607e7088e007bd838e95f1ad8ca2d422cc2c /crawl-ref
parent87b16bb06d3f693ec3f6d727a50bdadf4df5c138 (diff)
downloadcrawl-ref-ee53c253f44622190c9981c17e7efe66d15ddfc8.tar.gz
crawl-ref-ee53c253f44622190c9981c17e7efe66d15ddfc8.zip
Put skeletal dragons back in the dragon genus, and treat all
dragon-types consistently when dealing with weapons of dragon slaying (dragons, draconians, dragon-transformed players, zombified dragons, and zombified draconians). New function is_dragonkind() handles this. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7578 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/fight.cc5
-rw-r--r--crawl-ref/source/misc.cc23
-rw-r--r--crawl-ref/source/misc.h2
-rw-r--r--crawl-ref/source/mon-data.h2
-rw-r--r--crawl-ref/source/mstuff2.cc11
5 files changed, 32 insertions, 11 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 619217047d..ab988bcf71 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2170,10 +2170,7 @@ bool melee_attack::apply_damage_brand()
break;
case SPWPN_DRAGON_SLAYING:
- if (mons_genus(defender->mons_species()) == MONS_DRAGON
- || mons_genus(defender->mons_species()) == MONS_DRACONIAN
- || defender->atype() == ACT_PLAYER
- && you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON)
+ if (is_dragonkind(defender, def))
{
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 a5f5cc577b..ffc862cd29 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2861,3 +2861,26 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack,
return (retval);
}
+
+bool is_dragonkind(const actor *act, const monsters *mon)
+{
+ if (mons_genus(act->mons_species()) == MONS_DRAGON
+ || mons_genus(act->mons_species()) == MONS_DRACONIAN)
+ {
+ return (true);
+ }
+ else if (act->atype() == ACT_PLAYER
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON)
+ {
+ return (true);
+ }
+ else if (act->atype() == ACT_MONSTER
+ && mons_is_zombified(mon)
+ && (mons_genus(mon->base_monster) == MONS_DRAGON
+ || mons_genus(mon->base_monster) == MONS_DRACONIAN))
+ {
+ return (true);
+ }
+
+ return (false);
+}
diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h
index 6a7a095e9c..4c46506d0e 100644
--- a/crawl-ref/source/misc.h
+++ b/crawl-ref/source/misc.h
@@ -110,4 +110,6 @@ std::string your_hand(bool plural);
bool stop_attack_prompt(const monsters *mon, bool beam_attack,
bool beam_target);
+bool is_dragonkind(const actor *act, const monsters *mon);
+
#endif
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 0ceb1e273b..dc20a5f3ec 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -1910,7 +1910,7 @@ static monsterentry mondata[] = {
MONS_SKELETAL_DRAGON, 'D', LIGHTGREY, "skeletal dragon",
M_SENSE_INVIS | M_EVIL | M_FLIES,
MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,
- 0, 12, MONS_SKELETAL_DRAGON, MONS_SKELETAL_DRAGON, MH_UNDEAD, -4,
+ 0, 12, MONS_DRAGON, MONS_SKELETAL_DRAGON, MH_UNDEAD, -4,
{ {AT_BITE, AF_PLAIN, 30}, {AT_CLAW, AF_PLAIN, 20},
{AT_CLAW, AF_PLAIN, 20}, AT_NO_ATK },
{ 20, 8, 8, 0 },
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 22b9aa24c9..5f67fcb98f 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -707,12 +707,12 @@ void monster_teleport(monsters *monster, bool instan, bool silent)
else
monster->flags &= ~MF_KNOWN_MIMIC;
}
-} // end monster_teleport()
+}
-void setup_dragon(struct monsters *monster, struct bolt &pbolt)
+void setup_dragon(struct monsters *monster, bolt &pbolt)
{
- const int type = (mons_genus( monster->type ) == MONS_DRACONIAN)
- ? draco_subspecies( monster ) : monster->type;
+ const int type = (mons_genus(monster->type) == MONS_DRACONIAN)
+ ? draco_subspecies(monster) : monster->type;
int scaling = 100;
pbolt.name.clear();
@@ -788,8 +788,7 @@ void setup_dragon(struct monsters *monster, struct bolt &pbolt)
// 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 (mons_genus(monster->type) == MONS_DRAGON
- || mons_genus(monster->type) == MONS_DRACONIAN)
+ if (is_dragonkind(monster, monster))
{
if (actor *foe = monster->get_foe())
{