X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fspells3.c;h=68264b9698278114c59c1926cbf205b3fbbbc334;hb=56d92cdb7bca9a842b46ae7b0a7ba3264d50db97;hp=bf4bf2dc90683099d80e34ed7436dbd4ec85ea99;hpb=c5d66158ce26337f4e68aef35c0e7d4be2ed6d4b;p=hengband%2Fhengband.git diff --git a/src/spells3.c b/src/spells3.c index bf4bf2dc9..68264b969 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -799,7 +799,7 @@ void teleport_level(int m_idx) char m2_name[80]; monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, 8, m2_name); + do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name); } delete_monster_idx(m_idx); @@ -1642,7 +1642,7 @@ static bool vanish_dungeon(void) (void)set_monster_csleep(c_ptr->m_idx, 0); /* Notice the "waking up" */ - if (is_seen(m_ptr)) + if (m_ptr->ml) { /* Acquire the monster name */ monster_desc(m_name, m_ptr, 0); @@ -2838,24 +2838,32 @@ bool ident_spell(bool only_equip) else item_tester_hook = item_tester_hook_identify; - if (!can_get_item()) + if (can_get_item()) + { +#ifdef JP + q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ÕÄꤷ¤Þ¤¹¤«? "; +#else + q = "Identify which item? "; +#endif + } + else { if (only_equip) - { item_tester_hook = object_is_weapon_armour_ammo; - } else - { item_tester_hook = NULL; - } + +#ifdef JP + q = "¤¹¤Ù¤Æ´ÕÄêºÑ¤ß¤Ç¤¹¡£ "; +#else + q = "All items are identified. "; +#endif } /* Get an item */ #ifdef JP -q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ÕÄꤷ¤Þ¤¹¤«? "; -s = "´ÕÄꤹ¤ë¤Ù¤­¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£"; + s = "´ÕÄꤹ¤ë¤Ù¤­¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£"; #else - q = "Identify which item? "; s = "You have nothing to identify."; #endif @@ -3012,21 +3020,33 @@ bool identify_fully(bool only_equip) else item_tester_hook = item_tester_hook_identify_fully; - if (!can_get_item()) + if (can_get_item()) + { +#ifdef JP + q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò*´ÕÄê*¤·¤Þ¤¹¤«? "; +#else + q = "*Identify* which item? "; +#endif + } + else { if (only_equip) item_tester_hook = object_is_weapon_armour_ammo; else item_tester_hook = NULL; + +#ifdef JP + q = "¤¹¤Ù¤Æ*´ÕÄê*ºÑ¤ß¤Ç¤¹¡£ "; +#else + q = "All items are *identified*. "; +#endif } /* Get an item */ #ifdef JP -q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ÕÄꤷ¤Þ¤¹¤«? "; -s = "´ÕÄꤹ¤ë¤Ù¤­¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£"; + s = "*´ÕÄê*¤¹¤ë¤Ù¤­¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£"; #else - q = "Identify which item? "; - s = "You have nothing to identify."; + s = "You have nothing to *identify*."; #endif if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE); @@ -5472,18 +5492,27 @@ bool polymorph_monster(int y, int x) if (new_r_idx != old_r_idx) { u32b mode = 0L; + bool preserve_hold_objects = back_m.hold_o_idx ? TRUE : FALSE; + s16b this_o_idx, next_o_idx = 0; /* Get the monsters attitude */ if (is_friendly(m_ptr)) mode |= PM_FORCE_FRIENDLY; if (is_pet(m_ptr)) mode |= PM_FORCE_PET; if (m_ptr->mflag2 & MFLAG2_NOPET) mode |= PM_NO_PET; + /* Mega-hack -- ignore held objects */ + m_ptr->hold_o_idx = 0; + /* "Kill" the "old" monster */ delete_monster_idx(c_ptr->m_idx); /* Create a new monster (no groups) */ if (place_monster_aux(0, y, x, new_r_idx, mode)) { + m_list[hack_m_idx_ii].nickname = back_m.nickname; + m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx; + m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx; + /* Success */ polymorphed = TRUE; } @@ -5497,6 +5526,35 @@ bool polymorph_monster(int y, int x) /* Re-initialize monster process */ mproc_init(); } + else preserve_hold_objects = FALSE; + } + + /* Mega-hack -- preserve held objects */ + if (preserve_hold_objects) + { + for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx) + { + /* Acquire object */ + object_type *o_ptr = &o_list[this_o_idx]; + + /* Acquire next object */ + next_o_idx = o_ptr->next_o_idx; + + /* Held by new monster */ + o_ptr->held_m_idx = hack_m_idx_ii; + } + } + else if (back_m.hold_o_idx) /* Failed (paranoia) */ + { + /* Delete objects */ + for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx) + { + /* Acquire next object */ + next_o_idx = o_list[this_o_idx].next_o_idx; + + /* Delete the object */ + delete_object_idx(this_o_idx); + } } if (targeted) target_who = hack_m_idx_ii;