2 * @brief 靴に耐性等の追加効果を付与する処理
5 * @details ドラゴンブーツは必ず付与する. それ以外は確率的に付与する.
8 #include "object-enchant/apply-magic-boots.h"
9 #include "artifact/random-art-generator.h"
10 #include "inventory/inventory-slot-types.h"
11 #include "object-enchant/object-boost.h"
12 #include "object-enchant/object-ego.h"
13 #include "sv-definition/sv-protector-types.h"
14 #include "system/object-type-definition.h"
18 * @param player_ptr プレーヤーへの参照ポインタ
19 * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
23 BootsEnchanter::BootsEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power)
24 : AbstractProtectorEnchanter{ o_ptr, level, power }
25 , player_ptr(player_ptr)
32 void BootsEnchanter::apply_magic()
34 if (this->o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) {
35 dragon_resist(this->o_ptr);
41 if (this->power > 1) {
42 if (one_in_(20) || (this->power > 2)) {
43 become_random_artifact(this->player_ptr, this->o_ptr, false);
47 this->o_ptr->name2 = get_random_ego(INVEN_FEET, true);
51 if (this->power < -1) {
52 this->o_ptr->name2 = get_random_ego(INVEN_FEET, false);