diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-12 08:05:12 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-12 08:05:12 +0000 |
commit | 21695abdc349e579845565976a72d5600a1f8c4a (patch) | |
tree | 81ce4d25a33513f9abe9b0979d9e928e36cb0fcb | |
parent | f14293feb83a9a1790c0e158697bf36634655188 (diff) | |
download | crawl-ref-21695abdc349e579845565976a72d5600a1f8c4a.tar.gz crawl-ref-21695abdc349e579845565976a72d5600a1f8c4a.zip |
Give Zin a one-shot ability at piety > 160 (cf. TSO's/Lugonu's weapon
blessings) to remove all mutations.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10173 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/abl-show.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/mutation.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 31 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 1 |
6 files changed, 60 insertions, 5 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index a76fad1eb3..520cd54255 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -225,6 +225,7 @@ static const ability_def Ability_List[] = { ABIL_ZIN_RECITE, "Recite", 3, 0, 120, 0, ABFLAG_DELAY }, { ABIL_ZIN_VITALISATION, "Vitalisation", 0, 0, 100, 2, ABFLAG_CONF_OK }, { ABIL_ZIN_SANCTUARY, "Sanctuary", 7, 0, 150, 15, ABFLAG_NONE }, + { ABIL_ZIN_CURE_ALL_MUTATIONS, "Cure All Mutations", 0, 0, 0, 0, ABFLAG_NONE }, // The Shining One { ABIL_TSO_DIVINE_SHIELD, "Divine Shield", 3, 0, 50, 2, ABFLAG_NONE }, @@ -1482,6 +1483,10 @@ static bool _do_ability(const ability_def& abil) exercise(SK_INVOCATIONS, 5 + random2(8)); break; + case ABIL_ZIN_CURE_ALL_MUTATIONS: + zin_remove_all_mutations(); + break; + case ABIL_TSO_DIVINE_SHIELD: cast_divine_shield(); exercise(SK_INVOCATIONS, (coinflip() ? 3 : 2)); @@ -2208,21 +2213,29 @@ std::vector<talent> your_talents(bool check_confused) } } } + + if (you.religion == GOD_ZIN + && !you.num_gifts[GOD_ZIN] + && you.piety > 160) + { + _add_talent(talents, ABIL_ZIN_CURE_ALL_MUTATIONS, + check_confused); + } } // And finally, the ability to opt-out of your faith {dlb}: if (you.religion != GOD_NO_GOD && !silenced( you.pos() )) _add_talent(talents, ABIL_RENOUNCE_RELIGION, check_confused); - //jmf: Check for breath weapons -- they're exclusive of each other, I hope! - // Make better come ones first. + //jmf: Check for breath weapons - they're exclusive of each other, I hope! + // Make better ones come first. if (you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON || player_mutation_level(MUT_BREATHE_FLAMES)) { _add_talent(talents, ABIL_BREATHE_FIRE, check_confused); } - // Checking for unreleased delayed Fireball. + // Checking for unreleased Delayed Fireball. if (you.attribute[ ATTR_DELAYED_FIREBALL ]) _add_talent(talents, ABIL_DELAYED_FIREBALL, check_confused); diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 63eb56de81..ee23205521 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -56,6 +56,7 @@ enum ability_type ABIL_ZIN_RECITE, ABIL_ZIN_VITALISATION, ABIL_ZIN_SANCTUARY, + ABIL_ZIN_CURE_ALL_MUTATIONS, ABIL_TSO_DIVINE_SHIELD = 120, // 120 ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DIVINE_WARRIOR, diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index d12842a11e..d36c9a6579 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -2458,6 +2458,17 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg, return (_delete_single_mutation_level(mutat)); } +bool delete_all_mutations() +{ + for (int i = 0; i < NUM_MUTATIONS; ++i) + { + while (_delete_single_mutation_level(static_cast<mutation_type>(i))) + ; + } + + return (!how_mutated()); +} + static int _body_covered() { // Check how much of your body is covered by scales, etc. diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h index 6a1e8fcc10..0a1d3b082d 100644 --- a/crawl-ref/source/mutation.h +++ b/crawl-ref/source/mutation.h @@ -47,6 +47,8 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg = true, bool force_mutation = false, bool god_gift = false, bool non_fatal = false); +bool delete_all_mutations(); + std::string mutation_name(mutation_type which_mutat, int level = -1, bool colour = false); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 4811c92f7e..5fca7f4e09 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -849,6 +849,23 @@ bool zin_sustenance(bool actual) && (!actual || you.hunger_state == HS_STARVING)); } +bool zin_remove_all_mutations() +{ + if (!how_mutated()) + { + mpr("You have no mutations to be cured!"); + return (false); + } + + you.num_gifts[GOD_ZIN]++; + take_note(Note(NOTE_GOD_GIFT, you.religion)); + + simple_god_message(" draws all chaos from your body!"); + delete_all_mutations(); + + return (true); +} + bool yred_injury_mirror(bool actual) { return (you.religion == GOD_YREDELEMNUL && !player_under_penance() @@ -3407,8 +3424,13 @@ void gain_piety(int pgn) { if (!you.num_gifts[you.religion]) { - if (you.religion == GOD_SHINING_ONE || you.religion == GOD_LUGONU) + if (you.religion == GOD_ZIN) + simple_god_message(" will now cure all your mutations... once."); + else if (you.religion == GOD_SHINING_ONE + || you.religion == GOD_LUGONU) + { simple_god_message(" will now bless your weapon at an altar... once."); + } } // When you gain piety of more than 160, you get another chance @@ -4116,8 +4138,13 @@ void lose_piety(int pgn) if (you.piety <= 160 && old_piety > 160 && !you.num_gifts[you.religion]) { - if (you.religion == GOD_SHINING_ONE || you.religion == GOD_LUGONU) + if (you.religion == GOD_ZIN) + simple_god_message(" is no longer ready to cure all your mutations."); + else if (you.religion == GOD_SHINING_ONE + || you.religion == GOD_LUGONU) + { simple_god_message(" is no longer ready to bless your weapon."); + } } for (int i = 0; i < MAX_GOD_ABILITIES; ++i) diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 116fcb8c4a..b9d8c297ca 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -100,6 +100,7 @@ harm_protection_type god_protects_from_harm(god_type god, bool actual = true); bool divine_retribution(god_type god); bool zin_sustenance(bool actual = true); +bool zin_remove_all_mutations(); bool yred_injury_mirror(bool actual = true); bool beogh_water_walk(); void good_god_holy_attitude_change(monsters *holy); |