diff options
Diffstat (limited to 'src/map/battle.cpp')
-rw-r--r-- | src/map/battle.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/map/battle.cpp b/src/map/battle.cpp index b745e05..d66308d 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -2060,18 +2060,28 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target, // 攻撃対象となりうるので攻撃 | Attack because it can be attacked if (sd && sd->status.weapon == ItemLook::W_BOW) { - IOff0 aidx = sd->equip_index_maybe[EQUIP::ARROW]; - if (aidx.ok()) - { - if (battle_config.arrow_decrement) - pc_delitem(sd, aidx, 1, 0); - } - else + IOff0 widx = sd->equip_index_maybe[EQUIP::WEAPON]; + + OMATCH_BEGIN_SOME (sdidw, sd->inventory_data[widx]) { - clif_arrow_fail(sd, 0); - return ATK::ZERO; + if (!bool(sdidw->mode & ItemMode::DONT_USE_AMMO)) + { + IOff0 aidx = sd->equip_index_maybe[EQUIP::ARROW]; + if (aidx.ok()) + { + if (battle_config.arrow_decrement) + pc_delitem(sd, aidx, 1, 0); + } + else + { + clif_arrow_fail(sd, 0); + return ATK::ZERO; + } + } } + OMATCH_END (); } + wd = battle_calc_weapon_attack(src, target, SkillID::ZERO, 0, 0); // significantly increase injuries for hasted characters @@ -2081,10 +2091,10 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target, } if (wd.damage > 0 - && t_sc_data[StatusChange::SC_PHYS_SHIELD].timer + && (t_sc_data[StatusChange::SC_PHYS_SHIELD].timer || t_sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].timer) && target->bl_type == BL::PC) { - int reduction = t_sc_data[StatusChange::SC_PHYS_SHIELD].val1; + int reduction = std::max(t_sc_data[StatusChange::SC_PHYS_SHIELD].val1, t_sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].val1); // highest value is taken here but serverdata should make sure only one of those is active if (reduction > wd.damage) reduction = wd.damage; |