diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-26 17:05:38 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-26 17:05:38 +0000 |
commit | 5c6b5260c78682faae4822494a61ccb173117d85 (patch) | |
tree | 5d7bc2cbf8b7d6c00ef2e8a2ba28b761cbcf4e64 | |
parent | c96ad74301106bbc2163c96ae96590c23feb4a59 (diff) | |
download | crawl-ref-5c6b5260c78682faae4822494a61ccb173117d85.tar.gz crawl-ref-5c6b5260c78682faae4822494a61ccb173117d85.zip |
Add a blessing that sends in a small number of reinforcements, and have
a chance of using it when the random follower chosen for blessing turns
out to be you.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3885 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/religion.cc | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index fa589cbd20..e1cd14bc95 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -759,6 +759,20 @@ static void give_nemelex_gift() } } +static bool blessing_reinforcements(void) +{ + // Possible follower band leaders. + const monster_type followers[] = { + MONS_ORC, MONS_ORC_WARRIOR + }; + + monster_type follower_type = + followers[random2(ARRAYSIZE(followers))]; + + return (create_monster(follower_type, 0, BEH_GOD_GIFT, you.x_pos, + you.y_pos, MHITYOU, MONS_PROGRAM_BUG, true) != -1); +} + static bool blessing_priesthood(monsters* mon) { monster_type priest_type = MONS_PROGRAM_BUG; @@ -858,6 +872,11 @@ void bless_follower(god_type god, monsters *mon; + std::string blessed; + std::string result; + + int chance = random2(20); + // If a follower was specified, and it's suitable, pick it. if (follower && suitable(follower)) mon = follower; @@ -866,18 +885,28 @@ void bless_follower(god_type god, { int monster = choose_random_nearby_monster(0, suitable); + // If the follower chosen was you, either send reinforcements or + // get out. if (monster == NON_MONSTER) + { + if (chance == 0) + { + if (blessing_reinforcements()) + { + blessed = "you"; + result = "reinforcements"; + goto blessing_done; + } + } + return; + } mon = &menv[monster]; } - std::string blessed = (follower && !mons_near(follower)) - ? "a follower" - : mon->name(DESC_NOCAP_A).c_str(); - std::string result; - - int chance = random2(20); + blessed = (follower && !mons_near(follower)) ? "a follower" + : mon->name(DESC_NOCAP_A).c_str(); // Turn a monster into a priestly monster, if possible. if (chance == 0) @@ -929,13 +958,14 @@ void bless_follower(god_type god, } } - // 90% chance: either removal of harmful ailments... + // Either remove harmful ailments from a monster... if (coinflip() && blessing_balms(mon)) { result = "divine balms"; goto blessing_done; } - // ...or full healing, optionally adding one extra hit point. + // ...or give it full healing, optionally giving it one extra hit + // point. else { bool healing = blessing_healing(mon, false); |