X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd-read.c;h=d789a1ba837adfef1ae9fd0f503909a7a93d80e2;hb=7bdabc50285d97192a7cd286ebf825c2329b9235;hp=33bc61fee62fdaee9fa136525c939f22f8b28ffc;hpb=a711990a5a58a14847a0aba7ba99cadb61ea8352;p=hengband%2Fhengband.git diff --git a/src/cmd-read.c b/src/cmd-read.c index 33bc61fee..d789a1ba8 100644 --- a/src/cmd-read.c +++ b/src/cmd-read.c @@ -8,6 +8,13 @@ #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 巻物を読むコマンドのサブルーチン @@ -103,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; } @@ -117,7 +124,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) { for (k = 0; k < randint1(3); k++) { - if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { ident = TRUE; } @@ -129,7 +136,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) { for (k = 0; k < randint1(3); k++) { - if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { ident = TRUE; } @@ -139,7 +146,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) case SV_SCROLL_SUMMON_PET: { - if (summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET))) + if (summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0')) { ident = TRUE; } @@ -184,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; } @@ -531,11 +538,9 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) } else if (o_ptr->tval==TV_PARCHMENT) { - cptr q; - char o_name[MAX_NLEN]; + concptr q; + GAME_TEXT o_name[MAX_NLEN]; char buf[1024]; - - /* Save screen */ screen_save(); q=format("book-%d_jp.txt",o_ptr->sval); @@ -548,16 +553,12 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) /* Peruse the help file */ (void)show_file(TRUE, buf, o_name, 0, 0); - - /* Load screen */ screen_load(); used_up=FALSE; } - - /* Combine / Reorder the pack (later) */ - p_ptr->notice |= (PN_COMBINE | PN_REORDER); + p_ptr->update |= (PU_COMBINE | PU_REORDER); if (!(object_is_aware(o_ptr))) { @@ -613,7 +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 (cmd_limit_arena(p_ptr)) return; if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { @@ -644,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));