9 #include "spells-object.h"
10 #include "object-boost.h"
11 #include "object-hook.h"
12 #include "object-flavor.h"
13 #include "object-ego.h"
14 #include "player-status.h"
16 #include "player-effects.h"
17 #include "player-class.h"
18 #include "objectkind.h"
20 #include "targeting.h"
25 OBJECT_TYPE_VALUE tval;
26 OBJECT_SUBTYPE_VALUE sval;
32 * Scatter some "amusing" objects near the player
35 #define AMS_NOTHING 0x00 /* No restriction */
36 #define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */
37 #define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */
38 #define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */
39 #define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */
41 static amuse_type amuse_info[] =
43 { TV_BOTTLE, SV_ANY, 5, AMS_NOTHING },
44 { TV_JUNK, SV_ANY, 3, AMS_MULTIPLE },
45 { TV_SPIKE, SV_ANY, 10, AMS_PILE },
46 { TV_STATUE, SV_ANY, 15, AMS_NOTHING },
47 { TV_CORPSE, SV_ANY, 15, AMS_NO_UNIQUE },
48 { TV_SKELETON, SV_ANY, 10, AMS_NO_UNIQUE },
49 { TV_FIGURINE, SV_ANY, 10, AMS_NO_UNIQUE },
50 { TV_PARCHMENT, SV_ANY, 1, AMS_NOTHING },
51 { TV_POLEARM, SV_TSURIZAO, 3, AMS_NOTHING }, //Fishing Pole of Taikobo
52 { TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, //Broken Dagger of Magician
53 { TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING },
54 { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
55 { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
61 * @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
62 * Hook to determine if an object is contertible in an arrow/bolt
63 * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す
65 bool create_ammo(void)
74 GAME_TEXT o_name[MAX_NLEN];
79 sprintf(com, _("[S]弾, [A]矢, [B]クロスボウの矢 :", "Create [S]hots, Create [A]rrow or Create [B]olt ?"));
80 else if (p_ptr->lev >= 10)
81 sprintf(com, _("[S]弾, [A]矢:", "Create [S]hots or Create [A]rrow ?"));
83 sprintf(com, _("[S]弾:", "Create [S]hots ?"));
87 msg_print(_("混乱してる!", "You are too confused!"));
93 msg_print(_("目が見えない!", "You are blind!"));
99 if (!get_com(com, &ch, TRUE))
103 if (ch == 'S' || ch == 's')
108 if ((ch == 'A' || ch == 'a') && (p_ptr->lev >= 10))
113 if ((ch == 'B' || ch == 'b') && (p_ptr->lev >= 20))
120 /**********Create shots*********/
127 if (!get_rep_dir(&dir, FALSE)) return FALSE;
128 y = p_ptr->y + ddy[dir];
129 x = p_ptr->x + ddx[dir];
130 g_ptr = ¤t_floor_ptr->grid_array[y][x];
132 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
134 msg_print(_("そこには岩石がない。", "You need pile of rubble."));
137 else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
139 msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
146 /* Hack -- Give the player some small firestones */
147 object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
148 q_ptr->number = (byte)rand_range(15, 30);
151 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
152 q_ptr->discount = 99;
154 slot = inven_carry(q_ptr);
156 object_desc(o_name, q_ptr, 0);
157 msg_format(_("%sを作った。", "You make some ammo."), o_name);
159 /* Auto-inscription */
160 if (slot >= 0) autopick_alter_item(slot, FALSE);
162 /* Destroy the wall */
163 cave_alter_feat(y, x, FF_HURT_ROCK);
165 p_ptr->update |= (PU_FLOW);
168 /**********Create arrows*********/
175 item_tester_hook = item_tester_hook_convertible;
177 q = _("どのアイテムから作りますか? ", "Convert which item? ");
178 s = _("材料を持っていない。", "You have no item to convert.");
179 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
180 if (!q_ptr) return FALSE;
184 /* Hack -- Give the player some small firestones */
185 object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
186 q_ptr->number = (byte)rand_range(5, 10);
189 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
191 q_ptr->discount = 99;
193 object_desc(o_name, q_ptr, 0);
194 msg_format(_("%sを作った。", "You make some ammo."), o_name);
198 inven_item_increase(item, -1);
199 inven_item_describe(item);
200 inven_item_optimize(item);
204 floor_item_increase(0 - item, -1);
205 floor_item_describe(0 - item);
206 floor_item_optimize(0 - item);
209 slot = inven_carry(q_ptr);
211 /* Auto-inscription */
212 if (slot >= 0) autopick_alter_item(slot, FALSE);
214 /**********Create bolts*********/
221 item_tester_hook = item_tester_hook_convertible;
223 q = _("どのアイテムから作りますか? ", "Convert which item? ");
224 s = _("材料を持っていない。", "You have no item to convert.");
226 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
227 if (!q_ptr) return FALSE;
231 /* Hack -- Give the player some small firestones */
232 object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
233 q_ptr->number = (byte)rand_range(4, 8);
236 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
238 q_ptr->discount = 99;
240 object_desc(o_name, q_ptr, 0);
241 msg_format(_("%sを作った。", "You make some ammo."), o_name);
245 inven_item_increase(item, -1);
246 inven_item_describe(item);
247 inven_item_optimize(item);
251 floor_item_increase(0 - item, -1);
252 floor_item_describe(0 - item);
253 floor_item_optimize(0 - item);
256 slot = inven_carry(q_ptr);
258 /* Auto-inscription */
259 if (slot >= 0) autopick_alter_item(slot, FALSE);
265 * @brief 魔道具術師の魔力取り込み処理
266 * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す
268 bool import_magic_device(void)
271 PARAMETER_VALUE pval;
275 GAME_TEXT o_name[MAX_NLEN];
277 /* Only accept legal items */
278 item_tester_hook = item_tester_hook_recharge;
280 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
281 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
283 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
284 if (!o_ptr) return (FALSE);
286 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
288 msg_print(_("この杖には発動の為の能力は何も備わっていないようだ。", "This staff doesn't have any magical ability."));
292 if (!object_is_known(o_ptr))
294 msg_print(_("鑑定されていないと取り込めない。", "You need to identify before absorbing."));
300 msg_print(_("充填中のアイテムは取り込めない。", "This item is still charging."));
305 if (o_ptr->tval == TV_ROD)
307 else if (o_ptr->tval == TV_WAND)
310 if (o_ptr->tval == TV_ROD)
312 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)o_ptr->number;
313 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
318 for (num = o_ptr->number; num; num--)
321 if (o_ptr->tval == TV_WAND) gain_num = (pval + num - 1) / num;
322 if (p_ptr->magic_num2[o_ptr->sval + ext])
325 gain_num = (gain_num / 3 + randint0(gain_num / 3)) / 256;
326 if (gain_num < 1) gain_num = 1;
328 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)gain_num;
329 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
330 p_ptr->magic_num1[o_ptr->sval + ext] += pval * 0x10000;
331 if (p_ptr->magic_num1[o_ptr->sval + ext] > 99 * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = 99 * 0x10000;
332 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;
333 if (o_ptr->tval == TV_WAND) pval -= (pval + num - 1) / num;
337 object_desc(o_name, o_ptr, 0);
338 msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
340 /* Eliminate the item (from the pack) */
343 inven_item_increase(item, -999);
344 inven_item_describe(item);
345 inven_item_optimize(item);
348 /* Eliminate the item (from the floor) */
351 floor_item_increase(0 - item, -999);
352 floor_item_describe(0 - item);
353 floor_item_optimize(0 - item);
355 take_turn(p_ptr, 100);
361 * @param y1 配置したいフロアのY座標
362 * @param x1 配置したいフロアのX座標
364 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
367 void amusement(POSITION y1, POSITION x1, int num, bool known)
370 object_type object_type_body;
373 for (n = 0; amuse_info[n].tval != 0; n++)
375 t += amuse_info[n].prob;
382 KIND_OBJECT_IDX k_idx;
383 ARTIFACT_IDX a_idx = 0;
385 bool insta_art, fixed_art;
389 r -= amuse_info[i].prob;
392 i_ptr = &object_type_body;
394 k_idx = lookup_kind(amuse_info[i].tval, amuse_info[i].sval);
396 /* Paranoia - reroll if nothing */
397 if (!k_idx) continue;
399 /* Search an artifact index if need */
400 insta_art = (k_info[k_idx].gen_flags & TRG_INSTA_ART);
401 fixed_art = (amuse_info[i].flag & AMS_FIXED_ART);
403 if (insta_art || fixed_art)
405 for (a_idx = 1; a_idx < max_a_idx; a_idx++)
407 if (insta_art && !(a_info[a_idx].gen_flags & TRG_INSTA_ART)) continue;
408 if (a_info[a_idx].tval != k_info[k_idx].tval) continue;
409 if (a_info[a_idx].sval != k_info[k_idx].sval) continue;
410 if (a_info[a_idx].cur_num > 0) continue;
414 if (a_idx >= max_a_idx) continue;
417 /* Make an object (if possible) */
418 object_prep(i_ptr, k_idx);
419 if (a_idx) i_ptr->name1 = a_idx;
420 apply_magic(i_ptr, 1, AM_NO_FIXED_ART);
422 if (amuse_info[i].flag & AMS_NO_UNIQUE)
424 if (r_info[i_ptr->pval].flags1 & RF1_UNIQUE) continue;
427 if (amuse_info[i].flag & AMS_MULTIPLE) i_ptr->number = randint1(3);
428 if (amuse_info[i].flag & AMS_PILE) i_ptr->number = randint1(99);
436 /* Paranoia - reroll if nothing */
437 if (!(i_ptr->k_idx)) continue;
439 (void)drop_near(i_ptr, -1, y1, x1);
449 * Scatter some "great" objects near the player
450 * @param y1 配置したいフロアのY座標
451 * @param x1 配置したいフロアのX座標
453 * @param great TRUEならば必ず高級品以上を落とす
454 * @param special TRUEならば必ず特別品を落とす
455 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
458 void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
461 object_type object_type_body;
462 BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
467 i_ptr = &object_type_body;
470 /* Make a good (or great) object (if possible) */
471 if (!make_object(i_ptr, mode)) continue;
479 (void)drop_near(i_ptr, -1, y1, x1);
483 void acquire_chaos_weapon(player_type *creature_ptr)
486 object_type *q_ptr = &forge;
487 OBJECT_TYPE_VALUE dummy = TV_SWORD;
488 OBJECT_SUBTYPE_VALUE dummy2;
489 switch (randint1(creature_ptr->lev))
495 dummy2 = SV_MAIN_GAUCHE;
504 dummy2 = SV_SMALL_SWORD;
507 dummy2 = SV_BASILLARD;
509 case 11: case 12: case 13:
510 dummy2 = SV_SHORT_SWORD;
519 dummy2 = SV_WAKIZASHI;
528 dummy2 = SV_BROAD_SWORD;
531 dummy2 = SV_LONG_SWORD;
534 dummy2 = SV_SCIMITAR;
543 dummy2 = SV_BASTARD_SWORD;
546 dummy2 = SV_GREAT_SCIMITAR;
549 dummy2 = SV_CLAYMORE;
555 dummy2 = SV_TWO_HANDED_SWORD;
558 dummy2 = SV_FLAMBERGE;
561 dummy2 = SV_NO_DACHI;
564 dummy2 = SV_EXECUTIONERS_SWORD;
567 dummy2 = SV_ZWEIHANDER;
570 dummy2 = SV_HAYABUSA;
573 dummy2 = SV_BLADE_OF_CHAOS;
576 object_prep(q_ptr, lookup_kind(dummy, dummy2));
577 q_ptr->to_h = 3 + randint1(current_floor_ptr->dun_level) % 10;
578 q_ptr->to_d = 3 + randint1(current_floor_ptr->dun_level) % 10;
579 one_resistance(q_ptr);
580 q_ptr->name2 = EGO_CHAOTIC;
581 (void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
587 * Curse the players armor
588 * @return 実際に呪縛されたらTRUEを返す
590 bool curse_armor(void)
595 GAME_TEXT o_name[MAX_NLEN];
597 /* Curse the body armor */
598 o_ptr = &p_ptr->inventory_list[INVEN_BODY];
600 /* Nothing to curse */
601 if (!o_ptr->k_idx) return (FALSE);
603 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
605 /* Attempt a saving throw for artifacts */
606 if (object_is_artifact(o_ptr) && (randint0(100) < 50))
610 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
611 "恐怖の暗黒オーラ", "防具", o_name);
613 msg_format("A %s tries to %s, but your %s resists the effects!",
614 "terrible black aura", "surround your armor", o_name);
619 /* not artifact or failed save... */
622 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
623 chg_virtue(V_ENCHANT, -5);
625 /* Blast the armor */
627 o_ptr->name2 = EGO_BLASTED;
628 o_ptr->to_a = 0 - randint1(5) - randint1(5);
635 for (i = 0; i < TR_FLAG_SIZE; i++)
636 o_ptr->art_flags[i] = 0;
639 o_ptr->curse_flags = TRC_CURSED;
642 o_ptr->ident |= (IDENT_BROKEN);
643 p_ptr->update |= (PU_BONUS | PU_MANA);
644 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
652 * Curse the players weapon
653 * @param force 無条件に呪縛を行うならばTRUE
654 * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
655 * @return 実際に呪縛されたらTRUEを返す
657 bool curse_weapon_object(bool force, object_type *o_ptr)
660 GAME_TEXT o_name[MAX_NLEN];
662 /* Nothing to curse */
663 if (!o_ptr->k_idx) return (FALSE);
664 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
666 /* Attempt a saving throw */
667 if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
671 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
672 "恐怖の暗黒オーラ", "武器", o_name);
674 msg_format("A %s tries to %s, but your %s resists the effects!",
675 "terrible black aura", "surround your weapon", o_name);
679 /* not artifact or failed save... */
682 if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
683 chg_virtue(V_ENCHANT, -5);
685 /* Shatter the weapon */
687 o_ptr->name2 = EGO_SHATTERED;
688 o_ptr->to_h = 0 - randint1(5) - randint1(5);
689 o_ptr->to_d = 0 - randint1(5) - randint1(5);
695 for (i = 0; i < TR_FLAG_SIZE; i++)
696 o_ptr->art_flags[i] = 0;
699 o_ptr->curse_flags = TRC_CURSED;
702 o_ptr->ident |= (IDENT_BROKEN);
703 p_ptr->update |= (PU_BONUS | PU_MANA);
704 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
711 * @brief 武器呪縛処理のメインルーチン /
712 * Curse the players weapon
713 * @param force 無条件に呪縛を行うならばTRUE
714 * @param slot 呪縛する武器の装備スロット
715 * @return 実際に呪縛されたらTRUEを返す
717 bool curse_weapon(bool force, int slot)
719 return curse_weapon_object(force, &p_ptr->inventory_list[slot]);
725 * @return ターン消費を要する処理を行ったならばTRUEを返す
731 GAME_TEXT o_name[MAX_NLEN];
734 /* Select a piece of armour */
735 item_tester_hook = object_is_armour;
737 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
738 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
740 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
741 if (!o_ptr) return FALSE;
743 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
745 add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
747 if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
750 msg_format("%sは新品同様になった!", o_name);
752 msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
759 msg_format("%sは腐食しなくなった。", o_name);
761 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
769 * @brief ボルトのエゴ化処理(火炎エゴのみ) /
773 bool brand_bolts(void)
777 /* Use the first acceptable bolts */
778 for (i = 0; i < INVEN_PACK; i++)
780 object_type *o_ptr = &p_ptr->inventory_list[i];
783 if (o_ptr->tval != TV_BOLT) continue;
785 /* Skip artifacts and ego-items */
786 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
789 /* Skip cursed/broken items */
790 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
793 if (randint0(100) < 75) continue;
795 msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
798 o_ptr->name2 = EGO_FLAME;
799 enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
803 if (flush_failure) flush();
806 msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
812 bool perilous_secrets(player_type *creature_ptr)
814 if (!ident_spell(FALSE)) return FALSE;
816 if (mp_ptr->spell_book)
818 /* Sufficient mana */
819 if (20 <= creature_ptr->csp)
822 creature_ptr->csp -= 20;
825 /* Over-exert the player */
828 int oops = 20 - creature_ptr->csp;
831 creature_ptr->csp = 0;
832 creature_ptr->csp_frac = 0;
834 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
835 /* Hack -- Bypass free action */
836 (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
839 (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
841 creature_ptr->redraw |= (PR_MANA);
843 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
845 if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
847 /* Exercise a little care... */
848 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
854 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
855 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
856 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
859 void get_bloody_moon_flags(object_type *o_ptr)
863 for (i = 0; i < TR_FLAG_SIZE; i++)
864 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
866 dummy = randint1(2) + randint1(2);
867 for (i = 0; i < dummy; i++)
869 int flag = randint0(26);
870 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
871 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
872 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
873 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
877 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
879 for (i = 0; i < 2; i++)
881 int tmp = randint0(11);
882 if (tmp < A_MAX) add_flag(o_ptr->art_flags, TR_STR + tmp);
883 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
888 * @brief 寿命つき光源の燃素追加処理 /
889 * Charge a lite (torch or latern)
892 void phlogiston(void)
894 GAME_TURN max_flog = 0;
895 object_type * o_ptr = &p_ptr->inventory_list[INVEN_LITE];
898 if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
900 max_flog = FUEL_LAMP;
904 else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
906 max_flog = FUEL_TORCH;
909 /* No torch to refill */
912 msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
916 if (o_ptr->xtra4 >= max_flog)
918 msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
923 o_ptr->xtra4 += (XTRA16)(max_flog / 2);
924 msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
926 if (o_ptr->xtra4 >= max_flog)
928 o_ptr->xtra4 = (XTRA16)max_flog;
929 msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
932 p_ptr->update |= (PU_TORCH);
938 * @return ターン消費を要する処理を行ったならばTRUEを返す
940 bool bless_weapon(void)
944 BIT_FLAGS flgs[TR_FLAG_SIZE];
945 GAME_TEXT o_name[MAX_NLEN];
948 /* Bless only weapons */
949 item_tester_hook = object_is_weapon;
951 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
952 s = _("祝福できる武器がありません。", "You have weapon to bless.");
954 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
955 if (!o_ptr) return FALSE;
957 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
958 object_flags(o_ptr, flgs);
960 if (object_is_cursed(o_ptr))
962 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
963 have_flag(flgs, TR_ADD_L_CURSE) ||
964 have_flag(flgs, TR_ADD_H_CURSE) ||
965 (o_ptr->curse_flags & TRC_PERMA_CURSE))
968 msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
970 msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
977 msg_format("%s から邪悪なオーラが消えた。", o_name);
979 msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
983 o_ptr->curse_flags = 0L;
985 o_ptr->ident |= (IDENT_SENSE);
986 o_ptr->feeling = FEEL_NONE;
988 /* Recalculate the bonuses */
989 p_ptr->update |= (PU_BONUS);
990 p_ptr->window |= (PW_EQUIP);
994 * Next, we try to bless it. Artifacts have a 1/3 chance of
995 * being blessed, otherwise, the operation simply disenchants
996 * them, godly power negating the magic. Ok, the explanation
997 * is silly, but otherwise priests would always bless every
998 * artifact weapon they find. Ego weapons and normal weapons
999 * can be blessed automatically.
1001 if (have_flag(flgs, TR_BLESSED))
1004 msg_format("%s は既に祝福されている。", o_name);
1006 msg_format("%s %s %s blessed already.",
1007 ((item >= 0) ? "Your" : "The"), o_name,
1008 ((o_ptr->number > 1) ? "were" : "was"));
1014 if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
1017 msg_format("%sは輝いた!", o_name);
1019 msg_format("%s %s shine%s!",
1020 ((item >= 0) ? "Your" : "The"), o_name,
1021 ((o_ptr->number > 1) ? "" : "s"));
1024 add_flag(o_ptr->art_flags, TR_BLESSED);
1025 o_ptr->discount = 99;
1029 bool dis_happened = FALSE;
1030 msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
1032 /* Disenchant tohit */
1033 if (o_ptr->to_h > 0)
1036 dis_happened = TRUE;
1039 if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
1041 /* Disenchant todam */
1042 if (o_ptr->to_d > 0)
1045 dis_happened = TRUE;
1048 if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
1050 /* Disenchant toac */
1051 if (o_ptr->to_a > 0)
1054 dis_happened = TRUE;
1057 if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
1061 msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
1064 msg_format("%s は劣化した!", o_name);
1066 msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
1067 ((o_ptr->number > 1) ? "were" : "was"));
1073 p_ptr->update |= (PU_BONUS);
1074 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
1084 * @return ターン消費を要する処理を行ったならばTRUEを返す
1086 bool pulish_shield(void)
1090 BIT_FLAGS flgs[TR_FLAG_SIZE];
1091 GAME_TEXT o_name[MAX_NLEN];
1094 /* Assume enchant weapon */
1095 item_tester_tval = TV_SHIELD;
1097 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
1098 s = _("磨く盾がありません。", "You have weapon to pulish.");
1100 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1101 if (!o_ptr) return FALSE;
1103 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1104 object_flags(o_ptr, flgs);
1106 if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
1107 !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
1110 msg_format("%sは輝いた!", o_name);
1112 msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
1114 o_ptr->name2 = EGO_REFLECTION;
1115 enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
1117 o_ptr->discount = 99;
1118 chg_virtue(V_ENCHANT, 2);
1124 if (flush_failure) flush();
1126 msg_print(_("失敗した。", "Failed."));
1127 chg_virtue(V_ENCHANT, -2);