diff options
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 25 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 2 |
3 files changed, 22 insertions, 7 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index 75532cac3f..2990b06a52 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -486,7 +486,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, if (!monsterNearby || mons_friendly(monster)) return; - cast_refrigeration(random2(12 * monster->hit_dice)); + cast_refrigeration(random2(12 * monster->hit_dice), true); return; case SPELL_OLGREBS_TOXIC_RADIANCE: 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() diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 0fee00e019..3e9eeab5f7 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -23,7 +23,7 @@ bool vampiric_drain(int pow, const dist &vmove); int detect_creatures(int pow, bool telepathic = false); int detect_items(int pow); int detect_traps(int pow); -void cast_refrigeration(int pow); +void cast_refrigeration(int pow, bool monster_cast = false); void cast_toxic_radiance(bool monster_cast = false); void drain_life(int pow); |