8 #include "spells-object.h"
9 #include "object-boost.h"
10 #include "object-hook.h"
11 #include "object-flavor.h"
12 #include "player-status.h"
14 #include "player-effects.h"
19 OBJECT_TYPE_VALUE tval;
20 OBJECT_SUBTYPE_VALUE sval;
26 * Scatter some "amusing" objects near the player
29 #define AMS_NOTHING 0x00 /* No restriction */
30 #define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */
31 #define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */
32 #define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */
33 #define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */
35 static amuse_type amuse_info[] =
37 { TV_BOTTLE, SV_ANY, 5, AMS_NOTHING },
38 { TV_JUNK, SV_ANY, 3, AMS_MULTIPLE },
39 { TV_SPIKE, SV_ANY, 10, AMS_PILE },
40 { TV_STATUE, SV_ANY, 15, AMS_NOTHING },
41 { TV_CORPSE, SV_ANY, 15, AMS_NO_UNIQUE },
42 { TV_SKELETON, SV_ANY, 10, AMS_NO_UNIQUE },
43 { TV_FIGURINE, SV_ANY, 10, AMS_NO_UNIQUE },
44 { TV_PARCHMENT, SV_ANY, 1, AMS_NOTHING },
45 { TV_POLEARM, SV_TSURIZAO, 3, AMS_NOTHING }, //Fishing Pole of Taikobo
46 { TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, //Broken Dagger of Magician
47 { TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING },
48 { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
49 { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
55 * @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
56 * Hook to determine if an object is contertible in an arrow/bolt
57 * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す
59 bool create_ammo(void)
68 GAME_TEXT o_name[MAX_NLEN];
73 sprintf(com, _("[S]弾, [A]矢, [B]クロスボウの矢 :", "Create [S]hots, Create [A]rrow or Create [B]olt ?"));
74 else if (p_ptr->lev >= 10)
75 sprintf(com, _("[S]弾, [A]矢:", "Create [S]hots or Create [A]rrow ?"));
77 sprintf(com, _("[S]弾:", "Create [S]hots ?"));
81 msg_print(_("混乱してる!", "You are too confused!"));
87 msg_print(_("目が見えない!", "You are blind!"));
93 if (!get_com(com, &ch, TRUE))
97 if (ch == 'S' || ch == 's')
102 if ((ch == 'A' || ch == 'a') && (p_ptr->lev >= 10))
107 if ((ch == 'B' || ch == 'b') && (p_ptr->lev >= 20))
114 /**********Create shots*********/
121 if (!get_rep_dir(&dir, FALSE)) return FALSE;
122 y = p_ptr->y + ddy[dir];
123 x = p_ptr->x + ddx[dir];
124 g_ptr = ¤t_floor_ptr->grid_array[y][x];
126 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
128 msg_print(_("そこには岩石がない。", "You need pile of rubble."));
131 else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
133 msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
140 /* Hack -- Give the player some small firestones */
141 object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
142 q_ptr->number = (byte)rand_range(15, 30);
145 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
146 q_ptr->discount = 99;
148 slot = inven_carry(q_ptr);
150 object_desc(o_name, q_ptr, 0);
151 msg_format(_("%sを作った。", "You make some ammo."), o_name);
153 /* Auto-inscription */
154 if (slot >= 0) autopick_alter_item(slot, FALSE);
156 /* Destroy the wall */
157 cave_alter_feat(y, x, FF_HURT_ROCK);
159 p_ptr->update |= (PU_FLOW);
162 /**********Create arrows*********/
169 item_tester_hook = item_tester_hook_convertible;
171 q = _("どのアイテムから作りますか? ", "Convert which item? ");
172 s = _("材料を持っていない。", "You have no item to convert.");
173 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
174 if (!q_ptr) return FALSE;
178 /* Hack -- Give the player some small firestones */
179 object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
180 q_ptr->number = (byte)rand_range(5, 10);
183 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
185 q_ptr->discount = 99;
187 object_desc(o_name, q_ptr, 0);
188 msg_format(_("%sを作った。", "You make some ammo."), o_name);
192 inven_item_increase(item, -1);
193 inven_item_describe(item);
194 inven_item_optimize(item);
198 floor_item_increase(0 - item, -1);
199 floor_item_describe(0 - item);
200 floor_item_optimize(0 - item);
203 slot = inven_carry(q_ptr);
205 /* Auto-inscription */
206 if (slot >= 0) autopick_alter_item(slot, FALSE);
208 /**********Create bolts*********/
215 item_tester_hook = item_tester_hook_convertible;
217 q = _("どのアイテムから作りますか? ", "Convert which item? ");
218 s = _("材料を持っていない。", "You have no item to convert.");
220 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
221 if (!q_ptr) return FALSE;
225 /* Hack -- Give the player some small firestones */
226 object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
227 q_ptr->number = (byte)rand_range(4, 8);
230 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
232 q_ptr->discount = 99;
234 object_desc(o_name, q_ptr, 0);
235 msg_format(_("%sを作った。", "You make some ammo."), o_name);
239 inven_item_increase(item, -1);
240 inven_item_describe(item);
241 inven_item_optimize(item);
245 floor_item_increase(0 - item, -1);
246 floor_item_describe(0 - item);
247 floor_item_optimize(0 - item);
250 slot = inven_carry(q_ptr);
252 /* Auto-inscription */
253 if (slot >= 0) autopick_alter_item(slot, FALSE);
259 * @brief 魔道具術師の魔力取り込み処理
260 * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す
262 bool import_magic_device(void)
265 PARAMETER_VALUE pval;
269 GAME_TEXT o_name[MAX_NLEN];
271 /* Only accept legal items */
272 item_tester_hook = item_tester_hook_recharge;
274 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
275 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
277 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
278 if (!o_ptr) return (FALSE);
280 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
282 msg_print(_("この杖には発動の為の能力は何も備わっていないようだ。", "This staff doesn't have any magical ability."));
286 if (!object_is_known(o_ptr))
288 msg_print(_("鑑定されていないと取り込めない。", "You need to identify before absorbing."));
294 msg_print(_("充填中のアイテムは取り込めない。", "This item is still charging."));
299 if (o_ptr->tval == TV_ROD)
301 else if (o_ptr->tval == TV_WAND)
304 if (o_ptr->tval == TV_ROD)
306 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)o_ptr->number;
307 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
312 for (num = o_ptr->number; num; num--)
315 if (o_ptr->tval == TV_WAND) gain_num = (pval + num - 1) / num;
316 if (p_ptr->magic_num2[o_ptr->sval + ext])
319 gain_num = (gain_num / 3 + randint0(gain_num / 3)) / 256;
320 if (gain_num < 1) gain_num = 1;
322 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)gain_num;
323 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
324 p_ptr->magic_num1[o_ptr->sval + ext] += pval * 0x10000;
325 if (p_ptr->magic_num1[o_ptr->sval + ext] > 99 * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = 99 * 0x10000;
326 if (p_ptr->magic_num1[o_ptr->sval + ext] > p_ptr->magic_num2[o_ptr->sval + ext] * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = p_ptr->magic_num2[o_ptr->sval + ext] * 0x10000;
327 if (o_ptr->tval == TV_WAND) pval -= (pval + num - 1) / num;
331 object_desc(o_name, o_ptr, 0);
332 msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
334 /* Eliminate the item (from the pack) */
337 inven_item_increase(item, -999);
338 inven_item_describe(item);
339 inven_item_optimize(item);
342 /* Eliminate the item (from the floor) */
345 floor_item_increase(0 - item, -999);
346 floor_item_describe(0 - item);
347 floor_item_optimize(0 - item);
349 take_turn(p_ptr, 100);
355 * @param y1 配置したいフロアのY座標
356 * @param x1 配置したいフロアのX座標
358 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
361 void amusement(POSITION y1, POSITION x1, int num, bool known)
364 object_type object_type_body;
367 for (n = 0; amuse_info[n].tval != 0; n++)
369 t += amuse_info[n].prob;
376 KIND_OBJECT_IDX k_idx;
377 ARTIFACT_IDX a_idx = 0;
379 bool insta_art, fixed_art;
383 r -= amuse_info[i].prob;
386 i_ptr = &object_type_body;
388 k_idx = lookup_kind(amuse_info[i].tval, amuse_info[i].sval);
390 /* Paranoia - reroll if nothing */
391 if (!k_idx) continue;
393 /* Search an artifact index if need */
394 insta_art = (k_info[k_idx].gen_flags & TRG_INSTA_ART);
395 fixed_art = (amuse_info[i].flag & AMS_FIXED_ART);
397 if (insta_art || fixed_art)
399 for (a_idx = 1; a_idx < max_a_idx; a_idx++)
401 if (insta_art && !(a_info[a_idx].gen_flags & TRG_INSTA_ART)) continue;
402 if (a_info[a_idx].tval != k_info[k_idx].tval) continue;
403 if (a_info[a_idx].sval != k_info[k_idx].sval) continue;
404 if (a_info[a_idx].cur_num > 0) continue;
408 if (a_idx >= max_a_idx) continue;
411 /* Make an object (if possible) */
412 object_prep(i_ptr, k_idx);
413 if (a_idx) i_ptr->name1 = a_idx;
414 apply_magic(i_ptr, 1, AM_NO_FIXED_ART);
416 if (amuse_info[i].flag & AMS_NO_UNIQUE)
418 if (r_info[i_ptr->pval].flags1 & RF1_UNIQUE) continue;
421 if (amuse_info[i].flag & AMS_MULTIPLE) i_ptr->number = randint1(3);
422 if (amuse_info[i].flag & AMS_PILE) i_ptr->number = randint1(99);
430 /* Paranoia - reroll if nothing */
431 if (!(i_ptr->k_idx)) continue;
433 (void)drop_near(i_ptr, -1, y1, x1);
443 * Scatter some "great" objects near the player
444 * @param y1 配置したいフロアのY座標
445 * @param x1 配置したいフロアのX座標
447 * @param great TRUEならば必ず高級品以上を落とす
448 * @param special TRUEならば必ず特別品を落とす
449 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
452 void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
455 object_type object_type_body;
456 BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
461 i_ptr = &object_type_body;
464 /* Make a good (or great) object (if possible) */
465 if (!make_object(i_ptr, mode)) continue;
473 (void)drop_near(i_ptr, -1, y1, x1);
477 void acquire_chaos_weapon(player_type *creature_ptr)
480 object_type *q_ptr = &forge;
481 OBJECT_TYPE_VALUE dummy = TV_SWORD;
482 OBJECT_SUBTYPE_VALUE dummy2;
483 switch (randint1(creature_ptr->lev))
489 dummy2 = SV_MAIN_GAUCHE;
498 dummy2 = SV_SMALL_SWORD;
501 dummy2 = SV_BASILLARD;
503 case 11: case 12: case 13:
504 dummy2 = SV_SHORT_SWORD;
513 dummy2 = SV_WAKIZASHI;
522 dummy2 = SV_BROAD_SWORD;
525 dummy2 = SV_LONG_SWORD;
528 dummy2 = SV_SCIMITAR;
537 dummy2 = SV_BASTARD_SWORD;
540 dummy2 = SV_GREAT_SCIMITAR;
543 dummy2 = SV_CLAYMORE;
549 dummy2 = SV_TWO_HANDED_SWORD;
552 dummy2 = SV_FLAMBERGE;
555 dummy2 = SV_NO_DACHI;
558 dummy2 = SV_EXECUTIONERS_SWORD;
561 dummy2 = SV_ZWEIHANDER;
564 dummy2 = SV_HAYABUSA;
567 dummy2 = SV_BLADE_OF_CHAOS;
570 object_prep(q_ptr, lookup_kind(dummy, dummy2));
571 q_ptr->to_h = 3 + randint1(current_floor_ptr->dun_level) % 10;
572 q_ptr->to_d = 3 + randint1(current_floor_ptr->dun_level) % 10;
573 one_resistance(q_ptr);
574 q_ptr->name2 = EGO_CHAOTIC;
575 (void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
581 * Curse the players armor
582 * @return 実際に呪縛されたらTRUEを返す
584 bool curse_armor(void)
589 GAME_TEXT o_name[MAX_NLEN];
591 /* Curse the body armor */
592 o_ptr = &inventory[INVEN_BODY];
594 /* Nothing to curse */
595 if (!o_ptr->k_idx) return (FALSE);
597 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
599 /* Attempt a saving throw for artifacts */
600 if (object_is_artifact(o_ptr) && (randint0(100) < 50))
604 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
605 "恐怖の暗黒オーラ", "防具", o_name);
607 msg_format("A %s tries to %s, but your %s resists the effects!",
608 "terrible black aura", "surround your armor", o_name);
613 /* not artifact or failed save... */
616 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
617 chg_virtue(V_ENCHANT, -5);
619 /* Blast the armor */
621 o_ptr->name2 = EGO_BLASTED;
622 o_ptr->to_a = 0 - randint1(5) - randint1(5);
629 for (i = 0; i < TR_FLAG_SIZE; i++)
630 o_ptr->art_flags[i] = 0;
633 o_ptr->curse_flags = TRC_CURSED;
636 o_ptr->ident |= (IDENT_BROKEN);
637 p_ptr->update |= (PU_BONUS | PU_MANA);
638 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
646 * Curse the players weapon
647 * @param force 無条件に呪縛を行うならばTRUE
648 * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
649 * @return 実際に呪縛されたらTRUEを返す
651 bool curse_weapon_object(bool force, object_type *o_ptr)
654 GAME_TEXT o_name[MAX_NLEN];
656 /* Nothing to curse */
657 if (!o_ptr->k_idx) return (FALSE);
658 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
660 /* Attempt a saving throw */
661 if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
665 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
666 "恐怖の暗黒オーラ", "武器", o_name);
668 msg_format("A %s tries to %s, but your %s resists the effects!",
669 "terrible black aura", "surround your weapon", o_name);
673 /* not artifact or failed save... */
676 if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
677 chg_virtue(V_ENCHANT, -5);
679 /* Shatter the weapon */
681 o_ptr->name2 = EGO_SHATTERED;
682 o_ptr->to_h = 0 - randint1(5) - randint1(5);
683 o_ptr->to_d = 0 - randint1(5) - randint1(5);
689 for (i = 0; i < TR_FLAG_SIZE; i++)
690 o_ptr->art_flags[i] = 0;
693 o_ptr->curse_flags = TRC_CURSED;
696 o_ptr->ident |= (IDENT_BROKEN);
697 p_ptr->update |= (PU_BONUS | PU_MANA);
698 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
705 * @brief 武器呪縛処理のメインルーチン /
706 * Curse the players weapon
707 * @param force 無条件に呪縛を行うならばTRUE
708 * @param slot 呪縛する武器の装備スロット
709 * @return 実際に呪縛されたらTRUEを返す
711 bool curse_weapon(bool force, int slot)
713 return curse_weapon_object(force, &inventory[slot]);
719 * @return ターン消費を要する処理を行ったならばTRUEを返す
725 GAME_TEXT o_name[MAX_NLEN];
728 /* Select a piece of armour */
729 item_tester_hook = object_is_armour;
731 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
732 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
734 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
735 if (!o_ptr) return FALSE;
737 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
739 add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
741 if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
744 msg_format("%sは新品同様になった!", o_name);
746 msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
753 msg_format("%sは腐食しなくなった。", o_name);
755 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
763 * @brief ボルトのエゴ化処理(火炎エゴのみ) /
767 bool brand_bolts(void)
771 /* Use the first acceptable bolts */
772 for (i = 0; i < INVEN_PACK; i++)
774 object_type *o_ptr = &inventory[i];
777 if (o_ptr->tval != TV_BOLT) continue;
779 /* Skip artifacts and ego-items */
780 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
783 /* Skip cursed/broken items */
784 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
787 if (randint0(100) < 75) continue;
789 msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
792 o_ptr->name2 = EGO_FLAME;
793 enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
797 if (flush_failure) flush();
800 msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
806 bool perilous_secrets(player_type *creature_ptr)
808 if (!ident_spell(FALSE)) return FALSE;
810 if (mp_ptr->spell_book)
812 /* Sufficient mana */
813 if (20 <= creature_ptr->csp)
816 creature_ptr->csp -= 20;
819 /* Over-exert the player */
822 int oops = 20 - creature_ptr->csp;
825 creature_ptr->csp = 0;
826 creature_ptr->csp_frac = 0;
828 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
829 /* Hack -- Bypass free action */
830 (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
833 (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
835 creature_ptr->redraw |= (PR_MANA);
837 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
839 if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
841 /* Exercise a little care... */
842 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
848 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
849 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
850 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
853 void get_bloody_moon_flags(object_type *o_ptr)
857 for (i = 0; i < TR_FLAG_SIZE; i++)
858 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
860 dummy = randint1(2) + randint1(2);
861 for (i = 0; i < dummy; i++)
863 int flag = randint0(26);
864 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
865 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
866 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
867 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
871 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
873 for (i = 0; i < 2; i++)
875 int tmp = randint0(11);
876 if (tmp < A_MAX) add_flag(o_ptr->art_flags, TR_STR + tmp);
877 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
882 * @brief 寿命つき光源の燃素追加処理 /
883 * Charge a lite (torch or latern)
886 void phlogiston(void)
888 GAME_TURN max_flog = 0;
889 object_type * o_ptr = &inventory[INVEN_LITE];
892 if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
894 max_flog = FUEL_LAMP;
898 else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
900 max_flog = FUEL_TORCH;
903 /* No torch to refill */
906 msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
910 if (o_ptr->xtra4 >= max_flog)
912 msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
917 o_ptr->xtra4 += (XTRA16)(max_flog / 2);
918 msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
920 if (o_ptr->xtra4 >= max_flog)
922 o_ptr->xtra4 = (XTRA16)max_flog;
923 msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
926 p_ptr->update |= (PU_TORCH);
932 * @return ターン消費を要する処理を行ったならばTRUEを返す
934 bool bless_weapon(void)
938 BIT_FLAGS flgs[TR_FLAG_SIZE];
939 GAME_TEXT o_name[MAX_NLEN];
942 /* Bless only weapons */
943 item_tester_hook = object_is_weapon;
945 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
946 s = _("祝福できる武器がありません。", "You have weapon to bless.");
948 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
949 if (!o_ptr) return FALSE;
951 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
952 object_flags(o_ptr, flgs);
954 if (object_is_cursed(o_ptr))
956 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
957 have_flag(flgs, TR_ADD_L_CURSE) ||
958 have_flag(flgs, TR_ADD_H_CURSE) ||
959 (o_ptr->curse_flags & TRC_PERMA_CURSE))
962 msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
964 msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
971 msg_format("%s から邪悪なオーラが消えた。", o_name);
973 msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
977 o_ptr->curse_flags = 0L;
979 o_ptr->ident |= (IDENT_SENSE);
980 o_ptr->feeling = FEEL_NONE;
982 /* Recalculate the bonuses */
983 p_ptr->update |= (PU_BONUS);
984 p_ptr->window |= (PW_EQUIP);
988 * Next, we try to bless it. Artifacts have a 1/3 chance of
989 * being blessed, otherwise, the operation simply disenchants
990 * them, godly power negating the magic. Ok, the explanation
991 * is silly, but otherwise priests would always bless every
992 * artifact weapon they find. Ego weapons and normal weapons
993 * can be blessed automatically.
995 if (have_flag(flgs, TR_BLESSED))
998 msg_format("%s は既に祝福されている。", o_name);
1000 msg_format("%s %s %s blessed already.",
1001 ((item >= 0) ? "Your" : "The"), o_name,
1002 ((o_ptr->number > 1) ? "were" : "was"));
1008 if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
1011 msg_format("%sは輝いた!", o_name);
1013 msg_format("%s %s shine%s!",
1014 ((item >= 0) ? "Your" : "The"), o_name,
1015 ((o_ptr->number > 1) ? "" : "s"));
1018 add_flag(o_ptr->art_flags, TR_BLESSED);
1019 o_ptr->discount = 99;
1023 bool dis_happened = FALSE;
1024 msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
1026 /* Disenchant tohit */
1027 if (o_ptr->to_h > 0)
1030 dis_happened = TRUE;
1033 if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
1035 /* Disenchant todam */
1036 if (o_ptr->to_d > 0)
1039 dis_happened = TRUE;
1042 if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
1044 /* Disenchant toac */
1045 if (o_ptr->to_a > 0)
1048 dis_happened = TRUE;
1051 if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
1055 msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
1058 msg_format("%s は劣化した!", o_name);
1060 msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
1061 ((o_ptr->number > 1) ? "were" : "was"));
1067 p_ptr->update |= (PU_BONUS);
1068 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
1078 * @return ターン消費を要する処理を行ったならばTRUEを返す
1080 bool pulish_shield(void)
1084 BIT_FLAGS flgs[TR_FLAG_SIZE];
1085 GAME_TEXT o_name[MAX_NLEN];
1088 /* Assume enchant weapon */
1089 item_tester_tval = TV_SHIELD;
1091 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
1092 s = _("磨く盾がありません。", "You have weapon to pulish.");
1094 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1095 if (!o_ptr) return FALSE;
1097 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1098 object_flags(o_ptr, flgs);
1100 if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
1101 !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
1104 msg_format("%sは輝いた!", o_name);
1106 msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
1108 o_ptr->name2 = EGO_REFLECTION;
1109 enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
1111 o_ptr->discount = 99;
1112 chg_virtue(V_ENCHANT, 2);
1118 if (flush_failure) flush();
1120 msg_print(_("失敗した。", "Failed."));
1121 chg_virtue(V_ENCHANT, -2);