X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fxtra2.c;h=77d92ea584bd3d12a4e07ed04ecd019725411a2a;hb=3c26f0ccd00f36abaf409dc18fad7aec0def05bb;hp=37d5ab416de2a739b4ba2e04f20478a931c271ce;hpb=735e3ccbb3040baa1d3c84c02597968549f6523d;p=hengband%2Fhengband.git diff --git a/src/xtra2.c b/src/xtra2.c index 37d5ab416..77d92ea58 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -377,12 +377,59 @@ static bool kind_is_hafted(int k_idx) } +void complete_quest(int quest_num) +{ + quest_type* const q_ptr = &quest[quest_num]; + + switch (q_ptr->type) + { + case QUEST_TYPE_RANDOM: + if (record_rand_quest) do_cmd_write_nikki(NIKKI_RAND_QUEST_C, quest_num, NULL); + break; + default: + if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, quest_num, NULL); + break; + } + + q_ptr->status = QUEST_STATUS_COMPLETED; + q_ptr->complev = (byte)p_ptr->lev; + update_playtime(); + q_ptr->comptime = playtime; + + if (!(q_ptr->flags & QUEST_FLAG_SILENT)) + { + msg_print(_("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª", "You just completed your quest!")); + msg_print(NULL); + } +} + +static int count_all_hostile_monsters(void) +{ + int x, y; + int number_mon = 0; + + for (x = 0; x < cur_wid; ++ x) + { + for (y = 0; y < cur_hgt; ++ y) + { + int m_idx = cave[y][x].m_idx; + + if (m_idx > 0 && is_hostile(&m_list[m_idx])) + { + ++ number_mon; + } + } + } + + return number_mon; +} + /* * Check for "Quest" completion when a quest monster is killed or charmed. */ void check_quest_completion(monster_type *m_ptr) { - int i, j, y, x, ny, nx, i2, j2; + int y, x; int quest_num; @@ -397,41 +444,46 @@ void check_quest_completion(monster_type *m_ptr) x = m_ptr->fx; /* Inside a quest */ - quest_num = p_ptr->inside_quest; + quest_num = p_ptr->inside_quest; /* Search for an active quest on this dungeon level */ if (!quest_num) { + int i; + for (i = max_quests - 1; i > 0; i--) { + quest_type* const q_ptr = &quest[i]; + /* Quest is not active */ - if (quest[i].status != QUEST_STATUS_TAKEN) + if (q_ptr->status != QUEST_STATUS_TAKEN) continue; /* Quest is not a dungeon quest */ - if (quest[i].flags & QUEST_FLAG_PRESET) + if (q_ptr->flags & QUEST_FLAG_PRESET) continue; /* Quest is not on this level */ - if ((quest[i].level != dun_level) && - (quest[i].type != QUEST_TYPE_KILL_ANY_LEVEL)) + if ((q_ptr->level != dun_level) && + (q_ptr->type != QUEST_TYPE_KILL_ANY_LEVEL)) continue; /* Not a "kill monster" quest */ - if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) || - (quest[i].type == QUEST_TYPE_FIND_EXIT)) + if ((q_ptr->type == QUEST_TYPE_FIND_ARTIFACT) || + (q_ptr->type == QUEST_TYPE_FIND_EXIT)) continue; /* Interesting quest */ - if ((quest[i].type == QUEST_TYPE_KILL_NUMBER) || - (quest[i].type == QUEST_TYPE_KILL_ALL)) + if ((q_ptr->type == QUEST_TYPE_KILL_NUMBER) || + (q_ptr->type == QUEST_TYPE_TOWER) || + (q_ptr->type == QUEST_TYPE_KILL_ALL)) break; /* Interesting quest */ - if (((quest[i].type == QUEST_TYPE_KILL_LEVEL) || - (quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL) || - (quest[i].type == QUEST_TYPE_RANDOM)) && - (quest[i].r_idx == m_ptr->r_idx)) + if (((q_ptr->type == QUEST_TYPE_KILL_LEVEL) || + (q_ptr->type == QUEST_TYPE_KILL_ANY_LEVEL) || + (q_ptr->type == QUEST_TYPE_RANDOM)) && + (q_ptr->r_idx == m_ptr->r_idx)) break; } @@ -442,68 +494,35 @@ void check_quest_completion(monster_type *m_ptr) if (quest_num && (quest[quest_num].status == QUEST_STATUS_TAKEN)) { /* Current quest */ - i = quest_num; + quest_type* const q_ptr = &quest[quest_num]; - switch (quest[i].type) + switch (q_ptr->type) { case QUEST_TYPE_KILL_NUMBER: { - quest[i].cur_num++; + q_ptr->cur_num++; - if (quest[i].cur_num >= quest[i].num_mon) + if (q_ptr->cur_num >= q_ptr->num_mon) { - if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL); - /* completed quest */ - quest[i].status = QUEST_STATUS_COMPLETED; - quest[i].complev = (byte)p_ptr->lev; - - if (!(quest[i].flags & QUEST_FLAG_SILENT)) - { -#ifdef JP -msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª"); -#else - msg_print("You just completed your quest!"); -#endif - - msg_print(NULL); - } + complete_quest(quest_num); - quest[i].cur_num = 0; + q_ptr->cur_num = 0; } break; } case QUEST_TYPE_KILL_ALL: { - int number_mon = 0; - if (!is_hostile(m_ptr)) break; - /* Count all hostile monsters */ - for (i2 = 0; i2 < cur_wid; ++i2) - for (j2 = 0; j2 < cur_hgt; j2++) - if (cave[j2][i2].m_idx > 0) - if (is_hostile(&m_list[cave[j2][i2].m_idx])) - number_mon++; - - if ((number_mon - 1) == 0) + if (count_all_hostile_monsters() == 1) { - if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL); - /* completed */ - if (quest[i].flags & QUEST_FLAG_SILENT) + if (q_ptr->flags & QUEST_FLAG_SILENT) { - quest[i].status = QUEST_STATUS_FINISHED; + q_ptr->status = QUEST_STATUS_FINISHED; } else { - quest[i].status = QUEST_STATUS_COMPLETED; - quest[i].complev = (byte)p_ptr->lev; -#ifdef JP -msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª"); -#else - msg_print("You just completed your quest!"); -#endif - - msg_print(NULL); + complete_quest(quest_num); } } break; @@ -512,70 +531,60 @@ msg_print(" case QUEST_TYPE_RANDOM: { /* Only count valid monsters */ - if (quest[i].r_idx != m_ptr->r_idx) + if (q_ptr->r_idx != m_ptr->r_idx) break; - quest[i].cur_num++; + q_ptr->cur_num++; - if (quest[i].cur_num >= quest[i].max_num) + if (q_ptr->cur_num >= q_ptr->max_num) { - if (record_fix_quest && (quest[i].type == QUEST_TYPE_KILL_LEVEL)) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL); - if (record_rand_quest && (quest[i].type == QUEST_TYPE_RANDOM)) do_cmd_write_nikki(NIKKI_RAND_QUEST_C, i, NULL); - /* completed quest */ - quest[i].status = QUEST_STATUS_COMPLETED; - quest[i].complev = (byte)p_ptr->lev; - if (!(quest[i].flags & QUEST_FLAG_PRESET)) + complete_quest(quest_num); + + if (!(q_ptr->flags & QUEST_FLAG_PRESET)) { create_stairs = TRUE; p_ptr->inside_quest = 0; } - if (!(quest[i].flags & QUEST_FLAG_SILENT)) - { -#ifdef JP -msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª"); -#else - msg_print("You just completed your quest!"); -#endif - - msg_print(NULL); - } - /* Finish the two main quests without rewarding */ - if ((i == QUEST_OBERON) || (i == QUEST_SERPENT)) + if ((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT)) { - quest[i].status = QUEST_STATUS_FINISHED; + q_ptr->status = QUEST_STATUS_FINISHED; } - if (quest[i].type == QUEST_TYPE_RANDOM) + if (q_ptr->type == QUEST_TYPE_RANDOM) { reward = TRUE; - quest[i].status = QUEST_STATUS_FINISHED; + q_ptr->status = QUEST_STATUS_FINISHED; } } break; } case QUEST_TYPE_KILL_ANY_LEVEL: { - quest[i].cur_num++; - if (quest[i].cur_num >= quest[i].max_num) + q_ptr->cur_num++; + if (q_ptr->cur_num >= q_ptr->max_num) + { + complete_quest(quest_num); + q_ptr->cur_num = 0; + } + break; + } + case QUEST_TYPE_TOWER: + { + if (!is_hostile(m_ptr)) break; + + if (count_all_hostile_monsters() == 1) { - if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL); - /* completed quest */ - quest[i].status = QUEST_STATUS_COMPLETED; - quest[i].complev = (byte)p_ptr->lev; + q_ptr->status = QUEST_STATUS_STAGE_COMPLETED; - if (!(quest[i].flags & QUEST_FLAG_SILENT)) + if((quest[QUEST_TOWER1].status == QUEST_STATUS_STAGE_COMPLETED) && + (quest[QUEST_TOWER2].status == QUEST_STATUS_STAGE_COMPLETED) && + (quest[QUEST_TOWER3].status == QUEST_STATUS_STAGE_COMPLETED)) { -#ifdef JP -msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª"); -#else - msg_print("You just completed your quest!"); -#endif - msg_print(NULL); + complete_quest(QUEST_TOWER1); } - quest[i].cur_num = 0; } break; } @@ -585,6 +594,8 @@ msg_print(" /* Create a magical staircase */ if (create_stairs) { + int ny, nx; + /* Stagger around */ while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT) ) { @@ -604,7 +615,7 @@ msg_print(" /* Create stairs down */ - cave_set_feat(y, x, FEAT_MORE); + cave_set_feat(y, x, feat_down_stair); /* Remember to update everything */ p_ptr->update |= (PU_FLOW); @@ -615,7 +626,9 @@ msg_print(" */ if (reward) { - for (j = 0; j < (dun_level / 15)+1; j++) + int i; + + for (i = 0; i < (dun_level / 15)+1; i++) { /* Get local object */ q_ptr = &forge; @@ -633,6 +646,21 @@ msg_print(" } +void check_find_art_quest_completion(object_type *o_ptr) +{ + int i; + /* Check if completed a quest */ + for (i = 0; i < max_quests; i++) + { + if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) && + (quest[i].status == QUEST_STATUS_TAKEN) && + (quest[i].k_idx == o_ptr->name1)) + { + complete_quest(i); + } + } +} + /* * Return monster death string */ @@ -698,7 +726,7 @@ void monster_death(int m_idx, bool drop_item) monster_race *r_ptr = &r_info[m_ptr->r_idx]; - bool visible = (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE)); + bool visible = ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE)); u32b mo_mode = 0L; @@ -823,8 +851,7 @@ msg_print(" /* Drop a dead corpse? */ if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) && - ((r_ptr->flags9 & RF9_DROP_CORPSE) || - (r_ptr->flags9 & RF9_DROP_SKELETON)) && + (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) && !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)))) { /* Assume skeleton */ @@ -836,7 +863,7 @@ msg_print(" */ if (!(r_ptr->flags9 & RF9_DROP_SKELETON)) corpse = TRUE; - else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 && RF1_UNIQUE)) + else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 & RF1_UNIQUE)) corpse = TRUE; /* Else, a corpse is more likely unless we did a "lot" of damage */ @@ -999,6 +1026,7 @@ msg_print(" if (p_ptr->pseikaku == SEIKAKU_NAMAKE) { int a_idx = 0; + artifact_type *a_ptr = NULL; if (!drop_chosen_item) break; @@ -1016,15 +1044,20 @@ msg_print(" a_idx = ART_NAMAKE_ARMOR; break; } + + a_ptr = &a_info[a_idx]; } - while (a_info[a_idx].cur_num); + while (a_ptr->cur_num); - if (a_info[a_idx].cur_num == 0) + /* Create the artifact */ + if (create_named_art(a_idx, y, x)) { - /* Create the artifact */ - create_named_art(a_idx, y, x); - a_info[a_idx].cur_num = 1; + a_ptr->cur_num = 1; + + /* Hack -- Memorize location of artifact in saved floors */ + if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; } + else if (!preserve_mode) a_ptr->cur_num = 1; } break; @@ -1079,7 +1112,7 @@ msg_print(" case MON_A_GOLD: case MON_A_SILVER: if (drop_chosen_item && ((m_ptr->r_idx == MON_A_GOLD) || - ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_pkills % 5 == 0)))) + ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_akills % 5 == 0)))) { /* Get local object */ q_ptr = &forge; @@ -1178,7 +1211,7 @@ msg_print(" /* Activate restriction */ get_obj_num_hook = kind_is_hafted; - /* Make a poleweapon */ + /* Make a hafted weapon */ make_object(q_ptr, mo_mode); /* Drop it in the dungeon */ @@ -1300,8 +1333,16 @@ msg_print(" break; case MON_SURTUR: - a_idx = ART_TWILIGHT; - chance = 66; + if (!one_in_(3)) + { + a_idx = ART_TWILIGHT; + chance = 100; + } + else + { + a_idx = ART_ORB_OF_FATE; + chance = 100; + } break; case MON_SARUMAN: @@ -1383,15 +1424,34 @@ msg_print(" a_idx = ART_FUNDIN; chance = 5; break; + + case MON_ROBIN_HOOD: + a_idx = ART_ROBIN_HOOD; + chance = 5; + break; + + case MON_KOGAN: + a_idx = ART_NANACHO; + chance = 80; + break; + } if ((a_idx > 0) && ((randint0(100) < chance) || p_ptr->wizard)) { - if (a_info[a_idx].cur_num == 0) + artifact_type *a_ptr = &a_info[a_idx]; + + if (!a_ptr->cur_num) { /* Create the artifact */ - create_named_art(a_idx, y, x); - a_info[a_idx].cur_num = 1; + if (create_named_art(a_idx, y, x)) + { + a_ptr->cur_num = 1; + + /* Hack -- Memorize location of artifact in saved floors */ + if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; + } + else if (!preserve_mode) a_ptr->cur_num = 1; } } @@ -1403,11 +1463,19 @@ msg_print(" if (d_info[dungeon_type].final_artifact) { int a_idx = d_info[dungeon_type].final_artifact; - if (!a_info[a_idx].cur_num) + artifact_type *a_ptr = &a_info[a_idx]; + + if (!a_ptr->cur_num) { /* Create the artifact */ - create_named_art(a_idx, y, x); - a_info[a_idx].cur_num = 1; + if (create_named_art(a_idx, y, x)) + { + a_ptr->cur_num = 1; + + /* Hack -- Memorize location of artifact in saved floors */ + if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; + } + else if (!preserve_mode) a_ptr->cur_num = 1; /* Prevent rewarding both artifact and "default" object */ if (!d_info[dungeon_type].final_object) k_idx = 0; @@ -1449,6 +1517,9 @@ msg_print(" if (is_pet(m_ptr) || p_ptr->inside_battle || p_ptr->inside_arena) number = 0; /* Pets drop no stuff */ if (!drop_item && (r_ptr->d_char != '$')) number = 0; + + if((r_ptr->flags2 & (RF2_MULTIPLY)) && (r_ptr->r_akills > 1024)) + number = 0; /* Limit of Multiply monster drop */ /* Hack -- handle creeping coins */ coin_type = force_coin; @@ -1570,17 +1641,17 @@ int mon_damage_mod(monster_type *m_ptr, int dam, bool is_psy_spear) if ((r_ptr->flagsr & RFR_RES_ALL) && dam > 0) { dam /= 100; - if((dam == 0) && one_in_(3)) dam = 1; + if ((dam == 0) && one_in_(3)) dam = 1; } - if (m_ptr->invulner) + if (MON_INVULNER(m_ptr)) { if (is_psy_spear) { if (!p_ptr->blind && is_seen(m_ptr)) { #ifdef JP -msg_print("¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¤¤¿¡ª"); + msg_print("¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¤¤¿¡ª"); #else msg_print("The barrier is penetrated!"); #endif @@ -1628,9 +1699,9 @@ static void get_exp_from_mon(int dam, monster_type *m_ptr) /* Use (average maxhp * 2) as a denominator */ if (!(r_ptr->flags1 & RF1_FORCE_MAXHP)) - s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (r_ptr->hside + 1)); + s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (ironman_nightmare ? 2 : 1) * (r_ptr->hside + 1)); else - s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * r_ptr->hside * 2); + s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside * 2); /* Special penalty in the wilderness */ if (!dun_level && (!(r_ptr->flags8 & RF8_WILD_ONLY) || !(r_ptr->flags1 & RF1_UNIQUE))) @@ -1642,7 +1713,7 @@ static void get_exp_from_mon(int dam, monster_type *m_ptr) /* Special penalty for mutiply-monster */ if ((r_ptr->flags2 & RF2_MULTIPLY) || (m_ptr->r_idx == MON_DAWN)) { - int monnum_penarty = r_ptr->r_pkills / 400; + int monnum_penarty = r_ptr->r_akills / 400; if (monnum_penarty > 8) monnum_penarty = 8; while (monnum_penarty--) @@ -1651,6 +1722,20 @@ static void get_exp_from_mon(int dam, monster_type *m_ptr) s64b_RSHIFT(new_exp, new_exp_frac, 2); } } + + /* Special penalty for rest_and_shoot exp scum */ + if ((m_ptr->dealt_damage > m_ptr->max_maxhp) && (m_ptr->hp >= 0)) + { + int over_damage = m_ptr->dealt_damage / m_ptr->max_maxhp; + if (over_damage > 32) over_damage = 32; + + while (over_damage--) + { + /* 9/10 for once */ + s64b_mul(&new_exp, &new_exp_frac, 0, 9); + s64b_div(&new_exp, &new_exp_frac, 0, 10); + } + } /* Finally multiply base experience point of the monster */ s64b_mul(&new_exp, &new_exp_frac, 0, r_ptr->mexp); @@ -1700,27 +1785,23 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note) bool innocent = TRUE, thief = FALSE; int i; int expdam; + int dealt_damage; - COPY(&exp_mon, m_ptr, monster_type); - if (!(r_ptr->flags7 & RF7_KILL_EXP)) - { - expdam = (m_ptr->hp > dam) ? dam : m_ptr->hp; - if (r_ptr->flags6 & RF6_HEAL) expdam = (expdam+1) * 2 / 3; + (void)COPY(&exp_mon, m_ptr, monster_type); + + expdam = (m_ptr->hp > dam) ? dam : m_ptr->hp; - get_exp_from_mon(expdam, &exp_mon); - } + get_exp_from_mon(expdam, &exp_mon); + /* Genocided by chaos patron */ + if (!m_ptr->r_idx) m_idx = 0; + /* Redraw (later) if needed */ if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); - if (m_ptr->csleep) - { - /* Wake it up */ - m_ptr->csleep = 0; - if (!need_mproc(m_ptr)) mproc_remove(m_ptr->mproc_idx); - if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE); - } + /* Wake it up */ + (void)set_monster_csleep(m_idx, 0); /* Hack - Cancel any special player stealth magics. -LM- */ if (p_ptr->special_defense & NINJA_S_STEALTH) @@ -1728,8 +1809,22 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note) set_superstealth(FALSE); } + /* Genocided by chaos patron */ + if (!m_idx) return TRUE; + + /* Remember dealt_damage before this attack*/ + dealt_damage = m_ptr->dealt_damage; + /* Hurt it */ m_ptr->hp -= dam; + + m_ptr->dealt_damage += dam; + if(m_ptr->dealt_damage > m_ptr->max_maxhp * 100) m_ptr->dealt_damage = m_ptr->max_maxhp * 100; + if (p_ptr->wizard) + { + msg_format( _("¹ç·×%d/%d¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£","You do %d (out of %d) damage."), + m_ptr->dealt_damage, m_ptr->maxhp); + } /* It is dead now */ if (m_ptr->hp < 0) @@ -1763,15 +1858,18 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note) { r_info[MON_BANORLUPART].max_num = 0; r_info[MON_BANORLUPART].r_pkills++; + r_info[MON_BANORLUPART].r_akills++; if (r_info[MON_BANORLUPART].r_tkills < MAX_SHORT) r_info[MON_BANORLUPART].r_tkills++; } else if (m_ptr->r_idx == MON_BANORLUPART) { r_info[MON_BANOR].max_num = 0; r_info[MON_BANOR].r_pkills++; + r_info[MON_BANOR].r_akills++; if (r_info[MON_BANOR].r_tkills < MAX_SHORT) r_info[MON_BANOR].r_tkills++; r_info[MON_LUPART].max_num = 0; r_info[MON_LUPART].r_pkills++; + r_info[MON_LUPART].r_akills++; if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++; } } @@ -1780,8 +1878,11 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note) else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num--; } + /* Count all monsters killed */ + if (r_ptr->r_akills < MAX_SHORT) r_ptr->r_akills++; + /* Recall even invisible uniques or winners */ - if (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE)) + if ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE)) { /* Count kills this life */ if ((m_ptr->mflag2 & MFLAG2_KAGE) && (r_info[MON_KAGE].r_pkills < MAX_SHORT)) r_info[MON_KAGE].r_pkills++; @@ -1915,7 +2016,7 @@ msg_format("%^s chg_virtue(V_HONOUR, 1); } } - if ((r_ptr->flags2 & RF2_MULTIPLY) && (r_ptr->r_pkills > 1000) && one_in_(10)) + if ((r_ptr->flags2 & RF2_MULTIPLY) && (r_ptr->r_akills > 1000) && one_in_(10)) { chg_virtue(V_VALOUR, -1); } @@ -1999,9 +2100,9 @@ msg_format("%s /* Special note at death */ if (explode) #ifdef JP -msg_format("%s¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£", m_name); + msg_format("%s¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£", m_name); #else - msg_format("%s explodes into tiny shreds.", m_name); + msg_format("%^s explodes into tiny shreds.", m_name); #endif else { @@ -2076,11 +2177,7 @@ msg_format("%s delete_monster_idx(m_idx); } - /* Prevent bug of chaos patron's reward */ - if (r_ptr->flags7 & RF7_KILL_EXP) - get_exp_from_mon((long)exp_mon.max_maxhp*2, &exp_mon); - else - get_exp_from_mon(((long)exp_mon.max_maxhp+1L) * 9L / 10L, &exp_mon); + get_exp_from_mon((long)exp_mon.max_maxhp*2, &exp_mon); /* Not afraid */ (*fear) = FALSE; @@ -2093,36 +2190,21 @@ msg_format("%s #ifdef ALLOW_FEAR /* Mega-Hack -- Pain cancels fear */ - if (m_ptr->monfear && (dam > 0)) + if (MON_MONFEAR(m_ptr) && (dam > 0)) { - int tmp = randint1(dam); - - /* Cure a little fear */ - if (tmp < m_ptr->monfear) - { - /* Reduce fear */ - m_ptr->monfear -= tmp; - } - - /* Cure all the fear */ - else + /* Cure fear */ + if (set_monster_monfear(m_idx, MON_MONFEAR(m_ptr) - randint1(dam))) { - /* Cure fear */ - m_ptr->monfear = 0; - if (!need_mproc(m_ptr)) mproc_remove(m_ptr->mproc_idx); - /* No more fear */ (*fear) = FALSE; } } /* Sometimes a monster gets scared by damage */ - if (!m_ptr->monfear && !(r_ptr->flags3 & (RF3_NO_FEAR))) + if (!MON_MONFEAR(m_ptr) && !(r_ptr->flags3 & (RF3_NO_FEAR))) { - int percentage; - /* Percentage of fully healthy */ - percentage = (100L * m_ptr->hp) / m_ptr->maxhp; + int percentage = (100L * m_ptr->hp) / m_ptr->maxhp; /* * Run (sometimes) if at 10% or less of max hit points, @@ -2134,12 +2216,10 @@ msg_format("%s /* Hack -- note fear */ (*fear) = TRUE; - if (!m_ptr->mproc_idx) mproc_add(m_idx); - /* XXX XXX XXX Hack -- Add some timed fear */ - m_ptr->monfear = (randint1(10) + + (void)set_monster_monfear(m_idx, (randint1(10) + (((dam >= m_ptr->hp) && (percentage > 7)) ? - 20 : ((11 - percentage) * 5))); + 20 : ((11 - percentage) * 5)))); } } @@ -2325,6 +2405,24 @@ bool change_panel(int dy, int dx) return (FALSE); } +bool change_panel_xy(int y, int x) +{ + int dy = 0, dx = 0; + int wid, hgt; + + /* Get size */ + get_screen_size(&wid, &hgt); + + if (y < panel_row_min) dy = -1; + if (y > panel_row_max) dy = 1; + if (x < panel_col_min) dx = -1; + if (x > panel_col_max) dx = 1; + + if (!dy && !dx) return (FALSE); + + return change_panel(dy, dx); +} + /* * Given an row (y) and col (x), this routine detects when a move @@ -2713,7 +2811,6 @@ bool target_okay(void) } - /* * Sorting hook -- comp function -- by "distance to player" * @@ -2747,6 +2844,75 @@ static bool ang_sort_comp_distance(vptr u, vptr v, int a, int b) /* + * Sorting hook -- comp function -- by importance level of grids + * + * We use "u" and "v" to point to arrays of "x" and "y" positions, + * and sort the arrays by level of monster + */ +static bool ang_sort_comp_importance(vptr u, vptr v, int a, int b) +{ + byte *x = (byte*)(u); + byte *y = (byte*)(v); + cave_type *ca_ptr = &cave[y[a]][x[a]]; + cave_type *cb_ptr = &cave[y[b]][x[b]]; + monster_type *ma_ptr = &m_list[ca_ptr->m_idx]; + monster_type *mb_ptr = &m_list[cb_ptr->m_idx]; + monster_race *ap_ra_ptr, *ap_rb_ptr; + + /* The player grid */ + if (y[a] == py && x[a] == px) return TRUE; + if (y[b] == py && x[b] == px) return FALSE; + + /* Extract monster race */ + if (ca_ptr->m_idx && ma_ptr->ml) ap_ra_ptr = &r_info[ma_ptr->ap_r_idx]; + else ap_ra_ptr = NULL; + if (cb_ptr->m_idx && mb_ptr->ml) ap_rb_ptr = &r_info[mb_ptr->ap_r_idx]; + else ap_rb_ptr = NULL; + + if (ap_ra_ptr && !ap_rb_ptr) return TRUE; + if (!ap_ra_ptr && ap_rb_ptr) return FALSE; + + /* Compare two monsters */ + if (ap_ra_ptr && ap_rb_ptr) + { + /* Unique monsters first */ + if ((ap_ra_ptr->flags1 & RF1_UNIQUE) && !(ap_rb_ptr->flags1 & RF1_UNIQUE)) return TRUE; + if (!(ap_ra_ptr->flags1 & RF1_UNIQUE) && (ap_rb_ptr->flags1 & RF1_UNIQUE)) return FALSE; + + /* Shadowers first (¤¢¤ä¤·¤¤±Æ) */ + if ((ma_ptr->mflag2 & MFLAG2_KAGE) && !(mb_ptr->mflag2 & MFLAG2_KAGE)) return TRUE; + if (!(ma_ptr->mflag2 & MFLAG2_KAGE) && (mb_ptr->mflag2 & MFLAG2_KAGE)) return FALSE; + + /* Unknown monsters first */ + if (!ap_ra_ptr->r_tkills && ap_rb_ptr->r_tkills) return TRUE; + if (ap_ra_ptr->r_tkills && !ap_rb_ptr->r_tkills) return FALSE; + + /* Higher level monsters first (if known) */ + if (ap_ra_ptr->r_tkills && ap_rb_ptr->r_tkills) + { + if (ap_ra_ptr->level > ap_rb_ptr->level) return TRUE; + if (ap_ra_ptr->level < ap_rb_ptr->level) return FALSE; + } + + /* Sort by index if all conditions are same */ + if (ma_ptr->ap_r_idx > mb_ptr->ap_r_idx) return TRUE; + if (ma_ptr->ap_r_idx < mb_ptr->ap_r_idx) return FALSE; + } + + /* An object get higher priority */ + if (cave[y[a]][x[a]].o_idx && !cave[y[b]][x[b]].o_idx) return TRUE; + if (!cave[y[a]][x[a]].o_idx && cave[y[b]][x[b]].o_idx) return FALSE; + + /* Priority from the terrain */ + if (f_info[ca_ptr->feat].priority > f_info[cb_ptr->feat].priority) return TRUE; + if (f_info[ca_ptr->feat].priority < f_info[cb_ptr->feat].priority) return FALSE; + + /* If all conditions are same, compare distance */ + return ang_sort_comp_distance(u, v, a, b); +} + + +/* * Sorting hook -- swap function -- by "distance to player" * * We use "u" and "v" to point to arrays of "x" and "y" positions, @@ -2894,14 +3060,32 @@ static bool target_set_accept(int y, int x) static void target_set_prepare(int mode) { int y, x; + int min_hgt, max_hgt, min_wid, max_wid; + + if (mode & TARGET_KILL) + { + /* Inner range */ + min_hgt = MAX((py - MAX_RANGE), 0); + max_hgt = MIN((py + MAX_RANGE), cur_hgt - 1); + min_wid = MAX((px - MAX_RANGE), 0); + max_wid = MIN((px + MAX_RANGE), cur_wid - 1); + } + else /* not targetting */ + { + /* Inner panel */ + min_hgt = panel_row_min; + max_hgt = panel_row_max; + min_wid = panel_col_min; + max_wid = panel_col_max; + } /* Reset "temp" array */ temp_n = 0; /* Scan the current panel */ - for (y = panel_row_min; y <= panel_row_max; y++) + for (y = min_hgt; y <= max_hgt; y++) { - for (x = panel_col_min; x <= panel_col_max; x++) + for (x = min_wid; x <= max_wid; x++) { cave_type *c_ptr; @@ -2923,8 +3107,18 @@ static void target_set_prepare(int mode) } /* Set the sort hooks */ - ang_sort_comp = ang_sort_comp_distance; - ang_sort_swap = ang_sort_swap_distance; + if (mode & (TARGET_KILL)) + { + /* Target the nearest monster for shooting */ + ang_sort_comp = ang_sort_comp_distance; + ang_sort_swap = ang_sort_swap_distance; + } + else + { + /* Look important grids first in Look command */ + ang_sort_comp = ang_sort_comp_importance; + ang_sort_swap = ang_sort_swap_distance; + } /* Sort the positions */ ang_sort(temp_x, temp_y, temp_n); @@ -2941,6 +3135,9 @@ static void target_set_prepare(int mode) temp_x[1] = tmp; } } +void target_set_prepare_look(){ + target_set_prepare(TARGET_LOOK); +} /* @@ -2994,10 +3191,12 @@ static void evaluate_monster_exp(char *buf, monster_type *m_ptr) num = MIN(999, exp_adv_frac); /* Display the number */ - sprintf(buf,"%03ld", num); + sprintf(buf,"%03ld", (long int)num); } +bool show_gold_on_floor = FALSE; + /* * Examine a grid, return a keypress. * @@ -3349,7 +3548,9 @@ static int target_set_aux(int y, int x, int mode, cptr info) screen_save(); /* Display */ + show_gold_on_floor = TRUE; (void)show_floor(0, y, x, &min_width); + show_gold_on_floor = FALSE; /* Prompt */ #ifdef JP @@ -3474,7 +3675,7 @@ static int target_set_aux(int y, int x, int mode, cptr info) if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x)) { /* Forget feature */ - feat = FEAT_NONE; + feat = feat_none; } f_ptr = &f_info[feat]; @@ -3484,10 +3685,38 @@ static int target_set_aux(int y, int x, int mode, cptr info) { cptr name; + /* Hack -- special handling for quest entrances */ + if (have_flag(f_ptr->flags, FF_QUEST_ENTER)) + { + /* Set the quest number temporary */ + int old_quest = p_ptr->inside_quest; + int j; + + /* Clear the text */ + for (j = 0; j < 10; j++) quest_text[j][0] = '\0'; + quest_text_line = 0; + + p_ptr->inside_quest = c_ptr->special; + + /* Get the quest text */ + init_flags = INIT_NAME_ONLY; + + process_dungeon_file("q_info.txt", 0, 0, 0, 0); + +#ifdef JP + name = format("¥¯¥¨¥¹¥È¡Ö%s¡×(%d³¬ÁêÅö)", quest[c_ptr->special].name, quest[c_ptr->special].level); +#else + name = format("the entrance to the quest '%s'(level %d)", quest[c_ptr->special].name, quest[c_ptr->special].level); +#endif + + /* Reset the old quest number */ + p_ptr->inside_quest = old_quest; + } + /* Hack -- special handling for building doors */ - if (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena) + else if (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena) { - name = building[f_ptr->power].name; + name = building[f_ptr->subtype].name; } else if (have_flag(f_ptr->flags, FF_ENTRANCE)) { @@ -3501,7 +3730,7 @@ static int target_set_aux(int y, int x, int mode, cptr info) { name = town[c_ptr->special].name; } - else if (p_ptr->wild_mode && (feat == FEAT_FLOOR)) + else if (p_ptr->wild_mode && (feat == feat_floor)) { #ifdef JP name = "Æ»"; @@ -3530,6 +3759,7 @@ static int target_set_aux(int y, int x, int mode, cptr info) /* Hack -- special introduction for store & building doors -KMW- */ if (have_flag(f_ptr->flags, FF_STORE) || + have_flag(f_ptr->flags, FF_QUEST_ENTER) || (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena) || have_flag(f_ptr->flags, FF_ENTRANCE)) { @@ -3561,7 +3791,7 @@ static int target_set_aux(int y, int x, int mode, cptr info) if (c_ptr->mimic) sprintf(f_idx_str, "%d/%d", c_ptr->feat, c_ptr->mimic); else sprintf(f_idx_str, "%d", c_ptr->feat); #ifdef JP - sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d)", s1, name, s2, s3, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, y, x); + sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d) %d", s1, name, s2, s3, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, y, x, travel.cost[y][x]); #else sprintf(out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, y, x); #endif @@ -3647,8 +3877,7 @@ bool target_set(int mode) cave_type *c_ptr; int wid, hgt; - - + /* Get size */ get_screen_size(&wid, &hgt); @@ -3675,6 +3904,9 @@ bool target_set(int mode) y = temp_y[m]; x = temp_x[m]; + /* Set forcus */ + change_panel_xy(y, x); + if (!(mode & TARGET_LOOK)) prt_path(y, x); /* Access */ @@ -3701,9 +3933,12 @@ strcpy(info, "q #endif } - + /* Describe and Prompt */ - while (!(query = target_set_aux(y, x, mode, info))); + while (TRUE){ + query = target_set_aux(y, x, mode, info); + if(query)break; + } /* Cancel tracking */ /* health_track(0); */ @@ -4299,6 +4534,7 @@ msg_print(" bool get_rep_dir(int *dp, bool under) { int dir; + cptr prompt; /* Initialize */ (*dp) = 0; @@ -4316,24 +4552,36 @@ bool get_rep_dir(int *dp, bool under) #endif /* ALLOW_REPEAT -- TNB */ + if (under) + { + prompt = _("Êý¸þ ('.'­¸µ, ESC¤ÇÃæÃÇ)? ", "Direction ('.' at feet, Escape to cancel)? "); + } + else + { + prompt = _("Êý¸þ (ESC¤ÇÃæÃÇ)? ", "Direction (Escape to cancel)? "); + } + /* Get a direction */ while (!dir) { char ch; /* Get a command (or Cancel) */ -#ifdef JP -if (!get_com("Êý¸þ (ESC¤ÇÃæÃÇ)? ", &ch, TRUE)) break; -#else - if (!get_com("Direction (Escape to cancel)? ", &ch, TRUE)) break; -#endif - + if (!get_com(prompt, &ch, TRUE)) break; - /* Look up the direction */ - dir = get_keymap_dir(ch); + /* Look down */ + if ((under) && ((ch == '5') || (ch == '-') || (ch == '.'))) + { + dir = 5; + } + else + { + /* Look up the direction */ + dir = get_keymap_dir(ch); - /* Oops */ - if (!dir) bell(); + /* Oops */ + if (!dir) bell(); + } } /* Prevent weirdness */ @@ -4360,7 +4608,7 @@ if (!get_com(" monster_type *m_ptr = &m_list[p_ptr->riding]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - if (m_ptr->confused) + if (MON_CONFUSED(m_ptr)) { /* Standard confusion */ if (randint0(100) < 75) @@ -4399,7 +4647,7 @@ msg_print(" monster_type *m_ptr = &m_list[p_ptr->riding]; monster_desc(m_name, m_ptr, 0); - if (m_ptr->confused) + if (MON_CONFUSED(m_ptr)) { #ifdef JP msg_format("%s¤Ïº®Í𤷤Ƥ¤¤ë¡£", m_name); @@ -4520,7 +4768,6 @@ msg_print(" return (TRUE); } - void gain_level_reward(int chosen_reward) { object_type *q_ptr; @@ -5498,12 +5745,85 @@ msg_format(" /* + * XAngband: determine if a given location is "interesting" + * based on target_set_accept function. + */ +static bool tgt_pt_accept(int y, int x) +{ + cave_type *c_ptr; + + /* Bounds */ + if (!(in_bounds(y, x))) return (FALSE); + + /* Player grid is always interesting */ + if ((y == py) && (x == px)) return (TRUE); + + /* Handle hallucination */ + if (p_ptr->image) return (FALSE); + + /* Examine the grid */ + c_ptr = &cave[y][x]; + + /* Interesting memorized features */ + if (c_ptr->info & (CAVE_MARK)) + { + /* Notice stairs */ + if (cave_have_flag_grid(c_ptr, FF_LESS)) return (TRUE); + if (cave_have_flag_grid(c_ptr, FF_MORE)) return (TRUE); + + /* Notice quest features */ + if (cave_have_flag_grid(c_ptr, FF_QUEST_ENTER)) return (TRUE); + if (cave_have_flag_grid(c_ptr, FF_QUEST_EXIT)) return (TRUE); + } + + /* Nope */ + return (FALSE); +} + + +/* + * XAngband: Prepare the "temp" array for "tget_pt" + * based on target_set_prepare funciton. + */ +static void tgt_pt_prepare(void) +{ + int y, x; + + /* Reset "temp" array */ + temp_n = 0; + + if (!expand_list) return; + + /* Scan the current panel */ + for (y = 1; y < cur_hgt; y++) + { + for (x = 1; x < cur_wid; x++) + { + /* Require "interesting" contents */ + if (!tgt_pt_accept(y, x)) continue; + + /* Save the location */ + temp_x[temp_n] = x; + temp_y[temp_n] = y; + temp_n++; + } + } + + /* Target the nearest monster for shooting */ + ang_sort_comp = ang_sort_comp_distance; + ang_sort_swap = ang_sort_swap_distance; + + /* Sort the positions */ + ang_sort(temp_x, temp_y, temp_n); +} + +/* * old -- from PsiAngband. */ bool tgt_pt(int *x_ptr, int *y_ptr) { char ch = 0; - int d, x, y; + int d, x, y, n; bool success = FALSE; int wid, hgt; @@ -5514,8 +5834,14 @@ bool tgt_pt(int *x_ptr, int *y_ptr) x = px; y = py; + if (expand_list) + { + tgt_pt_prepare(); + n = 0; + } + #ifdef JP -msg_print("¾ì½ê¤òÁª¤ó¤Ç¥¹¥Ú¡¼¥¹¥­¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£"); + msg_print("¾ì½ê¤òÁª¤ó¤Ç¥¹¥Ú¡¼¥¹¥­¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£"); #else msg_print("Select a point and press space."); #endif @@ -5543,6 +5869,62 @@ msg_print(" else success = TRUE; break; + + /* XAngband: Move cursor to stairs */ + case '>': + case '<': + if (expand_list && temp_n) + { + int dx, dy; + int cx = (panel_col_min + panel_col_max) / 2; + int cy = (panel_row_min + panel_row_max) / 2; + + n++; + + /* Skip stairs which have defferent distance */ + for (; n < temp_n; ++ n) + { + cave_type *c_ptr = &cave[temp_y[n]][temp_x[n]]; + + if (cave_have_flag_grid(c_ptr, FF_STAIRS) && + cave_have_flag_grid(c_ptr, ch == '>' ? FF_MORE : FF_LESS)) + { + /* Found */ + break; + } + } + + if (n == temp_n) /* Loop out taget list */ + { + n = 0; + y = py; + x = px; + verify_panel(); /* Move cursor to player */ + + /* Update stuff */ + p_ptr->update |= (PU_MONSTERS); + + /* Redraw map */ + p_ptr->redraw |= (PR_MAP); + + /* Window stuff */ + p_ptr->window |= (PW_OVERHEAD); + + /* Handle stuff */ + handle_stuff(); + } + else /* move cursor to next stair and change panel */ + { + y = temp_y[n]; + x = temp_x[n]; + + dy = 2 * (y - cy) / hgt; + dx = 2 * (x - cx) / wid; + if (dy || dx) change_panel(dy, dx); + } + } + break; + default: /* Look up the direction */ d = get_keymap_dir(ch); @@ -5945,3 +6327,166 @@ int spell_exp_level(int spell_exp) else if (spell_exp < SPELL_EXP_MASTER) return EXP_LEVEL_EXPERT; else return EXP_LEVEL_MASTER; } + + +/* + * Display a rumor and apply its effects + */ + +int rumor_num(char *zz, int max_idx) +{ + if (strcmp(zz, "*") == 0) return randint1(max_idx - 1); + return atoi(zz); +} + +cptr rumor_bind_name(char *base, cptr fullname) +{ + char *s, *v; + + s = strstr(base, "{Name}"); + if (s) + { + s[0] = '\0'; + v = format("%s%s%s", base, fullname, (s + 6)); + } + else + { + v = base; + } + + return v; +} + +void display_rumor(bool ex) +{ + bool err; + int section = 0; + char Rumor[1024]; + + if (ex) + { + if (randint0(3) == 0) section = 1; + } + +#ifdef JP + err = get_rnd_line_jonly("rumors_j.txt", section, Rumor, 10); + if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£"); +#else + err = get_rnd_line("rumors.txt", section, Rumor); + if (err) strcpy(Rumor, "Some rumors are wrong."); +#endif + + err = TRUE; + + if (strncmp(Rumor, "R:", 2) == 0) + { + char *zz[4]; + cptr rumor_msg = NULL; + cptr rumor_eff_format = NULL; + char fullname[1024] = ""; + + if (tokenize(Rumor + 2, 3, zz, TOKENIZE_CHECKQUOTE) == 3) + { + if (strcmp(zz[0], "ARTIFACT") == 0) + { + int a_idx, k_idx; + object_type forge; + object_type *q_ptr = &forge; + artifact_type *a_ptr; + + while (1) + { + a_idx = rumor_num(zz[1], max_a_idx); + + a_ptr = &a_info[a_idx]; + if (a_ptr->name) break; + } + + k_idx = lookup_kind(a_ptr->tval, a_ptr->sval); + object_prep(q_ptr, k_idx); + q_ptr->name1 = a_idx; + q_ptr->ident = IDENT_STORE; + object_desc(fullname, q_ptr, OD_NAME_ONLY); + } + else if (strcmp(zz[0], "MONSTER") == 0) + { + int r_idx; + monster_race *r_ptr; + + while(1) + { + r_idx = rumor_num(zz[1], max_r_idx); + r_ptr = &r_info[r_idx]; + if (r_ptr->name) break; + } + + strcpy(fullname, r_name + r_ptr->name); + + /* Remember this monster */ + if (!r_ptr->r_sights) + { + r_ptr->r_sights++; + } + } + else if (strcmp(zz[0], "DUNGEON") == 0) + { + int d_idx; + dungeon_info_type *d_ptr; + + while (1) + { + d_idx = rumor_num(zz[1], max_d_idx); + d_ptr = &d_info[d_idx]; + if (d_ptr->name) break; + } + + strcpy(fullname, d_name + d_ptr->name); + + if (!max_dlv[d_idx]) + { + max_dlv[d_idx] = d_ptr->mindepth; + rumor_eff_format = _("%s¤Ëµ¢´Ô¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£", "You can recall to %s."); + } + } + else if (strcmp(zz[0], "TOWN") == 0) + { + int t_idx; + s32b visit; + + while(1) + { + t_idx = rumor_num(zz[1], NO_TOWN); + if (town[t_idx].name) break; + } + + strcpy(fullname, town[t_idx].name); + + visit = (1L << (t_idx - 1)); + if ((t_idx != SECRET_TOWN) && !(p_ptr->visit & visit)) + { + p_ptr->visit |= visit; + rumor_eff_format = _("%s¤Ë¹Ô¤Ã¤¿¤³¤È¤¬¤¢¤ëµ¤¤¬¤¹¤ë¡£", "You feel you have been to %s."); + } + } + + rumor_msg = rumor_bind_name(zz[2], fullname); + msg_print(rumor_msg); + if (rumor_eff_format) + { + msg_print(NULL); + msg_format(rumor_eff_format, fullname); + } + err = FALSE; + } + /* error */ +#ifdef JP + if (err) msg_print("¤³¤Î¾ðÊó¤Ï´Ö°ã¤Ã¤Æ¤¤¤ë¡£"); +#else + if (err) msg_print("This information is wrong."); +#endif + } + else + { + msg_format("%s", Rumor); + } +}