diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-08 01:56:07 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-08 01:56:07 +0000 |
commit | bd833f217fbc73d4b2632af11b9763c2b824ee1d (patch) | |
tree | e05790ec8344787ea2b5b4ad880640354ecfab4e /crawl-ref | |
parent | 9feee37f14ac85ba2fe1d1b77da6eeacb37ada93 (diff) | |
download | crawl-ref-bd833f217fbc73d4b2632af11b9763c2b824ee1d.tar.gz crawl-ref-bd833f217fbc73d4b2632af11b9763c2b824ee1d.zip |
Revert some of the previous simplifications, as they make other things
more complicated.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5570 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 46 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 58 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 12 |
4 files changed, 59 insertions, 63 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 3a35f4ac77..040c579c5d 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1456,7 +1456,7 @@ static bool _do_ability(const ability_def& abil) break; case ABIL_KIKU_INVOKE_DEATH: - summon_demon(MONS_REAPER, 20 + you.skills[SK_INVOCATIONS] * 3); + summon_demon(MONS_REAPER, 20 + you.skills[SK_INVOCATIONS] * 3, true); exercise(SK_INVOCATIONS, 10 + random2(14)); break; @@ -1537,7 +1537,7 @@ static bool _do_ability(const ability_def& abil) case ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB: summon_demon(static_cast<monster_type>(MONS_NEQOXEC + random2(5)), - 20 + you.skills[SK_INVOCATIONS] * 3); + 20 + you.skills[SK_INVOCATIONS] * 3, true); exercise(SK_INVOCATIONS, 2 + random2(3)); break; @@ -1596,7 +1596,7 @@ static bool _do_ability(const ability_def& abil) case ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB: summon_demon(static_cast<monster_type>(MONS_EXECUTIONER + random2(5)), - 20 + you.skills[SK_INVOCATIONS] * 3); + 20 + you.skills[SK_INVOCATIONS] * 3, true); exercise(SK_INVOCATIONS, 6 + random2(6)); break; diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index e0234b84c4..06db49b25d 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3016,7 +3016,9 @@ static bool _tso_retribution() for (int i = 0; i < how_many; ++i) { - if (summon_daeva(0, true, true, true)) + if (create_monster( + mgen_data::alert_hostile_at(MONS_DAEVA, + you.pos(), MF_GOD_GIFT)) != -1) { success = true; } @@ -3115,7 +3117,9 @@ static bool _zin_retribution() for (int i = 0; i < how_many; ++i) { - if (summon_guardian(0, true, true, true)) + if (create_monster( + mgen_data::alert_hostile_at(MONS_ANGEL, + you.pos(), MF_GOD_GIFT)) != -1) { success = true; } @@ -3275,10 +3279,11 @@ static bool _makhleb_retribution() if (random2(you.experience_level) > 7 && !one_chance_in(5)) { - bool success = - summon_demon( - static_cast<monster_type>(MONS_EXECUTIONER + random2(5)), - 0, true, true, true); + bool success = (create_monster( + mgen_data::alert_hostile_at( + static_cast<monster_type>( + MONS_EXECUTIONER + random2(5)), + you.pos(), MF_GOD_GIFT)) != -1); simple_god_message(success ? " sends a greater servant after you!" : @@ -3292,9 +3297,11 @@ static bool _makhleb_retribution() for (int i = 0; i < how_many; ++i) { - if (summon_demon( - static_cast<monster_type>(MONS_NEQOXEC + random2(5)), - 0, true, true, true)) + if (create_monster( + mgen_data::alert_hostile_at( + static_cast<monster_type>( + MONS_NEQOXEC + random2(5)), + you.pos(), MF_GOD_GIFT)) != -1) { count++; } @@ -3320,7 +3327,9 @@ static bool _kikubaaqudgha_retribution() for (int i = 0; i < how_many; ++i) { - if (summon_demon(MONS_REAPER, 0, true, true, true)) + if (create_monster( + mgen_data::alert_hostile_at(MONS_REAPER, + you.pos(), MF_GOD_GIFT)) != -1) { success = true; } @@ -3698,10 +3707,11 @@ static bool _lugonu_retribution() if (random2(you.experience_level) > 7 && !one_chance_in(5)) { - bool success = - summon_demon( - static_cast<monster_type>(MONS_GREEN_DEATH + random2(3)), - 0, true, true, true); + bool success = (create_monster( + mgen_data::alert_hostile_at( + static_cast<monster_type>( + MONS_GREEN_DEATH + random2(3)), + you.pos(), MF_GOD_GIFT)) != -1); simple_god_message(success ? " sends a demon after you!" : @@ -3715,9 +3725,11 @@ static bool _lugonu_retribution() for (int loopy = 0; loopy < how_many; loopy++) { - if (summon_demon( - static_cast<monster_type>(MONS_NEQOXEC + random2(5)), - 0, true, true, true)) + if (create_monster( + mgen_data::alert_hostile_at( + static_cast<monster_type>( + MONS_NEQOXEC + random2(5)), + you.pos(), MF_GOD_GIFT)) != -1) { success = true; } diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index c9598cd7c4..0711a6e37b 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1551,7 +1551,7 @@ bool summon_elemental(int pow, int restricted_type, mgen_data(mon, friendly ? BEH_FRIENDLY : BEH_HOSTILE, numsc, coord_def(targ_x, targ_y), - friendly ? you.pet_target : MHITYOU )) != -1) + friendly ? you.pet_target : MHITYOU)) != -1) { return (false); } @@ -2087,21 +2087,20 @@ bool summon_common_demon(int pow, bool god_gift) } // One of the demon-associated gods sends a demon for a follower. -bool summon_demon(monster_type mon, int pow, bool force_hostile, - bool quiet, bool permanent) +bool summon_demon(monster_type mon, int pow, bool god_gift) { bool success = false; const int dur = std::min(2 + (random2(pow) / 4), 6); - const bool friendly = (force_hostile) ? false : (random2(pow) > 3); + const bool friendly = (random2(pow) > 3); if (create_monster( mgen_data(mon, friendly ? BEH_FRIENDLY : BEH_HOSTILE, dur, you.pos(), friendly ? you.pet_target : MHITYOU, - MF_GOD_GIFT)) != -1) + god_gift ? MF_GOD_GIFT : 0)) != -1) { success = true; @@ -2115,7 +2114,7 @@ bool summon_demon(monster_type mon, int pow, bool force_hostile, } // Trog sends a fighting buddy (or enemy) for a follower. -bool summon_berserker(int pow, bool force_hostile) +bool summon_berserker(int pow, bool god_gift, bool force_hostile) { bool success = false; @@ -2169,7 +2168,7 @@ bool summon_berserker(int pow, bool force_hostile) !force_hostile ? BEH_FRIENDLY : BEH_HOSTILE, dur, you.pos(), !force_hostile ? you.pet_target : MHITYOU, - MF_GOD_GIFT)); + god_gift ? MF_GOD_GIFT : 0)); if (monster != -1) { @@ -2193,29 +2192,23 @@ bool summon_berserker(int pow, bool force_hostile) return (success); } -static bool _summon_holy_being_wrapper(int pow, holy_being_class_type hbct, - bool force_hostile, bool quiet, - bool permanent) +static bool _summon_holy_being_wrapper(int pow, bool god_gift, + holy_being_class_type hbct) { bool success = false; monster_type mon = summon_any_holy_being(hbct); - const int dur = (permanent) ? 0 : std::min(2 + (random2(pow) / 4), 6); + const int dur = std::min(2 + (random2(pow) / 4), 6); - if (!quiet) - { - mprf("You open a gate to %s's realm!", - (mon == MONS_DAEVA) ? god_name(GOD_SHINING_ONE).c_str() - : god_name(GOD_ZIN).c_str()); - } + mprf("You open a gate to %s's realm!", + (mon == MONS_DAEVA) ? god_name(GOD_SHINING_ONE).c_str() + : god_name(GOD_ZIN).c_str()); int monster = create_monster( - mgen_data(mon, - !force_hostile ? BEH_FRIENDLY : BEH_HOSTILE, - dur, you.pos(), - !force_hostile ? you.pet_target : MHITYOU, - MF_GOD_GIFT)); + mgen_data(mon, BEH_FRIENDLY, dur, you.pos(), + you.pet_target, + god_gift ? MF_GOD_GIFT : 0)); if (monster != -1) { success = true; @@ -2223,31 +2216,24 @@ static bool _summon_holy_being_wrapper(int pow, holy_being_class_type hbct, monsters *summon = &menv[monster]; summon->flags |= MF_ATT_CHANGE_ATTEMPT; - if (!quiet) - { - mprf("You are momentarily dazzled by a brilliant %s light.", - (mon == MONS_DAEVA) ? "golden" - : "white"); - } + mprf("You are momentarily dazzled by a brilliant %s light.", + (mon == MONS_DAEVA) ? "golden" + : "white"); } return (success); } // Zin sends an angel for a follower. -bool summon_guardian(int pow, bool force_hostile, bool quiet, - bool permanent) +bool summon_guardian(int pow, bool god_gift) { - return _summon_holy_being_wrapper(pow, HOLY_BEING_ANGEL, force_hostile, - quiet, permanent); + return _summon_holy_being_wrapper(pow, god_gift, HOLY_BEING_ANGEL); } // TSO sends a daeva for a follower. -bool summon_daeva(int pow, bool force_hostile, bool quiet, - bool permanent) +bool summon_daeva(int pow, bool god_gift) { - return _summon_holy_being_wrapper(pow, HOLY_BEING_DAEVA, force_hostile, - quiet, permanent); + return _summon_holy_being_wrapper(pow, god_gift, HOLY_BEING_DAEVA); } void summon_things(int pow) diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index d2f3683581..4ac7873b5c 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -169,16 +169,14 @@ bool summon_minor_demon(int pow, bool god_gift = false); bool summon_common_demon(int pow, bool god_gift = false); -bool summon_demon(monster_type mon, int pow, bool force_hostile = false, - bool quiet = false, bool permanent = false); +bool summon_demon(monster_type mon, int pow, bool god_gift = false); -bool summon_berserker(int pow, bool force_hostile = false); +bool summon_berserker(int pow, bool god_gift = false, + bool force_hostile = false); -bool summon_guardian(int pow, bool force_hostile = false, bool quiet = false, - bool permanent = false); +bool summon_guardian(int pow, bool god_gift = false); -bool summon_daeva(int pow, bool force_hostile = false, bool quiet = false, - bool permanent = false); +bool summon_daeva(int pow, bool god_gift = false); // last updated 24may2000 {dlb} /* *********************************************************************** |