X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd-read.c;h=d789a1ba837adfef1ae9fd0f503909a7a93d80e2;hb=7bdabc50285d97192a7cd286ebf825c2329b9235;hp=c3b4e80cef8a0175defcd92a802df0d282b6cff9;hpb=e52bcf22c2673c62cec7064d6a5271850dce3507;p=hengband%2Fhengband.git diff --git a/src/cmd-read.c b/src/cmd-read.c index c3b4e80ce..d789a1ba8 100644 --- a/src/cmd-read.c +++ b/src/cmd-read.c @@ -9,6 +9,12 @@ #include "angband.h" #include "object-hook.h" #include "spells-summon.h" +#include "artifact.h" +#include "avatar.h" +#include "player-status.h" +#include "spells-status.h" +#include "rumor.h" +#include "realm-hex.h" /*! * @brief 巻物を読むコマンドのサブルーチン @@ -104,12 +110,12 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) case SV_SCROLL_CURSE_WEAPON: { k = 0; - if (buki_motteruka(INVEN_RARM)) + if (has_melee_weapon(INVEN_RARM)) { k = INVEN_RARM; - if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM; + if (has_melee_weapon(INVEN_LARM) && one_in_(2)) k = INVEN_LARM; } - else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM; + else if (has_melee_weapon(INVEN_LARM)) k = INVEN_LARM; if (k && curse_weapon(FALSE, k)) ident = TRUE; break; } @@ -185,7 +191,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) case SV_SCROLL_WORD_OF_RECALL: { - if (!word_of_recall()) used_up = FALSE; + if (!recall_player(p_ptr, randint0(21) + 15)) used_up = FALSE; ident = TRUE; break; } @@ -532,7 +538,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) } else if (o_ptr->tval==TV_PARCHMENT) { - cptr q; + concptr q; GAME_TEXT o_name[MAX_NLEN]; char buf[1024]; screen_save(); @@ -552,8 +558,6 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) used_up=FALSE; } - - /* Combine / Reorder the pack (later) */ p_ptr->update |= (PU_COMBINE | PU_REORDER); if (!(object_is_aware(o_ptr))) @@ -610,19 +614,14 @@ void do_cmd_read_scroll(void) { object_type *o_ptr; OBJECT_IDX item; - cptr q, s; + concptr q, s; if (p_ptr->wild_mode) { return; } - if (p_ptr->inside_arena) - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - return; - } + if (cmd_limit_arena(p_ptr)) return; if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { @@ -653,19 +652,8 @@ void do_cmd_read_scroll(void) q = _("どの巻物を読みますか? ", "Read which scroll? "); s = _("読める巻物がない。", "You have no scrolls to read."); - if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return; - - /* Get the item (in the pack) */ - if (item >= 0) - { - o_ptr = &inventory[item]; - } - - /* Get the item (on the floor) */ - else - { - o_ptr = &o_list[0 - item]; - } + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR)); + if (!o_ptr) return; /* Read the scroll */ do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));