From f42c33718495449a5b1bce42d05b76d3975cc76e Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 3 Nov 2009 13:50:03 +0100 Subject: Bracers of archery: 5,3 slaying for ranged combat, -1,-1 for melee. --- crawl-ref/source/delay.cc | 4 ++++ crawl-ref/source/describe.cc | 6 ++++++ crawl-ref/source/it_use2.cc | 4 ++++ crawl-ref/source/item_use.cc | 4 ++-- crawl-ref/source/itemname.cc | 2 ++ crawl-ref/source/itemprop.cc | 2 ++ crawl-ref/source/itemprop.h | 3 ++- crawl-ref/source/makeitem.cc | 17 ++++++++++++++--- crawl-ref/source/player.cc | 6 +++++- crawl-ref/source/player.h | 2 +- 10 files changed, 42 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index cbc7993a3f..85f38ab8be 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1548,6 +1548,10 @@ void armour_wear_effects(const int item_slot) mpr("You feel spirits watching over you."); } break; + + case SPARM_ARCHERY: + mpr("You feel that your aim is more steady."); + break; } } diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index f723c1adfc..01daa4237a 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1262,6 +1262,12 @@ static std::string _describe_armour( const item_def &item, bool verbose ) description += "It shields its wearer from harm at the cost " "of magical power."; break; + + // This is only for bracers (gloves). + case SPARM_ARCHERY: + description += "These improve your skills with ranged weaponry " + "but interfere slightly with melee combat."; + break; } } diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index bd497e477a..ff67f83c57 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -679,6 +679,10 @@ void unwear_armour(int slot) } break; + case SPARM_ARCHERY: + mpr("Your aim is not that steady anymore."); + break; + default: break; } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index af23e7d2ff..21304e3ae9 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2832,12 +2832,12 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // slaying bonuses if (projected != LRET_LAUNCHED || wepType != MI_NEEDLE) { - slayDam = slaying_bonus(PWPN_DAMAGE); + slayDam = slaying_bonus(PWPN_DAMAGE, true); slayDam = (slayDam < 0 ? -random2(1 - slayDam) : random2(1 + slayDam)); } - exHitBonus += slaying_bonus(PWPN_HIT); + exHitBonus += slaying_bonus(PWPN_HIT, true); } } else // LRET_FUMBLED diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 307074402f..a76a45e6ba 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -379,6 +379,7 @@ static const char* armour_ego_name( special_armour_type sparm, bool terse ) case SPARM_PRESERVATION: return "preservation"; case SPARM_REFLECTION: return "reflection"; case SPARM_SPIRIT_SHIELD: return "spirit shield"; + case SPARM_ARCHERY: return "archery"; default: return "bugginess"; } } @@ -406,6 +407,7 @@ static const char* armour_ego_name( special_armour_type sparm, bool terse ) case SPARM_PRESERVATION: return " {rCorr, Cons}"; case SPARM_REFLECTION: return " {rflct}"; case SPARM_SPIRIT_SHIELD: return " {Spirit}"; + case SPARM_ARCHERY: return " {archer}"; default: return " {buggy}"; } } diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index eed9ac927d..90dade7d51 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -905,6 +905,8 @@ void set_gloves_random_desc( item_def &item ) ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_GLOVES ); item.plus2 = coinflip() ? TGLOV_DESC_GLOVES : TGLOV_DESC_GAUNTLETS; + if (get_armour_ego_type(item) == SPARM_ARCHERY) + item.plus2 = TGLOV_DESC_BRACERS; } // diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index 5fbd26c968..1c4543f856 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -343,7 +343,8 @@ enum special_armour_type SPARM_PRESERVATION, SPARM_REFLECTION, SPARM_SPIRIT_SHIELD, // 20 - NUM_SPECIAL_ARMOURS // 21 + SPARM_ARCHERY, + NUM_SPECIAL_ARMOURS // 22 }; enum special_missile_type // to separate from weapons in general {dlb} diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 035113b727..6b2daa84c5 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2067,7 +2067,17 @@ static special_armour_type _determine_armour_ego(const item_def& item, break; case ARM_GLOVES: - rc = coinflip() ? SPARM_DEXTERITY : SPARM_STRENGTH; + switch (random2(3)) + { + case 0: + rc = SPARM_DEXTERITY; + break; + case 1: + rc = SPARM_STRENGTH; + break; + default: + rc = SPARM_ARCHERY; + } break; case ARM_BOOTS: @@ -2144,8 +2154,6 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, // If we get here the item is not an artefact. if (is_helmet(item) && one_chance_in(3)) set_helmet_random_desc(item); - else if (item.sub_type == ARM_GLOVES) - set_gloves_random_desc(item); if (item_race == MAKE_ITEM_RANDOM_RACE && item.sub_type == ARM_BOOTS) { @@ -2245,6 +2253,9 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, if (armour_is_hide(item)) item.plus = 0; + + if (item.sub_type == ARM_GLOVES) + set_gloves_random_desc(item); } static monster_type _choose_random_monster_corpse() diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 69372b9fd7..94cd9271be 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4455,7 +4455,7 @@ unsigned long exp_needed(int lev) } // returns bonuses from rings of slaying, etc. -int slaying_bonus(char which_affected) +int slaying_bonus(char which_affected, bool ranged) { int ret = 0; @@ -4463,11 +4463,15 @@ int slaying_bonus(char which_affected) { ret += player_equip( EQ_RINGS_PLUS, RING_SLAYING ); ret += scan_artefacts(ARTP_ACCURACY); + if (player_equip_ego_type(EQ_GLOVES, SPARM_ARCHERY)) + ret += ranged ? 5 : -1; } else if (which_affected == PWPN_DAMAGE) { ret += player_equip( EQ_RINGS_PLUS2, RING_SLAYING ); ret += scan_artefacts(ARTP_DAMAGE); + if (player_equip_ego_type(EQ_GLOVES, SPARM_ARCHERY)) + ret += ranged ? 3 : -1; } ret += std::min(you.duration[DUR_SLAYING] / 13, 6); diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index f4c18f543e..940d828120 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -639,7 +639,7 @@ int player_teleport(bool calc_unid = true); bool items_give_ability(const int slot, artefact_prop_type abil); int scan_artefacts(artefact_prop_type which_property, bool calc_unid = true); -int slaying_bonus(char which_affected); +int slaying_bonus(char which_affected, bool ranged = false); bool player_mesmerised_by(const monsters *mon); -- cgit v1.2.3-54-g00ecf