diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/monplace.h | 20 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 44 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 52 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 4 |
5 files changed, 64 insertions, 63 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 432b80175f..6172e1f1ae 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -60,6 +60,7 @@ #include "spells1.h" #include "spells3.h" #include "spells4.h" +#include "state.h" #include "stuff.h" #include "terrain.h" #include "traps.h" @@ -3501,9 +3502,13 @@ static void _affect_place_explosion_clouds(bolt &beam, int x, int y) if (grd[x][y] == DNGN_FLOOR && mgrd[x][y] == NON_MONSTER && one_chance_in(4)) { + const god_type god = + (crawl_state.is_god_acting()) ? crawl_state.which_god_acting() + : GOD_NO_GOD; + mons_place( mgen_data::hostile_at( - MONS_FIRE_VORTEX, coord_def(x, y))); + MONS_FIRE_VORTEX, coord_def(x, y), 0, 0, false, god)); } } } diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index f0898245a2..bbba9f3c3f 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -216,19 +216,15 @@ struct mgen_data } static mgen_data hostile_at(monster_type what, - const coord_def &where) - { - return mgen_data(what, BEH_HOSTILE, 0, where); - } - - static mgen_data alert_hostile_at(monster_type what, - const coord_def &where, - int abj_deg = 0, - unsigned flags = 0, - god_type god = GOD_NO_GOD) + const coord_def &where, + int abj_deg = 0, + unsigned flags = 0, + bool alert = false, + god_type god = GOD_NO_GOD) { - return mgen_data(what, BEH_HOSTILE, abj_deg, where, MHITYOU, flags, - god); + return mgen_data(what, BEH_HOSTILE, abj_deg, where, + alert ? MHITYOU : MHITNOT, + flags, god); } }; diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index ebf82db292..c4c1975eb7 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3037,8 +3037,8 @@ static bool _tso_retribution() for (int i = 0; i < how_many; ++i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_DAEVA, - you.pos(), 0, 0, GOD_SHINING_ONE)) != -1) + mgen_data::hostile_at(MONS_DAEVA, + you.pos(), 0, 0, true, GOD_SHINING_ONE)) != -1) { success = true; } @@ -3138,8 +3138,8 @@ static bool _zin_retribution() for (int i = 0; i < how_many; ++i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_ANGEL, - you.pos(), 0, 0, GOD_ZIN)) != -1) + mgen_data::hostile_at(MONS_ANGEL, + you.pos(), 0, 0, true, GOD_ZIN)) != -1) { success = true; } @@ -3300,10 +3300,10 @@ static bool _makhleb_retribution() if (random2(you.experience_level) > 7 && !one_chance_in(5)) { bool success = (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( static_cast<monster_type>( MONS_EXECUTIONER + random2(5)), - you.pos(), 0, 0, GOD_MAKHLEB)) != -1); + you.pos(), 0, 0, true, GOD_MAKHLEB)) != -1); simple_god_message(success ? " sends a greater servant after you!" : @@ -3318,10 +3318,10 @@ static bool _makhleb_retribution() for (int i = 0; i < how_many; ++i) { if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( static_cast<monster_type>( MONS_NEQOXEC + random2(5)), - you.pos(), 0, 0, GOD_MAKHLEB)) != -1) + you.pos(), 0, 0, true, GOD_MAKHLEB)) != -1) { count++; } @@ -3348,8 +3348,8 @@ static bool _kikubaaqudgha_retribution() for (int i = 0; i < how_many; ++i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_REAPER, - you.pos(), 0, 0, GOD_KIKUBAAQUDGHA)) != -1) + mgen_data::hostile_at(MONS_REAPER, + you.pos(), 0, 0, true, GOD_KIKUBAAQUDGHA)) != -1) { success = true; } @@ -3387,8 +3387,8 @@ static bool _yredelemnul_retribution() monster_type punisher = _random_servant(GOD_YREDELEMNUL); if (create_monster( - mgen_data::alert_hostile_at(punisher, - you.pos(), 0, 0, GOD_YREDELEMNUL)) != -1) + mgen_data::hostile_at(punisher, + you.pos(), 0, 0, true, GOD_YREDELEMNUL)) != -1) { count++; } @@ -3552,8 +3552,8 @@ static bool _beogh_retribution() // Now create monster. int mons = create_monster( - mgen_data::alert_hostile_at(MONS_DANCING_WEAPON, - you.pos(), 0, 0, GOD_BEOGH)); + mgen_data::hostile_at(MONS_DANCING_WEAPON, + you.pos(), 0, 0, true, GOD_BEOGH)); // Hand item information over to monster. if (mons != -1) @@ -3607,8 +3607,8 @@ static bool _beogh_retribution() punisher = MONS_ORC; int mons = create_monster( - mgen_data::alert_hostile_at(punisher, - you.pos(), 0, MG_PERMIT_BANDS, GOD_BEOGH)); + mgen_data::hostile_at(punisher, + you.pos(), 0, MG_PERMIT_BANDS, true, GOD_BEOGH)); // sometimes name band leader if (mons != -1 && one_chance_in(3)) @@ -3637,8 +3637,8 @@ static bool _okawaru_retribution() monster_type punisher = _random_servant(GOD_OKAWARU); if (create_monster( - mgen_data::alert_hostile_at(punisher, - you.pos(), 0, 0, GOD_OKAWARU)) != -1) + mgen_data::hostile_at(punisher, + you.pos(), 0, 0, true, GOD_OKAWARU)) != -1) { success = true; } @@ -3728,10 +3728,10 @@ static bool _lugonu_retribution() if (random2(you.experience_level) > 7 && !one_chance_in(5)) { bool success = (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( static_cast<monster_type>( MONS_GREEN_DEATH + random2(3)), - you.pos(), 0, 0, GOD_LUGONU)) != -1); + you.pos(), 0, 0, true, GOD_LUGONU)) != -1); simple_god_message(success ? " sends a demon after you!" : @@ -3746,10 +3746,10 @@ static bool _lugonu_retribution() for (int loopy = 0; loopy < how_many; loopy++) { if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( static_cast<monster_type>( MONS_NEQOXEC + random2(5)), - you.pos(), 0, 0, GOD_LUGONU)) != -1) + you.pos(), 0, 0, true, GOD_LUGONU)) != -1) { success = true; } diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 0b989d42de..a86681a523 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2404,8 +2404,8 @@ static void _miscast_translocation(int severity, const char* cause) break; case 5: if (create_monster( - mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3, 0, god)) != -1) + mgen_data::hostile_at(MONS_SPATIAL_VORTEX, + you.pos(), 3, 0, false, god)) != -1) { mpr("Space twists in upon itself!"); } @@ -2443,8 +2443,8 @@ static void _miscast_translocation(int severity, const char* cause) for (int i = 1 + random2(3); i >= 0; --i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3, 0, god)) != -1) + mgen_data::hostile_at(MONS_SPATIAL_VORTEX, + you.pos(), 3, 0, false, god)) != -1) { success = true; } @@ -2546,8 +2546,8 @@ static void _miscast_summoning(int severity, const char* cause) break; case 3: if (create_monster( - mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3, 0, god)) != -1) + mgen_data::hostile_at(MONS_SPATIAL_VORTEX, + you.pos(), 3, 0, false, god)) != -1) { mpr("Space twists in upon itself!"); } @@ -2557,9 +2557,9 @@ static void _miscast_summoning(int severity, const char* cause) case 4: case 5: if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( summon_any_demon(DEMON_LESSER), - you.pos(), 5, 0, god)) != -1) + you.pos(), 5, 0, true, god)) != -1) { mpr("Something appears in a flash of light!"); } @@ -2579,8 +2579,8 @@ static void _miscast_summoning(int severity, const char* cause) for (int i = 1 + random2(3); i >= 0; --i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_SPATIAL_VORTEX, - you.pos(), 3, 0, god)) != -1) + mgen_data::hostile_at(MONS_SPATIAL_VORTEX, + you.pos(), 3, 0, false, god)) != -1) { success = true; } @@ -2596,9 +2596,9 @@ static void _miscast_summoning(int severity, const char* cause) case 1: case 2: if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( summon_any_demon(DEMON_COMMON), - you.pos(), 5, 0, god)) != -1) + you.pos(), 5, 0, true, god)) != -1) { mpr("Something forms out of thin air!"); } @@ -2615,9 +2615,9 @@ static void _miscast_summoning(int severity, const char* cause) for (int i = 1 + random2(2); i >= 0; --i) { if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( summon_any_demon(DEMON_LESSER), - you.pos(), 5, 0, god)) != -1) + you.pos(), 5, 0, true, god)) != -1) { success = true; } @@ -2637,8 +2637,8 @@ static void _miscast_summoning(int severity, const char* cause) { case 0: if (create_monster( - mgen_data::alert_hostile_at(MONS_ABOMINATION_SMALL, - you.pos(), 0, 0, god)) != -1) + mgen_data::hostile_at(MONS_ABOMINATION_SMALL, + you.pos(), 0, 0, true, god)) != -1) { mpr("Something forms out of thin air."); } @@ -2648,9 +2648,9 @@ static void _miscast_summoning(int severity, const char* cause) case 1: if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( summon_any_demon(DEMON_GREATER), - you.pos(), 0, 0, god)) != -1) + you.pos(), 0, 0, true, god)) != -1) { mpr("You sense a hostile presence."); } @@ -2665,9 +2665,9 @@ static void _miscast_summoning(int severity, const char* cause) for (int i = 1 + random2(2); i >= 0; --i) { if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( summon_any_demon(DEMON_COMMON), - you.pos(), 3, 0, god)) != -1) + you.pos(), 3, 0, true, god)) != -1) { success = true; } @@ -2897,8 +2897,8 @@ static void _miscast_necromancy(int severity, const char* cause) for (int i = random2(3); i >= 0; --i) { if (create_monster( - mgen_data::alert_hostile_at(MONS_SHADOW, - you.pos(), 2, 0, god)) != -1) + mgen_data::hostile_at(MONS_SHADOW, + you.pos(), 2, 0, true, god)) != -1) { success = true; } @@ -2962,8 +2962,8 @@ static void _miscast_necromancy(int severity, const char* cause) case 4: if (create_monster( - mgen_data::alert_hostile_at(MONS_SOUL_EATER, - you.pos(), 4, 0, god)) != -1) + mgen_data::hostile_at(MONS_SOUL_EATER, + you.pos(), 4, 0, true, god)) != -1) { mpr("Something reaches out for you..."); } @@ -2973,8 +2973,8 @@ static void _miscast_necromancy(int severity, const char* cause) case 5: if (create_monster( - mgen_data::alert_hostile_at(MONS_REAPER, - you.pos(), 4, 0, god)) != -1) + mgen_data::hostile_at(MONS_REAPER, + you.pos(), 4, 0, true, god)) != -1) { mpr("Death has come for you..."); } diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 00e3a55772..a3abecb91e 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -856,9 +856,9 @@ static bool xom_is_bad(int sever) for (int i = 0; i < numdemons; ++i) { if (create_monster( - mgen_data::alert_hostile_at( + mgen_data::hostile_at( xom_random_punishment_demon(sever), - you.pos(), 4, 0, GOD_XOM)) != -1) + you.pos(), 4, 0, true, GOD_XOM)) != -1) { success = true; } |