From 98440bb9d39190075d65f81cd13195b37ed5229e Mon Sep 17 00:00:00 2001 From: mogami Date: Tue, 4 Feb 2003 18:17:12 +0000 Subject: [PATCH] =?utf8?q?-=20lore=5Fdo=5Fprobe()=E3=81=A7=E6=80=9D?= =?utf8?q?=E3=81=84=E5=87=BA=E6=83=85=E5=A0=B1=E3=82=92=E5=85=A8=E3=81=A6?= =?utf8?q?=E5=BE=97=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=A6?= =?utf8?q?=E3=80=81=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E4=BB=99?= =?utf8?q?=E4=BA=BA=E3=81=A7=E3=82=82=20=E3=81=93=E3=81=AE=E9=96=A2?= =?utf8?q?=E6=95=B0=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=80=82probing()=E3=81=AE?= =?utf8?q?=E5=A0=B4=E5=90=88=E3=81=AF=E6=96=B0=E3=81=97=E3=81=84=E6=80=9D?= =?utf8?q?=E3=81=84=E5=87=BA=E6=83=85=E5=A0=B1=E3=82=92=E5=BE=97=E3=82=89?= =?utf8?q?=E3=82=8C=20=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AB=E3=83=A1?= =?utf8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E5=87=BA=E3=81=99?= =?utf8?q?=E3=80=82=20-=20files.c=E3=81=AE=E3=83=9E=E3=82=AF=E3=83=AD?= =?utf8?q?=E3=83=88=E3=83=AA=E3=82=AC=E3=83=BC=E3=81=AE=E3=82=B3=E3=83=BC?= =?utf8?q?=E3=83=89=E3=81=A7malloc()=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6?= =?utf8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=20string=5Fmake()=E3=81=AB?= =?utf8?q?=E6=9B=B8=E3=81=8D=E5=A4=89=E3=81=88=E3=80=81=E5=90=8C=E6=99=82?= =?utf8?q?=E3=81=AB=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86=E3=80=82?= =?utf8?q?=20inet.c=E3=81=A8report.c=E3=81=AF=E3=81=9D=E3=82=82=E3=81=9D?= =?utf8?q?=E3=82=82=E7=92=B0=E5=A2=83=E4=BE=9D=E5=AD=98=E3=81=AA=E3=81=AE?= =?utf8?q?=E3=81=A7malloc()=E3=81=AE=E3=81=BE=E3=81=BE=E5=A4=89=E6=9B=B4?= =?utf8?q?=E3=81=97=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 293 +++++++++++++++++++++++++++++++ src/cmd3.c | 533 --------------------------------------------------------- src/externs.h | 14 +- src/files.c | 92 ++++++---- src/floors.c | 2 +- src/monster1.c | 2 +- src/monster2.c | 92 +++++++++- src/spells2.c | 34 +++- src/tables.c | 206 ++++++++++++++++++++++ src/variable.c | 10 +- 10 files changed, 683 insertions(+), 595 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index d3ff394c1..75b34f006 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -4147,6 +4147,299 @@ bool tele_town(void) /* + * research_mon + * -KMW- + */ +static bool research_mon(void) +{ + int i, n, r_idx; + char sym, query; + char buf[128]; + + bool notpicked; + + bool recall = FALSE; + + u16b why = 0; + + u16b *who; + + /* XTRA HACK WHATSEARCH */ + bool all = FALSE; + bool uniq = FALSE; + bool norm = FALSE; + char temp[80] = ""; + + /* XTRA HACK REMEMBER_IDX */ + static int old_sym = '\0'; + static int old_i = 0; + + + /* Save the screen */ + screen_save(); + + /* Get a character, or abort */ +#ifdef JP +if (!get_com("¥â¥ó¥¹¥¿¡¼¤Îʸ»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ­¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°):", &sym, FALSE)) +#else + if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) +#endif + + { + /* Restore */ + screen_load(); + + return (FALSE); + } + + /* Find that character info, and describe it */ + for (i = 0; ident_info[i]; ++i) + { + if (sym == ident_info[i][0]) break; + } + + /* XTRA HACK WHATSEARCH */ + if (sym == KTRL('A')) + { + all = TRUE; +#ifdef JP + strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); +#else + strcpy(buf, "Full monster list."); +#endif + } + else if (sym == KTRL('U')) + { + all = uniq = TRUE; +#ifdef JP + strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); +#else + strcpy(buf, "Unique monster list."); +#endif + } + else if (sym == KTRL('N')) + { + all = norm = TRUE; +#ifdef JP + strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); +#else + strcpy(buf, "Non-unique monster list."); +#endif + } + else if (sym == KTRL('M')) + { + all = TRUE; +#ifdef JP + if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70)) +#else + if (!get_string("Enter name:",temp, 70)) +#endif + { + temp[0]=0; + + /* Restore */ + screen_load(); + + return FALSE; + } +#ifdef JP + sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp); +#else + sprintf(buf, "Monsters with a name \"%s\"",temp); +#endif + } + else if (ident_info[i]) + { + sprintf(buf, "%c - %s.", sym, ident_info[i] + 2); + } + else + { +#ifdef JP +sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú"); +#else + sprintf(buf, "%c - %s.", sym, "Unknown Symbol"); +#endif + + } + + /* Display the result */ + prt(buf, 16, 10); + + + /* Allocate the "who" array */ + C_MAKE(who, max_r_idx, u16b); + + /* Collect matching monsters */ + for (n = 0, i = 1; i < max_r_idx; i++) + { + monster_race *r_ptr = &r_info[i]; + + /* XTRA HACK WHATSEARCH */ + /* Require non-unique monsters if needed */ + if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue; + + /* Require unique monsters if needed */ + if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue; + + /* ̾Á°¸¡º÷ */ + if (temp[0]){ + int xx; + char temp2[80]; + + for (xx=0; temp[xx] && xx<80; xx++){ +#ifdef JP + if (iskanji( temp[xx])) { xx++; continue; } +#endif + if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]); + } + +#ifdef JP + strcpy(temp2, r_name+r_ptr->E_name); +#else + strcpy(temp2, r_name+r_ptr->name); +#endif + for (xx=0; temp2[xx] && xx<80; xx++) + if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]); + +#ifdef JP + if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) ) +#else + if (strstr(temp2, temp)) +#endif + who[n++]=i; + } + else if (all || (r_ptr->d_char == sym)) who[n++] = i; + } + + /* Nothing to recall */ + if (!n) + { + /* Free the "who" array */ + C_KILL(who, max_r_idx, u16b); + + /* Restore */ + screen_load(); + + return (FALSE); + } + + /* Sort by level */ + why = 2; + query = 'y'; + + /* Sort if needed */ + if (why) + { + /* Select the sort method */ + ang_sort_comp = ang_sort_comp_hook; + ang_sort_swap = ang_sort_swap_hook; + + /* Sort the array */ + ang_sort(who, &why, n); + } + + + /* Start at the end */ + /* XTRA HACK REMEMBER_IDX */ + if (old_sym == sym && old_i < n) i = old_i; + else i = n - 1; + + notpicked = TRUE; + + /* Scan the monster memory */ + while (notpicked) + { + /* Extract a race */ + r_idx = who[i]; + + /* Save this monster ID */ + p_ptr->monster_race_idx = r_idx; + + /* Hack -- Handle stuff */ + handle_stuff(); + + /* Hack -- Begin the prompt */ + roff_top(r_idx); + + /* Hack -- Complete the prompt */ +#ifdef JP +Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ' '¤Ç³¹Ô, ESC]"); +#else + Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC, space to continue]"); +#endif + + + /* Interact */ + while (1) + { + /* Recall */ + if (recall) + { + /* Recall on screen */ + monster_race *r_ptr = &r_info[r_idx]; + int m; + + /* Get maximal info about this monster */ + lore_do_probe(r_idx); + + /* know every thing mode */ + screen_roff(r_idx, 0x01); + notpicked = FALSE; + + /* XTRA HACK REMEMBER_IDX */ + old_sym = sym; + old_i = i; + } + + /* Command */ + query = inkey(); + + /* Normal commands */ + if (query != 'r') break; + + /* Toggle recall */ + recall = !recall; + } + + /* Stop scanning */ + if (query == ESCAPE) break; + + /* Move to "prev" monster */ + if (query == '-') + { + if (++i == n) + { + i = 0; + if (!expand_list) break; + } + } + + /* Move to "next" monster */ + else + { + if (i-- == 0) + { + i = n - 1; + if (!expand_list) break; + } + } + } + + + /* Re-display the identity */ + /* prt(buf, 5, 5);*/ + + /* Free the "who" array */ + C_KILL(who, max_r_idx, u16b); + + /* Restore */ + screen_load(); + + return (!notpicked); +} + + +/* * Execute a building command */ static void bldg_process_command(building_type *bldg, int i) diff --git a/src/cmd3.c b/src/cmd3.c index 7f8012004..62a85280c 100644 --- a/src/cmd3.c +++ b/src/cmd3.c @@ -1815,210 +1815,6 @@ void do_cmd_locate(void) /* - * The table of "symbol info" -- each entry is a string of the form - * "X:desc" where "X" is the trigger, and "desc" is the "info". - */ -static cptr ident_info[] = -{ -#ifdef JP - " :°Å°Ç", - "!:Ìô, ¥ª¥¤¥ë", - "\":¥¢¥ß¥å¥ì¥Ã¥È, ðô¾þ¤ê", - "#:ÊÉ(±£¤·¥É¥¢)Ëô¤Ï¿¢Êª", - "$:ºâÊõ(¶â¤«ÊõÀÐ)", - "%:¹ÛÌ®(Íϴ䤫ÀбÑ)", - "&:È¢", - "':³«¤¤¤¿¥É¥¢", - "(:Æð¤é¤«¤¤Ëɶñ", - "):½â", - "*:ºâÊõ¤ò´Þ¤ó¤À¹ÛÌ®¤Þ¤¿¤Ïµå·Á¤Î²øʪ", - "+:ÊĤ¸¤¿¥É¥¢", - ",:¿©¤Ùʪ, ¤ª¤Ð¤±¥­¥Î¥³", - "-:ËâË¡ËÀ, ¥í¥Ã¥É", - ".:¾²", - "/:´È¾õÉð´ï(¥¢¥Ã¥¯¥¹/¥Ñ¥¤¥¯/Åù)", - "0:Çîʪ´Û¤ÎÆþ¸ý", - "1:»¨²ß²°¤ÎÆþ¸ý", - "2:Ëɶñ²°¤ÎÆþ¸ý", - "3:Éð´ïÀìÌ珤ÎÆþ¸ý", - "4:»û±¡¤ÎÆþ¸ý", - "5:Ï£¶â½Ñ¤ÎŹ¤ÎÆþ¸ý", - "6:ËâË¡¤ÎŹ¤ÎÆþ¸ý", - "7:¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤ÎÆþ¸ý", - "8:²æ¤¬²È¤ÎÆþ¸ý", - "9:½ñŹ¤ÎÆþ¸ý", - "::´äÀÐ", - ";:²óÈò¤Î³¨Ê¸»ú/Çúȯ¤Î¥ë¡¼¥ó", - "<:¾å¤ê³¬ÃÊ", - "=:»ØÎØ", - ">:²¼¤ê³¬ÃÊ", - "?:´¬Êª", - "@:¥×¥ì¥¤¥ä¡¼", - "A:Å·»È", - "B:Ä»", - "C:¸¤", - "D:¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", - "E:¥¨¥ì¥á¥ó¥¿¥ë", - "F:¥È¥ó¥Ü", - "G:¥´¡¼¥¹¥È", - "H:»¨¼ï", - "I:º«Ãî", - "J:¥Ø¥Ó", - "K:¥­¥é¡¼¡¦¥Ó¡¼¥È¥ë", - "L:¥ê¥Ã¥Á", - "M:¿¼ó¤Îà¨ÃîÎà", - "N:Ææ¤ÎÀ¸Êª", - "O:¥ª¡¼¥¬", - "P:µðÂç¿Í´Ö·¿À¸Êª", - "Q:¥¯¥¤¥ë¥¹¥ë¥°(Ì®ÂǤÄÆù²ô)", - "R:à¨ÃîÎà/ξÀ¸Îà", - "S:ÃØéá/¥µ¥½¥ê/¥À¥Ë", - "T:¥È¥í¥ë", - "U:¾åµé¥Ç¡¼¥â¥ó", - "V:¥Ð¥ó¥Ñ¥¤¥¢", - "W:¥ï¥¤¥È/¥ì¥¤¥¹/Åù", - "X:¥¾¡¼¥ó/¥¶¥ì¥ó/Åù", - "Y:¥¤¥¨¥Æ¥£", - "Z:¥Ï¥¦¥ó¥É", - "[:·ø¤¤¥¢¡¼¥Þ¡¼", - "\\:Æß´ï(¥á¥¤¥¹/¥à¥Á/Åù)", - "]:¼ï¡¹¤ÎËɶñ", - "^:¥È¥é¥Ã¥×", - "_:¾ó", - "`:¿Í·Á¡¤Ä¦Áü", - "a:¥¢¥ê", - "b:¥³¥¦¥â¥ê", - "c:¥à¥«¥Ç", - "d:¥É¥é¥´¥ó", - "e:ÌܶÌ", - "f:¥Í¥³", - "g:¥´¡¼¥ì¥à", - "h:¥Û¥Ó¥Ã¥È/¥¨¥ë¥Õ/¥É¥ï¡¼¥Õ", - "i:¥Ù¥È¥Ù¥È", - "j:¥¼¥ê¡¼", - "k:¥³¥Ü¥ë¥É", - "l:¿åÀ³À¸Êª", - "m:¥â¥ë¥É", - "n:¥Ê¡¼¥¬", - "o:¥ª¡¼¥¯", - "p:¿Í´Ö", - "q:»Í­½Ã", - "r:¥Í¥º¥ß", - "s:¥¹¥±¥ë¥È¥ó", - "t:Ä®¤Î¿Í", - "u:²¼µé¥Ç¡¼¥â¥ó", - "v:¥Ü¥ë¥Æ¥Ã¥¯¥¹", - "w:¥¤¥â¥à¥·/Âç·²", - /* "x:unused", */ - "y:¥¤¡¼¥¯", - "z:¥¾¥ó¥Ó/¥ß¥¤¥é", - "{:Èô¤ÓÆ»¶ñ¤ÎÃÆ(Ìð/ÃÆ)", - "|:Åá·õÎà(¥½¡¼¥É/¥À¥¬¡¼/Åù)", - "}:Èô¤ÓÆ»¶ñ(µÝ/¥¯¥í¥¹¥Ü¥¦/¥¹¥ê¥ó¥°)", - "~:¿å/ÍÏ´äή(¼ï¡¹¤Î¥¢¥¤¥Æ¥à)", -#else - " :A dark grid", - "!:A potion (or oil)", - "\":An amulet (or necklace)", - "#:A wall (or secret door)", - "$:Treasure (gold or gems)", - "%:A vein (magma or quartz)", - "&:A chest", - "':An open door", - "(:Soft armor", - "):A shield", - "*:A vein with treasure or a ball monster", - "+:A closed door", - ",:Food (or mushroom patch)", - "-:A wand (or rod)", - ".:Floor", - "/:A polearm (Axe/Pike/etc)", - "0:Entrance to Museum", - "1:Entrance to General Store", - "2:Entrance to Armory", - "3:Entrance to Weaponsmith", - "4:Entrance to Temple", - "5:Entrance to Alchemy shop", - "6:Entrance to Magic store", - "7:Entrance to Black Market", - "8:Entrance to your home", - "9:Entrance to the bookstore", - "::Rubble", - ";:A glyph of warding / explosive rune", - "<:An up staircase", - "=:A ring", - ">:A down staircase", - "?:A scroll", - "@:You", - "A:Angel", - "B:Bird", - "C:Canine", - "D:Ancient Dragon/Wyrm", - "E:Elemental", - "F:Dragon Fly", - "G:Ghost", - "H:Hybrid", - "I:Insect", - "J:Snake", - "K:Killer Beetle", - "L:Lich", - "M:Multi-Headed Reptile", - "N:Mystery Living", - "O:Ogre", - "P:Giant Humanoid", - "Q:Quylthulg (Pulsing Flesh Mound)", - "R:Reptile/Amphibian", - "S:Spider/Scorpion/Tick", - "T:Troll", - "U:Major Demon", - "V:Vampire", - "W:Wight/Wraith/etc", - "X:Xorn/Xaren/etc", - "Y:Yeti", - "Z:Zephyr Hound", - "[:Hard armor", - "\\:A hafted weapon (mace/whip/etc)", - "]:Misc. armor", - "^:A trap", - "_:A staff", - "`:A figurine or statue", - "a:Ant", - "b:Bat", - "c:Centipede", - "d:Dragon", - "e:Floating Eye", - "f:Feline", - "g:Golem", - "h:Hobbit/Elf/Dwarf", - "i:Icky Thing", - "j:Jelly", - "k:Kobold", - "l:Aquatic monster", - "m:Mold", - "n:Naga", - "o:Orc", - "p:Person/Human", - "q:Quadruped", - "r:Rodent", - "s:Skeleton", - "t:Townsperson", - "u:Minor Demon", - "v:Vortex", - "w:Worm/Worm-Mass", - /* "x:unused", */ - "y:Yeek", - "z:Zombie/Mummy", - "{:A missile (arrow/bolt/shot)", - "|:An edged weapon (sword/dagger/etc)", - "}:A launcher (bow/crossbow/sling)", - "~:Fluid terrain (or miscellaneous item)", -#endif - - NULL -}; - - -/* * Sorting hook -- Comp function -- see below * * We use "u" to point to array of monster indexes, @@ -2427,332 +2223,3 @@ void do_cmd_query_symbol(void) } -/* - * research_mon - * -KMW- - */ -bool research_mon(void) -{ - int i, n, r_idx; - char sym, query; - char buf[128]; - - bool notpicked; - - bool recall = FALSE; - - u16b why = 0; - - u16b *who; - - /* XTRA HACK WHATSEARCH */ - bool all = FALSE; - bool uniq = FALSE; - bool norm = FALSE; - char temp[80] = ""; - - /* XTRA HACK REMEMBER_IDX */ - static int old_sym = '\0'; - static int old_i = 0; - - - /* Save the screen */ - screen_save(); - - /* Get a character, or abort */ -#ifdef JP -if (!get_com("¥â¥ó¥¹¥¿¡¼¤Îʸ»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ­¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°):", &sym, FALSE)) -#else - if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) -#endif - - { - /* Restore */ - screen_load(); - - return (FALSE); - } - - /* Find that character info, and describe it */ - for (i = 0; ident_info[i]; ++i) - { - if (sym == ident_info[i][0]) break; - } - - /* XTRA HACK WHATSEARCH */ - if (sym == KTRL('A')) - { - all = TRUE; -#ifdef JP - strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); -#else - strcpy(buf, "Full monster list."); -#endif - } - else if (sym == KTRL('U')) - { - all = uniq = TRUE; -#ifdef JP - strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); -#else - strcpy(buf, "Unique monster list."); -#endif - } - else if (sym == KTRL('N')) - { - all = norm = TRUE; -#ifdef JP - strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); -#else - strcpy(buf, "Non-unique monster list."); -#endif - } - else if (sym == KTRL('M')) - { - all = TRUE; -#ifdef JP - if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70)) -#else - if (!get_string("Enter name:",temp, 70)) -#endif - { - temp[0]=0; - - /* Restore */ - screen_load(); - - return FALSE; - } -#ifdef JP - sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp); -#else - sprintf(buf, "Monsters with a name \"%s\"",temp); -#endif - } - else if (ident_info[i]) - { - sprintf(buf, "%c - %s.", sym, ident_info[i] + 2); - } - else - { -#ifdef JP -sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú"); -#else - sprintf(buf, "%c - %s.", sym, "Unknown Symbol"); -#endif - - } - - /* Display the result */ - prt(buf, 16, 10); - - - /* Allocate the "who" array */ - C_MAKE(who, max_r_idx, u16b); - - /* Collect matching monsters */ - for (n = 0, i = 1; i < max_r_idx; i++) - { - monster_race *r_ptr = &r_info[i]; - - /* XTRA HACK WHATSEARCH */ - /* Require non-unique monsters if needed */ - if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue; - - /* Require unique monsters if needed */ - if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue; - - /* ̾Á°¸¡º÷ */ - if (temp[0]){ - int xx; - char temp2[80]; - - for (xx=0; temp[xx] && xx<80; xx++){ -#ifdef JP - if (iskanji( temp[xx])) { xx++; continue; } -#endif - if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]); - } - -#ifdef JP - strcpy(temp2, r_name+r_ptr->E_name); -#else - strcpy(temp2, r_name+r_ptr->name); -#endif - for (xx=0; temp2[xx] && xx<80; xx++) - if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]); - -#ifdef JP - if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) ) -#else - if (strstr(temp2, temp)) -#endif - who[n++]=i; - } - else if (all || (r_ptr->d_char == sym)) who[n++] = i; - } - - /* Nothing to recall */ - if (!n) - { - /* Free the "who" array */ - C_KILL(who, max_r_idx, u16b); - - /* Restore */ - screen_load(); - - return (FALSE); - } - - /* Sort by level */ - why = 2; - query = 'y'; - - /* Sort if needed */ - if (why) - { - /* Select the sort method */ - ang_sort_comp = ang_sort_comp_hook; - ang_sort_swap = ang_sort_swap_hook; - - /* Sort the array */ - ang_sort(who, &why, n); - } - - - /* Start at the end */ - /* XTRA HACK REMEMBER_IDX */ - if (old_sym == sym && old_i < n) i = old_i; - else i = n - 1; - - notpicked = TRUE; - - /* Scan the monster memory */ - while (notpicked) - { - /* Extract a race */ - r_idx = who[i]; - - /* Save this monster ID */ - p_ptr->monster_race_idx = r_idx; - - /* Hack -- Handle stuff */ - handle_stuff(); - - /* Hack -- Begin the prompt */ - roff_top(r_idx); - - /* Hack -- Complete the prompt */ -#ifdef JP -Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ' '¤Ç³¹Ô, ESC]"); -#else - Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC, space to continue]"); -#endif - - - /* Interact */ - while (1) - { - /* Recall */ - if (recall) - { - /* Recall on screen */ - monster_race *r_ptr = &r_info[r_idx]; - int m; - - /* Hack -- Maximal info */ - r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR; - - /* Observe "maximal" attacks */ - for (m = 0; m < 4; m++) - { - /* Examine "actual" blows */ - if (r_ptr->blow[m].effect || r_ptr->blow[m].method) - { - /* Hack -- maximal observations */ - r_ptr->r_blows[m] = MAX_UCHAR; - } - } - - /* Hack -- maximal drops */ - r_ptr->r_drop_gold = r_ptr->r_drop_item = - (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) + - ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) + - ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) + - ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) + - ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) + - ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0)); - - /* Hack -- but only "valid" drops */ - if (r_ptr->flags1 & RF1_ONLY_GOLD) r_ptr->r_drop_item = 0; - if (r_ptr->flags1 & RF1_ONLY_ITEM) r_ptr->r_drop_gold = 0; - - /* Hack -- observe many spells */ - r_ptr->r_cast_spell = MAX_UCHAR; - - /* Hack -- know all the flags */ - r_ptr->r_flags1 = r_ptr->flags1; - r_ptr->r_flags2 = r_ptr->flags2; - r_ptr->r_flags3 = r_ptr->flags3; - r_ptr->r_flags4 = r_ptr->flags4; - r_ptr->r_flags5 = r_ptr->flags5; - r_ptr->r_flags6 = r_ptr->flags6; - - r_ptr->r_xtra1 |= MR1_SINKA; - - /* know every thing mode */ - screen_roff(r_idx, 0x01); - notpicked = FALSE; - - /* XTRA HACK REMEMBER_IDX */ - old_sym = sym; - old_i = i; - } - - /* Command */ - query = inkey(); - - /* Normal commands */ - if (query != 'r') break; - - /* Toggle recall */ - recall = !recall; - } - - /* Stop scanning */ - if (query == ESCAPE) break; - - /* Move to "prev" monster */ - if (query == '-') - { - if (++i == n) - { - i = 0; - if (!expand_list) break; - } - } - - /* Move to "next" monster */ - else - { - if (i-- == 0) - { - i = n - 1; - if (!expand_list) break; - } - } - } - - - /* Re-display the identity */ - /* prt(buf, 5, 5);*/ - - /* Free the "who" array */ - C_KILL(who, max_r_idx, u16b); - - /* Restore */ - screen_load(); - - return (!notpicked); -} - diff --git a/src/externs.h b/src/externs.h index f0fb6a52e..375e09bc8 100644 --- a/src/externs.h +++ b/src/externs.h @@ -13,11 +13,11 @@ */ extern int max_macrotrigger; -extern char *macro_template; -extern char *macro_modifier_chr; -extern char *macro_modifier_name[MAX_MACRO_MOD]; -extern char *macro_trigger_name[MAX_MACRO_TRIG]; -extern char *macro_trigger_keycode[2][MAX_MACRO_TRIG]; +extern cptr macro_template; +extern cptr macro_modifier_chr; +extern cptr macro_modifier_name[MAX_MACRO_MOD]; +extern cptr macro_trigger_name[MAX_MACRO_TRIG]; +extern cptr macro_trigger_keycode[2][MAX_MACRO_TRIG]; /* ÆüËܸìÈǵ¡Ç½ÄɲäǻȤ¦ */ @@ -103,6 +103,7 @@ extern cptr shougou_moji[5]; extern byte conv_terrain2feat[MAX_WILDERNESS]; extern cptr silly_attacks[MAX_SILLY_ATTACK]; extern monster_power monster_powers[MAX_MONSPELLS]; +extern cptr ident_info[]; /* variable.c */ extern cptr copyright[5]; @@ -631,7 +632,6 @@ extern void do_cmd_target(void); extern void do_cmd_look(void); extern void do_cmd_locate(void); extern void do_cmd_query_symbol(void); -extern bool research_mon(void); extern void kamaenaoshi(int item); extern bool ang_sort_comp_hook(vptr u, vptr v, int a, int b); extern void ang_sort_swap_hook(vptr u, vptr v, int a, int b); @@ -827,7 +827,7 @@ extern s16b m_pop(void); extern errr get_mon_num_prep(monster_hook_type monster_hook, monster_hook_type monster_hook2); extern s16b get_mon_num(int level); extern void monster_desc(char *desc, monster_type *m_ptr, int mode); -extern void lore_do_probe(int m_idx); +extern int lore_do_probe(int r_idx); extern void lore_treasure(int m_idx, int num_item, int num_gold); extern void sanity_blast(monster_type *m_ptr, bool necro); extern void update_mon(int m_idx, bool full); diff --git a/src/files.c b/src/files.c index ac7c67fb2..e3ebeb80f 100644 --- a/src/files.c +++ b/src/files.c @@ -683,13 +683,15 @@ errr process_pref_file_command(char *buf) } } } - /* set macro trigger names and a template */ + /* Initialize macro trigger names and a template */ /* Process "T:::" */ /* Process "T: