4 #include "spells-object.h"
5 #include "object-boost.h"
6 #include "object-hook.h"
7 #include "player-status.h"
13 OBJECT_TYPE_VALUE tval;
14 OBJECT_SUBTYPE_VALUE sval;
20 * Scatter some "amusing" objects near the player
23 #define AMS_NOTHING 0x00 /* No restriction */
24 #define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */
25 #define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */
26 #define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */
27 #define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */
29 static amuse_type amuse_info[] =
31 { TV_BOTTLE, SV_ANY, 5, AMS_NOTHING },
32 { TV_JUNK, SV_ANY, 3, AMS_MULTIPLE },
33 { TV_SPIKE, SV_ANY, 10, AMS_PILE },
34 { TV_STATUE, SV_ANY, 15, AMS_NOTHING },
35 { TV_CORPSE, SV_ANY, 15, AMS_NO_UNIQUE },
36 { TV_SKELETON, SV_ANY, 10, AMS_NO_UNIQUE },
37 { TV_FIGURINE, SV_ANY, 10, AMS_NO_UNIQUE },
38 { TV_PARCHMENT, SV_ANY, 1, AMS_NOTHING },
39 { TV_POLEARM, SV_TSURIZAO, 3, AMS_NOTHING }, //Fishing Pole of Taikobo
40 { TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, //Broken Dagger of Magician
41 { TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING },
42 { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
43 { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
49 * @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
50 * Hook to determine if an object is contertible in an arrow/bolt
51 * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す
53 bool create_ammo(void)
62 GAME_TEXT o_name[MAX_NLEN];
67 sprintf(com, _("[S]弾, [A]矢, [B]クロスボウの矢 :", "Create [S]hots, Create [A]rrow or Create [B]olt ?"));
68 else if (p_ptr->lev >= 10)
69 sprintf(com, _("[S]弾, [A]矢:", "Create [S]hots or Create [A]rrow ?"));
71 sprintf(com, _("[S]弾:", "Create [S]hots ?"));
75 msg_print(_("混乱してる!", "You are too confused!"));
81 msg_print(_("目が見えない!", "You are blind!"));
87 if (!get_com(com, &ch, TRUE))
91 if (ch == 'S' || ch == 's')
96 if ((ch == 'A' || ch == 'a') && (p_ptr->lev >= 10))
101 if ((ch == 'B' || ch == 'b') && (p_ptr->lev >= 20))
108 /**********Create shots*********/
115 if (!get_rep_dir(&dir, FALSE)) return FALSE;
116 y = p_ptr->y + ddy[dir];
117 x = p_ptr->x + ddx[dir];
118 g_ptr = ¤t_floor_ptr->grid_array[y][x];
120 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
122 msg_print(_("そこには岩石がない。", "You need a pile of rubble."));
125 else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
127 msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
134 /* Hack -- Give the player some small firestones */
135 object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
136 q_ptr->number = (byte)rand_range(15, 30);
139 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
140 q_ptr->discount = 99;
142 slot = inven_carry(q_ptr);
144 object_desc(o_name, q_ptr, 0);
145 msg_format(_("%sを作った。", "You make some ammo."), o_name);
147 /* Auto-inscription */
148 if (slot >= 0) autopick_alter_item(slot, FALSE);
150 /* Destroy the wall */
151 cave_alter_feat(y, x, FF_HURT_ROCK);
153 p_ptr->update |= (PU_FLOW);
156 /**********Create arrows*********/
163 item_tester_hook = item_tester_hook_convertible;
165 q = _("どのアイテムから作りますか? ", "Convert which item? ");
166 s = _("材料を持っていない。", "You have no item to convert.");
167 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
168 if (!q_ptr) return FALSE;
172 /* Hack -- Give the player some small firestones */
173 object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
174 q_ptr->number = (byte)rand_range(5, 10);
177 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
179 q_ptr->discount = 99;
181 object_desc(o_name, q_ptr, 0);
182 msg_format(_("%sを作った。", "You make some ammo."), o_name);
186 inven_item_increase(item, -1);
187 inven_item_describe(item);
188 inven_item_optimize(item);
192 floor_item_increase(0 - item, -1);
193 floor_item_describe(0 - item);
194 floor_item_optimize(0 - item);
197 slot = inven_carry(q_ptr);
199 /* Auto-inscription */
200 if (slot >= 0) autopick_alter_item(slot, FALSE);
202 /**********Create bolts*********/
209 item_tester_hook = item_tester_hook_convertible;
211 q = _("どのアイテムから作りますか? ", "Convert which item? ");
212 s = _("材料を持っていない。", "You have no item to convert.");
214 q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
215 if (!q_ptr) return FALSE;
219 /* Hack -- Give the player some small firestones */
220 object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
221 q_ptr->number = (byte)rand_range(4, 8);
224 apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
226 q_ptr->discount = 99;
228 object_desc(o_name, q_ptr, 0);
229 msg_format(_("%sを作った。", "You make some ammo."), o_name);
233 inven_item_increase(item, -1);
234 inven_item_describe(item);
235 inven_item_optimize(item);
239 floor_item_increase(0 - item, -1);
240 floor_item_describe(0 - item);
241 floor_item_optimize(0 - item);
244 slot = inven_carry(q_ptr);
246 /* Auto-inscription */
247 if (slot >= 0) autopick_alter_item(slot, FALSE);
253 * @brief 魔道具術師の魔力取り込み処理
254 * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す
256 bool import_magic_device(void)
259 PARAMETER_VALUE pval;
263 GAME_TEXT o_name[MAX_NLEN];
265 /* Only accept legal items */
266 item_tester_hook = item_tester_hook_recharge;
268 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
269 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
271 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
272 if (!o_ptr) return (FALSE);
274 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
276 msg_print(_("この杖には発動の為の能力は何も備わっていないようだ。", "This staff doesn't have any magical ability."));
280 if (!object_is_known(o_ptr))
282 msg_print(_("鑑定されていないと取り込めない。", "You need to identify before absorbing."));
288 msg_print(_("充填中のアイテムは取り込めない。", "This item is still charging."));
293 if (o_ptr->tval == TV_ROD)
295 else if (o_ptr->tval == TV_WAND)
298 if (o_ptr->tval == TV_ROD)
300 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)o_ptr->number;
301 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
306 for (num = o_ptr->number; num; num--)
309 if (o_ptr->tval == TV_WAND) gain_num = (pval + num - 1) / num;
310 if (p_ptr->magic_num2[o_ptr->sval + ext])
313 gain_num = (gain_num / 3 + randint0(gain_num / 3)) / 256;
314 if (gain_num < 1) gain_num = 1;
316 p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)gain_num;
317 if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
318 p_ptr->magic_num1[o_ptr->sval + ext] += pval * 0x10000;
319 if (p_ptr->magic_num1[o_ptr->sval + ext] > 99 * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = 99 * 0x10000;
320 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;
321 if (o_ptr->tval == TV_WAND) pval -= (pval + num - 1) / num;
325 object_desc(o_name, o_ptr, 0);
326 msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
328 /* Eliminate the item (from the pack) */
331 inven_item_increase(item, -999);
332 inven_item_describe(item);
333 inven_item_optimize(item);
336 /* Eliminate the item (from the floor) */
339 floor_item_increase(0 - item, -999);
340 floor_item_describe(0 - item);
341 floor_item_optimize(0 - item);
343 take_turn(p_ptr, 100);
349 * @param y1 配置したいフロアのY座標
350 * @param x1 配置したいフロアのX座標
352 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
355 void amusement(POSITION y1, POSITION x1, int num, bool known)
358 object_type object_type_body;
361 for (n = 0; amuse_info[n].tval != 0; n++)
363 t += amuse_info[n].prob;
370 KIND_OBJECT_IDX k_idx;
371 ARTIFACT_IDX a_idx = 0;
373 bool insta_art, fixed_art;
377 r -= amuse_info[i].prob;
380 i_ptr = &object_type_body;
382 k_idx = lookup_kind(amuse_info[i].tval, amuse_info[i].sval);
384 /* Paranoia - reroll if nothing */
385 if (!k_idx) continue;
387 /* Search an artifact index if need */
388 insta_art = (k_info[k_idx].gen_flags & TRG_INSTA_ART);
389 fixed_art = (amuse_info[i].flag & AMS_FIXED_ART);
391 if (insta_art || fixed_art)
393 for (a_idx = 1; a_idx < max_a_idx; a_idx++)
395 if (insta_art && !(a_info[a_idx].gen_flags & TRG_INSTA_ART)) continue;
396 if (a_info[a_idx].tval != k_info[k_idx].tval) continue;
397 if (a_info[a_idx].sval != k_info[k_idx].sval) continue;
398 if (a_info[a_idx].cur_num > 0) continue;
402 if (a_idx >= max_a_idx) continue;
405 /* Make an object (if possible) */
406 object_prep(i_ptr, k_idx);
407 if (a_idx) i_ptr->name1 = a_idx;
408 apply_magic(i_ptr, 1, AM_NO_FIXED_ART);
410 if (amuse_info[i].flag & AMS_NO_UNIQUE)
412 if (r_info[i_ptr->pval].flags1 & RF1_UNIQUE) continue;
415 if (amuse_info[i].flag & AMS_MULTIPLE) i_ptr->number = randint1(3);
416 if (amuse_info[i].flag & AMS_PILE) i_ptr->number = randint1(99);
424 /* Paranoia - reroll if nothing */
425 if (!(i_ptr->k_idx)) continue;
427 (void)drop_near(i_ptr, -1, y1, x1);
437 * Scatter some "great" objects near the player
438 * @param y1 配置したいフロアのY座標
439 * @param x1 配置したいフロアのX座標
441 * @param great TRUEならば必ず高級品以上を落とす
442 * @param special TRUEならば必ず特別品を落とす
443 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
446 void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
449 object_type object_type_body;
450 BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
455 i_ptr = &object_type_body;
458 /* Make a good (or great) object (if possible) */
459 if (!make_object(i_ptr, mode)) continue;
467 (void)drop_near(i_ptr, -1, y1, x1);
471 void acquire_chaos_weapon(player_type *creature_ptr)
474 object_type *q_ptr = &forge;
475 OBJECT_TYPE_VALUE dummy = TV_SWORD;
476 OBJECT_SUBTYPE_VALUE dummy2;
477 switch (randint1(creature_ptr->lev))
483 dummy2 = SV_MAIN_GAUCHE;
492 dummy2 = SV_SMALL_SWORD;
495 dummy2 = SV_BASILLARD;
497 case 11: case 12: case 13:
498 dummy2 = SV_SHORT_SWORD;
507 dummy2 = SV_WAKIZASHI;
516 dummy2 = SV_BROAD_SWORD;
519 dummy2 = SV_LONG_SWORD;
522 dummy2 = SV_SCIMITAR;
531 dummy2 = SV_BASTARD_SWORD;
534 dummy2 = SV_GREAT_SCIMITAR;
537 dummy2 = SV_CLAYMORE;
543 dummy2 = SV_TWO_HANDED_SWORD;
546 dummy2 = SV_FLAMBERGE;
549 dummy2 = SV_NO_DACHI;
552 dummy2 = SV_EXECUTIONERS_SWORD;
555 dummy2 = SV_ZWEIHANDER;
558 dummy2 = SV_HAYABUSA;
561 dummy2 = SV_BLADE_OF_CHAOS;
564 object_prep(q_ptr, lookup_kind(dummy, dummy2));
565 q_ptr->to_h = 3 + randint1(current_floor_ptr->dun_level) % 10;
566 q_ptr->to_d = 3 + randint1(current_floor_ptr->dun_level) % 10;
567 one_resistance(q_ptr);
568 q_ptr->name2 = EGO_CHAOTIC;
569 (void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
575 * Curse the players armor
576 * @return 実際に呪縛されたらTRUEを返す
578 bool curse_armor(void)
583 GAME_TEXT o_name[MAX_NLEN];
585 /* Curse the body armor */
586 o_ptr = &inventory[INVEN_BODY];
588 /* Nothing to curse */
589 if (!o_ptr->k_idx) return (FALSE);
591 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
593 /* Attempt a saving throw for artifacts */
594 if (object_is_artifact(o_ptr) && (randint0(100) < 50))
598 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
599 "恐怖の暗黒オーラ", "防具", o_name);
601 msg_format("A %s tries to %s, but your %s resists the effects!",
602 "terrible black aura", "surround your armor", o_name);
607 /* not artifact or failed save... */
610 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
611 chg_virtue(V_ENCHANT, -5);
613 /* Blast the armor */
615 o_ptr->name2 = EGO_BLASTED;
616 o_ptr->to_a = 0 - randint1(5) - randint1(5);
623 for (i = 0; i < TR_FLAG_SIZE; i++)
624 o_ptr->art_flags[i] = 0;
627 o_ptr->curse_flags = TRC_CURSED;
630 o_ptr->ident |= (IDENT_BROKEN);
631 p_ptr->update |= (PU_BONUS | PU_MANA);
632 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
640 * Curse the players weapon
641 * @param force 無条件に呪縛を行うならばTRUE
642 * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
643 * @return 実際に呪縛されたらTRUEを返す
645 bool curse_weapon_object(bool force, object_type *o_ptr)
648 GAME_TEXT o_name[MAX_NLEN];
650 /* Nothing to curse */
651 if (!o_ptr->k_idx) return (FALSE);
652 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
654 /* Attempt a saving throw */
655 if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
659 msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
660 "恐怖の暗黒オーラ", "武器", o_name);
662 msg_format("A %s tries to %s, but your %s resists the effects!",
663 "terrible black aura", "surround your weapon", o_name);
667 /* not artifact or failed save... */
670 if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
671 chg_virtue(V_ENCHANT, -5);
673 /* Shatter the weapon */
675 o_ptr->name2 = EGO_SHATTERED;
676 o_ptr->to_h = 0 - randint1(5) - randint1(5);
677 o_ptr->to_d = 0 - randint1(5) - randint1(5);
683 for (i = 0; i < TR_FLAG_SIZE; i++)
684 o_ptr->art_flags[i] = 0;
687 o_ptr->curse_flags = TRC_CURSED;
690 o_ptr->ident |= (IDENT_BROKEN);
691 p_ptr->update |= (PU_BONUS | PU_MANA);
692 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
699 * @brief 武器呪縛処理のメインルーチン /
700 * Curse the players weapon
701 * @param force 無条件に呪縛を行うならばTRUE
702 * @param slot 呪縛する武器の装備スロット
703 * @return 実際に呪縛されたらTRUEを返す
705 bool curse_weapon(bool force, int slot)
707 return curse_weapon_object(force, &inventory[slot]);
713 * @return ターン消費を要する処理を行ったならばTRUEを返す
719 GAME_TEXT o_name[MAX_NLEN];
722 /* Select a piece of armour */
723 item_tester_hook = object_is_armour;
725 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
726 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
728 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
729 if (!o_ptr) return FALSE;
731 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
733 add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
735 if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
738 msg_format("%sは新品同様になった!", o_name);
740 msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
747 msg_format("%sは腐食しなくなった。", o_name);
749 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
757 * @brief ボルトのエゴ化処理(火炎エゴのみ) /
761 bool brand_bolts(void)
765 /* Use the first acceptable bolts */
766 for (i = 0; i < INVEN_PACK; i++)
768 object_type *o_ptr = &inventory[i];
771 if (o_ptr->tval != TV_BOLT) continue;
773 /* Skip artifacts and ego-items */
774 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
777 /* Skip cursed/broken items */
778 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
781 if (randint0(100) < 75) continue;
783 msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
786 o_ptr->name2 = EGO_FLAME;
787 enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
791 if (flush_failure) flush();
794 msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
800 bool perilous_secrets(player_type *creature_ptr)
802 if (!ident_spell(FALSE)) return FALSE;
804 if (mp_ptr->spell_book)
806 /* Sufficient mana */
807 if (20 <= creature_ptr->csp)
810 creature_ptr->csp -= 20;
813 /* Over-exert the player */
816 int oops = 20 - creature_ptr->csp;
819 creature_ptr->csp = 0;
820 creature_ptr->csp_frac = 0;
822 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
823 /* Hack -- Bypass free action */
824 (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
827 (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
829 creature_ptr->redraw |= (PR_MANA);
831 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
833 if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
835 /* Exercise a little care... */
836 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
842 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
843 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
844 * @param o_ptr 対象のオブジェクト構造体(ブラッディムーン)のポインタ
847 void get_bloody_moon_flags(object_type *o_ptr)
851 for (i = 0; i < TR_FLAG_SIZE; i++)
852 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
854 dummy = randint1(2) + randint1(2);
855 for (i = 0; i < dummy; i++)
857 int flag = randint0(26);
858 if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
859 else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
860 else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
861 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
865 for (i = 0; i < dummy; i++) one_resistance(o_ptr);
867 for (i = 0; i < 2; i++)
869 int tmp = randint0(11);
870 if (tmp < A_MAX) add_flag(o_ptr->art_flags, TR_STR + tmp);
871 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
876 * @brief 寿命つき光源の燃素追加処理 /
877 * Charge a lite (torch or latern)
880 void phlogiston(void)
882 GAME_TURN max_flog = 0;
883 object_type * o_ptr = &inventory[INVEN_LITE];
886 if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
888 max_flog = FUEL_LAMP;
892 else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
894 max_flog = FUEL_TORCH;
897 /* No torch to refill */
900 msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
904 if (o_ptr->xtra4 >= max_flog)
906 msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
911 o_ptr->xtra4 += (XTRA16)(max_flog / 2);
912 msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
914 if (o_ptr->xtra4 >= max_flog)
916 o_ptr->xtra4 = (XTRA16)max_flog;
917 msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
920 p_ptr->update |= (PU_TORCH);
926 * @return ターン消費を要する処理を行ったならばTRUEを返す
928 bool bless_weapon(void)
932 BIT_FLAGS flgs[TR_FLAG_SIZE];
933 GAME_TEXT o_name[MAX_NLEN];
936 /* Bless only weapons */
937 item_tester_hook = object_is_weapon;
939 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
940 s = _("祝福できる武器がありません。", "You have weapon to bless.");
942 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
943 if (!o_ptr) return FALSE;
945 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
946 object_flags(o_ptr, flgs);
948 if (object_is_cursed(o_ptr))
950 if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
951 have_flag(flgs, TR_ADD_L_CURSE) ||
952 have_flag(flgs, TR_ADD_H_CURSE) ||
953 (o_ptr->curse_flags & TRC_PERMA_CURSE))
956 msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
958 msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
965 msg_format("%s から邪悪なオーラが消えた。", o_name);
967 msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
971 o_ptr->curse_flags = 0L;
973 o_ptr->ident |= (IDENT_SENSE);
974 o_ptr->feeling = FEEL_NONE;
976 /* Recalculate the bonuses */
977 p_ptr->update |= (PU_BONUS);
978 p_ptr->window |= (PW_EQUIP);
982 * Next, we try to bless it. Artifacts have a 1/3 chance of
983 * being blessed, otherwise, the operation simply disenchants
984 * them, godly power negating the magic. Ok, the explanation
985 * is silly, but otherwise priests would always bless every
986 * artifact weapon they find. Ego weapons and normal weapons
987 * can be blessed automatically.
989 if (have_flag(flgs, TR_BLESSED))
992 msg_format("%s は既に祝福されている。", o_name);
994 msg_format("%s %s %s blessed already.",
995 ((item >= 0) ? "Your" : "The"), o_name,
996 ((o_ptr->number > 1) ? "were" : "was"));
1002 if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
1005 msg_format("%sは輝いた!", o_name);
1007 msg_format("%s %s shine%s!",
1008 ((item >= 0) ? "Your" : "The"), o_name,
1009 ((o_ptr->number > 1) ? "" : "s"));
1012 add_flag(o_ptr->art_flags, TR_BLESSED);
1013 o_ptr->discount = 99;
1017 bool dis_happened = FALSE;
1018 msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
1020 /* Disenchant tohit */
1021 if (o_ptr->to_h > 0)
1024 dis_happened = TRUE;
1027 if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
1029 /* Disenchant todam */
1030 if (o_ptr->to_d > 0)
1033 dis_happened = TRUE;
1036 if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
1038 /* Disenchant toac */
1039 if (o_ptr->to_a > 0)
1042 dis_happened = TRUE;
1045 if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
1049 msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
1052 msg_format("%s は劣化した!", o_name);
1054 msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
1055 ((o_ptr->number > 1) ? "were" : "was"));
1061 p_ptr->update |= (PU_BONUS);
1062 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
1072 * @return ターン消費を要する処理を行ったならばTRUEを返す
1074 bool pulish_shield(void)
1078 BIT_FLAGS flgs[TR_FLAG_SIZE];
1079 GAME_TEXT o_name[MAX_NLEN];
1082 /* Assume enchant weapon */
1083 item_tester_tval = TV_SHIELD;
1085 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
1086 s = _("磨く盾がありません。", "You have weapon to pulish.");
1088 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1089 if (!o_ptr) return FALSE;
1091 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1092 object_flags(o_ptr, flgs);
1094 if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
1095 !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
1098 msg_format("%sは輝いた!", o_name);
1100 msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
1102 o_ptr->name2 = EGO_REFLECTION;
1103 enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
1105 o_ptr->discount = 99;
1106 chg_virtue(V_ENCHANT, 2);
1112 if (flush_failure) flush();
1114 msg_print(_("失敗した。", "Failed."));
1115 chg_virtue(V_ENCHANT, -2);