summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.com>2009-10-16 17:50:20 +1000
committerRobert Vollmert <rvollmert@gmx.net>2009-10-16 10:15:50 +0200
commitdce44e60507ec723f3cf94cdeadc6762ee492786 (patch)
treeaf5aafc95a487b586d7a7f4a9411ab4758179a0a /crawl-ref/source/spells2.cc
parent6525d257d208e990f5d62213adf6a062943e6626 (diff)
downloadcrawl-ref-dce44e60507ec723f3cf94cdeadc6762ee492786.tar.gz
crawl-ref-dce44e60507ec723f3cf94cdeadc6762ee492786.zip
Resolve issues with monster-cast refrig/radiance kills being assigned to player.
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc25
1 files changed, 20 insertions, 5 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index c2d4478462..230386026d 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -511,10 +511,19 @@ static std::string _describe_monsters(const counted_monster_list &list)
// assumes only you can cast this spell (or would want to).
void cast_toxic_radiance(bool monster_cast)
{
+ kill_category kc;
+
if (monster_cast)
+ {
mpr("Sickly green light fills the air!");
+ // Friendlies will never cast this.
+ kc = KC_OTHER;
+ }
else
+ {
mpr("You radiate a sickly green light!");
+ kc = KC_YOU;
+ }
you.flash_colour = GREEN;
viewwindow(true, false);
@@ -546,9 +555,9 @@ void cast_toxic_radiance(bool monster_cast)
if (!monster->has_ench(ENCH_INVIS))
{
bool affected =
- poison_monster(monster, KC_YOU, 1, false, false);
+ poison_monster(monster, kc, 1, false, false);
- if (coinflip() && poison_monster(monster, KC_YOU, false, false))
+ if (coinflip() && poison_monster(monster, kc, false, false))
affected = true;
if (affected)
@@ -580,7 +589,7 @@ void cast_toxic_radiance(bool monster_cast)
}
}
-void cast_refrigeration(int pow)
+void cast_refrigeration(int pow, bool monster_cast)
{
mpr("The heat is drained from your surroundings.");
@@ -637,7 +646,10 @@ void cast_refrigeration(int pow)
// Set up the cold attack.
bolt beam;
beam.flavour = BEAM_COLD;
- beam.thrower = KILL_YOU;
+ if (monster_cast)
+ beam.thrower = KILL_MON;
+ else
+ beam.thrower = KILL_YOU;
for (int i = 0; i < MAX_MONSTERS; i++)
{
@@ -649,7 +661,10 @@ void cast_refrigeration(int pow)
{
// Calculate damage and apply.
int hurt = mons_adjust_flavoured(monster, beam, dam_dice.roll());
- monster->hurt(&you, hurt, BEAM_COLD);
+ if (monster_cast)
+ monster->hurt(NULL, hurt, BEAM_COLD);
+ else
+ monster->hurt(&you, hurt, BEAM_COLD);
// Cold-blooded creatures can be slowed.
if (monster->alive()