2 * @brief 兜に耐性等の追加効果を付与する処理
5 * @details ドラゴンヘルムは必ず付与する. それ以外は確率的に付与する.
8 #include "object-enchant/protector/apply-magic-helm.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 HelmEnchanter::HelmEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power)
24 : AbstractProtectorEnchanter{ o_ptr, level, power }
25 , player_ptr(player_ptr)
29 void HelmEnchanter::apply_magic()
31 if (this->o_ptr->sval == SV_DRAGON_HELM) {
32 dragon_resist(this->o_ptr);
38 if (this->power > 1) {
39 this->give_ego_index();
43 if (this->power < -1) {
49 * @details power > 2はデバッグ専用.
51 void HelmEnchanter::give_ego_index()
53 if (one_in_(20) || (this->power > 2)) {
54 become_random_artifact(this->player_ptr, this->o_ptr, false);
59 this->o_ptr->name2 = get_random_ego(INVEN_HEAD, true);
60 switch (this->o_ptr->name2) {
64 case EGO_H_PROTECTION:
69 add_low_telepathy(this->o_ptr);
79 void HelmEnchanter::give_cursed()
82 this->o_ptr->name2 = get_random_ego(INVEN_HEAD, false);
83 switch (this->o_ptr->name2) {
84 case EGO_ANCIENT_CURSE: