diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-13 22:06:28 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-13 22:06:28 +0000 |
commit | d6118194ace99a16d1a55cb7a93416892c45e713 (patch) | |
tree | bc40b3e6be183b7d4a398f69392ca7a1709cb5bd | |
parent | b89715ca53db848f394801e8f6a95dff45a56fc9 (diff) | |
download | crawl-ref-d6118194ace99a16d1a55cb7a93416892c45e713.tar.gz crawl-ref-d6118194ace99a16d1a55cb7a93416892c45e713.zip |
Backport melding fixes (shields and uncursing) and allow to cast spells
on slot 'I'.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10672 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/player.cc | 31 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/transfor.cc | 4 |
4 files changed, 22 insertions, 20 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 96cbdb6ad0..107c6b07c0 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2320,7 +2320,7 @@ int player_evasion() // Some lesser armours have small penalties now (shields, barding). for (int i = EQ_CLOAK; i < EQ_BODY_ARMOUR; i++) { - if (you.equip[i] == -1) + if (!player_wearing_slot(i)) continue; int pen = property( you.inv[ you.equip[i] ], PARM_EVASION ); @@ -2559,22 +2559,10 @@ item_def *player_shield() int player_shield_class(void) //jmf: changes for new spell { int base_shield = 0; - const int shield = you.equip[EQ_SHIELD]; - - if (shield == -1) - { - 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 + if (player_wearing_slot(EQ_SHIELD)) { - const item_def& item = you.inv[shield]; + const item_def& item = you.inv[you.equip[EQ_SHIELD]]; base_shield = property(item, PARM_AC); int racial_bonus = _player_armour_racial_bonus(item) * 2 / 3; @@ -2585,6 +2573,17 @@ int player_shield_class(void) //jmf: changes for new spell base_shield += item.plus; } + else + { + 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 + } + } if (you.duration[DUR_DIVINE_SHIELD]) base_shield += you.attribute[ATTR_DIVINE_SHIELD]; @@ -6313,7 +6312,7 @@ bool player::can_wield(const item_def& item, bool ignore_curse, const bool two_handed = item.base_type == OBJ_UNASSIGNED || hands_reqd(item, body_size()) == HANDS_TWO; - if (two_handed && !ignore_shield && equip[EQ_SHIELD] != -1) + if (two_handed && !ignore_shield && player_wearing_slot(EQ_SHIELD)) return (false); return could_wield(item, ignore_brand, ignore_transform); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 56d2c079aa..95fdb24d93 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -134,8 +134,8 @@ bool remove_curse(bool suppress_msg) // What of artefact rings and amulets? {dlb}: for (int i = EQ_WEAPON + 1; i < NUM_EQUIP; i++) { - if (you.equip[i] != -1 && item_cursed(you.inv[you.equip[i]]) - && you_tran_can_wear(you.equip[i])) + // Melded equipment can also get uncursed this way. + if (you.equip[i] != -1 && item_cursed(you.inv[you.equip[i]])) { do_uncurse_item(you.inv[you.equip[i]]); success = true; diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index f9c865450d..61be1b39c5 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -245,6 +245,9 @@ static bool _spell_no_hostile_in_range(spell_type spell, int minRange) int list_spells(bool toggle_with_I, bool viewing, int minRange) { + if (toggle_with_I && get_spell_by_letter('I') != SPELL_NO_SPELL) + toggle_with_I = false; + ToggleableMenu spell_menu(MF_SINGLESELECT | MF_ANYPRINTABLE | MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING); #ifdef USE_TILE diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 799df4f74b..bfd4ef0403 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -65,7 +65,7 @@ bool transform_allows_wearing_item(const item_def& item, { // It's not jewellery, and it's worn, so it must be armour. const equipment_type eqslot = get_armour_slot(item); - const bool is_soft_helmet = is_helmet(item) && !is_hard_helmet(item); + const bool is_soft_helmet = is_helmet(item) && !is_hard_helmet(item); switch (transform) { @@ -143,7 +143,7 @@ static void _unwear_equipment_slot(equipment_type eqslot) if (eqslot == EQ_WEAPON) { - unwield_item(); + unwield_item(!you.duration[DUR_BERSERKER]); canned_msg(MSG_EMPTY_HANDED); you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = slot + 1; } |