|
From: <dsh...@us...> - 2007-04-03 16:34:00
|
Revision: 1201
http://svn.sourceforge.net/crawl-ref/?rev=1201&view=rev
Author: dshaligram
Date: 2007-04-03 09:33:59 -0700 (Tue, 03 Apr 2007)
Log Message:
-----------
Fire resistant monsters drown in lava instead of being incinerated.
Used correct check to see if monsters can drown.
Monsters quaffing healing are also cured of confusion and rotting now (Erik).
Modified Paths:
--------------
trunk/crawl-ref/source/externs.h
trunk/crawl-ref/source/fight.cc
trunk/crawl-ref/source/mon-util.cc
trunk/crawl-ref/source/monstuff.cc
Modified: trunk/crawl-ref/source/externs.h
===================================================================
--- trunk/crawl-ref/source/externs.h 2007-04-03 15:09:20 UTC (rev 1200)
+++ trunk/crawl-ref/source/externs.h 2007-04-03 16:33:59 UTC (rev 1201)
@@ -943,6 +943,7 @@
bool alive() const;
coord_def pos() const;
bool swimming() const;
+ bool can_drown() const;
bool floundering() const;
size_type body_size(int psize = PSIZE_TORSO, bool base = false) const;
int damage_type(int attk = -1);
Modified: trunk/crawl-ref/source/fight.cc
===================================================================
--- trunk/crawl-ref/source/fight.cc 2007-04-03 15:09:20 UTC (rev 1200)
+++ trunk/crawl-ref/source/fight.cc 2007-04-03 16:33:59 UTC (rev 1201)
@@ -2767,10 +2767,11 @@
special_damage = special_damage * 2 / 3;
if (needs_message && special_damage)
- mprf("%s %s %s!",
+ mprf("%s %s %s%s",
attacker->name(DESC_CAP_THE).c_str(),
attacker->conj_verb("shock").c_str(),
- defender->name(DESC_NOCAP_THE).c_str());
+ defender->name(DESC_NOCAP_THE).c_str(),
+ special_attack_punctuation().c_str());
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Shock damage: %d", special_damage);
Modified: trunk/crawl-ref/source/mon-util.cc
===================================================================
--- trunk/crawl-ref/source/mon-util.cc 2007-04-03 15:09:20 UTC (rev 1200)
+++ trunk/crawl-ref/source/mon-util.cc 2007-04-03 16:33:59 UTC (rev 1201)
@@ -2477,6 +2477,11 @@
&& !mons_flies(this));
}
+bool monsters::can_drown() const
+{
+ return (!mons_res_asphyx(this));
+}
+
size_type monsters::body_size(int /* psize */, bool /* base */) const
{
const monsterentry *e = seekmonster(type);
Modified: trunk/crawl-ref/source/monstuff.cc
===================================================================
--- trunk/crawl-ref/source/monstuff.cc 2007-04-03 15:09:20 UTC (rev 1200)
+++ trunk/crawl-ref/source/monstuff.cc 2007-04-03 16:33:59 UTC (rev 1201)
@@ -2433,6 +2433,8 @@
{
monster->del_ench(ENCH_POISON);
monster->del_ench(ENCH_SICK);
+ monster->del_ench(ENCH_CONFUSION);
+ monster->del_ench(ENCH_ROT);
}
imbibed = true;
@@ -4239,7 +4241,7 @@
if (lev == 2 || (lev && !mons->paralysed()))
return;
- const int grid = grd(mons->pos());
+ int grid = grd(mons->pos());
if ((grid == DNGN_LAVA || grid == DNGN_DEEP_WATER)
&& !monster_habitable_grid(mons, grid))
{
@@ -4252,9 +4254,12 @@
ptr_monam(mons, DESC_CAP_THE),
(grid == DNGN_LAVA ? "lava" : "water"));
+ if (grid == DNGN_LAVA && mons_res_fire(mons) > 0)
+ grid = DNGN_DEEP_WATER;
+
// Even fire resistant monsters perish in lava, but undead can survive
// deep water.
- if (grid == DNGN_LAVA || mons->holiness() != MH_UNDEAD)
+ if (grid == DNGN_LAVA || mons->can_drown())
{
if (message)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|