2 * @brief 弓系のアイテムを強化する処理
7 #include "object-enchant/weapon/apply-magic-bow.h"
8 #include "artifact/random-art-generator.h"
9 #include "inventory/inventory-slot-types.h"
10 #include "system/item-entity.h"
13 * @brief 弓強化クラスのコンストラクタ
14 * @param player_ptr プレイヤーへの参照ポインタ
15 * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
19 BowEnchanter::BowEnchanter(PlayerType *player_ptr, ItemEntity *o_ptr, DEPTH level, int power)
20 : AbstractWeaponEnchanter(o_ptr, level, power)
21 , player_ptr(player_ptr)
26 * @brief 弓系オブジェクトに生成ランクごとの強化を与えるサブルーチン
27 * Apply magic to an item known to be a "weapon"
28 * @details power > 2はデバッグ専用.
30 void BowEnchanter::apply_magic()
33 if (this->should_skip) {
37 this->give_killing_bonus();
38 if (this->power > 1) {
39 if ((this->power > 2) || one_in_(20)) {
40 become_random_artifact(this->player_ptr, this->o_ptr, false);
44 this->o_ptr->ego_idx = get_random_ego(INVEN_BOW, true);