From 8011d5b9610bd259faa1604db0a4400edf6a3f40 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 30 Oct 2008 20:02:49 +0000 Subject: Add more holy being-related cleanups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7315 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 5 +---- crawl-ref/source/monplace.cc | 2 +- crawl-ref/source/monplace.h | 2 +- crawl-ref/source/religion.cc | 23 ++++++++++++----------- crawl-ref/source/spells2.cc | 33 +++++++++++++++++++-------------- crawl-ref/source/spells2.h | 8 ++++---- crawl-ref/source/spells3.cc | 2 -- crawl-ref/source/spl-cast.cc | 4 ++-- 8 files changed, 40 insertions(+), 39 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index e81fe3deb0..5327b69350 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1468,10 +1468,7 @@ static bool _do_ability(const ability_def& abil) break; case ABIL_TSO_SUMMON_DIVINE_WARRIOR: - if (coinflip()) - summon_angel(you.skills[SK_INVOCATIONS] * 4, GOD_SHINING_ONE); - else - summon_daeva(you.skills[SK_INVOCATIONS] * 4, GOD_SHINING_ONE); + summon_holy_warrior(you.skills[SK_INVOCATIONS] * 4, GOD_SHINING_ONE); exercise(SK_INVOCATIONS, 8 + random2(10)); break; diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 9f1299d5da..6f440d0036 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -2291,7 +2291,7 @@ monster_type summon_any_holy_being(holy_being_class_type hbct) switch (hbct) { - case HOLY_BEING_TSO: + case HOLY_BEING_WARRIOR: mon = coinflip() ? MONS_DAEVA : MONS_ANGEL; break; diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index 4c489686b4..d17c6938a8 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -76,7 +76,7 @@ enum demon_class_type enum holy_being_class_type { - HOLY_BEING_TSO, // 0: Daeva or Angel + HOLY_BEING_WARRIOR, // 0: Daeva or Angel HOLY_BEING_RANDOM // any of the above }; diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 5fa56ac0e2..2d2d2e0986 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3536,29 +3536,26 @@ static bool _tso_retribution() { const god_type god = GOD_SHINING_ONE; - // holy warriors/cleansing theme + // holy beings/cleansing theme int punishment = random2(7); switch (punishment) { case 0: case 1: - case 2: // summon holy warriors (3/7) + case 2: // summon holy beings (3/7) { bool success = false; int how_many = 1 + random2(you.experience_level / 5) + random2(3); for (int i = 0; i < how_many; ++i) { - if (coinflip()) - { - if (summon_daeva(100, god, true, true, true)) - success = true; - } - else + if (create_monster( + mgen_data::hostile_at( + summon_any_holy_being(HOLY_BEING_RANDOM), + you.pos(), 0, 0, true, god)) != -1) { - if (summon_angel(100, god, true, true, true)) - success = true; + success = true; } } @@ -3650,8 +3647,12 @@ static bool _zin_retribution() for (int i = 0; i < how_many; ++i) { - if (summon_angel(100, god, true, true, true)) + if (create_monster( + mgen_data::hostile_at(MONS_ANGEL, + you.pos(), 0, 0, true, god)) != -1) + { success = true; + } } simple_god_message(success ? " sends the divine host to punish " diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 318eb43fc4..28222a96e1 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1616,9 +1616,11 @@ bool summon_berserker(int pow, god_type god, bool force_hostile) return (true); } -static bool _summon_holy_being_wrapper(god_type god, monster_type mon, int dur, - bool friendly, bool quiet) +static bool _summon_holy_being_wrapper(int pow, god_type god, monster_type mon, + int dur, bool friendly, bool quiet) { + UNUSED(pow); + const int monster = create_monster( mgen_data(mon, @@ -1646,24 +1648,27 @@ static bool _summon_holy_being_wrapper(god_type god, monster_type mon, int dur, return (true); } -// TSO sends an angel for a follower. -bool summon_angel(int pow, god_type god, bool quiet, - bool force_hostile, bool permanent) +static bool _summon_holy_being_wrapper(int pow, god_type god, + holy_being_class_type hbct, + int dur, bool friendly, bool quiet) { - int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0; + monster_type mon = summon_any_holy_being(hbct); - return _summon_holy_being_wrapper(god, MONS_ANGEL, dur, !force_hostile, - quiet); + return _summon_holy_being_wrapper(pow, god, mon, dur, friendly, quiet); } -// TSO sends a daeva for a follower. -bool summon_daeva(int pow, god_type god, bool quiet, - bool force_hostile, bool permanent) +bool summon_holy_warrior(int pow, god_type god, bool quiet) { - int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0; + return _summon_holy_being_wrapper(pow, god, HOLY_BEING_WARRIOR, + std::min(2 + (random2(pow) / 4), 6), + true, quiet); +} - return _summon_holy_being_wrapper(god, MONS_DAEVA, dur, !force_hostile, - quiet); +bool summon_holy_being_type(monster_type mon, int pow, god_type god) +{ + return _summon_holy_being_wrapper(pow, god, mon, + std::min(2 + (random2(pow) / 4), 6), + true, false); } bool cast_tukimas_dance(int pow, god_type god, diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 9f583b1030..6d8d4b9aaa 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -63,10 +63,10 @@ bool cast_summon_ugly_thing(int pow, god_type god = GOD_NO_GOD); bool cast_summon_dragon(int pow, god_type god = GOD_NO_GOD); bool summon_berserker(int pow, god_type god = GOD_NO_GOD, bool force_hostile = false); -bool summon_angel(int pow, god_type god = GOD_NO_GOD, bool quiet = false, - bool force_hostile = false, bool permanent = false); -bool summon_daeva(int pow, god_type god = GOD_NO_GOD, bool quiet = false, - bool force_hostile = false, bool permanent = false); +bool summon_holy_warrior(int pow, god_type god = GOD_NO_GOD, + bool quiet = false); +bool summon_holy_being_type(monster_type mon, int pow, + god_type god = GOD_NO_GOD); bool cast_tukimas_dance(int pow, god_type god = GOD_NO_GOD, bool force_hostile = false); bool cast_conjure_ball_lightning(int pow, god_type god = GOD_NO_GOD); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 55c7c46e3c..950e4a7f67 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -489,8 +489,6 @@ bool summon_greater_demon(int pow, god_type god, 5, false, random2(pow) > 5, quiet); } -// Makhleb or Kikubaaqudgha sends a demonic buddy (or enemy) for a -// follower. bool summon_demon_type(monster_type mon, int pow, god_type god) { return _summon_demon_wrapper(pow, god, mon, diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index d00bbb4241..2049738726 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1510,11 +1510,11 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) break; case SPELL_SUMMON_ANGEL: - summon_angel(powc, god); + summon_holy_being_type(MONS_ANGEL, powc, god); break; case SPELL_SUMMON_DAEVA: - summon_daeva(powc, god); + summon_holy_being_type(MONS_DAEVA, powc, god); break; case SPELL_TUKIMAS_DANCE: -- cgit v1.2.3-54-g00ecf