From 5b2d47dfa224b441c5d39007bf6f98ef0597f9d6 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 8 Jan 2008 21:33:27 +0000 Subject: Replace TSO's Smiting with Divine Shield. Actually, I wasn't entirely sure which of the many attack invocations to replace and I chose Smiting mostly because of the new overlap with Zin and because such a change is easiest to revert (copy code from Zin). :p Divine Shield strengthens existing shields (also magical, which might have to be excluded) or else creates a new magical one. Either way, the shields value is increased by 3 + skills(SHIELDS)/5 and this bonus lasts for 5 + (skills(SHIELS) + 2*skills(INVOCATIONS))/6 turns, after which it is decreased by 1 every two out of three turns until it reaches 0. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3225 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 57 +++++++++++++++++++++++--------------------- crawl-ref/source/acr.cc | 19 +++++++++++++++ crawl-ref/source/enum.h | 4 +++- crawl-ref/source/output.cc | 6 +++-- crawl-ref/source/player.cc | 3 +++ crawl-ref/source/religion.cc | 22 +++++++++++++++-- crawl-ref/source/spells4.cc | 30 +++++++++++++++++++++++ crawl-ref/source/spells4.h | 1 + 8 files changed, 110 insertions(+), 32 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index f40abf9151..f37ccb2854 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -113,7 +113,7 @@ ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = { ABIL_NON_ABILITY, ABIL_ZIN_SMITING, ABIL_ZIN_REVITALISATION, ABIL_NON_ABILITY, ABIL_ZIN_SANCTUARY }, // TSO - { ABIL_TSO_REPEL_UNDEAD, ABIL_TSO_SMITING, ABIL_TSO_ANNIHILATE_UNDEAD, + { ABIL_TSO_REPEL_UNDEAD, ABIL_TSO_DIVINE_SHIELD, ABIL_TSO_ANNIHILATE_UNDEAD, ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DAEVA }, // Kikubaaqudgha { ABIL_KIKU_RECALL_UNDEAD_SLAVES, ABIL_NON_ABILITY, @@ -239,8 +239,7 @@ static const ability_def Ability_List[] = // The Shining One { ABIL_TSO_REPEL_UNDEAD, "Repel Undead", 1, 0, 100, 0, ABFLAG_NONE }, - { ABIL_TSO_SMITING, "Smiting", - 3, 0, 50, generic_cost::fixed(2), ABFLAG_NONE }, + { ABIL_TSO_DIVINE_SHIELD, "Divine Shield", 3, 0, 50, 2, ABFLAG_NONE }, { ABIL_TSO_ANNIHILATE_UNDEAD, "Annihilate Undead", 3, 0, 50, 2, ABFLAG_NONE }, { ABIL_TSO_CLEANSING_FLAME, "Cleansing Flame", 5, 0, 100, 2, ABFLAG_NONE }, { ABIL_TSO_SUMMON_DAEVA, "Summon Daeva", 8, 0, 150, 4, ABFLAG_NONE }, @@ -679,7 +678,7 @@ static talent get_talent(ability_type ability, bool check_confused) break; case ABIL_ZIN_SMITING: - case ABIL_TSO_SMITING: + case ABIL_TSO_DIVINE_SHIELD: case ABIL_BEOGH_SMITING: case ABIL_MAKHLEB_MINOR_DESTRUCTION: case ABIL_SIF_MUNA_FORGET_SPELL: @@ -1319,19 +1318,21 @@ static bool do_ability(const ability_def& abil) break; // INVOCATIONS: - case ABIL_TSO_REPEL_UNDEAD: - turn_undead(you.piety); - - if (!you.duration[DUR_REPEL_UNDEAD]) - mpr( "You feel a holy aura protecting you." ); - - you.duration[DUR_REPEL_UNDEAD] += 8 - + roll_dice(2, 2 * you.skills[SK_INVOCATIONS]); + 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; - if (you.duration[ DUR_REPEL_UNDEAD ] > 50) - you.duration[ DUR_REPEL_UNDEAD ] = 50; + case ABIL_ZIN_REVITALISATION: + if (cast_revitalisation( 3 + (you.skills[SK_INVOCATIONS] / 6) )) + exercise(SK_INVOCATIONS, 1 + random2(3)); + break; - exercise(SK_INVOCATIONS, 1); + case ABIL_ZIN_SANCTUARY: + if (cast_sanctuary(you.skills[SK_INVOCATIONS] * 4)) + exercise(SK_INVOCATIONS, 5 + random2(8)); break; // no longer in use, maybe keep for other cases (or remove!) @@ -1356,21 +1357,23 @@ static bool do_ability(const ability_def& abil) break; */ - case ABIL_ZIN_REVITALISATION: - if (cast_revitalisation( 3 + (you.skills[SK_INVOCATIONS] / 6) )) - exercise(SK_INVOCATIONS, 1 + random2(3)); - break; + case ABIL_TSO_REPEL_UNDEAD: + turn_undead(you.piety); - case ABIL_ZIN_SANCTUARY: - if (cast_sanctuary(you.skills[SK_INVOCATIONS] * 4)) - exercise(SK_INVOCATIONS, 5 + random2(8)); + if (!you.duration[DUR_REPEL_UNDEAD]) + mpr( "You feel a holy aura protecting you." ); + + you.duration[DUR_REPEL_UNDEAD] += 8 + + roll_dice(2, 2 * you.skills[SK_INVOCATIONS]); + + if (you.duration[ DUR_REPEL_UNDEAD ] > 50) + you.duration[ DUR_REPEL_UNDEAD ] = 50; + + exercise(SK_INVOCATIONS, 1); break; - case ABIL_ZIN_SMITING: - case ABIL_TSO_SMITING: - if (your_spells( SPELL_SMITING, (2 + skill_bump(SK_INVOCATIONS)) * 6, - false ) == SPRET_ABORT) - return (false); + case ABIL_TSO_DIVINE_SHIELD: + cast_divine_shield(); exercise( SK_INVOCATIONS, (coinflip()? 3 : 2) ); break; diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 0bad5ecd37..89e6d0aad1 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2410,6 +2410,25 @@ static void decrement_durations() you.duration[DUR_PRAYER] = 0; } + if (you.duration[DUR_DIVINE_SHIELD]) + { + if (you.duration[DUR_DIVINE_SHIELD] > 1) + { + if (--you.duration[DUR_DIVINE_SHIELD] == 1) + mpr("Your divine shield starts to fade."); + } + + if (you.duration[DUR_DIVINE_SHIELD] == 1 && !one_chance_in(3)) + { + you.redraw_armour_class = true; + if (--you.attribute[ATTR_DIVINE_SHIELD] == 0) + { + you.duration[DUR_DIVINE_SHIELD] = 0; + mpr("Your divine shield fades completely."); + } + } + } + //jmf: more flexible weapon branding code if (you.duration[DUR_WEAPON_BRAND] > 1) you.duration[DUR_WEAPON_BRAND]--; diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 2da0262574..e72f69a792 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -79,7 +79,7 @@ enum ability_type ABIL_ZIN_REVITALISATION, ABIL_ZIN_SANCTUARY, ABIL_TSO_REPEL_UNDEAD = 120, // 120 - ABIL_TSO_SMITING, + ABIL_TSO_DIVINE_SHIELD, ABIL_TSO_ANNIHILATE_UNDEAD, ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DAEVA, // 124 @@ -174,6 +174,7 @@ enum attribute_type ATTR_HELD, // caught in a net ATTR_ABYSS_ENTOURAGE, // maximum number of hostile monsters in // sight of the player while in the Abyss. + ATTR_DIVINE_SHIELD, // strength of TSO's Divine Shield ATTR_UNIQUE_RUNES, ATTR_DEMONIC_RUNES, ATTR_ABYSSAL_RUNES, @@ -1045,6 +1046,7 @@ enum duration_type DUR_REPEL_MISSILES, DUR_PRAYER, DUR_PIETY_POOL, // distribute piety over time + DUR_DIVINE_SHIELD, // duration of TSO's Divine Shield DUR_REGENERATION, DUR_SWIFTNESS, DUR_STONEMAIL, diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 234ec87019..7003483091 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -308,9 +308,11 @@ void print_stats(void) gotoxy(11, 5, GOTO_STAT); - if (you.duration[DUR_CONDENSATION_SHIELD]) //jmf: added 24mar2000 + if (you.duration[DUR_CONDENSATION_SHIELD] + || you.duration[DUR_DIVINE_SHIELD]) + { textcolor( LIGHTBLUE ); // no end of effect warning - + } cprintf( "(%d) ", player_shield_class() ); textcolor( LIGHTGREY ); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 827afc83ac..bb2c592c7d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2344,6 +2344,9 @@ int player_shield_class(void) //jmf: changes for new spell base_shield += you.inv[ shield ].plus; } + if (you.duration[DUR_DIVINE_SHIELD]) + base_shield += you.attribute[ATTR_DIVINE_SHIELD]; + return (base_shield); } // end player_shield_class() diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 4aa9d6708f..ecec1ddb1a 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -195,7 +195,7 @@ const char* god_gain_power_messages[NUM_GODS][MAX_GOD_ABILITIES] = "call upon Zin to create a Sanctuary" }, // TSO { "repel the undead", - "smite your foes", + "call upon The Shining One for a divine shield", "dispel the undead", "hurl blasts of cleansing flame", "summon a divine warrior" }, @@ -280,7 +280,7 @@ const char* god_lose_power_messages[NUM_GODS][MAX_GOD_ABILITIES] = "call upon Zin to create a Sanctuary" }, // TSO { "repel the undead", - "smite your foes", + "call upon The Shining One for a divine shield", "dispel the undead", "hurl blasts of cleansing flame", "summon a divine warrior" }, @@ -426,6 +426,13 @@ void inc_penance(god_type god, int val) // orcish bonuses don't apply under penance if (god == GOD_BEOGH) you.redraw_armour_class = true; + else if (god == GOD_SHINING_ONE && you.duration[DUR_DIVINE_SHIELD]) + { // nor does TSO's divine shield + mpr("Your divine shield disappears!"); + you.duration[DUR_DIVINE_SHIELD] = 0; + you.attribute[ATTR_DIVINE_SHIELD] = 0; + you.redraw_armour_class = true; + } } if (you.penance[god] + val > 200) @@ -2994,6 +3001,17 @@ void excommunication(void) case GOD_ELYVILON: // never seeks revenge break; + + case GOD_SHINING_ONE: + if (you.duration[DUR_DIVINE_SHIELD]) + { + mpr("Your divine shield disappears!"); + you.duration[DUR_DIVINE_SHIELD] = 0; + you.attribute[ATTR_DIVINE_SHIELD] = 0; + you.redraw_armour_class = true; + } + inc_penance( old_god, 50 ); + break; case GOD_ZIN: if (env.sanctuary_time) diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 665ebd1901..603c16932b 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -44,6 +44,7 @@ #include "ouch.h" #include "player.h" #include "randart.h" +#include "religion.h" #include "skills.h" #include "spells1.h" #include "spells4.h" @@ -2816,6 +2817,35 @@ void cast_condensation_shield(int pow) return; } // end cast_condensation_shield() +// shield bonus = attribute for duration turns, then decreasing by 1 +// every two out of three turns +// overall shield duration = duration + attribute +// recasting simply resets those two values (to better values, presumably) +void cast_divine_shield() +{ + if (!you.duration[DUR_DIVINE_SHIELD]) + { + you.redraw_armour_class = true; + if (you.shield() || you.duration[DUR_FIRE_SHIELD] + || you.duration[DUR_CONDENSATION_SHIELD]) + { + mprf("Your shield is strengthened by %s's divine power.", + god_name(you.religion).c_str()); + } + else + mpr("A divine shield forms around you!"); + } + + // duration of complete shield bonus up to 18 turns + you.duration[DUR_DIVINE_SHIELD] + = 5 + (you.skills[SK_SHIELDS] + you.skills[SK_INVOCATIONS]*2)/6; + + // shield bonus up to 8 + you.attribute[ATTR_DIVINE_SHIELD] = 3 + you.skills[SK_SHIELDS]/5; + + return; +} + static int quadrant_blink(int x, int y, int pow, int garbage) { UNUSED( garbage ); diff --git a/crawl-ref/source/spells4.h b/crawl-ref/source/spells4.h index 4493f40d3d..f807104e3d 100644 --- a/crawl-ref/source/spells4.h +++ b/crawl-ref/source/spells4.h @@ -26,6 +26,7 @@ int disperse_monsters(int x, int y, int pow, int message); void cast_bend(int pow); void cast_condensation_shield(int pow); +void cast_divine_shield(void); void cast_detect_secret_doors(int pow); void cast_discharge(int pow); bool cast_evaporate(int pow, bolt& beem, int potion); -- cgit v1.2.3-54-g00ecf