From a9f1fec61232ffd3c80b7a6589bcca31b8524aff Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 24 Jun 2007 10:59:41 +0000 Subject: Helm card can now have a shield effect. (Well, sort of.) Antimagic shouldn't cancel kenku permaflight. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1635 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 9 +++++++++ crawl-ref/source/decks.cc | 7 ++++++- crawl-ref/source/enum.h | 1 + crawl-ref/source/player.cc | 10 ++++++---- crawl-ref/source/spells1.cc | 20 ++++++++++++-------- 5 files changed, 34 insertions(+), 13 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 731427fb98..35f57a4f3c 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1843,6 +1843,15 @@ static void decrement_durations() you.redraw_armour_class = 1; } + if (you.duration[DUR_MAGIC_SHIELD] > 1) + you.duration[DUR_MAGIC_SHIELD]--; + else if (you.duration[DUR_MAGIC_SHIELD] == 1) + { + you.duration[DUR_MAGIC_SHIELD] = 0; + mpr("Your magical shield disappears.", MSGCH_DURATION); + you.redraw_armour_class = 1; + } + if (you.duration[DUR_STONESKIN] > 1) you.duration[DUR_STONESKIN]--; else if (you.duration[DUR_STONESKIN] == 1) diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 84ad81fe18..39d28626e3 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -762,7 +762,12 @@ static void helm_card(int power, deck_rarity_type rarity) } } - // XXX XXX FIXME handle do_shield + if ( do_shield ) + { + if ( you.duration[DUR_MAGIC_SHIELD] == 0 ) + mpr("A magical shield forms in front of you."); + you.duration[DUR_MAGIC_SHIELD] += random2(power/6) + 1; + } } // Do one of: vorpalise, sure blade, dancing weapon diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 8eca15f3b8..38c9cac85a 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1192,6 +1192,7 @@ enum duration_type DUR_RESIST_COLD, DUR_SLAYING, DUR_STEALTH, + DUR_MAGIC_SHIELD, NUM_DURATIONS }; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 356228f36b..8f5e5088bd 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2027,10 +2027,12 @@ int player_shield_class(void) //jmf: changes for new spell if (shield == -1) { - if (!you.duration[DUR_FIRE_SHIELD] && you.duration[DUR_CONDENSATION_SHIELD]) - base_shield = 2 + (you.skills[SK_ICE_MAGIC] / 6); // max 6 - else - return (0); + if (you.duration[DUR_MAGIC_SHIELD]) + base_shield = 2 + you.skills[SK_EVOCATIONS] / 6; + + if (!you.duration[DUR_FIRE_SHIELD] && + you.duration[DUR_CONDENSATION_SHIELD]) + base_shield += 2 + (you.skills[SK_ICE_MAGIC] / 6); // max 6 } else { diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 973b82a2e7..9c783f89c5 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -691,18 +691,22 @@ void abjuration(int pow) void antimagic() { duration_type dur_list[] = { - DUR_HASTE, DUR_SLOW, DUR_PARALYSIS, DUR_CONF, - DUR_MIGHT, DUR_INVIS, DUR_FIRE_SHIELD, - DUR_WEAPON_BRAND, DUR_ICY_ARMOUR, DUR_REPEL_MISSILES, DUR_REGENERATION, - DUR_DEFLECT_MISSILES, DUR_SWIFTNESS, DUR_INSULATION, DUR_STONEMAIL, - DUR_CONTROLLED_FLIGHT, DUR_CONTROL_TELEPORT, DUR_RESIST_POISON, - DUR_RESIST_FIRE, DUR_RESIST_COLD, DUR_TRANSFORMATION, DUR_STONESKIN, - DUR_FORESCRY, DUR_SEE_INVISIBLE, DUR_SILENCE, DUR_CONDENSATION_SHIELD + DUR_INVIS, DUR_CONF, DUR_PARALYSIS, DUR_SLOW, DUR_HASTE, + DUR_MIGHT, DUR_FIRE_SHIELD, DUR_ICY_ARMOUR, DUR_REPEL_MISSILES, + DUR_REGENERATION, DUR_SWIFTNESS, DUR_STONEMAIL, DUR_CONTROL_TELEPORT, + DUR_TRANSFORMATION, DUR_DEATH_CHANNEL, DUR_DEFLECT_MISSILES, + DUR_FORESCRY, DUR_SEE_INVISIBLE, DUR_WEAPON_BRAND, DUR_SILENCE, + DUR_CONDENSATION_SHIELD, DUR_STONESKIN, DUR_BARGAIN, + DUR_INSULATION, DUR_RESIST_POISON, DUR_RESIST_FIRE, DUR_RESIST_COLD, + DUR_SLAYING, DUR_STEALTH, DUR_MAGIC_SHIELD }; - if (you.duration[DUR_LEVITATION] > 2) + if (you.duration[DUR_LEVITATION] > 2 && you.duration[DUR_LEVITATION] < 100) you.duration[DUR_LEVITATION] = 2; + if (you.duration[DUR_CONTROLLED_FLIGHT] < 100 && + you.duration[DUR_CONTROLLED_FLIGHT] > 1) // don't mess with permaflight + you.duration[DUR_CONTROLLED_FLIGHT] = 1; for ( unsigned int i = 0; i < ARRAYSIZE(dur_list); ++i ) if ( you.duration[dur_list[i]] > 1 ) you.duration[dur_list[i]] = 1; -- cgit v1.2.3-54-g00ecf