/* hack as in leave_store in store.c */
static bool leave_bldg = FALSE;
-/* remember building location */
-static int building_loc = 0;
-
static bool is_owner(building_type *bldg)
{
if (bldg->member_class[p_ptr->pclass] == BUILDING_OWNER)
if (get_check("Do you fight? "))
#endif
{
- p_ptr->leftbldg = TRUE;
- p_ptr->inside_arena = TRUE;
p_ptr->exit_bldg = FALSE;
reset_tim_flags();
+
+ /* Save the surface floor as saved floor */
+ prepare_change_floor_mode(CFM_SAVE_FLOORS);
+
+ p_ptr->inside_arena = TRUE;
p_ptr->leaving = TRUE;
leave_bldg = TRUE;
}
}
else
{
- p_ptr->leftbldg = TRUE;
- p_ptr->inside_arena = TRUE;
p_ptr->exit_bldg = FALSE;
reset_tim_flags();
+
+ /* Save the surface floor as saved floor */
+ prepare_change_floor_mode(CFM_SAVE_FLOORS);
+
+ p_ptr->inside_arena = TRUE;
p_ptr->leaving = TRUE;
leave_bldg = TRUE;
}
}
else
{
- r_ptr = &r_info[arena_monsters[p_ptr->arena_number]];
+ r_ptr = &r_info[arena_info[p_ptr->arena_number].r_idx];
name = (r_name + r_ptr->name);
#ifdef JP
msg_format("%s ¤ËÄ©À魯¤ë¤â¤Î¤Ï¤¤¤Ê¤¤¤«¡©", name);
monster_race *r_ptr = &r_info[r_idx];
/* Decline town monsters */
-/* if (!monster_dungeon(r_idx)) return FALSE; */
+/* if (!mon_hook_dungeon(r_idx)) return FALSE; */
/* Decline unique monsters */
/* if (r_ptr->flags1 & (RF1_UNIQUE)) return (FALSE); */
-/* if (r_ptr->flags7 & (RF7_UNIQUE_7)) return (FALSE); */
+/* if (r_ptr->flags7 & (RF7_NAZGUL)) return (FALSE); */
if (r_ptr->flags1 & (RF1_NEVER_MOVE)) return (FALSE);
if (r_ptr->flags2 & (RF2_MULTIPLY)) return (FALSE);
for (i=0;i<4;i++)
{
monster_race *r_ptr = &r_info[battle_mon[i]];
- int num_taisei = count_bits(r_ptr->flags3 & (RF3_IM_ACID | RF3_IM_ELEC | RF3_IM_FIRE | RF3_IM_COLD | RF3_IM_POIS));
+ int num_taisei = count_bits(r_ptr->flagsr & (RFR_IM_ACID | RFR_IM_ELEC | RFR_IM_FIRE | RFR_IM_COLD | RFR_IM_POIS));
if (r_ptr->flags1 & RF1_FORCE_MAXHP)
power[i] = r_ptr->hdice * r_ptr->hside * 2;
case MON_SHADOWLORD:
case MON_ARCHLICH:
case MON_BLEYS:
- case MON_CAIN:
+ case MON_CAINE:
case MON_JULIAN:
case MON_VENOM_WYRM:
case MON_MASTER_MYS:
case MON_BAZOOKER:
case MON_GCWADL:
case MON_KIRIN:
- case MON_HOUOU:
+ case MON_FENGHUANG:
power[i] = power[i] * 4 / 3;
break;
case MON_UMBER_HULK:
case MON_WATER_VOR:
case MON_COLD_VOR:
case MON_ENERGY_VOR:
- case MON_BARNEY:
+ case MON_GACHAPIN:
case MON_REVENANT:
case MON_NEXUS_VOR:
case MON_PLASMA_VOR:
battle_odds = MAX(wager+1, wager * battle_odds / 100);
kakekin = wager;
p_ptr->au -= wager;
- p_ptr->leftbldg = TRUE;
- p_ptr->inside_battle = TRUE;
reset_tim_flags();
+
+ /* Save the surface floor as saved floor */
+ prepare_change_floor_mode(CFM_SAVE_FLOORS);
+
+ p_ptr->inside_battle = TRUE;
p_ptr->leaving = TRUE;
+
leave_bldg = TRUE;
screen_load();
clear_bldg(4,18);
#ifdef JP
- prt("»àÂΤò»ý¤Áµ¢¤ë¤È¾Þ¶â¤òº¹¤·¾å¤²¤Þ¤¹¡£",4 ,10);
+ prt("»àÂΤò»ý¤Áµ¢¤ì¤ÐÊó½·¤òº¹¤·¾å¤²¤Þ¤¹¡£",4 ,10);
c_put_str(TERM_YELLOW, "¸½ºß¤Î¾Þ¶â¼ó", 6, 10);
#else
prt("Offer a prize when you bring a wanted monster's corpse",4 ,10);
for (i = 0; i < MAX_KUBI; i++)
{
- char buf[160];
+ byte color;
+ cptr done_mark;
monster_race *r_ptr = &r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])];
- sprintf(buf,"%-40s ---- ",r_name + r_ptr->name);
- prt(buf, y+7, 10);
if (kubi_r_idx[i] > 10000)
+ {
+ color = TERM_RED;
#ifdef JP
- c_put_str(TERM_RED,"ºÑ", y+7, 56);
+ done_mark = "(ºÑ)";
#else
- c_put_str(TERM_RED,"done", y+7, 56);
+ done_mark = "(done)";
#endif
+ }
else
{
- sprintf(buf,"$%d", 300 * (r_ptr->level + 1));
- prt(buf, y+7, 56);
+ color = TERM_WHITE;
+ done_mark = "";
}
+
+ c_prt(color, format("%s %s", r_name + r_ptr->name, done_mark), y+7, 10);
+
y = (y+1) % 10;
if (!y && (i < MAX_KUBI -1))
{
}
}
+
+/* List of prize object */
+static struct {
+ s16b tval;
+ s16b sval;
+} prize_list[MAX_KUBI] =
+{
+ {TV_POTION, SV_POTION_CURING},
+ {TV_POTION, SV_POTION_SPEED},
+ {TV_POTION, SV_POTION_SPEED},
+ {TV_POTION, SV_POTION_RESISTANCE},
+ {TV_POTION, SV_POTION_ENLIGHTENMENT},
+
+ {TV_POTION, SV_POTION_HEALING},
+ {TV_POTION, SV_POTION_RESTORE_MANA},
+ {TV_SCROLL, SV_SCROLL_STAR_DESTRUCTION},
+ {TV_POTION, SV_POTION_STAR_ENLIGHTENMENT},
+ {TV_SCROLL, SV_SCROLL_SUMMON_PET},
+
+ {TV_SCROLL, SV_SCROLL_GENOCIDE},
+ {TV_POTION, SV_POTION_STAR_HEALING},
+ {TV_POTION, SV_POTION_STAR_HEALING},
+ {TV_POTION, SV_POTION_NEW_LIFE},
+ {TV_SCROLL, SV_SCROLL_MASS_GENOCIDE},
+
+ {TV_POTION, SV_POTION_LIFE},
+ {TV_POTION, SV_POTION_LIFE},
+ {TV_POTION, SV_POTION_AUGMENTATION},
+ {TV_POTION, SV_POTION_INVULNERABILITY},
+ {TV_SCROLL, SV_SCROLL_ARTIFACT},
+};
+
+
+/* Get prize */
static bool kankin(void)
{
int i, j;
char o_name[MAX_NLEN];
object_type *o_ptr;
- for (i = 0;i <= INVEN_LARM; i++)
+ /* Loop for inventory and right/left arm */
+ for (i = 0; i <= INVEN_LARM; i++)
{
o_ptr = &inventory[i];
+
+ /* Living Tsuchinoko worthes $1000000 */
if ((o_ptr->tval == TV_CAPTURE) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
#else
change = TRUE;
}
}
- for (i = 0;i <= INVEN_LARM; i++)
+
+ for (i = 0; i < INVEN_PACK; i++)
{
o_ptr = &inventory[i];
+
+ /* Corpse of Tsuchinoko worthes $200000 */
if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
#else
change = TRUE;
}
}
- for (i = 0;i <= INVEN_LARM; i++)
+
+ for (i = 0; i < INVEN_PACK; i++)
{
o_ptr = &inventory[i];
+
+ /* Bones of Tsuchinoko worthes $100000 */
if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
#else
}
}
- for (i = 0;i <= INVEN_LARM; i++)
+ for (i = 0; i < INVEN_PACK; i++)
{
o_ptr = &inventory[i];
- if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == today_mon))
+ if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (streq(r_name + r_info[o_ptr->pval].name, r_name + r_info[today_mon].name)))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
#else
change = TRUE;
}
}
- for (i = 0;i <= INVEN_LARM; i++)
+
+ for (i = 0; i < INVEN_PACK; i++)
{
o_ptr = &inventory[i];
- if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (o_ptr->pval == today_mon))
+
+ if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (streq(r_name + r_info[o_ptr->pval].name, r_name + r_info[today_mon].name)))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
#else
for (j = 0; j < MAX_KUBI; j++)
{
- for (i = 0;i <= INVEN_LARM; i++)
+ /* Need reverse order --- Positions will be changed in the loop */
+ for (i = INVEN_PACK-1; i >= 0; i--)
{
o_ptr = &inventory[i];
- if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == kubi_r_idx[j]))
+ if ((o_ptr->tval == TV_CORPSE) && (o_ptr->pval == kubi_r_idx[j]))
{
char buf[MAX_NLEN+20];
- object_desc(o_name, o_ptr, TRUE, 3);
+ int num, k, item_new;
+ object_type forge;
+
+ object_desc(o_name, o_ptr, 0);
#ifdef JP
- sprintf(buf, "%s ¤ò´¹¶â¤·¤Þ¤¹¤«¡©",o_name);
+ sprintf(buf, "%s¤òÅϤ·¤Þ¤¹¤«¡©",o_name);
#else
- sprintf(buf, "Convert %s into money? ",o_name);
+ sprintf(buf, "Hand %s over? ",o_name);
#endif
- if (get_check(buf))
- {
+ if (!get_check(buf)) continue;
+
+#if 0 /* Obsoleted */
#ifdef JP
- msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (r_info[kubi_r_idx[j]].level + 1) * 300 * o_ptr->number);
+ msg_format("¾Þ¶â %ld¡ð¤ò¼ê¤ËÆþ¤ì¤¿¡£", (r_info[kubi_r_idx[j]].level + 1) * 300 * o_ptr->number);
#else
- msg_format("You get %ldgp.", (r_info[kubi_r_idx[j]].level + 1) * 300 * o_ptr->number);
+ msg_format("You get %ldgp.", (r_info[kubi_r_idx[j]].level + 1) * 300 * o_ptr->number);
#endif
- p_ptr->au += (r_info[kubi_r_idx[j]].level+1) * 300 * o_ptr->number;
- p_ptr->redraw |= (PR_GOLD);
- inven_item_increase(i, -o_ptr->number);
- inven_item_describe(i);
- inven_item_optimize(i);
- chg_virtue(V_JUSTICE, 5);
- kubi_r_idx[j] += 10000;
+ p_ptr->au += (r_info[kubi_r_idx[j]].level+1) * 300 * o_ptr->number;
+ p_ptr->redraw |= (PR_GOLD);
+ inven_item_increase(i, -o_ptr->number);
+ inven_item_describe(i);
+ inven_item_optimize(i);
+ chg_virtue(V_JUSTICE, 5);
+ kubi_r_idx[j] += 10000;
+
+ change = TRUE;
+#endif /* Obsoleted */
+
+ /* Hand it first */
+ inven_item_increase(i, -o_ptr->number);
+ inven_item_describe(i);
+ inven_item_optimize(i);
+
+ chg_virtue(V_JUSTICE, 5);
+ kubi_r_idx[j] += 10000;
+
+ /* Count number of unique corpses already handed */
+ for (num = 0, k = 0; k < MAX_KUBI; k++)
+ {
+ if (kubi_r_idx[k] >= 10000) num++;
}
+
+#ifdef JP
+ msg_format("¤³¤ì¤Ç¹ç·× %d ¥Ý¥¤¥ó¥È³ÍÆÀ¤·¤Þ¤·¤¿¡£", num);
+#else
+ msg_format("You earned %d point%s total.", num, (num > 1 ? "s" : ""));
+#endif
+
+ /* Prepare to make a prize */
+ object_prep(&forge, lookup_kind(prize_list[num-1].tval, prize_list[num-1].sval));
+ apply_magic(&forge, object_level, AM_NO_FIXED_ART);
+
+ /* Identify it fully */
+ object_aware(&forge);
+ object_known(&forge);
+
+ /*
+ * Hand it --- Assume there is an empty slot.
+ * Since a corpse is handed at first,
+ * there is at least one empty slot.
+ */
+ item_new = inven_carry(&forge);
+
+ /* Describe the object */
+ object_desc(o_name, &forge, 0);
+#ifdef JP
+ msg_format("%s(%c)¤òÌã¤Ã¤¿¡£", o_name, index_to_label(item_new));
+#else
+ msg_format("You get %s (%c). ", o_name, index_to_label(item_new));
+#endif
+
+ /* Auto-inscription */
+ autopick_alter_item(item_new, FALSE);
+
+ /* Handle stuff */
+ handle_stuff();
+
change = TRUE;
}
}
void have_nightmare(int r_idx)
{
bool happened = FALSE;
-
- int power = 100;
-
monster_race *r_ptr = &r_info[r_idx];
-
+ int power = r_ptr->level + 10;
char m_name[80];
cptr desc = r_name + r_ptr->name;
-
- power = r_ptr->level + 10;
-
-#ifdef JP
- if (0)
-#else
+ /* Describe it */
+#ifndef JP
if (!(r_ptr->flags1 & RF1_UNIQUE))
-#endif
-
- {
- /* Describe it */
sprintf(m_name, "%s %s", (is_a_vowel(desc[0]) ? "an" : "a"), desc);
-
- if (r_ptr->flags1 & RF1_FRIENDS)
- {
- power /= 2;
- }
- }
else
- {
- /* Describe it */
+#endif
sprintf(m_name, "%s", desc);
- power *= 2;
+ if (!(r_ptr->flags1 & RF1_UNIQUE))
+ {
+ if (r_ptr->flags1 & RF1_FRIENDS) power /= 2;
}
+ else power *= 2;
if (saving_throw(p_ptr->skill_sav * 100 / power))
{
#ifdef JP
- msg_format("Ì´¤ÎÃæ¤Ç%s¤ËÄɤ¤¤«¤±¤é¤ì¤¿¡£", m_name);
+ msg_format("Ì´¤ÎÃæ¤Ç%s¤ËÄɤ¤¤«¤±¤é¤ì¤¿¡£", m_name);
#else
- msg_format("%^s chases you through your dreams.", m_name);
+ msg_format("%^s chases you through your dreams.", m_name);
#endif
-
/* Safe */
return;
}
{
/* Something silly happens... */
#ifdef JP
-msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
+ msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
#else
msg_format("You behold the %s visage of %s!",
#endif
/* Something frightening happens... */
#ifdef JP
-msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
+ msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
#else
msg_format("You behold the %s visage of %s!",
#endif
r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
- switch(p_ptr->prace)
+ if (!p_ptr->mimic_form)
{
- /* Imps may make a saving throw */
+ switch (p_ptr->prace)
+ {
+ /* Demons may make a saving throw */
case RACE_IMP:
case RACE_DEMON:
- {
if (saving_throw(20 + p_ptr->lev)) return;
- }
+ break;
/* Undead may make a saving throw */
case RACE_SKELETON:
case RACE_ZOMBIE:
case RACE_SPECTRE:
case RACE_VAMPIRE:
+ if (saving_throw(10 + p_ptr->lev)) return;
+ break;
+ }
+ }
+ else
+ {
+ /* Demons may make a saving throw */
+ if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)
+ {
+ if (saving_throw(20 + p_ptr->lev)) return;
+ }
+ /* Undead may make a saving throw */
+ else if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD)
{
if (saving_throw(10 + p_ptr->lev)) return;
}
*/
static bool inn_comm(int cmd)
{
- int dawnval;
-
switch (cmd)
{
case BACT_FOOD: /* Buy food & drink */
+ if (p_ptr->food >= PY_FOOD_FULL)
+ {
+#ifdef JP
+ msg_print("º£¤ÏËþÊ¢¤À¡£");
+#else
+ msg_print("You are full now.");
+#endif
+ return FALSE;
+ }
+
#ifdef JP
msg_print("¥Ð¡¼¥Æ¥ó¤Ï¤¤¤¯¤é¤«¤Î¿©¤Ùʪ¤È¥Ó¡¼¥ë¤ò¤¯¤ì¤¿¡£");
#else
break;
case BACT_REST: /* Rest for the night */
- dawnval = ((turn % (TURNS_PER_TICK * TOWN_DAWN)));
- if (dawnval > (TURNS_PER_TICK * TOWN_DAWN)/4)
- { /* nighttime */
- if ((p_ptr->poisoned) || (p_ptr->cut))
- {
+ if ((p_ptr->poisoned) || (p_ptr->cut))
+ {
#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ËɬÍפʤΤÏÉô²°¤Ç¤Ï¤Ê¤¯¡¢¼£ÎżԤǤ¹¡£");
+ msg_print("¤¢¤Ê¤¿¤ËɬÍפʤΤÏÉô²°¤Ç¤Ï¤Ê¤¯¡¢¼£ÎżԤǤ¹¡£");
#else
- msg_print("You need a healer, not a room.");
+ msg_print("You need a healer, not a room.");
#endif
- msg_print(NULL);
+ msg_print(NULL);
#ifdef JP
-msg_print("¤¹¤ß¤Þ¤»¤ó¡¢¤Ç¤â¤¦¤Á¤Ç狼¤Ë»à¤Ê¤ì¤Á¤ãº¤¤ê¤Þ¤¹¤ó¤Ç¡£");
+ msg_print("¤¹¤ß¤Þ¤»¤ó¡¢¤Ç¤â¤¦¤Á¤Ç狼¤Ë»à¤Ê¤ì¤Á¤ãº¤¤ê¤Þ¤¹¤ó¤Ç¡£");
#else
- msg_print("Sorry, but don't want anyone dying in here.");
+ msg_print("Sorry, but don't want anyone dying in here.");
#endif
+ }
+ else
+ {
+ int oldturn = turn;
+ int prev_day, prev_hour, prev_min;
- }
- else
- {
- int oldturn = turn;
+ extract_day_hour_min(&prev_day, &prev_hour, &prev_min);
#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "½É²°¤ËÇñ¤Þ¤Ã¤¿¡£");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "½É²°¤ËÇñ¤Þ¤Ã¤¿¡£");
#else
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "stay over night at the inn");
+ if ((prev_hour >= 6) && (prev_hour <= 17)) do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "stay over daytime at the inn.");
+ else do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "stay over night at the inn.");
#endif
- turn = (turn / (TURNS_PER_TICK*TOWN_DAWN/2) + 1) * (TURNS_PER_TICK*TOWN_DAWN/2);
- if (((oldturn + TURNS_PER_TICK * TOWN_DAWN / 4) % (TURNS_PER_TICK * TOWN_DAWN)) > TURNS_PER_TICK * TOWN_DAWN/4) do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
- p_ptr->chp = p_ptr->mhp;
+ turn = (turn / (TURNS_PER_TICK*TOWN_DAWN/2) + 1) * (TURNS_PER_TICK*TOWN_DAWN/2);
+ if ((prev_hour >= 18) && (prev_hour <= 23)) do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
+ p_ptr->chp = p_ptr->mhp;
- dungeon_turn += MIN(turn - oldturn, TURNS_PER_TICK*250);
+ dungeon_turn += MIN(turn - oldturn, TURNS_PER_TICK*250);
- if (ironman_nightmare)
- {
+ if (ironman_nightmare)
+ {
#ifdef JP
-msg_print("̲¤ê¤Ë½¢¤¯¤È¶²¤í¤·¤¤¸÷·Ê¤¬¿´¤ò¤è¤®¤Ã¤¿¡£");
+ msg_print("̲¤ê¤Ë½¢¤¯¤È¶²¤í¤·¤¤¸÷·Ê¤¬¿´¤ò¤è¤®¤Ã¤¿¡£");
#else
- msg_print("Horrible visions flit through your mind as you sleep.");
+ msg_print("Horrible visions flit through your mind as you sleep.");
#endif
+ /* Pick a nightmare */
+ get_mon_num_prep(get_nightmare, NULL);
- /* Pick a nightmare */
- get_mon_num_prep(get_nightmare, NULL);
-
- /* Have some nightmares */
- while(1)
- {
- have_nightmare(get_mon_num(MAX_DEPTH));
+ /* Have some nightmares */
+ while(1)
+ {
+ have_nightmare(get_mon_num(MAX_DEPTH));
- if (!one_in_(3)) break;
- }
+ if (!one_in_(3)) break;
+ }
- /* Remove the monster restriction */
- get_mon_num_prep(NULL, NULL);
+ /* Remove the monster restriction */
+ get_mon_num_prep(NULL, NULL);
#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÏÀ䶫¤·¤ÆÌܤò³Ð¤Þ¤·¤¿¡£");
+ msg_print("¤¢¤Ê¤¿¤ÏÀ䶫¤·¤ÆÌܤò³Ð¤Þ¤·¤¿¡£");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "°Ì´¤Ë¤¦¤Ê¤µ¤ì¤Æ¤è¤¯Ì²¤ì¤Ê¤«¤Ã¤¿¡£");
#else
- msg_print("You awake screaming.");
+ msg_print("You awake screaming.");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "be troubled by a nightmare.");
#endif
+ }
+ else
+ {
+ set_blind(0);
+ set_confused(0);
+ p_ptr->stun = 0;
+ p_ptr->chp = p_ptr->mhp;
+ p_ptr->csp = p_ptr->msp;
+ if (p_ptr->pclass == CLASS_MAGIC_EATER)
+ {
+ int i;
+ for (i = 0; i < 72; i++)
+ {
+ p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
+ }
+ for (; i < 108; i++)
+ {
+ p_ptr->magic_num1[i] = 0;
+ }
+ }
+ if ((prev_hour >= 6) && (prev_hour <= 17))
+ {
#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "°Ì´¤Ë¤¦¤Ê¤µ¤ì¤Æ¤è¤¯Ì²¤ì¤Ê¤«¤Ã¤¿¡£");
+ msg_print("¤¢¤Ê¤¿¤Ï¥ê¥Õ¥ì¥Ã¥·¥å¤·¤ÆÌܳФᡢͼÊý¤ò·Þ¤¨¤¿¡£");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ͼÊý¤ò·Þ¤¨¤¿¡£");
#else
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "be troubled by a nightmare.");
+ msg_print("You awake refreshed for the evening.");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "awake refreshed.");
#endif
}
else
{
- set_blind(0);
- set_confused(0);
- p_ptr->stun = 0;
- p_ptr->chp = p_ptr->mhp;
- p_ptr->csp = p_ptr->msp;
- if (p_ptr->pclass == CLASS_MAGIC_EATER)
- {
- int i;
- for (i = 0; i < 72; i++)
- {
- p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
- }
- for (; i < 108; i++)
- {
- p_ptr->magic_num1[i] = 0;
- }
- }
-
#ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥ê¥Õ¥ì¥Ã¥·¥å¤·¤ÆÌܳФᡢ¿·¤¿¤ÊÆü¤ò·Þ¤¨¤¿¡£");
+ msg_print("¤¢¤Ê¤¿¤Ï¥ê¥Õ¥ì¥Ã¥·¥å¤·¤ÆÌܳФᡢ¿·¤¿¤ÊÆü¤ò·Þ¤¨¤¿¡£");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¤¹¤¬¤¹¤¬¤·¤¤Ä«¤ò·Þ¤¨¤¿¡£");
#else
msg_print("You awake refreshed for the new day.");
-#endif
-
-#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¤¹¤¬¤¹¤¬¤·¤¤Ä«¤ò¤à¤«¤¨¤¿¡£");
-#else
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "awake refreshed.");
#endif
}
-
- p_ptr->leftbldg = TRUE;
}
}
- else
- {
-#ifdef JP
-msg_print("Éô²°¤ÏÌë¤À¤±»ÈÍѲÄǽ¤Ç¤¹¡£");
-#else
- msg_print("The rooms are available only at night.");
-#endif
-
- return (FALSE);
- }
break;
+
case BACT_RUMORS: /* Listen for rumors */
{
char Rumor[1024];
/*
- * Share gold for thieves
- */
-static void share_gold(void)
-{
- int i = (p_ptr->lev * 2) * 10;
-#ifdef JP
-msg_format("¡ð%d ¤ò¼ê¤ËÆþ¤ì¤¿¡£", i);
-#else
- msg_format("You collect %d gold pieces", i);
-#endif
-
- p_ptr->au += i;
-}
-
-
-/*
* Display quest information
*/
static void get_questinfo(int questnum)
{
char tmp_str[80];
+ /* Effective dices */
+ int eff_dd = o_ptr->dd + p_ptr->to_dd[0];
+ int eff_ds = o_ptr->ds + p_ptr->to_ds[0];
+
/* Print the intro text */
c_put_str(color, attr, r, c);
sprintf(tmp_str, "Attack: %d-%d damage",
#endif
- (numblows * (mult * o_ptr->dd /60 + o_ptr->to_d + p_ptr->to_d[0])),
- (numblows * (mult * o_ptr->ds * o_ptr->dd /60 + o_ptr->to_d + p_ptr->to_d[0])));
+ (numblows * (mult * eff_dd / 60 + o_ptr->to_d + p_ptr->to_d[0])),
+ (numblows * (mult * eff_ds * eff_dd / 60 + o_ptr->to_d + p_ptr->to_d[0])));
/* Print the damage */
put_str(tmp_str, r, c + 8);
int mult = 60;
u32b flgs[TR_FLAG_SIZE];
int blow = p_ptr->num_blow[0];
+ bool print_force_weapon = FALSE;
/* Get the flags of the weapon */
object_flags(o_ptr, flgs);
- if (p_ptr->riding)
+ if ((p_ptr->pclass != CLASS_SAMURAI) && have_flag(flgs, TR_FORCE_WEAPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
{
- if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
- mult = mult * (o_ptr->dd + 2) / o_ptr->dd;
+ mult = mult * 7 / 2;
+ print_force_weapon = TRUE;
}
- if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5))) mult = mult * 7 / 2;
/* Print the relevant lines */
#ifdef JP
-if (have_flag(flgs, TR_FORCE_WEAPON)) compare_weapon_aux2(o_ptr, blow, r++, col, 1*mult, "ÍýÎÏ:", TERM_L_BLUE);
-if (have_flag(flgs, TR_KILL_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 4*mult, "ưʪ:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ưʪ:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_EVIL)) compare_weapon_aux2(o_ptr, blow, r++, col, 7*mult/2, "¼Ù°:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_EVIL)) compare_weapon_aux2(o_ptr, blow, r++, col, 2*mult, "¼Ù°:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_HUMAN)) compare_weapon_aux2(o_ptr, blow, r++, col, 4*mult, "¿Í´Ö:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_HUMAN)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "¿Í´Ö:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_UNDEAD)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "ÉÔ»à:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_UNDEAD)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "ÉÔ»à:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_DEMON)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "°Ëâ:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_DEMON)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "°Ëâ:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_ORC)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "¥ª¡¼¥¯:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_ORC)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "¥ª¡¼¥¯:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_TROLL)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "¥È¥í¥ë:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_TROLL)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "¥È¥í¥ë:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_GIANT)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "µð¿Í:", TERM_YELLOW);
- else if (have_flag(flgs, TR_SLAY_GIANT)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "µð¿Í:", TERM_YELLOW);
-if (have_flag(flgs, TR_KILL_DRAGON)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "ε:", TERM_YELLOW);
-else if (have_flag(flgs, TR_SLAY_DRAGON)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "ε:", TERM_YELLOW);
-if (have_flag(flgs, TR_BRAND_ACID)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "»À°À:", TERM_RED);
-if (have_flag(flgs, TR_BRAND_ELEC)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ÅÅ°À:", TERM_RED);
-if (have_flag(flgs, TR_BRAND_FIRE)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "±ê°À:", TERM_RED);
-if (have_flag(flgs, TR_BRAND_COLD)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "Îä°À:", TERM_RED);
-if (have_flag(flgs, TR_BRAND_POIS)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ÆÇ°À:", TERM_RED);
-#else
- if (have_flag(flgs, TR_FORCE_WEAPON)) compare_weapon_aux2(o_ptr, blow, r++, col, 1*mult, "Force :", TERM_L_BLUE);
+ if (print_force_weapon) compare_weapon_aux2(o_ptr, blow, r++, col, 1*mult, "ÍýÎÏ:", TERM_L_BLUE);
+ if (have_flag(flgs, TR_KILL_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 4*mult, "ưʪ:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ưʪ:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_EVIL)) compare_weapon_aux2(o_ptr, blow, r++, col, 7*mult/2, "¼Ù°:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_EVIL)) compare_weapon_aux2(o_ptr, blow, r++, col, 2*mult, "¼Ù°:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_HUMAN)) compare_weapon_aux2(o_ptr, blow, r++, col, 4*mult, "¿Í´Ö:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_HUMAN)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "¿Í´Ö:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_UNDEAD)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "ÉÔ»à:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_UNDEAD)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "ÉÔ»à:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_DEMON)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "°Ëâ:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_DEMON)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "°Ëâ:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_ORC)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "¥ª¡¼¥¯:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_ORC)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "¥ª¡¼¥¯:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_TROLL)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "¥È¥í¥ë:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_TROLL)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "¥È¥í¥ë:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_GIANT)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "µð¿Í:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_GIANT)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "µð¿Í:", TERM_YELLOW);
+ if (have_flag(flgs, TR_KILL_DRAGON)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult, "ε:", TERM_YELLOW);
+ else if (have_flag(flgs, TR_SLAY_DRAGON)) compare_weapon_aux2(o_ptr, blow, r++, col, 3*mult, "ε:", TERM_YELLOW);
+ if (have_flag(flgs, TR_BRAND_ACID)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "»À°À:", TERM_RED);
+ if (have_flag(flgs, TR_BRAND_ELEC)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ÅÅ°À:", TERM_RED);
+ if (have_flag(flgs, TR_BRAND_FIRE)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "±ê°À:", TERM_RED);
+ if (have_flag(flgs, TR_BRAND_COLD)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "Îä°À:", TERM_RED);
+ if (have_flag(flgs, TR_BRAND_POIS)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "ÆÇ°À:", TERM_RED);
+#else
+ if (print_force_weapon) compare_weapon_aux2(o_ptr, blow, r++, col, 1*mult, "Force :", TERM_L_BLUE);
if (have_flag(flgs, TR_KILL_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 4*mult, "Animals:", TERM_YELLOW);
else if (have_flag(flgs, TR_SLAY_ANIMAL)) compare_weapon_aux2(o_ptr, blow, r++, col, 5*mult/2, "Animals:", TERM_YELLOW);
if (have_flag(flgs, TR_KILL_EVIL)) compare_weapon_aux2(o_ptr, blow, r++, col, 7*mult/2, "Evil:", TERM_YELLOW);
char o_name[MAX_NLEN];
char tmp_str[80];
+ /* Effective dices */
+ int eff_dd = o_ptr->dd + p_ptr->to_dd[0];
+ int eff_ds = o_ptr->ds + p_ptr->to_ds[0];
+
/* Print the weapon name */
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
c_put_str(TERM_YELLOW, o_name, row, col);
/* Print the player's number of blows */
sprintf(tmp_str, "One Strike: %d-%d damage",
#endif
- o_ptr->dd + o_ptr->to_d + p_ptr->to_d[0],
- o_ptr->ds * o_ptr->dd + o_ptr->to_d + p_ptr->to_d[0]);
+ eff_dd + o_ptr->to_d + p_ptr->to_d[0],
+ eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0]);
put_str(tmp_str, row+6, col+1);
/* Damage for the complete attack (if all blows hit) */
sprintf(tmp_str, "One Attack: %d-%d damage",
#endif
- p_ptr->num_blow[0] * (o_ptr->dd + o_ptr->to_d + p_ptr->to_d[0]),
- p_ptr->num_blow[0] * (o_ptr->ds * o_ptr->dd + o_ptr->to_d + p_ptr->to_d[0]));
+ p_ptr->num_blow[0] * (eff_dd + o_ptr->to_d + p_ptr->to_d[0]),
+ p_ptr->num_blow[0] * (eff_ds * eff_dd + o_ptr->to_d + p_ptr->to_d[0]));
put_str(tmp_str, row+7, col+1);
}
object_type *i_ptr;
cptr q, s;
int row = 2;
+ bool old_character_xtra = character_xtra;
screen_save();
/* Clear the screen */
if (o1_ptr != i_ptr)
object_copy(i_ptr, o1_ptr);
+ /* Hack -- prevent "icky" message */
+ character_xtra = TRUE;
+
/* Get the new values */
calc_bonuses();
+ character_xtra = old_character_xtra;
+
/* List the new values */
list_weapon(o1_ptr, row, 2);
compare_weapon_aux1(o1_ptr, 2, row + 8);
else
object_copy(i_ptr, &orig_weapon);
+ /* Hack -- prevent "icky" message */
+ character_xtra = TRUE;
+
/* Get the new values */
calc_bonuses();
+ character_xtra = old_character_xtra;
+
/* List the new values */
list_weapon(o2_ptr, row, 40);
compare_weapon_aux1(o2_ptr, 40, row + 8);
/* Check if the player has enough money */
if (p_ptr->au < (cost * o_ptr->number))
{
- object_desc(tmp_str, o_ptr, TRUE, 0);
+ object_desc(tmp_str, o_ptr, OD_NAME_ONLY);
#ifdef JP
msg_format("%s¤ò²þÎɤ¹¤ë¤À¤±¤Î¥´¡¼¥ë¥É¤¬¤¢¤ê¤Þ¤»¤ó¡ª", tmp_str);
#else
}
else
{
- object_desc(tmp_str, o_ptr, TRUE, 1);
+ object_desc(tmp_str, o_ptr, OD_NAME_AND_ENCHANT);
#ifdef JP
msg_format("¡ð%d ¤Ç%s¤ò²þÎɤ·¤Þ¤·¤¿¡£", cost * o_ptr->number, tmp_str );
#else
* the level of the item or the number of charges.
*/
/* The item must be "known" */
- if (!object_known_p(o_ptr))
+ if (!object_is_known(o_ptr))
{
#ifdef JP
msg_format("½¼Å¶¤¹¤ëÁ°¤Ë´ÕÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡ª");
identify_item(o_ptr);
/* Description */
- object_desc(tmp_str, o_ptr, TRUE, 3);
+ object_desc(tmp_str, o_ptr, 0);
#ifdef JP
msg_format("%s ¤Ç¤¹¡£", tmp_str);
msg_format("You have: %s.", tmp_str);
#endif
+ /* Auto-inscription */
+ autopick_alter_item(item, FALSE);
/* Update the gold display */
building_prt_gold();
}
/* Extract the object "level" */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
/* Price for a rod */
if (o_ptr->tval == TV_ROD)
else if (o_ptr->tval == TV_STAFF)
{
/* Price per charge ( = double the price paid by shopkeepers for the charge) */
- price = (get_object_cost(o_ptr) / 10) * o_ptr->number;
+ price = (k_info[o_ptr->k_idx].cost / 10) * o_ptr->number;
/* Pay at least 10 gold per charge */
price = MAX(10, price);
else
{
/* Price per charge ( = double the price paid by shopkeepers for the charge) */
- price = (get_object_cost(o_ptr) / 10);
+ price = (k_info[o_ptr->k_idx].cost / 10);
/* Pay at least 10 gold per charge */
price = MAX(10, price);
/* Check if the player has enough money */
if (p_ptr->au < price)
{
- object_desc(tmp_str, o_ptr, TRUE, 0);
+ object_desc(tmp_str, o_ptr, OD_NAME_ONLY);
#ifdef JP
msg_format("%s¤òºÆ½¼Å¶¤¹¤ë¤Ë¤Ï¡ð%d ɬÍפǤ¹¡ª", tmp_str,price );
#else
}
/* Give feedback */
- object_desc(tmp_str, o_ptr, TRUE, 3);
+ object_desc(tmp_str, o_ptr, 0);
#ifdef JP
msg_format("%s¤ò¡ð%d ¤ÇºÆ½¼Å¶¤·¤Þ¤·¤¿¡£", tmp_str, price);
#else
if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
/* need identified */
- if (!object_known_p(o_ptr)) total_cost += 50;
+ if (!object_is_known(o_ptr)) total_cost += 50;
/* Extract the object "level" */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
k_ptr = &k_info[o_ptr->k_idx];
case TV_STAFF:
/* Price per charge ( = double the price paid by shopkeepers for the charge) */
- price = (get_object_cost(o_ptr) / 10) * o_ptr->number;
+ price = (k_info[o_ptr->k_idx].cost / 10) * o_ptr->number;
/* Pay at least 10 gold per charge */
price = MAX(10, price);
case TV_WAND:
/* Price per charge ( = double the price paid by shopkeepers for the charge) */
- price = (get_object_cost(o_ptr) / 10);
+ price = (k_info[o_ptr->k_idx].cost / 10);
/* Pay at least 10 gold per charge */
price = MAX(10, price);
{
o_ptr = &inventory[i];
k_ptr = &k_info[o_ptr->k_idx];
-
+
/* skip non magic device */
if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
/* Identify it */
- if (!object_known_p(o_ptr)) identify_item(o_ptr);
+ if (!object_is_known(o_ptr))
+ {
+ identify_item(o_ptr);
+
+ /* Auto-inscription */
+ autopick_alter_item(i, FALSE);
+ }
/* Recharge */
switch (o_ptr->tval)
}
}
}
- p_ptr->leftbldg = TRUE;
+
p_ptr->leaving = TRUE;
leave_bldg = TRUE;
p_ptr->teleport_town = TRUE;
{
monster_race *r_ptr = &r_info[i];
+ /* Empty monster */
+ if (!r_ptr->name) continue;
+
/* XTRA HACK WHATSEARCH */
/* Require non-unique monsters if needed */
if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
/* ̾Á°¸¡º÷ */
- if (temp[0]){
- int xx;
- char temp2[80];
-
- for (xx=0; temp[xx] && xx<80; xx++){
+ if (temp[0])
+ {
+ int xx;
+ char temp2[80];
+
+ for (xx = 0; temp[xx] && xx < 80; xx++)
+ {
#ifdef JP
- if (iskanji( temp[xx])) { xx++; continue; }
+ if (iskanji(temp[xx]))
+ {
+ xx++;
+ continue;
+ }
#endif
- if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
- }
+ if (isupper(temp[xx])) temp[xx] = tolower(temp[xx]);
+ }
#ifdef JP
- strcpy(temp2, r_name+r_ptr->E_name);
+ strcpy(temp2, r_name + r_ptr->E_name);
#else
- strcpy(temp2, r_name+r_ptr->name);
+ 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]);
-
+ 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) )
+ if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp))
#else
- if (strstr(temp2, temp))
+ if (my_strstr(temp2, temp))
#endif
- who[n++]=i;
+ who[n++] = i;
}
else if (all || (r_ptr->d_char == sym)) who[n++] = i;
}
/* 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);
/* Get maximal info about this monster */
lore_do_probe(r_idx);
-
+
+ /* Save this monster ID */
+ monster_race_track(r_idx);
+
+ /* Hack -- Handle stuff */
+ handle_stuff();
+
/* know every thing mode */
screen_roff(r_idx, 0x01);
notpicked = FALSE;
int bact = bldg->actions[i];
int bcost;
bool paid = FALSE;
- bool set_reward = FALSE;
int amt;
/* Flush messages XXX XXX XXX */
return;
}
- if (!bcost) set_reward = TRUE;
-
switch (bact)
{
case BACT_NOTHING:
- /* Do nothing */
+ /* Do nothing */
break;
case BACT_RESEARCH_ITEM:
paid = identify_fully(FALSE);
paid = compare_weapons();
break;
case BACT_ENCHANT_WEAPON:
- item_tester_hook = item_tester_hook_melee_weapon;
+ item_tester_hook = object_allow_enchant_melee_weapon;
enchant_item(bcost, 1, 1, 0);
break;
case BACT_ENCHANT_ARMOR:
- item_tester_hook = item_tester_hook_armour;
+ item_tester_hook = object_is_armour;
enchant_item(bcost, 0, 0, 1);
break;
case BACT_RECHARGE:
if (do_res_stat(A_CON)) paid = TRUE;
if (do_res_stat(A_CHR)) paid = TRUE;
break;
- case BACT_GOLD: /* set timed reward flag */
- if (!p_ptr->rewards[BACT_GOLD])
- {
- share_gold();
- p_ptr->rewards[BACT_GOLD] = TRUE;
- }
- else
- {
-#ifdef JP
- msg_print("º£Æü¤Îʬ¤±Á°¤Ï¤¹¤Ç¤Ë»Ùʧ¤Ã¤¿¤¾¡ª");
-#else
- msg_print("You just had your daily allowance!");
-#endif
- }
- break;
case BACT_ENCHANT_ARROWS:
item_tester_hook = item_tester_hook_ammo;
enchant_item(bcost, 1, 1, 0);
case BACT_TELEPORT_LEVEL:
{
int select_dungeon;
- int i, num = 0;
- s16b *dun;
int max_depth;
- /* Allocate the "dun" array */
- C_MAKE(dun, max_d_idx, s16b);
-
- screen_save();
clear_bldg(4, 20);
-
- for(i = 1; i < max_d_idx; i++)
- {
- char buf[80];
- bool seiha = FALSE;
-
- if (!d_info[i].maxdepth) continue;
- if (!max_dlv[i]) continue;
- if (d_info[i].final_guardian)
- {
- if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
- }
- else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
-
-#ifdef JP
- sprintf(buf,"%c) %c%-12s : ºÇÂç %d ³¬", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
-#else
- sprintf(buf,"%c) %c%-12s : Max level %d", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
-#endif
- put_str(buf, 4+num, 5);
- dun[num] = i;
- num++;
- }
#ifdef JP
- prt("¤É¤Î¥À¥ó¥¸¥ç¥ó¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«:", 0, 0);
+ select_dungeon = choose_dungeon("¤Ë¥Æ¥ì¥Ý¡¼¥È", 4, 0);
#else
- prt("Which dungeon do you teleport?: ", 0, 0);
+ select_dungeon = choose_dungeon("teleport", 4, 0);
#endif
- while(1)
- {
- i = inkey();
-
- if (i == ESCAPE)
- {
- /* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
-
- screen_load();
- return;
- }
- if (i >= 'a' && i <('a'+num))
- {
- select_dungeon = dun[i-'a'];
- break;
- }
- else bell();
- }
- screen_load();
-
- /* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
+ show_building(bldg);
+ if (!select_dungeon) return;
max_depth = d_info[select_dungeon].maxdepth;
p_ptr->word_recall = 1;
p_ptr->recall_dungeon = select_dungeon;
max_dlv[p_ptr->recall_dungeon] = ((amt > d_info[select_dungeon].maxdepth) ? d_info[select_dungeon].maxdepth : ((amt < d_info[select_dungeon].mindepth) ? d_info[select_dungeon].mindepth : amt));
- if (record_maxdeapth)
+ if (record_maxdepth)
#ifdef JP
do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, "¥È¥é¥ó¥×¥¿¥ï¡¼¤Ç");
#else
break;
}
case BACT_LOSE_MUTATION:
- if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
+ if (p_ptr->muta1 || p_ptr->muta2 ||
+ (p_ptr->muta3 & ~MUT3_GOOD_LUCK) ||
+ (p_ptr->pseikaku != SEIKAKU_LUCKY &&
+ (p_ptr->muta3 & MUT3_GOOD_LUCK)))
{
while(!lose_mutation(0));
paid = TRUE;
{
energy_use = 100;
- if (cave[py][px].feat != FEAT_QUEST_ENTER)
+ if (!cave_have_flag_bold(py, px, FF_QUEST_ENTER))
{
#ifdef JP
msg_print("¤³¤³¤Ë¤Ï¥¯¥¨¥¹¥È¤ÎÆþ¸ý¤Ï¤Ê¤¤¡£");
leave_quest_check();
+ if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) dun_level = 1;
p_ptr->inside_quest = cave[py][px].special;
- if(quest[leaving_quest].type != QUEST_TYPE_RANDOM) dun_level = 1;
- p_ptr->leftbldg = TRUE;
+
p_ptr->leaving = TRUE;
}
}
energy_use = 100;
- if (!((cave[py][px].feat >= FEAT_BLDG_HEAD) &&
- (cave[py][px].feat <= FEAT_BLDG_TAIL)))
+ if (!cave_have_flag_bold(py, px, FF_BLDG))
{
#ifdef JP
-msg_print("¤³¤³¤Ë¤Ï·úʪ¤Ï¤Ê¤¤¡£");
+ msg_print("¤³¤³¤Ë¤Ï·úʪ¤Ï¤Ê¤¤¡£");
#else
msg_print("You see no building here.");
#endif
return;
}
- which = (cave[py][px].feat - FEAT_BLDG_HEAD);
- building_loc = which;
+ which = f_info[cave[py][px].feat].subtype;
bldg = &building[which];
/* Don't re-init the wilderness */
reinit_wilderness = FALSE;
- if ((which == 2) && (p_ptr->arena_number == 99))
+ if ((which == 2) && (p_ptr->arena_number < 0))
{
#ifdef JP
-msg_print("¡ÖÇÔ¼Ô¤ËÍѤϤʤ¤¡£¡×");
+ msg_print("¡ÖÇÔ¼Ô¤ËÍѤϤʤ¤¡£¡×");
#else
msg_print("'There's no place here for a LOSER like you!'");
#endif
return;
}
- else if ((which == 2) && p_ptr->inside_arena && !p_ptr->exit_bldg)
+ else if ((which == 2) && p_ptr->inside_arena)
{
+ if (!p_ptr->exit_bldg)
+ {
#ifdef JP
-prt("¥²¡¼¥È¤ÏÊĤޤäƤ¤¤ë¡£¥â¥ó¥¹¥¿¡¼¤¬¤¢¤Ê¤¿¤òÂԤäƤ¤¤ë¡ª",0,0);
+ prt("¥²¡¼¥È¤ÏÊĤޤäƤ¤¤ë¡£¥â¥ó¥¹¥¿¡¼¤¬¤¢¤Ê¤¿¤òÂԤäƤ¤¤ë¡ª", 0, 0);
#else
- prt("The gates are closed. The monster awaits!", 0, 0);
+ prt("The gates are closed. The monster awaits!", 0, 0);
#endif
+ }
+ else
+ {
+ /* Don't save the arena as saved floor */
+ prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_NO_RETURN);
+
+ p_ptr->inside_arena = FALSE;
+ p_ptr->leaving = TRUE;
+
+ /* Re-enter the arena */
+ command_new = SPECIAL_KEY_BUILDING;
+
+ /* No energy needed to re-enter the arena */
+ energy_use = 0;
+ }
return;
}
- else if ((which == 2) && p_ptr->inside_arena)
- {
- p_ptr->leaving = TRUE;
- p_ptr->inside_arena = FALSE;
- }
else if (p_ptr->inside_battle)
{
+ /* Don't save the arena as saved floor */
+ prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_NO_RETURN);
+
p_ptr->leaving = TRUE;
p_ptr->inside_battle = FALSE;
+
+ /* Re-enter the monster arena */
+ command_new = SPECIAL_KEY_BUILDING;
+
+ /* No energy needed to re-enter the arena */
+ energy_use = 0;
+
+ return;
}
else
{
/* Reinit wilderness to activate quests ... */
if (reinit_wilderness)
+ {
p_ptr->leaving = TRUE;
+ }
/* Hack -- Decrease "icky" depth */
character_icky--;