From: <dol...@us...> - 2008-10-30 19:08:41
|
Revision: 7312 http://crawl-ref.svn.sourceforge.net/crawl-ref/?rev=7312&view=rev Author: dolorous Date: 2008-10-30 19:08:31 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Add various holy being-related cleanups. Modified Paths: -------------- trunk/crawl-ref/source/mon-util.cc trunk/crawl-ref/source/monplace.cc trunk/crawl-ref/source/monplace.h trunk/crawl-ref/source/religion.cc trunk/crawl-ref/source/spells2.cc trunk/crawl-ref/source/spells2.h Modified: trunk/crawl-ref/source/mon-util.cc =================================================================== --- trunk/crawl-ref/source/mon-util.cc 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/mon-util.cc 2008-10-30 19:08:31 UTC (rev 7312) @@ -4960,7 +4960,7 @@ int monsters::holy_aura() const { - return ((type == MONS_DAEVA || type == MONS_ANGEL) ? hit_dice : 0); + return (mons_is_holy(this) ? hit_dice : 0); } bool monsters::has_spell(spell_type spell) const Modified: trunk/crawl-ref/source/monplace.cc =================================================================== --- trunk/crawl-ref/source/monplace.cc 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/monplace.cc 2008-10-30 19:08:31 UTC (rev 7312) @@ -2291,12 +2291,8 @@ switch (hbct) { - case HOLY_BEING_ZIN: - mon = MONS_ANGEL; - break; - case HOLY_BEING_TSO: - mon = MONS_DAEVA; + mon = coinflip() ? MONS_DAEVA : MONS_ANGEL; break; default: Modified: trunk/crawl-ref/source/monplace.h =================================================================== --- trunk/crawl-ref/source/monplace.h 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/monplace.h 2008-10-30 19:08:31 UTC (rev 7312) @@ -76,8 +76,7 @@ enum holy_being_class_type { - HOLY_BEING_ZIN, // 0: Angel - HOLY_BEING_TSO, // 1: Daeva + HOLY_BEING_TSO, // 0: Daeva or Angel HOLY_BEING_RANDOM // any of the above }; Modified: trunk/crawl-ref/source/religion.cc =================================================================== --- trunk/crawl-ref/source/religion.cc 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/religion.cc 2008-10-30 19:08:31 UTC (rev 7312) @@ -3536,26 +3536,30 @@ { const god_type god = GOD_SHINING_ONE; - // daevas/cleansing theme + // holy warriors/cleansing theme int punishment = random2(7); switch (punishment) { case 0: case 1: - case 2: // summon daevas (3/7) + case 2: // summon holy warriors (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 (create_monster( - mgen_data::hostile_at(coinflip() ? MONS_ANGEL : MONS_DAEVA, - you.pos(), 0, 0, true, god)) != -1) + if (coinflip()) { - success = true; + if (summon_daeva(100, god, true, true, true)) + success = true; } + else + { + if (summon_angel(100, god, true, true, true)) + success = true; + } } simple_god_message(success ? " sends the divine host to punish " @@ -3646,12 +3650,8 @@ for (int i = 0; i < how_many; ++i) { - if (create_monster( - mgen_data::hostile_at(MONS_ANGEL, - you.pos(), 0, 0, true, god)) != -1) - { + if (summon_angel(100, god, true, true, true)) success = true; - } } simple_god_message(success ? " sends the divine host to punish " Modified: trunk/crawl-ref/source/spells2.cc =================================================================== --- trunk/crawl-ref/source/spells2.cc 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/spells2.cc 2008-10-30 19:08:31 UTC (rev 7312) @@ -1614,11 +1614,9 @@ return (true); } -static bool _summon_holy_being_wrapper(int pow, god_type god, - monster_type mon, bool quiet) +static bool _summon_holy_being_wrapper(god_type god, monster_type mon, int dur, + bool friendly, bool quiet) { - const int dur = std::min(2 + (random2(pow) / 4), 6); - const int monster = create_monster( mgen_data(mon, BEH_FRIENDLY, dur, @@ -1633,25 +1631,35 @@ 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 %slight.", + (mon == MONS_DAEVA) ? "golden " : + (mon == MONS_ANGEL) ? "white " + : ""); } + player_angers_monster(&menv[monster]); return (true); } // TSO sends an angel for a follower. -bool summon_angel(int pow, god_type god, bool quiet) +bool summon_angel(int pow, god_type god, bool quiet, + bool force_hostile, bool permanent) { - return _summon_holy_being_wrapper(pow, god, MONS_ANGEL, quiet); + int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0; + + return _summon_holy_being_wrapper(god, MONS_ANGEL, dur, !force_hostile, + quiet); } // TSO sends a daeva for a follower. -bool summon_daeva(int pow, god_type god, bool quiet) +bool summon_daeva(int pow, god_type god, bool quiet, + bool force_hostile, bool permanent) { - return _summon_holy_being_wrapper(pow, god, MONS_DAEVA, quiet); + int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0; + + return _summon_holy_being_wrapper(god, MONS_DAEVA, dur, !force_hostile, + quiet); } bool cast_tukimas_dance(int pow, god_type god, Modified: trunk/crawl-ref/source/spells2.h =================================================================== --- trunk/crawl-ref/source/spells2.h 2008-10-30 19:06:26 UTC (rev 7311) +++ trunk/crawl-ref/source/spells2.h 2008-10-30 19:08:31 UTC (rev 7312) @@ -63,9 +63,10 @@ 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 summon_daeva(int pow, god_type god = GOD_NO_GOD, bool quiet = 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 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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |