summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 12:49:40 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 12:49:40 +0000
commit3e17829c6b5d11b23fda59f0dd38b8aa88638f39 (patch)
treefe9970c069fa91ae39e05d4d7fb9d58bd969ae11 /crawl-ref
parent9eff4a73889f90cea1f4d5c869205f9e127c20c5 (diff)
downloadcrawl-ref-3e17829c6b5d11b23fda59f0dd38b8aa88638f39.tar.gz
crawl-ref-3e17829c6b5d11b23fda59f0dd38b8aa88638f39.zip
The royal jelly can no longer expel lesser jellies when tormented.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6921 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/effects.cc2
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/externs.h11
-rw-r--r--crawl-ref/source/mon-util.cc8
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/player.cc2
6 files changed, 15 insertions, 12 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 1b4833d3a3..0cb9c18977 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -259,7 +259,7 @@ int torment_monsters(coord_def where, int pow, int caster)
// Currently, torment doesn't annoy the monsters it affects because
// it can't kill them, and because hostile monsters use it.
- hurt_monster(monster, hploss);
+ monster->hurt(NULL, hploss, BEAM_TORMENT_DAMAGE);
if (hploss)
{
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 9e252c7330..779123b7bf 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -260,6 +260,8 @@ enum beam_type // beam[].flavour
BEAM_POTION_PURP_SMOKE,
BEAM_POTION_RANDOM, // 55
+ BEAM_TORMENT_DAMAGE, // Pseudo-beam for damage flavour.
+
BEAM_LINE_OF_SIGHT // only used for checking monster LOS
};
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index c8f294523c..4c69d915e4 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -309,7 +309,8 @@ public:
virtual bool can_mutate() const = 0;
virtual bool can_safely_mutate() const = 0;
virtual bool mutate() = 0;
- virtual int hurt(const actor *attacker, int amount) = 0;
+ virtual int hurt(const actor *attacker, int amount,
+ beam_type flavour = BEAM_MISSILE) = 0;
virtual void heal(int amount, bool max_too = false) = 0;
virtual void banish(const std::string &who = "") = 0;
virtual void blink(bool allow_partial_control = true) = 0;
@@ -895,7 +896,8 @@ public:
void confuse(int strength);
void rot(actor *agent, int rotlevel, int immed_rot);
void heal(int amount, bool max_too = false);
- int hurt(const actor *agent, int amount);
+ int hurt(const actor *attacker, int amount,
+ beam_type flavour = BEAM_MISSILE);
int holy_aura() const;
int warding() const;
@@ -1140,7 +1142,7 @@ public:
void scale_hp(int num, int den);
bool gain_exp(int exp);
- void react_to_damage(int damage);
+ void react_to_damage(int damage, beam_type flavour);
void add_enchantment_effect(const mon_enchant &me, bool quiet = false);
void remove_enchantment_effect(const mon_enchant &me, bool quiet = false);
@@ -1288,7 +1290,8 @@ public:
void slow_down(int str);
void confuse(int strength);
void rot(actor *agent, int rotlevel, int immed_rot);
- int hurt(const actor *agent, int amount);
+ int hurt(const actor *attacker, int amount,
+ beam_type flavour = BEAM_MISSILE);
void heal(int amount, bool max_too = false);
void blink(bool allow_partial_control = true);
void teleport(bool right_now = false, bool abyss_shift = false);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 997a503406..050fde1d98 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4928,7 +4928,7 @@ god_type monsters::deity() const
return (god);
}
-int monsters::hurt(const actor *agent, int amount)
+int monsters::hurt(const actor *agent, int amount, beam_type flavour)
{
if (amount <= 0)
return (0);
@@ -4937,7 +4937,7 @@ int monsters::hurt(const actor *agent, int amount)
hit_points -= amount;
// Allow the victim to exhibit passive damage behaviour (royal jelly).
- react_to_damage(amount);
+ react_to_damage(amount, flavour);
if (agent && (hit_points < 1 || hit_dice < 1) && type != -1)
{
@@ -6674,10 +6674,10 @@ static inline monster_type _royal_jelly_ejectable_monster()
-1 ) );
}
-void monsters::react_to_damage(int damage)
+void monsters::react_to_damage(int damage, beam_type flavour)
{
// The royal jelly objects to taking damage and will SULK. :-)
- if (type == MONS_ROYAL_JELLY && alive()
+ if (type == MONS_ROYAL_JELLY && flavour != BEAM_TORMENT_DAMAGE && alive()
&& damage > 8 && x_chance_in_y(damage, 50))
{
const int tospawn =
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 4a4549d755..ce58adfc30 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -7623,8 +7623,6 @@ unsigned int monster_index(const monsters *monster)
int hurt_monster(monsters * victim, int damage_dealt)
{
- damage_dealt = std::max(std::min(damage_dealt, victim->hit_points), 0);
-
return (victim->hurt(NULL, damage_dealt));
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index fe0e26a6fc..ab1e3d668b 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6504,7 +6504,7 @@ void player::teleport(bool now, bool abyss_shift)
you_teleport();
}
-int player::hurt(const actor *agent, int amount)
+int player::hurt(const actor *agent, int amount, beam_type flavour)
{
const monsters *mon = dynamic_cast<const monsters*>(agent);
if (agent->atype() == ACT_MONSTER)