2 * @brief 鈍器に耐性等の追加効果を付与する処理
7 #include "object-enchant/weapon/apply-magic-hafted.h"
8 #include "floor/floor-base-definitions.h"
9 #include "inventory/inventory-slot-types.h"
10 #include "object-enchant/object-boost.h"
11 #include "sv-definition/sv-weapon-types.h"
12 #include "system/object-type-definition.h"
15 * @brief 鈍器強化クラスのコンストラクタ
16 * @param player_ptr プレイヤーへの参照ポインタ
17 * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
21 HaftedEnchanter::HaftedEnchanter(PlayerType *player_ptr, ObjectType *o_ptr, DEPTH level, int power)
22 : MeleeWeaponEnchanter(player_ptr, o_ptr, level, power)
26 void HaftedEnchanter::apply_magic()
29 this->give_killing_bonus();
30 MeleeWeaponEnchanter::apply_magic();
33 void HaftedEnchanter::give_ego_index()
36 this->o_ptr->ego_idx = get_random_ego(INVEN_MAIN_HAND, true);
37 if (this->o_ptr->ego_idx == EgoType::SHARPNESS) {
44 switch (this->o_ptr->ego_idx) {
45 case EgoType::EARTHQUAKES:
46 if (one_in_(3) && (this->level > 60)) {
47 this->o_ptr->art_flags.set(TR_BLOWS);
49 this->o_ptr->pval = static_cast<short>(m_bonus(3, this->level));
58 void HaftedEnchanter::give_cursed()
60 if (randint0(MAX_DEPTH) >= this->level) {
65 this->o_ptr->ego_idx = get_random_ego(INVEN_MAIN_HAND, false);
66 if (this->o_ptr->ego_idx == EgoType::WEIRD) {