2 * @brief 矢類のアイテムを強化する処理
7 #include "object-enchant/weapon/apply-magic-arrow.h"
8 #include "artifact/random-art-generator.h"
9 #include "floor/floor-base-definitions.h"
10 #include "inventory/inventory-slot-types.h"
11 #include "system/item-entity.h"
12 #include "system/player-type-definition.h"
15 * @brief 矢類強化クラスのコンストラクタ
16 * @param player_ptr プレイヤーへの参照ポインタ
17 * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
21 ArrowEnchanter::ArrowEnchanter(PlayerType *player_ptr, ItemEntity *o_ptr, DEPTH level, int power)
22 : AbstractWeaponEnchanter(o_ptr, level, power)
23 , player_ptr(player_ptr)
28 * @brief 矢類に生成ランクごとの強化を与えるサブルーチン
29 * @details power > 2はデバッグ専用.
31 void ArrowEnchanter::apply_magic()
34 if (this->should_skip) {
38 this->give_killing_bonus();
39 if (this->power > 1) {
40 if (this->power > 2) {
41 become_random_artifact(this->player_ptr, this->o_ptr, false);
45 this->o_ptr->ego_idx = get_random_ego(INVEN_AMMO, true);
46 while (one_in_(10 * this->o_ptr->dd * this->o_ptr->ds)) {
50 if (this->o_ptr->dd > 9) {
57 if (this->power < -1) {
58 if (randint0(MAX_DEPTH) < this->level) {
59 this->o_ptr->ego_idx = get_random_ego(INVEN_AMMO, false);