From 5e33fad9c14df165b32f3682af4b36b3db13c927 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 10 Jun 2008 22:56:45 +0000 Subject: After some more thought, remove the god gift exceptions for natural-phenomenon-type monsters. Fire vortices still need to be dealt with properly, though. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5716 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-data.h | 3 ++- crawl-ref/source/spells2.cc | 7 +++---- crawl-ref/source/spells2.h | 2 +- crawl-ref/source/spl-cast.cc | 27 ++++++++------------------- 4 files changed, 14 insertions(+), 25 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 5d4201287f..37b4d7bcfe 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -3725,7 +3725,8 @@ // ball lightning / orb of fire ('*') { MONS_BALL_LIGHTNING, '*', LIGHTCYAN, "ball lightning", - M_FLIES | M_CONFUSED | M_SPELLCASTER | M_SPECIAL_ABILITY | M_INSUBSTANTIAL, + M_FLIES | M_CONFUSED | M_SPELLCASTER | M_SPECIAL_ABILITY + | M_INSUBSTANTIAL, mrd(MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD, 3), 0, 20, MONS_BALL_LIGHTNING, MONS_BALL_LIGHTNING, MH_NONLIVING, MAG_IMMUNE, { {AT_HIT, AF_PLAIN, 5}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index ebb3fe3c99..4346627113 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1842,9 +1842,7 @@ bool cast_tukimas_dance(int pow, bool god_gift, return (true); } -// God gift exception: Ball lightning is a natural phenomenon treated as -// a monster, so don't mark it as a god gift. -bool cast_conjure_ball_lightning(int pow) +bool cast_conjure_ball_lightning(int pow, bool god_gift) { bool success = false; @@ -1875,7 +1873,8 @@ bool cast_conjure_ball_lightning(int pow) int monster = mons_place( mgen_data(MONS_BALL_LIGHTNING, BEH_FRIENDLY, 0, - coord_def(tx, ty), MHITNOT)); + coord_def(tx, ty), MHITNOT, + god_gift ? MG_GOD_GIFT : 0)); if (monster != -1) { diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 95f78bd93d..d8d62c9f27 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -157,7 +157,7 @@ bool cast_tukimas_dance(int pow, bool god_gift = false, /* *********************************************************************** * called from: ability - spell * *********************************************************************** */ -bool cast_conjure_ball_lightning(int pow); +bool cast_conjure_ball_lightning(int pow, bool god_gift = false); // last updated 24may2000 {dlb} /* *********************************************************************** diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 9ed1257a97..b6617d6779 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1476,9 +1476,7 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) break; case SPELL_CONJURE_BALL_LIGHTNING: - // God gift exception: Ball lightning is a natural phenomenon - // treated as a monster, so don't mark it as a god gift. - cast_conjure_ball_lightning(powc); + cast_conjure_ball_lightning(powc, god_gift); break; case SPELL_CALL_IMP: @@ -2340,6 +2338,9 @@ static void _miscast_enchantment(int severity, const char* cause) static void _miscast_translocation(int severity, const char* cause) { + const bool god_gift = crawl_state.is_god_acting(); + const unsigned flags = (god_gift) ? MG_GOD_GIFT : 0; + switch (severity) { case 0: // harmless messages only @@ -2394,12 +2395,9 @@ static void _miscast_translocation(int severity, const char* cause) ouch(4 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause); break; case 5: - // God gift exception: A spatial vortex is a natural - // phenomenon treated as a monster, so don't mark it as a - // god gift. if (create_monster( mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3)) != -1) + you.pos(), 3, flags)) != -1) { mpr("Space twists in upon itself!"); } @@ -2434,14 +2432,11 @@ static void _miscast_translocation(int severity, const char* cause) { bool success = false; - // God gift exception: A spatial vortex is a natural - // phenomenon treated as a monster, so don't mark it as a - // god gift. for (int i = 1 + random2(3); i >= 0; --i) { if (create_monster( mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3)) != -1) + you.pos(), 3, flags)) != -1) { success = true; } @@ -2541,12 +2536,9 @@ static void _miscast_summoning(int severity, const char* cause) ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause); break; case 3: - // God gift exception: A spatial vortex is a natural - // phenomenon treated as a monster, so don't mark it as a - // god gift. if (create_monster( mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3)) != -1) + you.pos(), 3, flags)) != -1) { mpr("Space twists in upon itself!"); } @@ -2575,14 +2567,11 @@ static void _miscast_summoning(int severity, const char* cause) { bool success = false; - // God gift exception: A spatial vortex is a natural - // phenomenon treated as a monster, so don't mark it as a - // god gift. for (int i = 1 + random2(3); i >= 0; --i) { if (create_monster( mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3)) != -1) + you.pos(), 3, flags)) != -1) { success = true; } -- cgit v1.2.3-54-g00ecf