diff options
-rw-r--r-- | crawl-ref/source/abl-show.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 26 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 227 |
4 files changed, 136 insertions, 134 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 9622641c4b..4a1ffa74ca 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -111,7 +111,7 @@ ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY }, // Zin - { ABIL_ZIN_RECITE, ABIL_ZIN_SMITING, ABIL_ZIN_REVITALISATION, + { ABIL_ZIN_RECITE, ABIL_ZIN_REVITALISATION, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_ZIN_SANCTUARY }, // TSO { ABIL_NON_ABILITY, ABIL_TSO_DIVINE_SHIELD, ABIL_NON_ABILITY, @@ -233,9 +233,7 @@ static const ability_def Ability_List[] = // INVOCATIONS: // Zin { ABIL_ZIN_RECITE, "Recite", 3, 0, 120, 0, ABFLAG_DELAY }, - { ABIL_ZIN_SMITING, "Smiting", - 3, 0, 50, generic_cost::fixed(2), ABFLAG_NONE }, - { ABIL_ZIN_REVITALISATION, "Revitalisation", 0, 0, 100, 3, ABFLAG_NONE }, + { ABIL_ZIN_REVITALISATION, "Revitalisation", 0, 0, 100, 2, ABFLAG_NONE }, { ABIL_ZIN_SANCTUARY, "Sanctuary", 7, 0, 150, 15, ABFLAG_NONE }, // The Shining One @@ -672,7 +670,7 @@ static talent get_talent(ability_type ability, bool check_confused) failure = 40 - (you.piety / 20) - (3 * you.skills[SK_INVOCATIONS]); break; - case ABIL_ZIN_SMITING: + case ABIL_ZIN_REVITALISATION: case ABIL_TSO_DIVINE_SHIELD: case ABIL_BEOGH_SMITING: case ABIL_MAKHLEB_MINOR_DESTRUCTION: @@ -696,7 +694,6 @@ static talent get_talent(ability_type ability, bool check_confused) failure = 50 - (you.piety / 20) - (you.skills[SK_INVOCATIONS] * 4); break; - case ABIL_ZIN_REVITALISATION: case ABIL_LUGONU_BANISH: invoc = true; failure = 60 - (you.piety / 20) - (5 * you.skills[SK_INVOCATIONS]); @@ -1344,13 +1341,6 @@ static bool do_ability(const ability_def& abil) exercise( SK_INVOCATIONS, 2 ); break; } - case ABIL_ZIN_SMITING: - if (your_spells( SPELL_SMITING, (2 + skill_bump(SK_INVOCATIONS)) * 6, - false ) == SPRET_ABORT) - return (false); - exercise( SK_INVOCATIONS, (coinflip()? 3 : 2) ); - break; - case ABIL_ZIN_REVITALISATION: if (cast_revitalisation( 3 + (you.skills[SK_INVOCATIONS] / 6) )) exercise(SK_INVOCATIONS, 1 + random2(3)); diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index dc7971297a..d1ec75d5ee 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2410,21 +2410,21 @@ void describe_god( god_type which_god, bool give_title ) if (you.piety > 160) { cprintf("%s", - (which_god == GOD_ZIN) ? "Champion of Law" : - (which_god == GOD_SHINING_ONE) ? "Divine Warrior" : - (which_god == GOD_ELYVILON) ? "Champion of Light" : - (which_god == GOD_OKAWARU) ? "Master of a Thousand Battles" : - (which_god == GOD_YREDELEMNUL) ? "Master of Eternal Death" : + (which_god == GOD_ZIN) ? "Champion of Law" : + (which_god == GOD_SHINING_ONE) ? "Divine Warrior" : + (which_god == GOD_ELYVILON) ? "Champion of Light" : + (which_god == GOD_OKAWARU) ? "Master of a Thousand Battles" : + (which_god == GOD_YREDELEMNUL) ? "Master of Eternal Death" : (which_god == GOD_KIKUBAAQUDGHA) ? "Lord of Darkness" : - (which_god == GOD_MAKHLEB) ? "Champion of Chaos" : - (which_god == GOD_VEHUMET) ? "Lord of Destruction" : - (which_god == GOD_TROG) ? "Great Slayer" : + (which_god == GOD_MAKHLEB) ? "Champion of Chaos" : + (which_god == GOD_VEHUMET) ? "Lord of Destruction" : + (which_god == GOD_TROG) ? "Great Slayer" : (which_god == GOD_NEMELEX_XOBEH) ? "Great Trickster" : - (which_god == GOD_SIF_MUNA) ? "Master of the Arcane" : - (which_god == GOD_LUGONU) ? "Agent of Entropy" : - (which_god == GOD_BEOGH) ? "Messiah" : - (which_god == GOD_XOM) ? "Teddy Bear" : - "Bogy the Lord of the Bugs"); + (which_god == GOD_SIF_MUNA) ? "Master of the Arcane" : + (which_god == GOD_LUGONU) ? "Agent of Entropy" : + (which_god == GOD_BEOGH) ? "Messiah" : + (which_god == GOD_XOM) ? "Teddy Bear" + : "Bogy the Lord of the Bugs"); } else { diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 7ec41efef5..0eb5b861c6 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -75,7 +75,6 @@ enum ability_type // Divine abilities ABIL_ZIN_RECITE = 110, // 110 - ABIL_ZIN_SMITING, ABIL_ZIN_REVITALISATION, ABIL_ZIN_SANCTUARY, ABIL_TSO_DIVINE_SHIELD = 120, // 120 diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 0f64682178..eba2d3b207 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -194,9 +194,9 @@ const char* god_gain_power_messages[NUM_GODS][MAX_GOD_ABILITIES] = { "", "", "", "", "" }, // Zin { "recite Zin's Axioms of Law", - "smite your foes", "call upon Zin for revitalisation", "", + "", "call upon Zin to create a Sanctuary" }, // TSO { "You and your allies can now gain power from killing evil.", @@ -280,9 +280,9 @@ const char* god_lose_power_messages[NUM_GODS][MAX_GOD_ABILITIES] = { "", "", "", "", "" }, // Zin { "recite Zin's Axioms of Law", - "smite your foes", "call upon Zin for revitalisation", "", + "", "call upon Zin to create a Sanctuary" }, // TSO { "You and your allies can no longer gain power from killing evil.", @@ -2410,10 +2410,107 @@ static bool zin_retribution() simple_god_message(" booms out: \"Return to the light! REPENT!\"", god); noisy( 25, you.x_pos, you.y_pos ); // same as scroll of noise break; - } // plus Smiting? + } return false; } +static void ely_destroy_inventory_weapon() +{ + int count = 0; + int item = ENDOFPACK; + + for (int i = 0; i < ENDOFPACK; i++) + { + if (!is_valid_item( you.inv[i] )) + continue; + + if (you.inv[i].base_type == OBJ_WEAPONS + || you.inv[i].base_type == OBJ_MISSILES) + { + if (is_artefact(you.inv[i])) + continue; + + // item is valid for destroying, so give it a chance + count++; + if (one_chance_in( count )) + item = i; + } + } + + // any item to destroy? + if (item == ENDOFPACK) + return; + + int value = 1; + bool wielded = false; + + // increase value wielded weapons or large stacks of ammo + if (you.inv[item].base_type == OBJ_WEAPONS + && you.inv[item].link == you.equip[EQ_WEAPON]) + { + wielded = true; + value += 2; + } + else if (you.inv[item].quantity > random2(you.penance[GOD_ELYVILON])) + value += 1 + random2(2); + + std::ostream& strm = msg::streams(MSGCH_GOD); + strm << you.inv[item].name(DESC_CAP_YOUR); + + if (value == 1) + strm << " barely"; + + if ( you.inv[item].quantity == 1 ) + strm << " shimmers and breaks into pieces." << std::endl; + else + strm << " shimmer and break into pieces." << std::endl; + + if (wielded) + { + unwield_item(true); + you.wield_change = true; + } + // just in case + you.quiver_change = true; + + destroy_item(you.inv[item]); + burden_change(); + + dec_penance(GOD_ELYVILON, value); +} + +static bool elyvilon_retribution() +{ + // healing theme and interfering with fighting + // doesn't care unless you've gone over to evil + if ( !is_evil_god(you.religion) ) + return false; + + const god_type god = GOD_ELYVILON; + + simple_god_message("'s displeasure finds you.", god); + + switch (random2(5)) + { + case 0: + case 1: + confuse_player( 3 + random2(10), false ); + break; + + case 2: // mostly flavour messages + miscast_effect(SPTYP_POISON, 0, 0, one_chance_in(3), + "the will of Elyvilon"); + break; + + case 3: + case 4: // destroy weapons in your inventory + ely_destroy_inventory_weapon(); + break; + } + + return true; +} + static bool makhleb_retribution() { const god_type god = GOD_MAKHLEB; @@ -2875,100 +2972,6 @@ static bool nemelex_retribution() return true; } -static void ely_destroy_inventory_weapon() -{ - int count = 0; - int item = ENDOFPACK; - - for (int i = 0; i < ENDOFPACK; i++) - { - if (!is_valid_item( you.inv[i] )) - continue; - - if (you.inv[i].base_type == OBJ_WEAPONS - || you.inv[i].base_type == OBJ_MISSILES) - { - if (is_artefact(you.inv[i])) - continue; - - // item is valid for destroying, so give it a chance - count++; - if (one_chance_in( count )) - item = i; - } - } - - // any item to destroy? - if (item == ENDOFPACK) - return; - - int value = 1; - bool wielded = false; - - // increase value wielded weapons or large stacks of ammo - if (you.inv[item].base_type == OBJ_WEAPONS - && you.inv[item].link == you.equip[EQ_WEAPON]) - { - wielded = true; - value += 2; - } - else if (you.inv[item].quantity > random2(you.penance[GOD_ELYVILON])) - value += 1 + random2(2); - - std::ostream& strm = msg::streams(MSGCH_GOD); - strm << you.inv[item].name(DESC_CAP_YOUR); - - if (value == 1) - strm << " barely"; - - if ( you.inv[item].quantity == 1 ) - strm << " shimmers and breaks into pieces." << std::endl; - else - strm << " shimmer and break into pieces." << std::endl; - - if (wielded) - { - unwield_item(true); - you.wield_change = true; - } - // just in case - you.quiver_change = true; - - destroy_item(you.inv[item]); - burden_change(); - - dec_penance(GOD_ELYVILON, value); -} - -// comparatively lenient -static bool elyvilon_retribution() -{ - const god_type god = GOD_ELYVILON; - - simple_god_message("'s displeasure finds you.", god); - - // healing theme and interfering with fighting - switch (random2(5)) - { - case 0: - case 1: - confuse_player( 3 + random2(10), false ); - break; - - case 2: // mostly flavour messages - miscast_effect(SPTYP_POISON, 0, 0, one_chance_in(3), - "the will of Elyvilon"); - break; - - case 3: - case 4: // destroy weapons in your inventory - ely_destroy_inventory_weapon(); - break; - } - - return true; -} - void divine_retribution( god_type god ) { ASSERT(god != GOD_NO_GOD); @@ -3489,6 +3492,8 @@ bool is_orcish_follower(const monsters* mon) void excommunication(god_type new_god) { const god_type old_god = you.religion; + ASSERT(old_god != new_god); + god_acting gdact(old_god, true); take_note(Note(NOTE_LOSE_GOD, old_god)); @@ -3581,13 +3586,7 @@ void excommunication(god_type new_god) inc_penance(old_god, 50); break; - case GOD_ELYVILON: - inc_penance( old_god, 50 ); - break; - case GOD_SHINING_ONE: - mpr("Your divine halo starts to fade."); - if (you.duration[DUR_DIVINE_SHIELD]) { mpr("Your divine shield disappears!"); @@ -3607,7 +3606,13 @@ void excommunication(god_type new_god) case GOD_ZIN: if (env.sanctuary_time) remove_sanctuary(); - // deliberate fall-through + inc_penance( old_god, 25 ); + break; + + case GOD_ELYVILON: + inc_penance( old_god, 30 ); + break; + default: inc_penance( old_god, 25 ); break; @@ -4080,6 +4085,11 @@ void god_pitch(god_type which_god) redraw_screen(); + const int old_piety = you.piety; + // Are you switching between good gods? + const bool good_god_switch = is_good_god(you.religion) + && is_good_god(which_god); + // Leave your prior religion first. if (you.religion != GOD_NO_GOD) excommunication(which_god); @@ -4095,7 +4105,7 @@ void god_pitch(god_type which_god) } else { - you.piety = 15; // to prevent near instant excommunication + you.piety = 15; // to prevent near instant excommunication you.piety_hysteresis = 0; you.gift_timeout = 0; } @@ -4133,11 +4143,14 @@ void god_pitch(god_type which_god) // evil and unholy beings hostile. if (is_good_god(you.religion)) { + // piety bonus when switching between good gods + if (good_god_switch && old_piety > 15) + gain_piety(std::min(30, old_piety - 15)); + if (moral_beings_attitude_change()) mpr("Your evil allies forsake you.", MSGCH_MONSTER_ENCHANT); } - - if (is_evil_god(you.religion)) + else if (is_evil_god(you.religion)) { // Note: Using worshipped[] we could make this sort of grudge // permanent instead of based off of penance. -- bwr |