9 #include "spells-object.h"
10 #include "object-boost.h"
11 #include "object-hook.h"
12 #include "object-flavor.h"
13 #include "player-status.h"
15 #include "player-effects.h"
16 #include "player-class.h"
17 #include "objectkind.h"
23 OBJECT_TYPE_VALUE tval;
24 OBJECT_SUBTYPE_VALUE sval;
30 * Scatter some "amusing" objects near the player
33 #define AMS_NOTHING 0x00 /* No restriction */
34 #define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */
35 #define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */
36 #define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */
37 #define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */
39 static amuse_type amuse_info[] =
41 { TV_BOTTLE, SV_ANY, 5, AMS_NOTHING },
42 { TV_JUNK, SV_ANY, 3, AMS_MULTIPLE },
43 { TV_SPIKE, SV_ANY, 10, AMS_PILE },
44 { TV_STATUE, SV_ANY, 15, AMS_NOTHING },
45 { TV_CORPSE, SV_ANY, 15, AMS_NO_UNIQUE },
46 { TV_SKELETON, SV_ANY, 10, AMS_NO_UNIQUE },
47 { TV_FIGURINE, SV_ANY, 10, AMS_NO_UNIQUE },
48 { TV_PARCHMENT, SV_ANY, 1, AMS_NOTHING },
49 { TV_POLEARM, SV_TSURIZAO, 3, AMS_NOTHING }, //Fishing Pole of Taikobo
50 { TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, //Broken Dagger of Magician
51 { TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING },
52 { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
53 { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
59 * @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
60 * Hook to determine if an object is contertible in an arrow/bolt
61 * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す
63 bool create_ammo(void)
72 GAME_TEXT o_name[MAX_NLEN];
77 sprintf(com, _("[S]弾, [A]矢, [B]クロスボウの矢 :", "Create [S]hots, Create [A]rrow or Create [B]olt ?"));
78 else if (p_ptr->lev >= 10)
79 sprintf(com, _("[S]弾, [A]矢:", "Create [S]hots or Create [A]rrow ?"));
81 sprintf(com, _("[S]弾:", "Create [S]hots ?"));
85 msg_print(_("混乱してる!", "You are too confused!"));
91 msg_print(_("目が見えない!", "You are blind!"));
97 if (!get_com(com, &ch, TRUE))
101 if (ch == 'S' || ch == 's')
106 if ((ch == 'A' || ch == 'a') && (p_ptr->lev >= 10))
111 if ((ch == 'B' || ch == 'b') && (p_ptr->lev >= 20))
118 /**********Create shots*********/
125 if (!get_rep_dir(&dir, FALSE)) return FALSE;
126 y = p_ptr->y + ddy[dir];
127 x = p_ptr->x + ddx[dir];
128 g_ptr = ¤t_floor_ptr->grid_array[y][x];
130 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
132 msg_print(_("そこには岩石がない。", "You need pile of rubble."));
135 else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
137 msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
144 /* Hack -- Give the player some small firestones */
145 object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
146 q_ptr->number = (byte)rand_range(15, 30);
149 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
150 q_ptr->discount = 99;
152 slot = inven_carry(q_ptr);
154 object_desc(o_name, q_ptr, 0);
155 msg_format(_("%sを作った。", "You make some ammo."), o_name);
157 /* Auto-inscription */
158 if (slot >= 0) autopick_alter_item(slot, FALSE);
160 /* Destroy the wall */
161 cave_alter_feat(y, x, FF_HURT_ROCK);
163 p_ptr->update |= (PU_FLOW);
166 /**********Create arrows*********/
173 item_tester_hook = item_tester_hook_convertible;
175 q = _("どのアイテムから作りますか? ", "Convert which item? ");
176 s = _("材料を持っていない。", "You have no item to convert.");
177 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
178 if (!q_ptr) return FALSE;
182 /* Hack -- Give the player some small firestones */
183 object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
184 q_ptr->number = (byte)rand_range(5, 10);
187 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
189 q_ptr->discount = 99;
191 object_desc(o_name, q_ptr, 0);
192 msg_format(_("%sを作った。", "You make some ammo."), o_name);
196 inven_item_increase(item, -1);
197 inven_item_describe(item);
198 inven_item_optimize(item);
202 floor_item_increase(0 - item, -1);
203 floor_item_describe(0 - item);
204 floor_item_optimize(0 - item);
207 slot = inven_carry(q_ptr);
209 /* Auto-inscription */
210 if (slot >= 0) autopick_alter_item(slot, FALSE);
212 /**********Create bolts*********/
219 item_tester_hook = item_tester_hook_convertible;
221 q = _("どのアイテムから作りますか? ", "Convert which item? ");
222 s = _("材料を持っていない。", "You have no item to convert.");
224 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
225 if (!q_ptr) return FALSE;
229 /* Hack -- Give the player some small firestones */
230 object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
231 q_ptr->number = (byte)rand_range(4, 8);
234 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
236 q_ptr->discount = 99;
238 object_desc(o_name, q_ptr, 0);
239 msg_format(_("%sを作った。", "You make some ammo."), o_name);
243 inven_item_increase(item, -1);
244 inven_item_describe(item);
245 inven_item_optimize(item);
249 floor_item_increase(0 - item, -1);
250 floor_item_describe(0 - item);
251 floor_item_optimize(0 - item);
254 slot = inven_carry(q_ptr);
256 /* Auto-inscription */
257 if (slot >= 0) autopick_alter_item(slot, FALSE);
263 * @brief 魔道具術師の魔力取り込み処理
264 * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す
266 bool import_magic_device(void)
269 PARAMETER_VALUE pval;
273 GAME_TEXT o_name[MAX_NLEN];
275 /* Only accept legal items */
276 item_tester_hook = item_tester_hook_recharge;
278 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
279 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
281 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
282 if (!o_ptr) return (FALSE);
284 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
286 msg_print(_("この杖には発動の為の能力は何も備わっていないようだ。", "This staff doesn't have any magical ability."));
290 if (!object_is_known(o_ptr))
292 msg_print(_("鑑定されていないと取り込めない。", "You need to identify before absorbing."));
298 msg_print(_("充填中のアイテムは取り込めない。", "This item is still charging."));
303 if (o_ptr->tval == TV_ROD)
305 else if (o_ptr->tval == TV_WAND)
308 if (o_ptr->tval == TV_ROD)
310 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)o_ptr->number;
311 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
316 for (num = o_ptr->number; num; num--)
319 if (o_ptr->tval == TV_WAND) gain_num = (pval + num - 1) / num;
320 if (p_ptr->magic_num2[o_ptr->sval + ext])
323 gain_num = (gain_num / 3 + randint0(gain_num / 3)) / 256;
324 if (gain_num < 1) gain_num = 1;
326 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)gain_num;
327 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
328 p_ptr->magic_num1[o_ptr->sval + ext] += pval * 0x10000;
329 if (p_ptr->magic_num1[o_ptr->sval + ext] > 99 * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = 99 * 0x10000;
330 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;
331 if (o_ptr->tval == TV_WAND) pval -= (pval + num - 1) / num;
335 object_desc(o_name, o_ptr, 0);
336 msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
338 /* Eliminate the item (from the pack) */
341 inven_item_increase(item, -999);
342 inven_item_describe(item);
343 inven_item_optimize(item);
346 /* Eliminate the item (from the floor) */
349 floor_item_increase(0 - item, -999);
350 floor_item_describe(0 - item);
351 floor_item_optimize(0 - item);
353 take_turn(p_ptr, 100);
359 * @param y1 配置したいフロアのY座標
360 * @param x1 配置したいフロアのX座標
362 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
365 void amusement(POSITION y1, POSITION x1, int num, bool known)
368 object_type object_type_body;
371 for (n = 0; amuse_info[n].tval != 0; n++)
373 t += amuse_info[n].prob;
380 KIND_OBJECT_IDX k_idx;
381 ARTIFACT_IDX a_idx = 0;
383 bool insta_art, fixed_art;
387 r -= amuse_info[i].prob;
390 i_ptr = &object_type_body;
392 k_idx = lookup_kind(amuse_info[i].tval, amuse_info[i].sval);
394 /* Paranoia - reroll if nothing */
395 if (!k_idx) continue;
397 /* Search an artifact index if need */
398 insta_art = (k_info[k_idx].gen_flags & TRG_INSTA_ART);
399 fixed_art = (amuse_info[i].flag & AMS_FIXED_ART);
401 if (insta_art || fixed_art)
403 for (a_idx = 1; a_idx < max_a_idx; a_idx++)
405 if (insta_art && !(a_info[a_idx].gen_flags & TRG_INSTA_ART)) continue;
406 if (a_info[a_idx].tval != k_info[k_idx].tval) continue;
407 if (a_info[a_idx].sval != k_info[k_idx].sval) continue;
408 if (a_info[a_idx].cur_num > 0) continue;
412 if (a_idx >= max_a_idx) continue;
415 /* Make an object (if possible) */
416 object_prep(i_ptr, k_idx);
417 if (a_idx) i_ptr->name1 = a_idx;
418 apply_magic(i_ptr, 1, AM_NO_FIXED_ART);
420 if (amuse_info[i].flag & AMS_NO_UNIQUE)
422 if (r_info[i_ptr->pval].flags1 & RF1_UNIQUE) continue;
425 if (amuse_info[i].flag & AMS_MULTIPLE) i_ptr->number = randint1(3);
426 if (amuse_info[i].flag & AMS_PILE) i_ptr->number = randint1(99);
434 /* Paranoia - reroll if nothing */
435 if (!(i_ptr->k_idx)) continue;
437 (void)drop_near(i_ptr, -1, y1, x1);
447 * Scatter some "great" objects near the player
448 * @param y1 配置したいフロアのY座標
449 * @param x1 配置したいフロアのX座標
451 * @param great TRUEならば必ず高級品以上を落とす
452 * @param special TRUEならば必ず特別品を落とす
453 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
456 void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
459 object_type object_type_body;
460 BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
465 i_ptr = &object_type_body;
468 /* Make a good (or great) object (if possible) */
469 if (!make_object(i_ptr, mode)) continue;
477 (void)drop_near(i_ptr, -1, y1, x1);
481 void acquire_chaos_weapon(player_type *creature_ptr)
484 object_type *q_ptr = &forge;
485 OBJECT_TYPE_VALUE dummy = TV_SWORD;
486 OBJECT_SUBTYPE_VALUE dummy2;
487 switch (randint1(creature_ptr->lev))
493 dummy2 = SV_MAIN_GAUCHE;
502 dummy2 = SV_SMALL_SWORD;
505 dummy2 = SV_BASILLARD;
507 case 11: case 12: case 13:
508 dummy2 = SV_SHORT_SWORD;
517 dummy2 = SV_WAKIZASHI;
526 dummy2 = SV_BROAD_SWORD;
529 dummy2 = SV_LONG_SWORD;
532 dummy2 = SV_SCIMITAR;
541 dummy2 = SV_BASTARD_SWORD;
544 dummy2 = SV_GREAT_SCIMITAR;
547 dummy2 = SV_CLAYMORE;
553 dummy2 = SV_TWO_HANDED_SWORD;
556 dummy2 = SV_FLAMBERGE;
559 dummy2 = SV_NO_DACHI;
562 dummy2 = SV_EXECUTIONERS_SWORD;
565 dummy2 = SV_ZWEIHANDER;
568 dummy2 = SV_HAYABUSA;
571 dummy2 = SV_BLADE_OF_CHAOS;
574 object_prep(q_ptr, lookup_kind(dummy, dummy2));
575 q_ptr->to_h = 3 + randint1(current_floor_ptr->dun_level) % 10;
576 q_ptr->to_d = 3 + randint1(current_floor_ptr->dun_level) % 10;
577 one_resistance(q_ptr);
578 q_ptr->name2 = EGO_CHAOTIC;
579 (void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
585 * Curse the players armor
586 * @return 実際に呪縛されたらTRUEを返す
588 bool curse_armor(void)
593 GAME_TEXT o_name[MAX_NLEN];
595 /* Curse the body armor */
596 o_ptr = &p_ptr->inventory_list[INVEN_BODY];
598 /* Nothing to curse */
599 if (!o_ptr->k_idx) return (FALSE);
601 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
603 /* Attempt a saving throw for artifacts */
604 if (object_is_artifact(o_ptr) && (randint0(100) < 50))
608 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
609 "恐怖の暗黒オーラ", "防具", o_name);
611 msg_format("A %s tries to %s, but your %s resists the effects!",
612 "terrible black aura", "surround your armor", o_name);
617 /* not artifact or failed save... */
620 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
621 chg_virtue(V_ENCHANT, -5);
623 /* Blast the armor */
625 o_ptr->name2 = EGO_BLASTED;
626 o_ptr->to_a = 0 - randint1(5) - randint1(5);
633 for (i = 0; i < TR_FLAG_SIZE; i++)
634 o_ptr->art_flags[i] = 0;
637 o_ptr->curse_flags = TRC_CURSED;
640 o_ptr->ident |= (IDENT_BROKEN);
641 p_ptr->update |= (PU_BONUS | PU_MANA);
642 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
650 * Curse the players weapon
651 * @param force 無条件に呪縛を行うならばTRUE
652 * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
653 * @return 実際に呪縛されたらTRUEを返す
655 bool curse_weapon_object(bool force, object_type *o_ptr)
658 GAME_TEXT o_name[MAX_NLEN];
660 /* Nothing to curse */
661 if (!o_ptr->k_idx) return (FALSE);
662 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
664 /* Attempt a saving throw */
665 if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
669 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
670 "恐怖の暗黒オーラ", "武器", o_name);
672 msg_format("A %s tries to %s, but your %s resists the effects!",
673 "terrible black aura", "surround your weapon", o_name);
677 /* not artifact or failed save... */
680 if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
681 chg_virtue(V_ENCHANT, -5);
683 /* Shatter the weapon */
685 o_ptr->name2 = EGO_SHATTERED;
686 o_ptr->to_h = 0 - randint1(5) - randint1(5);
687 o_ptr->to_d = 0 - randint1(5) - randint1(5);
693 for (i = 0; i < TR_FLAG_SIZE; i++)
694 o_ptr->art_flags[i] = 0;
697 o_ptr->curse_flags = TRC_CURSED;
700 o_ptr->ident |= (IDENT_BROKEN);
701 p_ptr->update |= (PU_BONUS | PU_MANA);
702 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
709 * @brief 武器呪縛処理のメインルーチン /
710 * Curse the players weapon
711 * @param force 無条件に呪縛を行うならばTRUE
712 * @param slot 呪縛する武器の装備スロット
713 * @return 実際に呪縛されたらTRUEを返す
715 bool curse_weapon(bool force, int slot)
717 return curse_weapon_object(force, &p_ptr->inventory_list[slot]);
723 * @return ターン消費を要する処理を行ったならばTRUEを返す
729 GAME_TEXT o_name[MAX_NLEN];
732 /* Select a piece of armour */
733 item_tester_hook = object_is_armour;
735 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
736 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
738 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
739 if (!o_ptr) return FALSE;
741 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
743 add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
745 if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
748 msg_format("%sは新品同様になった!", o_name);
750 msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
757 msg_format("%sは腐食しなくなった。", o_name);
759 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
767 * @brief ボルトのエゴ化処理(火炎エゴのみ) /
771 bool brand_bolts(void)
775 /* Use the first acceptable bolts */
776 for (i = 0; i < INVEN_PACK; i++)
778 object_type *o_ptr = &p_ptr->inventory_list[i];
781 if (o_ptr->tval != TV_BOLT) continue;
783 /* Skip artifacts and ego-items */
784 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
787 /* Skip cursed/broken items */
788 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
791 if (randint0(100) < 75) continue;
793 msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
796 o_ptr->name2 = EGO_FLAME;
797 enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
801 if (flush_failure) flush();
804 msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
810 bool perilous_secrets(player_type *creature_ptr)
812 if (!ident_spell(FALSE)) return FALSE;
814 if (mp_ptr->spell_book)
816 /* Sufficient mana */
817 if (20 <= creature_ptr->csp)
820 creature_ptr->csp -= 20;
823 /* Over-exert the player */
826 int oops = 20 - creature_ptr->csp;
829 creature_ptr->csp = 0;
830 creature_ptr->csp_frac = 0;
832 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
833 /* Hack -- Bypass free action */
834 (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
837 (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
839 creature_ptr->redraw |= (PR_MANA);
841 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
843 if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
845 /* Exercise a little care... */
846 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
852 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
853 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
854 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
857 void get_bloody_moon_flags(object_type *o_ptr)
861 for (i = 0; i < TR_FLAG_SIZE; i++)
862 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
864 dummy = randint1(2) + randint1(2);
865 for (i = 0; i < dummy; i++)
867 int flag = randint0(26);
868 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
869 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
870 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
871 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
875 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
877 for (i = 0; i < 2; i++)
879 int tmp = randint0(11);
880 if (tmp < A_MAX) add_flag(o_ptr->art_flags, TR_STR + tmp);
881 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
886 * @brief 寿命つき光源の燃素追加処理 /
887 * Charge a lite (torch or latern)
890 void phlogiston(void)
892 GAME_TURN max_flog = 0;
893 object_type * o_ptr = &p_ptr->inventory_list[INVEN_LITE];
896 if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
898 max_flog = FUEL_LAMP;
902 else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
904 max_flog = FUEL_TORCH;
907 /* No torch to refill */
910 msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
914 if (o_ptr->xtra4 >= max_flog)
916 msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
921 o_ptr->xtra4 += (XTRA16)(max_flog / 2);
922 msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
924 if (o_ptr->xtra4 >= max_flog)
926 o_ptr->xtra4 = (XTRA16)max_flog;
927 msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
930 p_ptr->update |= (PU_TORCH);
936 * @return ターン消費を要する処理を行ったならばTRUEを返す
938 bool bless_weapon(void)
942 BIT_FLAGS flgs[TR_FLAG_SIZE];
943 GAME_TEXT o_name[MAX_NLEN];
946 /* Bless only weapons */
947 item_tester_hook = object_is_weapon;
949 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
950 s = _("祝福できる武器がありません。", "You have weapon to bless.");
952 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
953 if (!o_ptr) return FALSE;
955 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
956 object_flags(o_ptr, flgs);
958 if (object_is_cursed(o_ptr))
960 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
961 have_flag(flgs, TR_ADD_L_CURSE) ||
962 have_flag(flgs, TR_ADD_H_CURSE) ||
963 (o_ptr->curse_flags & TRC_PERMA_CURSE))
966 msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
968 msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
975 msg_format("%s から邪悪なオーラが消えた。", o_name);
977 msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
981 o_ptr->curse_flags = 0L;
983 o_ptr->ident |= (IDENT_SENSE);
984 o_ptr->feeling = FEEL_NONE;
986 /* Recalculate the bonuses */
987 p_ptr->update |= (PU_BONUS);
988 p_ptr->window |= (PW_EQUIP);
992 * Next, we try to bless it. Artifacts have a 1/3 chance of
993 * being blessed, otherwise, the operation simply disenchants
994 * them, godly power negating the magic. Ok, the explanation
995 * is silly, but otherwise priests would always bless every
996 * artifact weapon they find. Ego weapons and normal weapons
997 * can be blessed automatically.
999 if (have_flag(flgs, TR_BLESSED))
1002 msg_format("%s は既に祝福されている。", o_name);
1004 msg_format("%s %s %s blessed already.",
1005 ((item >= 0) ? "Your" : "The"), o_name,
1006 ((o_ptr->number > 1) ? "were" : "was"));
1012 if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
1015 msg_format("%sは輝いた!", o_name);
1017 msg_format("%s %s shine%s!",
1018 ((item >= 0) ? "Your" : "The"), o_name,
1019 ((o_ptr->number > 1) ? "" : "s"));
1022 add_flag(o_ptr->art_flags, TR_BLESSED);
1023 o_ptr->discount = 99;
1027 bool dis_happened = FALSE;
1028 msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
1030 /* Disenchant tohit */
1031 if (o_ptr->to_h > 0)
1034 dis_happened = TRUE;
1037 if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
1039 /* Disenchant todam */
1040 if (o_ptr->to_d > 0)
1043 dis_happened = TRUE;
1046 if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
1048 /* Disenchant toac */
1049 if (o_ptr->to_a > 0)
1052 dis_happened = TRUE;
1055 if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
1059 msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
1062 msg_format("%s は劣化した!", o_name);
1064 msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
1065 ((o_ptr->number > 1) ? "were" : "was"));
1071 p_ptr->update |= (PU_BONUS);
1072 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
1082 * @return ターン消費を要する処理を行ったならばTRUEを返す
1084 bool pulish_shield(void)
1088 BIT_FLAGS flgs[TR_FLAG_SIZE];
1089 GAME_TEXT o_name[MAX_NLEN];
1092 /* Assume enchant weapon */
1093 item_tester_tval = TV_SHIELD;
1095 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
1096 s = _("磨く盾がありません。", "You have weapon to pulish.");
1098 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1099 if (!o_ptr) return FALSE;
1101 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1102 object_flags(o_ptr, flgs);
1104 if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
1105 !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
1108 msg_format("%sは輝いた!", o_name);
1110 msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
1112 o_ptr->name2 = EGO_REFLECTION;
1113 enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
1115 o_ptr->discount = 99;
1116 chg_virtue(V_ENCHANT, 2);
1122 if (flush_failure) flush();
1124 msg_print(_("失敗した。", "Failed."));
1125 chg_virtue(V_ENCHANT, -2);