-/* File: spells3.c */
-
-/*
+/*!
+ * @file spells3.c
+ * @brief 魔法効果の実装/ Spell code (part 3)
+ * @date 2014/07/26
+ * @author
+ * <pre>
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
- *
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
+ * </pre>
*/
-/* Purpose: Spell code (part 3) */
-
#include "angband.h"
-/* Maximum number of tries for teleporting */
+/*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
#define MAX_TRIES 100
-/* 1/x chance of reducing stats (for elemental attacks) */
+/*! 能力値現象の基本確率(1 / HURT_CHANCE) / 1/x chance of reducing stats (for elemental attacks) */
#define HURT_CHANCE 16
+/*!
+ * @brief 指定されたマスがモンスターのテレポート可能先かどうかを判定する。
+ * @param m_idx モンスターID
+ * @param y 移動先Y座標
+ * @param x 移動先X座標
+ * @param mode オプション
+ */
+static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode)
+{
+ monster_type *m_ptr = &m_list[m_idx];
+ cave_type *c_ptr = &cave[y][x];
+ feature_type *f_ptr = &f_info[c_ptr->feat];
-/*
+ /* Require "teleportable" space */
+ if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) return FALSE;
+
+ if (c_ptr->m_idx && (c_ptr->m_idx != m_idx)) return FALSE;
+ if (player_bold(y, x)) return FALSE;
+
+ /* Hack -- no teleport onto glyph of warding */
+ if (is_glyph_grid(c_ptr)) return FALSE;
+ if (is_explosive_rune_grid(c_ptr)) return FALSE;
+
+ if (!(mode & TELEPORT_PASSIVE))
+ {
+ if (!monster_can_cross_terrain(c_ptr->feat, &r_info[m_ptr->r_idx], 0)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*!
+ * @brief モンスターのテレポートアウェイ処理 /
* Teleport a monster, normally up to "dis" grids away.
- *
+ * @param m_idx モンスターID
+ * @param dis テレポート距離
+ * @param mode オプション
+ * @details
* Attempt to move the monster at least "dis/2" grids away.
- *
* But allow variation to prevent infinite loops.
*/
-bool teleport_away(int m_idx, int dis, bool dec_valour)
+bool teleport_away(int m_idx, int dis, u32b mode)
{
int oy, ox, d, i, min;
int tries = 0;
monster_type *m_ptr = &m_list[m_idx];
-
/* Paranoia */
if (!m_ptr->r_idx) return (FALSE);
/* Minimum distance */
min = dis / 2;
- if (dec_valour &&
+ if ((mode & TELEPORT_DEC_VALOUR) &&
(((p_ptr->chp * 10) / p_ptr->mhp) > 5) &&
(4+randint1(5) < ((p_ptr->chp * 10) / p_ptr->mhp)))
- {
+ {
chg_virtue(V_VALOUR, -1);
}
/* Ignore illegal locations */
if (!in_bounds(ny, nx)) continue;
- /* Require "empty" floor space */
- if (!cave_empty_bold(ny, nx)) continue;
-
- /* Hack -- no teleport onto glyph of warding */
- if (is_glyph_grid(&cave[ny][nx])) continue;
- if (is_explosive_rune_grid(&cave[ny][nx])) continue;
-
- /* ...nor onto the Pattern */
- if (pattern_tile(ny, nx)) continue;
+ if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
if (!(p_ptr->inside_quest || p_ptr->inside_arena))
/* Sound */
sound(SOUND_TPOTHER);
- /* Update the new location */
- cave[ny][nx].m_idx = m_idx;
-
/* Update the old location */
cave[oy][ox].m_idx = 0;
+ /* Update the new location */
+ cave[ny][nx].m_idx = m_idx;
+
/* Move the monster */
m_ptr->fy = ny;
m_ptr->fx = nx;
}
-
-/*
+/*!
+ * @brief モンスターを指定された座標付近にテレポートする /
* Teleport monster next to a grid near the given location
+ * @param m_idx モンスターID
+ * @param ty 目安Y座標
+ * @param tx 目安X座標
+ * @param power テレポート成功確率
+ * @param mode オプション
*/
-void teleport_monster_to(int m_idx, int ty, int tx, int power)
+void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode)
{
int ny, nx, oy, ox, d, i, min;
int attempts = 500;
bool look = TRUE;
monster_type *m_ptr = &m_list[m_idx];
-
/* Paranoia */
if (!m_ptr->r_idx) return;
/* Try several locations */
for (i = 0; i < 500; i++)
{
- cave_type *c_ptr;
-
/* Pick a (possibly illegal) location */
while (1)
{
/* Ignore illegal locations */
if (!in_bounds(ny, nx)) continue;
- /* Require "empty" floor space */
- if (!cave_empty_bold(ny, nx)) continue;
-
- c_ptr = &cave[ny][nx];
-
- /* Hack -- no teleport onto glyph of warding */
- if (is_glyph_grid(c_ptr)) continue;
- if (is_explosive_rune_grid(c_ptr)) continue;
-
- /* ...nor onto the Pattern */
- if (pattern_tile(ny, nx)) continue;
+ if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- /* if (c_ptr->info & (CAVE_ICKY)) continue; */
+ /* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
look = FALSE;
/* Sound */
sound(SOUND_TPOTHER);
- /* Update the new location */
- cave[ny][nx].m_idx = m_idx;
-
/* Update the old location */
cave[oy][ox].m_idx = 0;
+ /* Update the new location */
+ cave[ny][nx].m_idx = m_idx;
+
/* Move the monster */
m_ptr->fy = ny;
m_ptr->fx = nx;
}
-bool cave_teleportable_bold(int y, int x, bool passive)
+bool cave_player_teleportable_bold(int y, int x, u32b mode)
{
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Require "teleportable" space */
if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) return FALSE;
- /* No teleporting into vaults and such */
- if (c_ptr->info & CAVE_ICKY) return FALSE;
+ /* No magical teleporting into vaults and such */
+ if (!(mode & TELEPORT_NONMAGICAL) && (c_ptr->info & CAVE_ICKY)) return FALSE;
+
+ if (c_ptr->m_idx && (c_ptr->m_idx != p_ptr->riding)) return FALSE;
- if (c_ptr->m_idx) return FALSE;
+ /* don't teleport on a trap. */
+ if (have_flag(f_ptr->flags, FF_HIT_TRAP)) return FALSE;
- if (!passive)
+ if (!(mode & TELEPORT_PASSIVE))
{
if (!player_can_enter(c_ptr->feat, 0)) return FALSE;
if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP))
{
- if (!p_ptr->ffall && !p_ptr->can_swim) return FALSE;
+ if (!p_ptr->levitation && !p_ptr->can_swim) return FALSE;
}
if (have_flag(f_ptr->flags, FF_LAVA) && !p_ptr->immune_fire && !IS_INVULN())
if (have_flag(f_ptr->flags, FF_DEEP)) return FALSE;
/* Forbid shallow lava when the player don't have levitation */
- if (!p_ptr->ffall) return FALSE;
+ if (!p_ptr->levitation) return FALSE;
}
- if (have_flag(f_ptr->flags, FF_HIT_TRAP))
- {
- if (!is_known_trap(c_ptr) || !trap_can_be_ignored(c_ptr->feat)) return FALSE;
- }
}
return TRUE;
* If no such spaces are readily available, the distance may increase.
* Try very hard to move the player at least a quarter that distance.
*
- * When long-range teleport effects are considered, there is a nasty
- * tendency to "bounce" the player between two or three different spots
- * because these are the only spots that are "far enough" way to satisfy
- * the algorithm. Therefore, if the teleport distance is more than 50,
- * we decrease the minimum acceptable distance to try to increase randomness.
- * -GJW
+ * There was a nasty tendency for a long time; which was causing the
+ * player to "bounce" between two or three different spots because
+ * these are the only spots that are "far enough" way to satisfy the
+ * algorithm.
+ *
+ * But this tendency is now removed; in the new algorithm, a list of
+ * candidates is selected first, which includes at least 50% of all
+ * floor grids within the distance, and any single grid in this list
+ * of candidates has equal possibility to be choosen as a destination.
*/
-void teleport_player(int dis, bool passive)
+
+#define MAX_TELEPORT_DISTANCE 200
+
+bool teleport_player_aux(int dis, u32b mode)
{
- int d, i, min, ox, oy;
- int tries = 0;
+ int candidates_at[MAX_TELEPORT_DISTANCE + 1];
+ int total_candidates, cur_candidates;
+ int y = 0, x = 0, min, pick, i;
- int xx, yy;
+ int left = MAX(1, px - dis);
+ int right = MIN(cur_wid - 2, px + dis);
+ int top = MAX(1, py - dis);
+ int bottom = MIN(cur_hgt - 2, py + dis);
- /* Initialize */
- int y = py;
- int x = px;
+ if (p_ptr->wild_mode) return FALSE;
- bool look = TRUE;
+ if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
+ {
+ msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
+ return FALSE;
+ }
+
+ /* Initialize counters */
+ total_candidates = 0;
+ for (i = 0; i <= MAX_TELEPORT_DISTANCE; i++)
+ candidates_at[i] = 0;
- if (p_ptr->wild_mode) return;
+ /* Limit the distance */
+ if (dis > MAX_TELEPORT_DISTANCE) dis = MAX_TELEPORT_DISTANCE;
- if (p_ptr->anti_tele)
+ /* Search valid locations */
+ for (y = top; y <= bottom; y++)
{
-#ifdef JP
-msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
-#else
- msg_print("A mysterious force prevents you from teleporting!");
-#endif
+ for (x = left; x <= right; x++)
+ {
+ int d;
- return;
- }
+ /* Skip illegal locations */
+ if (!cave_player_teleportable_bold(y, x, mode)) continue;
- if (dis > 200) dis = 200; /* To be on the safe side... */
+ /* Calculate distance */
+ d = distance(py, px, y, x);
- /* Minimum distance */
- min = dis / (dis > 50 ? 3 : 2);
+ /* Skip too far locations */
+ if (d > dis) continue;
- /* Look until done */
- while (look)
+ /* Count the total number of candidates */
+ total_candidates++;
+
+ /* Count the number of candidates in this circumference */
+ candidates_at[d]++;
+ }
+ }
+
+ /* No valid location! */
+ if (0 == total_candidates) return FALSE;
+
+ /* Fix the minimum distance */
+ for (cur_candidates = 0, min = dis; min >= 0; min--)
{
- tries++;
+ cur_candidates += candidates_at[min];
- /* Verify max distance */
- if (dis > 200) dis = 200;
+ /* 50% of all candidates will have an equal chance to be choosen. */
+ if (cur_candidates && (cur_candidates >= total_candidates / 2)) break;
+ }
- /* Try several locations */
- for (i = 0; i < 500; i++)
+ /* Pick up a single location randomly */
+ pick = randint1(cur_candidates);
+
+ /* Search again the choosen location */
+ for (y = top; y <= bottom; y++)
+ {
+ for (x = left; x <= right; x++)
{
- /* Pick a (possibly illegal) location */
- while (1)
- {
- y = rand_spread(py, dis);
- x = rand_spread(px, dis);
- d = distance(py, px, y, x);
- if ((d >= min) && (d <= dis)) break;
- }
+ int d;
- /* Ignore illegal locations */
- if (!in_bounds(y, x)) continue;
+ /* Skip illegal locations */
+ if (!cave_player_teleportable_bold(y, x, mode)) continue;
- if (!cave_teleportable_bold(y, x, passive)) continue;
+ /* Calculate distance */
+ d = distance(py, px, y, x);
- /* This grid looks good */
- look = FALSE;
+ /* Skip too far locations */
+ if (d > dis) continue;
- /* Stop looking */
- break;
- }
-
- /* Increase the maximum distance */
- dis = dis * 2;
+ /* Skip too close locations */
+ if (d < min) continue;
- /* Decrease the minimum distance */
- min = min / 2;
+ /* This grid was picked up? */
+ pick--;
+ if (!pick) break;
+ }
- /* Stop after MAX_TRIES tries */
- if (tries > MAX_TRIES) return;
+ /* Exit the loop */
+ if (!pick) break;
}
+ if (player_bold(y, x)) return FALSE;
+
/* Sound */
sound(SOUND_TELEPORT);
#ifdef JP
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
- msg_format("¡Ø¤³¤Ã¤Á¤À¤¡¡¢%s¡Ù", player_name);
+ msg_format("『こっちだぁ、%s』", player_name);
#endif
+ /* Move the player */
+ (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
+
+ return TRUE;
+}
+
+void teleport_player(int dis, u32b mode)
+{
+ int yy, xx;
+
/* Save the old location */
- oy = py;
- ox = px;
+ int oy = py;
+ int ox = px;
- /* Move the player */
- (void)move_player_effect(py, px, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
+ if (!teleport_player_aux(dis, mode)) return;
/* Monsters with teleport ability may follow the player */
for (xx = -1; xx < 2; xx++)
int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
- if (tmp_m_idx && p_ptr->riding != tmp_m_idx)
+ if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
{
monster_type *m_ptr = &m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if ((r_ptr->flags6 & RF6_TPORT) &&
!(r_ptr->flagsr & RFR_RES_TELE))
{
- if (!m_ptr->csleep) teleport_monster_to(tmp_m_idx, y, x, r_ptr->level);
+ if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
}
}
}
}
+void teleport_player_away(int m_idx, int dis)
+{
+ int yy, xx;
+
+ /* Save the old location */
+ int oy = py;
+ int ox = px;
+
+ if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
+
+ /* Monsters with teleport ability may follow the player */
+ for (xx = -1; xx < 2; xx++)
+ {
+ for (yy = -1; yy < 2; yy++)
+ {
+ int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+
+ /* A monster except your mount or caster may follow */
+ if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
+ {
+ monster_type *m_ptr = &m_list[tmp_m_idx];
+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
+
+ /*
+ * The latter limitation is to avoid
+ * totally unkillable suckers...
+ */
+ if ((r_ptr->flags6 & RF6_TPORT) &&
+ !(r_ptr->flagsr & RFR_RES_TELE))
+ {
+ if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+ }
+ }
+ }
+ }
+}
+
/*
* Teleport player to a grid near the given location
* This function is slightly obsessive about correctness.
* This function allows teleporting into vaults (!)
*/
-void teleport_player_to(int ny, int nx, bool no_tele, bool passive)
+void teleport_player_to(int ny, int nx, u32b mode)
{
int y, x, dis = 0, ctr = 0;
- if (p_ptr->anti_tele && no_tele)
+ if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
{
-#ifdef JP
- msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
-#else
- msg_print("A mysterious force prevents you from teleporting!");
-#endif
-
+ msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
return;
}
}
/* Accept any grid when wizard mode */
- if (p_ptr->wizard) break;
+ if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
/* Accept teleportable floor grids */
- if (cave_teleportable_bold(y, x, passive)) break;
+ if (cave_player_teleportable_bold(y, x, mode)) break;
/* Occasionally advance the distance */
if (++ctr > (4 * dis * dis + 4 * dis + 1))
sound(SOUND_TELEPORT);
/* Move the player */
- (void)move_player_effect(py, px, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
+ (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
}
+void teleport_away_followable(int m_idx)
+{
+ monster_type *m_ptr = &m_list[m_idx];
+ int oldfy = m_ptr->fy;
+ int oldfx = m_ptr->fx;
+ bool old_ml = m_ptr->ml;
+ int old_cdis = m_ptr->cdis;
+
+ teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+
+ if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(py, px, oldfy, oldfx))
+ {
+ bool follow = FALSE;
+
+ if ((p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR)) follow = TRUE;
+ else
+ {
+ u32b flgs[TR_FLAG_SIZE];
+ object_type *o_ptr;
+ int i;
+
+ for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
+ {
+ o_ptr = &inventory[i];
+ if (o_ptr->k_idx && !object_is_cursed(o_ptr))
+ {
+ object_flags(o_ptr, flgs);
+ if (have_flag(flgs, TR_TELEPORT))
+ {
+ follow = TRUE;
+ break;
+ }
+ }
+ }
+ }
+
+ if (follow)
+ {
+ if (get_check_strict(_("ついていきますか?", "Do you follow it? "), CHECK_OKAY_CANCEL))
+ {
+ if (one_in_(3))
+ {
+ teleport_player(200, TELEPORT_PASSIVE);
+ msg_print(_("失敗!", "Failed!"));
+ }
+ else teleport_player_to(m_ptr->fy, m_ptr->fx, 0L);
+ p_ptr->energy_need += ENERGY_NEED();
+ }
+ }
+ }
+}
+
/*
* Teleport the player one level up or down (random when legal)
if (m_idx <= 0) /* To player */
{
-#ifdef JP
- strcpy(m_name, "¤¢¤Ê¤¿");
-#else
- strcpy(m_name, "you");
-#endif
+ strcpy(m_name, _("あなた", "you"));
}
else /* To monster */
{
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
- see_m = m_ptr->ml;
+ see_m = is_seen(m_ptr);
}
/* No effect in some case */
if (TELE_LEVEL_IS_INEFF(m_idx))
{
-#ifdef JP
- if (see_m) msg_print("¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£");
-#else
- if (see_m) msg_print("There is no effect.");
-#endif
-
+ if (see_m) msg_print(_("効果がなかった。", "There is no effect."));
return;
}
if ((m_idx <= 0) && p_ptr->anti_tele) /* To player */
{
-#ifdef JP
- msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
-#else
- msg_print("A mysterious force prevents you from teleporting!");
-#endif
+ msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
return;
}
if ((ironman_downward && (m_idx <= 0)) || (dun_level <= d_info[dungeon_type].mindepth))
{
#ifdef JP
- if (see_m) msg_format("%^s¤Ï¾²¤òÆͤÇˤäÆÄÀ¤ó¤Ç¤¤¤¯¡£", m_name);
+ if (see_m) msg_format("%^sは床を突き破って沈んでいく。", m_name);
#else
if (see_m) msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
#endif
else if (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth))
{
#ifdef JP
- if (see_m) msg_format("%^s¤ÏÅ·°æ¤òÆͤÇˤäÆÃè¤ØÉ⤤¤Æ¤¤¤¯¡£", m_name);
+ if (see_m) msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
#else
if (see_m) msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
#endif
else if (go_up)
{
#ifdef JP
- if (see_m) msg_format("%^s¤ÏÅ·°æ¤òÆͤÇˤäÆÃè¤ØÉ⤤¤Æ¤¤¤¯¡£", m_name);
+ if (see_m) msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
#else
if (see_m) msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
#endif
else
{
#ifdef JP
- if (see_m) msg_format("%^s¤Ï¾²¤òÆͤÇˤäÆÄÀ¤ó¤Ç¤¤¤¯¡£", m_name);
+ if (see_m) msg_format("%^sは床を突き破って沈んでいく。", m_name);
#else
if (see_m) msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
#endif
/* Check for quest completion */
check_quest_completion(m_ptr);
+ if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
+ {
+ char m2_name[80];
+
+ monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
+ do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
+ }
+
delete_monster_idx(m_idx);
}
if (max_dlv[DUNGEON_ANGBAND]) return DUNGEON_ANGBAND;
else
{
-#ifdef JP
- msg_format("¤Þ¤À%s¤ËÆþ¤Ã¤¿¤³¤È¤Ï¤Ê¤¤¡£", d_name + d_info[DUNGEON_ANGBAND].name);
-#else
- msg_format("You haven't entered %s yet.", d_name + d_info[DUNGEON_ANGBAND].name);
-#endif
+ msg_format(_("まだ%sに入ったことはない。", "You haven't entered %s yet."), d_name + d_info[DUNGEON_ANGBAND].name);
msg_print(NULL);
return 0;
}
}
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%-16s : Max level %d", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
-#endif
+ sprintf(buf,_(" %c) %c%-12s : 最大 %d 階", " %c) %c%-16s : Max level %d"),
+ 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
prt(buf, y + num, x);
dun[num++] = i;
}
if (!num)
{
-#ifdef JP
- prt(" Áª¤Ù¤ë¥À¥ó¥¸¥ç¥ó¤¬¤Ê¤¤¡£", y, x);
-#else
- prt(" No dungeon is available.", y, x);
-#endif
+ prt(_(" 選べるダンジョンがない。", " No dungeon is available."), y, x);
}
-#ifdef JP
- prt(format("¤É¤Î¥À¥ó¥¸¥ç¥ó%s¤·¤Þ¤¹¤«:", note), 0, 0);
-#else
- prt(format("Which dungeon do you %s?: ", note), 0, 0);
-#endif
+ prt(format(_("どのダンジョン%sしますか:", "Which dungeon do you %s?: "), note), 0, 0);
while(1)
{
i = inkey();
/* Ironman option */
if (p_ptr->inside_arena || ironman_downward)
{
-#ifdef JP
-msg_print("²¿¤âµ¯¤³¤é¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("Nothing happens.");
-#endif
-
+ msg_print(_("何も起こらなかった。", "Nothing happens."));
return TRUE;
}
if (dun_level && (max_dlv[dungeon_type] > dun_level) && !p_ptr->inside_quest && !p_ptr->word_recall)
{
-#ifdef JP
-if (get_check("¤³¤³¤ÏºÇ¿¼Åþ㳬¤è¤êÀõ¤¤³¬¤Ç¤¹¡£¤³¤Î³¬¤ËÌá¤Ã¤ÆÍè¤Þ¤¹¤«¡© "))
-#else
- if (get_check("Reset recall depth? "))
-#endif
+ if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? ")))
{
max_dlv[dungeon_type] = dun_level;
if (record_maxdepth)
-#ifdef JP
- do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, "µ¢´Ô¤Î¤È¤¤Ë");
-#else
- do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, "when recall from dungeon");
-#endif
+ do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, _("帰還のときに", "when recall from dungeon"));
}
}
if (!dun_level)
{
int select_dungeon;
-#ifdef JP
- select_dungeon = choose_dungeon("¤Ëµ¢´Ô", 2, 14);
-#else
- select_dungeon = choose_dungeon("recall", 2, 14);
-#endif
+ select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14);
if (!select_dungeon) return FALSE;
p_ptr->recall_dungeon = select_dungeon;
}
p_ptr->word_recall = turns;
-#ifdef JP
-msg_print("²ó¤ê¤ÎÂ絤¤¬Ä¥¤ê¤Ä¤á¤Æ¤¤¿...");
-#else
- msg_print("The air about you becomes charged...");
-#endif
-
+ msg_print(_("回りの大気が張りつめてきた...", "The air about you becomes charged..."));
p_ptr->redraw |= (PR_STATUS);
}
else
{
p_ptr->word_recall = 0;
-#ifdef JP
-msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
-#else
- msg_print("A tension leaves the air around you...");
-#endif
-
+ msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
p_ptr->redraw |= (PR_STATUS);
}
return TRUE;
char ppp[80];
char tmp_val[160];
-#ifdef JP
- select_dungeon = choose_dungeon("¤ò¥»¥Ã¥È", 2, 14);
-#else
- select_dungeon = choose_dungeon("reset", 2, 14);
-#endif
+ select_dungeon = choose_dungeon(_("をセット", "reset"), 2, 14);
/* Ironman option */
if (ironman_downward)
{
-#ifdef JP
- msg_print("²¿¤âµ¯¤³¤é¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("Nothing happens.");
-#endif
-
+ msg_print(_("何も起こらなかった。", "Nothing happens."));
return TRUE;
}
if (!select_dungeon) return FALSE;
/* Prompt */
-#ifdef JP
-sprintf(ppp, "²¿³¬¤Ë¥»¥Ã¥È¤·¤Þ¤¹¤« (%d-%d):", d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
-#else
- sprintf(ppp, "Reset to which level (%d-%d): ", d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
-#endif
-
+ sprintf(ppp, _("何階にセットしますか (%d-%d):", "Reset to which level (%d-%d): "), d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
/* Default */
sprintf(tmp_val, "%d", MAX(dun_level, 1));
max_dlv[select_dungeon] = dummy;
if (record_maxdepth)
-#ifdef JP
- do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, "¥Õ¥í¥¢¡¦¥ê¥»¥Ã¥È¤Ç");
-#else
- do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, "using a scroll of reset recall");
-#endif
+ do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, _("フロア・リセットで", "using a scroll of reset recall"));
/* Accept request */
#ifdef JP
-msg_format("%s¤Îµ¢´Ô¥ì¥Ù¥ë¤ò %d ³¬¤Ë¥»¥Ã¥È¡£", d_name+d_info[select_dungeon].name, dummy, dummy * 50);
+msg_format("%sの帰還レベルを %d 階にセット。", d_name+d_info[select_dungeon].name, dummy, dummy * 50);
#else
msg_format("Recall depth set to level %d (%d').", dummy, dummy * 50);
#endif
if (!o_ptr->k_idx) return (FALSE);
/* Disenchant equipments only -- No disenchant on monster ball */
- if (o_ptr->tval < TV_EQUIP_BEGIN || TV_EQUIP_END < o_ptr->tval)
+ if (!object_is_weapon_armour_ammo(o_ptr))
return FALSE;
/* Nothing to disenchant */
/* Artifacts have 71% chance to resist */
- if ((artifact_p(o_ptr) || o_ptr->art_name) && (randint0(100) < 71))
+ if (object_is_artifact(o_ptr) && (randint0(100) < 71))
{
/* Message */
#ifdef JP
-msg_format("%s(%c)¤ÏÎô²½¤òÄ·¤ÍÊÖ¤·¤¿¡ª",o_name, index_to_label(t) );
+msg_format("%s(%c)は劣化を跳ね返した!",o_name, index_to_label(t) );
#else
msg_format("Your %s (%c) resist%s disenchantment!",
o_name, index_to_label(t),
{
/* Message */
#ifdef JP
- msg_format("%s(%c)¤ÏÎô²½¤·¤Æ¤·¤Þ¤Ã¤¿¡ª",
+ msg_format("%s(%c)は劣化してしまった!",
o_name, index_to_label(t) );
#else
msg_format("Your %s (%c) %s disenchanted!",
{
case 1: case 2: case 3:
{
- teleport_player(200, TRUE);
+ teleport_player(200, TELEPORT_PASSIVE);
break;
}
case 4: case 5:
{
- teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, TRUE);
+ teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
break;
}
{
if (randint0(100) < p_ptr->skill_sav)
{
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
- msg_print("You resist the effects!");
-#endif
-
+ msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
break;
}
{
if (randint0(100) < p_ptr->skill_sav)
{
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
- msg_print("You resist the effects!");
-#endif
-
+ msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
break;
}
-#ifdef JP
-msg_print("ÂΤ¬¤Í¤¸¤ì»Ï¤á¤¿...");
-#else
- msg_print("Your body starts to scramble...");
-#endif
-
+ msg_print(_("体がねじれ始めた...", "Your body starts to scramble..."));
mutate_player();
break;
}
/* No torch to refill */
else
{
-#ifdef JP
-msg_print("dzÁǤò¾ÃÈñ¤¹¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Þ¤»¤ó¡£");
-#else
- msg_print("You are not wielding anything which uses phlogiston.");
-#endif
-
+ msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
return;
}
if (o_ptr->xtra4 >= max_flog)
{
-#ifdef JP
-msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¤³¤ì°Ê¾ådzÁǤòÊä½¼¤Ç¤¤Þ¤»¤ó¡£");
-#else
- msg_print("No more phlogiston can be put in this item.");
-#endif
-
+ msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
return;
}
o_ptr->xtra4 += (max_flog / 2);
/* Message */
-#ifdef JP
-msg_print("¾ÈÌÀÍÑ¥¢¥¤¥Æ¥à¤ËdzÁǤòÊä½¼¤·¤¿¡£");
-#else
- msg_print("You add phlogiston to your light item.");
-#endif
-
+ msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
/* Comment */
if (o_ptr->xtra4 >= max_flog)
{
o_ptr->xtra4 = max_flog;
-#ifdef JP
-msg_print("¾ÈÌÀÍÑ¥¢¥¤¥Æ¥à¤ÏËþ¥¿¥ó¤Ë¤Ê¤Ã¤¿¡£");
-#else
- msg_print("Your light item is full.");
-#endif
-
+ msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
}
/* Recalculate torch */
}
-static bool item_tester_hook_weapon_nobow(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_DIGGING:
- {
- return (TRUE);
- }
- case TV_SWORD:
- {
- if (o_ptr->sval != SV_DOKUBARI) return (TRUE);
- }
- }
-
- return (FALSE);
-}
-
/*
* Brand the current weapon
*/
/* Assume enchant weapon */
- item_tester_hook = item_tester_hook_weapon_nobow;
+ item_tester_hook = object_allow_enchant_melee_weapon;
item_tester_no_ryoute = TRUE;
/* Get an item */
-#ifdef JP
-q = "¤É¤ÎÉð´ï¤ò¶¯²½¤·¤Þ¤¹¤«? ";
-s = "¶¯²½¤Ç¤¤ëÉð´ï¤¬¤Ê¤¤¡£";
-#else
- q = "Enchant which weapon? ";
- s = "You have nothing to enchant.";
-#endif
+ q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
+ s = _("強化できる武器がない。", "You have nothing to enchant.");
if (!get_item(&item, q, s, (USE_EQUIP))) return;
/* you can never modify artifacts / ego-items */
/* you can never modify cursed items */
/* TY: You _can_ modify broken items (if you're silly enough) */
- if (o_ptr->k_idx && !artifact_p(o_ptr) && !ego_item_p(o_ptr) &&
- !o_ptr->art_name && !cursed_p(o_ptr) &&
+ if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
+ !object_is_cursed(o_ptr) &&
!((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) &&
!((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE)) &&
!((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
case 17:
if (o_ptr->tval == TV_SWORD)
{
-#ifdef JP
-act = "¤Ï±Ô¤µ¤òÁý¤·¤¿¡ª";
-#else
- act = "becomes very sharp!";
-#endif
+ act = _("は鋭さを増した!", "becomes very sharp!");
o_ptr->name2 = EGO_SHARPNESS;
o_ptr->pval = m_bonus(5, dun_level) + 1;
+
+ if ((o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2))
+ o_ptr->pval = 2;
}
else
{
-#ifdef JP
-act = "¤ÏÇ˲õÎϤòÁý¤·¤¿¡ª";
-#else
- act = "seems very powerful.";
-#endif
-
+ act = _("は破壊力を増した!", "seems very powerful.");
o_ptr->name2 = EGO_EARTHQUAKES;
o_ptr->pval = m_bonus(3, dun_level);
}
break;
case 16:
-#ifdef JP
-act = "¤Ï¿Í´Ö¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for humans!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_HUMAN;
+ act = _("は人間の血を求めている!", "seems to be looking for humans!");
+ o_ptr->name2 = EGO_KILL_HUMAN;
break;
case 15:
-#ifdef JP
-act = "¤ÏÅÅ·â¤Ëʤ¤ï¤ì¤¿¡ª";
-#else
- act = "covered with lightning!";
-#endif
-
+ act = _("は電撃に覆われた!", "covered with lightning!");
o_ptr->name2 = EGO_BRAND_ELEC;
break;
case 14:
-#ifdef JP
-act = "¤Ï»À¤Ëʤ¤ï¤ì¤¿¡ª";
-#else
- act = "coated with acid!";
-#endif
-
+ act = _("は酸に覆われた!", "coated with acid!");
o_ptr->name2 = EGO_BRAND_ACID;
break;
case 13:
-#ifdef JP
-act = "¤Ï¼Ù°¤Ê¤ë²øʪ¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for evil monsters!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_EVIL;
+ act = _("は邪悪なる怪物を求めている!", "seems to be looking for evil monsters!");
+ o_ptr->name2 = EGO_KILL_EVIL;
break;
case 12:
-#ifdef JP
-act = "¤Ï°ÛÀ¤³¦¤Î½»¿Í¤ÎÆùÂΤòµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for demons!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_DEMON;
+ act = _("は異世界の住人の肉体を求めている!", "seems to be looking for demons!");
+ o_ptr->name2 = EGO_KILL_DEMON;
break;
case 11:
-#ifdef JP
-act = "¤Ï»Ó¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for undead!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_UNDEAD;
+ act = _("は屍を求めている!", "seems to be looking for undead!");
+ o_ptr->name2 = EGO_KILL_UNDEAD;
break;
case 10:
-#ifdef JP
-act = "¤Ïưʪ¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for animals!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_ANIMAL;
+ act = _("は動物の血を求めている!", "seems to be looking for animals!");
+ o_ptr->name2 = EGO_KILL_ANIMAL;
break;
case 9:
-#ifdef JP
-act = "¤Ï¥É¥é¥´¥ó¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for dragons!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_DRAGON;
+ act = _("はドラゴンの血を求めている!", "seems to be looking for dragons!");
+ o_ptr->name2 = EGO_KILL_DRAGON;
break;
case 8:
-#ifdef JP
-act = "¤Ï¥È¥í¥ë¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for troll!s";
-#endif
-
- o_ptr->name2 = EGO_SLAY_TROLL;
+ act = _("はトロルの血を求めている!", "seems to be looking for troll!s");
+ o_ptr->name2 = EGO_KILL_TROLL;
break;
case 7:
-#ifdef JP
-act = "¤Ï¥ª¡¼¥¯¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for orcs!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_ORC;
+ act = _("はオークの血を求めている!", "seems to be looking for orcs!");
+ o_ptr->name2 = EGO_KILL_ORC;
break;
case 6:
-#ifdef JP
-act = "¤Ïµð¿Í¤Î·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "seems to be looking for giants!";
-#endif
-
- o_ptr->name2 = EGO_SLAY_GIANT;
+ act = _("は巨人の血を求めている!", "seems to be looking for giants!");
+ o_ptr->name2 = EGO_KILL_GIANT;
break;
case 5:
-#ifdef JP
-act = "¤ÏÈó¾ï¤ËÉÔ°ÂÄê¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡£";
-#else
- act = "seems very unstable now.";
-#endif
-
+ act = _("は非常に不安定になったようだ。", "seems very unstable now.");
o_ptr->name2 = EGO_TRUMP;
o_ptr->pval = randint1(2);
break;
case 4:
-#ifdef JP
-act = "¤Ï·ì¤òµá¤á¤Æ¤¤¤ë¡ª";
-#else
- act = "thirsts for blood!";
-#endif
-
+ act = _("は血を求めている!", "thirsts for blood!");
o_ptr->name2 = EGO_VAMPIRIC;
break;
case 3:
-#ifdef JP
-act = "¤ÏÆǤËʤ¤ï¤ì¤¿¡£";
-#else
- act = "is coated with poison.";
-#endif
-
+ act = _("は毒に覆われた。", "is coated with poison.");
o_ptr->name2 = EGO_BRAND_POIS;
break;
case 2:
-#ifdef JP
-act = "¤Ï½ã¥í¥°¥ë¥¹¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£";
-#else
- act = "is engulfed in raw Logrus!";
-#endif
-
+ act = _("は純ログルスに飲み込まれた。", "is engulfed in raw Logrus!");
o_ptr->name2 = EGO_CHAOTIC;
break;
case 1:
-#ifdef JP
-act = "¤Ï±ê¤Î¥·¡¼¥ë¥É¤Ëʤ¤ï¤ì¤¿¡ª";
-#else
- act = "is covered in a fiery shield!";
-#endif
-
+ act = _("は炎のシールドに覆われた!", "is covered in a fiery shield!");
o_ptr->name2 = EGO_BRAND_FIRE;
break;
default:
-#ifdef JP
-act = "¤Ï¿¼¤¯Î䤿¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿¡ª";
-#else
- act = "glows deep, icy blue!";
-#endif
-
+ act = _("は深く冷たいブルーに輝いた!", "glows deep, icy blue!");
o_ptr->name2 = EGO_BRAND_COLD;
break;
}
-#ifdef JP
-msg_format("¤¢¤Ê¤¿¤Î%s%s", o_name, act);
-#else
- msg_format("Your %s %s", o_name, act);
-#endif
-
-
+ msg_format(_("あなたの%s%s", "Your %s %s"), o_name, act);
enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
o_ptr->discount = 99;
{
if (flush_failure) flush();
-#ifdef JP
-msg_print("°ÀÉղä˼ºÇÔ¤·¤¿¡£");
-#else
- msg_print("The Branding failed.");
-#endif
-
+ msg_print(_("属性付加に失敗した。", "The Branding failed."));
chg_virtue(V_ENCHANT, -2);
}
calc_android_exp();
m_ptr = &m_list[c_ptr->m_idx];
/* Awake monster */
- if (c_ptr->m_idx && m_ptr->csleep)
+ if (c_ptr->m_idx && MON_CSLEEP(m_ptr))
{
/* Reset sleep counter */
- m_ptr->csleep = 0;
+ (void)set_monster_csleep(c_ptr->m_idx, 0);
/* Notice the "waking up" */
if (m_ptr->ml)
{
/* Acquire the monster name */
- monster_desc(m_name, m_ptr, 0);
-
- /* Dump a message */
-#ifdef JP
- msg_format("%^s¤¬Ìܤò³Ð¤Þ¤·¤¿¡£", m_name);
-#else
- msg_format("%^s wakes up.", m_name);
-#endif
+ monster_desc(m_name, m_ptr, 0);
- /* Redraw the health bar */
- if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
+ /* Dump a message */
+ msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
}
}
{
c_ptr = &cave[py + ddy_ddd[i]][px + ddx_ddd[i]];
- if (!have_flag(f_flags_grid(c_ptr), FF_PROJECT))
+ if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
{
if (!c_ptr->mimic || !have_flag(f_info[c_ptr->mimic].flags, FF_PROJECT) ||
!permanent_wall(&f_info[c_ptr->feat]))
/* Prevent destruction of quest levels and town */
else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
{
-#ifdef JP
- msg_print("ÃÏÌ̤¬Íɤ줿¡£");
-#else
- msg_print("The ground trembles.");
-#endif
+ msg_print(_("地面が揺れた。", "The ground trembles."));
}
else
{
#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤òÊɤ˶᤹¤®¤ë¾ì½ê¤Ç¾§¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª",
- ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "µ§¤ê" : "¼öʸ"));
- msg_print("Â礤ÊÇúȯ²»¤¬¤¢¤Ã¤¿¡ª");
+ msg_format("あなたは%sを壁に近すぎる場所で唱えてしまった!",
+ ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "祈り" : "呪文"));
+ msg_print("大きな爆発音があった!");
#else
msg_format("You %s the %s too close to a wall!",
((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
if (one_in_(666))
{
-#ifdef JP
- if (!vanish_dungeon()) msg_print("¥À¥ó¥¸¥ç¥ó¤Ï°ì½ÖÀŤޤêÊ֤ä¿¡£");
-#else
- if (!vanish_dungeon()) msg_print("The dungeon silences a moment.");
-#endif
+ if (!vanish_dungeon()) msg_print(_("ダンジョンは一瞬静まり返った。", "The dungeon silences a moment."));
}
else
{
if (destroy_area(py, px, 15 + p_ptr->lev + randint0(11), FALSE))
-#ifdef JP
- msg_print("¥À¥ó¥¸¥ç¥ó¤¬Êø²õ¤·¤¿...");
-#else
- msg_print("The dungeon collapses...");
-#endif
-
+ msg_print(_("ダンジョンが崩壊した...", "The dungeon collapses..."));
else
-#ifdef JP
- msg_print("¥À¥ó¥¸¥ç¥ó¤ÏÂ礤¯Íɤ줿¡£");
-#else
- msg_print("The dungeon trembles.");
-#endif
+ msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
}
-#ifdef JP
- take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "¼«»¦Åª¤Êµõ̵¾·Íè", -1);
-#else
- take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "a suicidal Call the Void", -1);
-#endif
+ take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
}
}
/* Check to see if an object is already there */
if (cave[py][px].o_idx)
{
-#ifdef JP
-msg_print("¼«Ê¬¤Î¤β¼¤Ë¤¢¤ëʪ¤Ï¼è¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("You can't fetch when you're already standing on something.");
-#endif
-
+ msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
}
if (distance(py, px, ty, tx) > MAX_RANGE)
{
-#ifdef JP
-msg_print("¤½¤ó¤Ê¤Ë±ó¤¯¤Ë¤¢¤ëʪ¤Ï¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- msg_print("You can't fetch something that far away!");
-#endif
-
+ msg_print(_("そんなに遠くにある物は取れません!", "You can't fetch something that far away!"));
return;
}
/* We need an item to fetch */
if (!c_ptr->o_idx)
{
-#ifdef JP
-msg_print("¤½¤³¤Ë¤Ï²¿¤â¤¢¤ê¤Þ¤»¤ó¡£");
-#else
- msg_print("There is no object at this place.");
-#endif
-
+ msg_print(_("そこには何もありません。", "There is no object at this place."));
return;
}
/* No fetching from vault */
if (c_ptr->info & CAVE_ICKY)
{
-#ifdef JP
-msg_print("¥¢¥¤¥Æ¥à¤¬¥³¥ó¥È¥í¡¼¥ë¤ò³°¤ì¤ÆÍî¤Á¤¿¡£");
-#else
- msg_print("The item slips from your control.");
-#endif
-
+ msg_print(_("アイテムがコントロールを外れて落ちた。", "The item slips from your control."));
return;
}
{
if (!player_has_los_bold(ty, tx))
{
-#ifdef JP
- msg_print("¤½¤³¤Ï¤¢¤Ê¤¿¤Î»ë³¦¤ËÆþ¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
-#else
- msg_print("You have no direct line of sight to that location.");
-#endif
-
+ msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
return;
}
else if (!projectable(py, px, ty, tx))
{
-#ifdef JP
- msg_print("¤½¤³¤ÏÊɤθþ¤³¤¦¤Ç¤¹¡£");
-#else
- msg_print("You have no direct line of sight to that location.");
-#endif
-
+ msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
return;
}
}
c_ptr = &cave[ty][tx];
if ((distance(py, px, ty, tx) > MAX_RANGE) ||
- !have_flag(f_flags_bold(ty, tx), FF_PROJECT)) return;
+ !cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
}
while (!c_ptr->o_idx);
}
if (o_ptr->weight > wgt)
{
/* Too heavy to 'fetch' */
-#ifdef JP
-msg_print("¤½¤Î¥¢¥¤¥Æ¥à¤Ï½Å²á¤®¤Þ¤¹¡£");
-#else
- msg_print("The object is too heavy.");
-#endif
-
+ msg_print(_("そのアイテムは重過ぎます。", "The object is too heavy."));
return;
}
o_ptr->ix = (byte)px;
object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¸µ¤ËÈô¤ó¤Ç¤¤¿¡£", o_name);
-#else
- msg_format("%^s flies through the air to your feet.", o_name);
-#endif
-
+ msg_format(_("%^sがあなたの足元に飛んできた。", "%^s flies through the air to your feet."), o_name);
note_spot(py, px);
p_ptr->redraw |= PR_MAP;
/* Ironman option */
if (p_ptr->inside_arena || ironman_downward)
{
-#ifdef JP
- msg_print("²¿¤âµ¯¤³¤é¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("Nothing happens.");
-#endif
+ msg_print(_("何も起こらなかった。", "Nothing happens."));
return;
}
int turns = randint0(21) + 15;
p_ptr->alter_reality = turns;
-#ifdef JP
- msg_print("²ó¤ê¤Î·Ê¿§¤¬ÊѤï¤ê»Ï¤á¤¿...");
-#else
- msg_print("The view around you begins to change...");
-#endif
+ msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
p_ptr->redraw |= (PR_STATUS);
}
else
{
p_ptr->alter_reality = 0;
-#ifdef JP
- msg_print("·Ê¿§¤¬¸µ¤ËÌá¤Ã¤¿...");
-#else
- msg_print("The view around you got back...");
-#endif
-
+ msg_print(_("景色が元に戻った...", "The view around you got back..."));
p_ptr->redraw |= (PR_STATUS);
}
return;
/* XXX XXX XXX */
if (!cave_clean_bold(py, px))
{
-#ifdef JP
-msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");
-#else
- msg_print("The object resists the spell.");
-#endif
-
+ msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a glyph */
cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = FEAT_GLYPH;
+ cave[py][px].mimic = feat_glyph;
/* Notice */
note_spot(py, px);
/* XXX XXX XXX */
if (!cave_clean_bold(py, px))
{
-#ifdef JP
-msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");
-#else
- msg_print("The object resists the spell.");
-#endif
-
+ msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a mirror */
cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = FEAT_MIRROR;
+ cave[py][px].mimic = feat_mirror;
/* Turn on the light */
cave[py][px].info |= CAVE_GLOW;
/* XXX XXX XXX */
if (!cave_clean_bold(py, px))
{
-#ifdef JP
-msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");
-#else
- msg_print("The object resists the spell.");
-#endif
-
+ msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a glyph */
cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = FEAT_MINOR_GLYPH;
+ cave[py][px].mimic = feat_explosive_rune;
/* Notice */
note_spot(py, px);
if (!o_ptr->k_idx) continue;
/* Uncursed already */
- if (!cursed_p(o_ptr)) continue;
+ if (!object_is_cursed(o_ptr)) continue;
/* Heavily Cursed Items need a special spell */
if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE)) continue;
if (command_arg > 0) force = TRUE;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò¶â¤ËÊѤ¨¤Þ¤¹¤«¡©";
-s = "¶â¤ËÊѤ¨¤é¤ì¤ëʪ¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Turn which item to gold? ";
- s = "You have nothing to turn to gold.";
-#endif
+ q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
+ s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
if (confirm_destroy || (object_value(o_ptr) > 0))
{
/* Make a verification */
-#ifdef JP
-sprintf(out_val, "ËÜÅö¤Ë%s¤ò¶â¤ËÊѤ¨¤Þ¤¹¤«¡©", o_name);
-#else
- sprintf(out_val, "Really turn %s to gold? ", o_name);
-#endif
-
+ sprintf(out_val, _("本当に%sを金に変えますか?", "Really turn %s to gold? "), o_name);
if (!get_check(out_val)) return FALSE;
}
}
if (!can_player_destroy_object(o_ptr))
{
/* Message */
-#ifdef JP
- msg_format("%s¤ò¶â¤ËÊѤ¨¤ë¤³¤È¤Ë¼ºÇÔ¤·¤¿¡£", o_name);
-#else
- msg_format("You fail to turn %s to gold!", o_name);
-#endif
+ msg_format(_("%sを金に変えることに失敗した。", "You fail to turn %s to gold!"), o_name);
/* Done */
return FALSE;
if (price <= 0)
{
/* Message */
-#ifdef JP
-msg_format("%s¤ò¥Ë¥»¤Î¶â¤ËÊѤ¨¤¿¡£", o_name);
-#else
- msg_format("You turn %s to fool's gold.", o_name);
-#endif
-
+ msg_format(_("%sをニセの金に変えた。", "You turn %s to fool's gold."), o_name);
}
else
{
if (amt > 1) price *= amt;
if (price > 30000) price = 30000;
-#ifdef JP
-msg_format("%s¤ò¡ð%d ¤Î¶â¤ËÊѤ¨¤¿¡£", o_name, price);
-#else
- msg_format("You turn %s to %ld coins worth of gold.", o_name, price);
-#endif
+ msg_format(_("%sを$%d の金に変えた。", "You turn %s to %ld coins worth of gold."), o_name, price);
p_ptr->au += price;
}
-
-/*
- * Hook to specify "weapon"
- */
-bool item_tester_hook_weapon(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_DIGGING:
- case TV_BOW:
- case TV_BOLT:
- case TV_ARROW:
- case TV_SHOT:
- {
- return (TRUE);
- }
- case TV_SWORD:
- {
- if (o_ptr->sval != SV_DOKUBARI) return (TRUE);
- }
- }
-
- return (FALSE);
-}
-
-static bool item_tester_hook_weapon2(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_SWORD:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_DIGGING:
- case TV_BOW:
- case TV_BOLT:
- case TV_ARROW:
- case TV_SHOT:
- {
- return (TRUE);
- }
- }
-
- return (FALSE);
-}
-
-
-/*
- * Hook to specify "armour"
- */
-bool item_tester_hook_armour(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_DRAG_ARMOR:
- case TV_HARD_ARMOR:
- case TV_SOFT_ARMOR:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_CROWN:
- case TV_HELM:
- case TV_BOOTS:
- case TV_GLOVES:
- {
- return (TRUE);
- }
- }
-
- return (FALSE);
-}
-
-
-/*
- * Check if an object is weapon or armour (but not arrow, bolt, or shot)
- */
-bool item_tester_hook_weapon_armour(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_SWORD:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_DIGGING:
- case TV_BOW:
- case TV_BOLT:
- case TV_ARROW:
- case TV_SHOT:
- case TV_DRAG_ARMOR:
- case TV_HARD_ARMOR:
- case TV_SOFT_ARMOR:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_CROWN:
- case TV_HELM:
- case TV_BOOTS:
- case TV_GLOVES:
- {
- return (TRUE);
- }
- }
-
- return (FALSE);
-}
-
-
-/*
- * Check if an object is nameless weapon or armour
- */
-static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
-{
- switch (o_ptr->tval)
- {
- case TV_SWORD:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_DIGGING:
- case TV_BOW:
- case TV_BOLT:
- case TV_ARROW:
- case TV_SHOT:
- case TV_DRAG_ARMOR:
- case TV_HARD_ARMOR:
- case TV_SOFT_ARMOR:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_CROWN:
- case TV_HELM:
- case TV_BOOTS:
- case TV_GLOVES:
- if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2 || o_ptr->xtra3)
- {
- if (object_known_p(o_ptr)) return FALSE;
- }
- return TRUE;
- }
-
- return FALSE;
-}
-
-
/*
* Break the curse of an item
*/
static void break_curse(object_type *o_ptr)
{
- if (cursed_p(o_ptr) && !(o_ptr->curse_flags & TRC_PERMA_CURSE) && !(o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint0(100) < 25))
+ if (object_is_cursed(o_ptr) && !(o_ptr->curse_flags & TRC_PERMA_CURSE) && !(o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint0(100) < 25))
{
-#ifdef JP
-msg_print("¤«¤±¤é¤ì¤Æ¤¤¤¿¼ö¤¤¤¬ÂǤÁÇˤé¤ì¤¿¡ª");
-#else
- msg_print("The curse is broken!");
-#endif
+ msg_print(_("かけられていた呪いが打ち破られた!", "The curse is broken!"));
o_ptr->curse_flags = 0L;
-
o_ptr->ident |= (IDENT_SENSE);
-
o_ptr->feeling = FEEL_NONE;
}
}
{
int i, chance, prob;
bool res = FALSE;
- bool a = (artifact_p(o_ptr) || o_ptr->art_name);
+ bool a = object_is_artifact(o_ptr);
bool force = (eflag & ENCH_FORCE);
/* Assume enchant weapon */
- item_tester_hook = item_tester_hook_weapon;
+ item_tester_hook = object_allow_enchant_weapon;
item_tester_no_ryoute = TRUE;
/* Enchant armor if requested */
- if (num_ac) item_tester_hook = item_tester_hook_armour;
+ if (num_ac) item_tester_hook = object_is_armour;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò¶¯²½¤·¤Þ¤¹¤«? ";
-s = "¶¯²½¤Ç¤¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Enchant which item? ";
- s = "You have nothing to enchant.";
-#endif
+ q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
+ s = _("強化できるアイテムがない。", "You have nothing to enchant.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
/* Describe */
#ifdef JP
-msg_format("%s ¤ÏÌÀ¤ë¤¯µ±¤¤¤¿¡ª",
+msg_format("%s は明るく輝いた!",
o_name);
#else
msg_format("%s %s glow%s brightly!",
if (flush_failure) flush();
/* Message */
-#ifdef JP
-msg_print("¶¯²½¤Ë¼ºÇÔ¤·¤¿¡£");
-#else
- msg_print("The enchantment failed.");
-#endif
+ msg_print(_("強化に失敗した。", "The enchantment failed."));
if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
}
}
+/*
+ * Check if an object is nameless weapon or armour
+ */
+static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
+{
+ /* Require weapon or armour */
+ if (!object_is_weapon_armour_ammo(o_ptr)) return FALSE;
+
+ /* Require nameless object if the object is well known */
+ if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
+ return FALSE;
+
+ return TRUE;
+}
+
+
bool artifact_scroll(void)
{
int item;
item_tester_no_ryoute = TRUE;
+
/* Enchant weapon/armour */
item_tester_hook = item_tester_hook_nameless_weapon_armour;
/* Get an item */
-#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò¶¯²½¤·¤Þ¤¹¤«? ";
- s = "¶¯²½¤Ç¤¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Enchant which item? ";
- s = "You have nothing to enchant.";
-#endif
+ q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
+ s = _("強化できるアイテムがない。", "You have nothing to enchant.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
/* Describe */
#ifdef JP
- msg_format("%s ¤ÏâÁ¤¤¸÷¤òȯ¤·¤¿¡ª",o_name);
+ msg_format("%s は眩い光を発した!",o_name);
#else
msg_format("%s %s radiate%s a blinding light!",
((item >= 0) ? "Your" : "The"), o_name,
((o_ptr->number > 1) ? "" : "s"));
#endif
- if (o_ptr->name1 || o_ptr->art_name)
+ if (object_is_artifact(o_ptr))
{
#ifdef JP
- msg_format("%s¤Ï´û¤ËÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤Ç¤¹¡ª", o_name );
+ msg_format("%sは既に伝説のアイテムです!", o_name );
#else
msg_format("The %s %s already %s!",
o_name, ((o_ptr->number > 1) ? "are" : "is"),
okay = FALSE;
}
- else if (o_ptr->name2)
+ else if (object_is_ego(o_ptr))
{
#ifdef JP
- msg_format("%s¤Ï´û¤Ë̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à¤Ç¤¹¡ª", o_name );
+ msg_format("%sは既に名のあるアイテムです!", o_name );
#else
msg_format("The %s %s already %s!",
o_name, ((o_ptr->number > 1) ? "are" : "is"),
else if (o_ptr->xtra3)
{
#ifdef JP
- msg_format("%s¤Ï´û¤Ë¶¯²½¤µ¤ì¤Æ¤¤¤Þ¤¹¡ª", o_name );
+ msg_format("%sは既に強化されています!", o_name );
#else
msg_format("The %s %s already %s!",
o_name, ((o_ptr->number > 1) ? "are" : "is"),
if (o_ptr->number > 1)
{
#ifdef JP
- msg_print("Ê£¿ô¤Î¥¢¥¤¥Æ¥à¤ËËâË¡¤ò¤«¤±¤ë¤À¤±¤Î¥¨¥Í¥ë¥®¡¼¤Ï¤¢¤ê¤Þ¤»¤ó¡ª");
- msg_format("%d ¸Ä¤Î%s¤¬²õ¤ì¤¿¡ª",(o_ptr->number)-1, o_name);
+ msg_print("複数のアイテムに魔法をかけるだけのエネルギーはありません!");
+ msg_format("%d 個の%sが壊れた!",(o_ptr->number)-1, o_name);
#else
msg_print("Not enough enough energy to enchant more than one object!");
msg_format("%d of your %s %s destroyed!",(o_ptr->number)-1, o_name, (o_ptr->number>2?"were":"was"));
if (flush_failure) flush();
/* Message */
-#ifdef JP
- msg_print("¶¯²½¤Ë¼ºÇÔ¤·¤¿¡£");
-#else
- msg_print("The enchantment failed.");
-#endif
+ msg_print(_("強化に失敗した。", "The enchantment failed."));
if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
}
if (!(o_ptr->ident & (IDENT_MENTAL)))
{
- if ((o_ptr->art_name) || (artifact_p(o_ptr)) || one_in_(5))
+ if (object_is_artifact(o_ptr) || one_in_(5))
chg_virtue(V_KNOWLEDGE, 1);
}
object_aware(o_ptr);
object_known(o_ptr);
+ /* Player touches it */
+ o_ptr->marked |= OM_TOUCHED;
+
/* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
/* Description */
object_desc(o_name, o_ptr, OD_NAME_ONLY);
- if(record_fix_art && !old_known && artifact_p(o_ptr))
+ if(record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
do_cmd_write_nikki(NIKKI_ART, 0, o_name);
if(record_rand_art && !old_known && o_ptr->art_name)
do_cmd_write_nikki(NIKKI_ART, 0, o_name);
static bool item_tester_hook_identify(object_type *o_ptr)
{
- return (bool)!object_known_p(o_ptr);
+ return (bool)!object_is_known(o_ptr);
}
static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
{
- if (object_known_p(o_ptr))
+ if (object_is_known(o_ptr))
return FALSE;
- return item_tester_hook_weapon_armour(o_ptr);
+ return object_is_weapon_armour_ammo(o_ptr);
}
/*
else
item_tester_hook = item_tester_hook_identify;
- if (!can_get_item())
+ if (can_get_item())
+ {
+ q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
+ }
+ else
{
if (only_equip)
- {
- item_tester_hook = item_tester_hook_weapon_armour;
- }
+ item_tester_hook = object_is_weapon_armour_ammo;
else
- {
item_tester_hook = NULL;
- }
- }
- /* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ÕÄꤷ¤Þ¤¹¤«? ";
-s = "´ÕÄꤹ¤ë¤Ù¤¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Identify which item? ";
- s = "You have nothing to identify.";
-#endif
+ q = _("すべて鑑定済みです。 ", "All items are identified. ");
+ }
+
+ /* Get an item */
+ s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
/* Describe */
if (item >= INVEN_RARM)
{
-#ifdef JP
- msg_format("%^s: %s(%c)¡£", describe_use(item), o_name, index_to_label(item));
-#else
- msg_format("%^s: %s (%c).", describe_use(item), o_name, index_to_label(item));
-#endif
+ msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
}
else if (item >= 0)
{
-#ifdef JP
- msg_format("¥¶¥Ã¥¯Ãæ: %s(%c)¡£", o_name, index_to_label(item));
-#else
- msg_format("In your pack: %s (%c).", o_name, index_to_label(item));
-#endif
+ msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
}
else
{
-#ifdef JP
- msg_format("¾²¾å: %s¡£", o_name);
-#else
- msg_format("On the ground: %s.", o_name);
-#endif
+ msg_format(_("床上: %s。", "On the ground: %s."), o_name);
}
/* Auto-inscription/destroy */
object_type *o_ptr;
cptr q, s;
- if (only_equip) item_tester_hook = item_tester_hook_weapon_armour;
+ if (only_equip) item_tester_hook = object_is_weapon_armour_ammo;
item_tester_no_ryoute = TRUE;
/* Get an item */
-#ifdef JP
-q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
-s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Use which item? ";
- s = "You have nothing you can use.";
-#endif
+ q = _("どれを使いますか?", "Use which item? ");
+ s = _("使えるものがありません。", "You have nothing you can use.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
}
/* Oops */
-#ifdef JP
- msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
-#else
- msg_print("There is a bright flash of light!");
-#endif
+ msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
{
byte iy = o_ptr->iy; /* Y-position on map, or zero */
byte ix = o_ptr->ix; /* X-position on map, or zero */
static bool item_tester_hook_identify_fully(object_type *o_ptr)
{
- return (bool)(!object_known_p(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
+ return (bool)(!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
}
static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr)
{
if (!item_tester_hook_identify_fully(o_ptr))
return FALSE;
- return item_tester_hook_weapon_armour(o_ptr);
+ return object_is_weapon_armour_ammo(o_ptr);
}
/*
else
item_tester_hook = item_tester_hook_identify_fully;
- if (!can_get_item())
+ if (can_get_item())
+ {
+ q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
+ }
+ else
{
if (only_equip)
- item_tester_hook = item_tester_hook_weapon_armour;
+ item_tester_hook = object_is_weapon_armour_ammo;
else
item_tester_hook = NULL;
+
+ q = _("すべて*鑑定*済みです。 ", "All items are *identified*. ");
}
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ÕÄꤷ¤Þ¤¹¤«? ";
-s = "´ÕÄꤹ¤ë¤Ù¤¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Identify which item? ";
- s = "You have nothing to identify.";
-#endif
+ s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
/* Describe */
if (item >= INVEN_RARM)
{
-#ifdef JP
- msg_format("%^s: %s(%c)¡£", describe_use(item), o_name, index_to_label(item));
-#else
- msg_format("%^s: %s (%c).", describe_use(item), o_name, index_to_label(item));
-#endif
-
-
+ msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
}
else if (item >= 0)
{
-#ifdef JP
- msg_format("¥¶¥Ã¥¯Ãæ: %s(%c)¡£", o_name, index_to_label(item));
-#else
- msg_format("In your pack: %s (%c).", o_name, index_to_label(item));
-#endif
+ msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
}
else
{
-#ifdef JP
- msg_format("¾²¾å: %s¡£", o_name);
-#else
- msg_format("On the ground: %s.", o_name);
-#endif
+ msg_format(_("床上: %s。", "On the ground: %s."), o_name);
}
/* Describe it fully */
- (void)screen_object(o_ptr, TRUE);
+ (void)screen_object(o_ptr, 0L);
/* Auto-inscription/destroy */
autopick_alter_item(item, (bool)(destroy_identify && !old_known));
item_tester_hook = item_tester_hook_recharge;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËËâÎϤò½¼Å¶¤·¤Þ¤¹¤«? ";
-s = "ËâÎϤò½¼Å¶¤¹¤Ù¤¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Recharge which item? ";
- s = "You have nothing to recharge.";
-#endif
+ q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
+ s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
k_ptr = &k_info[o_ptr->k_idx];
/* Extract the object "level" */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
/* Recharge a rod */
if (fail)
{
/* Artifacts are never destroyed. */
- if (artifact_p(o_ptr))
+ if (object_is_fixed_artifact(o_ptr))
{
object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("ËâÎϤ¬µÕή¤·¤¿¡ª%s¤Ï´°Á´¤ËËâÎϤò¼º¤Ã¤¿¡£", o_name);
-#else
- msg_format("The recharging backfires - %s is completely drained!", o_name);
-#endif
-
+ msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
/* Artifact rods. */
if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout < 10000))
{
if (o_ptr->tval == TV_ROD)
{
-#ifdef JP
-msg_print("ËâÎϤ¬µÕÊ®¼Í¤·¤Æ¡¢¥í¥Ã¥É¤«¤é¤µ¤é¤ËËâÎϤòµÛ¤¤¼è¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
-#else
- msg_print("The recharge backfires, draining the rod further!");
-#endif
+ msg_print(_("魔力が逆噴射して、ロッドからさらに魔力を吸い取ってしまった!", "The recharge backfires, draining the rod further!"));
if (o_ptr->timeout < 10000)
o_ptr->timeout = (o_ptr->timeout + 100) * 2;
}
else if (o_ptr->tval == TV_WAND)
{
-#ifdef JP
-msg_format("%s¤ÏÇË»¤òÌȤ줿¤¬¡¢ËâÎϤ¬Á´¤Æ¼º¤ï¤ì¤¿¡£", o_name);
-#else
- msg_format("You save your %s from destruction, but all charges are lost.", o_name);
-#endif
-
+ msg_format(_("%sは破損を免れたが、魔力が全て失われた。", "You save your %s from destruction, but all charges are lost."), o_name);
o_ptr->pval = 0;
}
/* Staffs aren't drained. */
if (fail_type == 2)
{
if (o_ptr->number > 1)
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬°ìËܲõ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes one of your %s!", o_name);
-#endif
-
+ msg_format(_("乱暴な魔法のために%sが一本壊れた!", "Wild magic consumes one of your %s!"), o_name);
else
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
+ msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
/* Reduce rod stack maximum timeout, drain wands. */
if (o_ptr->tval == TV_ROD) o_ptr->timeout = (o_ptr->number - 1) * k_ptr->pval;
if (fail_type == 3)
{
if (o_ptr->number > 1)
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬Á´¤Æ²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes all your %s!", o_name);
-#endif
-
+ msg_format(_("乱暴な魔法のために%sが全て壊れた!", "Wild magic consumes all your %s!"), o_name);
else
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
-
+ msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
/* Reduce and describe inventory */
if (item >= 0)
cptr q, s;
item_tester_no_ryoute = TRUE;
- /* Assume enchant weapon */
- item_tester_hook = item_tester_hook_weapon2;
+
+ /* Bless only weapons */
+ item_tester_hook = object_is_weapon;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò½ËÊ¡¤·¤Þ¤¹¤«¡©";
-s = "½ËÊ¡¤Ç¤¤ëÉð´ï¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Bless which weapon? ";
- s = "You have weapon to bless.";
-#endif
+ q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
+ s = _("祝福できる武器がありません。", "You have weapon to bless.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR)))
return FALSE;
/* Extract the flags */
object_flags(o_ptr, flgs);
- if (cursed_p(o_ptr))
+ if (object_is_cursed(o_ptr))
{
if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
+ have_flag(flgs, TR_ADD_L_CURSE) ||
+ have_flag(flgs, TR_ADD_H_CURSE) ||
(o_ptr->curse_flags & TRC_PERMA_CURSE))
{
#ifdef JP
-msg_format("%s¤òʤ¤¦¹õ¤¤¥ª¡¼¥é¤Ï½ËÊ¡¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
+msg_format("%sを覆う黒いオーラは祝福を跳ね返した!",
o_name);
#else
msg_format("The black aura on %s %s disrupts the blessing!",
}
#ifdef JP
-msg_format("%s ¤«¤é¼Ù°¤Ê¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£",
+msg_format("%s から邪悪なオーラが消えた。",
o_name);
#else
msg_format("A malignant aura leaves %s %s.",
if (have_flag(flgs, TR_BLESSED))
{
#ifdef JP
-msg_format("%s ¤Ï´û¤Ë½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¡£",
+msg_format("%s は既に祝福されている。",
o_name );
#else
msg_format("%s %s %s blessed already.",
return TRUE;
}
- if (!(o_ptr->art_name || o_ptr->name1 || o_ptr->name2) || one_in_(3))
+ if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
{
/* Describe */
#ifdef JP
-msg_format("%s¤Ïµ±¤¤¤¿¡ª",
+msg_format("%sは輝いた!",
o_name);
#else
msg_format("%s %s shine%s!",
else
{
bool dis_happened = FALSE;
-
-#ifdef JP
-msg_print("¤½¤ÎÉð´ï¤Ï½ËÊ¡¤ò·ù¤Ã¤Æ¤¤¤ë¡ª");
-#else
- msg_print("The weapon resists your blessing!");
-#endif
-
+ msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
/* Disenchant tohit */
if (o_ptr->to_h > 0)
if (dis_happened)
{
-#ifdef JP
-msg_print("¼þ°Ï¤¬ËÞÍǤÊÊ·°Ïµ¤¤ÇËþ¤Á¤¿...");
-#else
- msg_print("There is a static feeling in the air...");
-#endif
+ msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
#ifdef JP
-msg_format("%s ¤ÏÎô²½¤·¤¿¡ª",
+msg_format("%s は劣化した!",
o_name );
#else
msg_format("%s %s %s disenchanted!",
item_tester_tval = TV_SHIELD;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î½â¤òËᤤޤ¹¤«¡©";
-s = "Ë᤯½â¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Pulish which weapon? ";
- s = "You have weapon to pulish.";
-#endif
+ q = _("どの盾を磨きますか?", "Pulish which weapon? ");
+ s = _("磨く盾がありません。", "You have weapon to pulish.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR)))
return FALSE;
/* Extract the flags */
object_flags(o_ptr, flgs);
- if (o_ptr->k_idx && !artifact_p(o_ptr) && !ego_item_p(o_ptr) &&
- !o_ptr->art_name && !cursed_p(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
+ if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
+ !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
{
#ifdef JP
-msg_format("%s¤Ïµ±¤¤¤¿¡ª", o_name);
+msg_format("%sは輝いた!", o_name);
#else
msg_format("%s %s shine%s!",
((item >= 0) ? "Your" : "The"), o_name,
{
if (flush_failure) flush();
-#ifdef JP
-msg_print("¼ºÇÔ¤·¤¿¡£");
-#else
- msg_print("Failed.");
-#endif
-
+ msg_print(_("失敗した。", "Failed."));
chg_virtue(V_ENCHANT, -2);
}
calc_android_exp();
int i, j;
int y, x;
int m[9];
- magic_type *s_ptr;
+ const magic_type *s_ptr;
char name[80];
char out_val[160];
if (p_ptr->pclass == CLASS_SORCERER) return;
if (p_ptr->pclass == CLASS_RED_MAGE) return;
+ /* Snipers */
+ if (p_ptr->pclass == CLASS_SNIPER)
+ {
+ display_snipe_list();
+ return;
+ }
+
/* mind.c type classes */
if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
(p_ptr->pclass == CLASS_BERSERKER) ||
/* Display a list of spells */
prt("", y, x);
-#ifdef JP
-put_str("̾Á°", y, x + 5);
-put_str("Lv MP ¼ºÎ¨ ¸ú²Ì", y, x + 35);
-#else
- put_str("Name", y, x + 5);
- put_str("Lv Mana Fail Info", y, x + 35);
-#endif
+ put_str(_("名前", "Name"), y, x + 5);
+ put_str(_("Lv MP 失率 効果", "Lv Mana Fail Info"), y, x + 35);
switch(p_ptr->pclass)
{
s_ptr = &mp_ptr->info[((j < 1) ? p_ptr->realm1 : p_ptr->realm2) - 1][i % 32];
}
- strcpy(name, spell_names[technic2magic((j < 1) ? p_ptr->realm1 : p_ptr->realm2)-1][i % 32]);
+ strcpy(name, do_spell((j < 1) ? p_ptr->realm1 : p_ptr->realm2, i % 32, SPELL_NAME));
/* Illegible */
if (s_ptr->slevel >= 99)
{
/* Illegible */
-#ifdef JP
-strcpy(name, "(ȽÆÉÉÔǽ)");
-#else
- strcpy(name, "(illegible)");
-#endif
-
+ strcpy(name, _("(判読不能)", "(illegible)"));
/* Unusable */
a = TERM_L_DARK;
s16b spell_chance(int spell, int use_realm)
{
int chance, minfail;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
int need_mana;
int penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
chance = mod_spell_chance_1(chance);
- if ((use_realm == REALM_NATURE) && ((p_ptr->align > 50) || (p_ptr->align < -50))) chance += penalty;
- if (((use_realm == REALM_LIFE) || (use_realm == REALM_CRUSADE)) && (p_ptr->align < -20)) chance += penalty;
- if (((use_realm == REALM_DEATH) || (use_realm == REALM_DAEMON)) && (p_ptr->align > 20)) chance += penalty;
-
- /* Minimum failure rate */
- if (chance < minfail) chance = minfail;
-
- /* Stunning makes spells harder */
- if (p_ptr->stun > 50) chance += 25;
- else if (p_ptr->stun) chance += 15;
-
- /* Always a 5 percent chance of working */
- if (chance > 95) chance = 95;
-
- if ((use_realm == p_ptr->realm1) || (use_realm == p_ptr->realm2)
- || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
- {
- s16b exp = experience_of_spell(spell, use_realm);
- if (exp >= SPELL_EXP_EXPERT) chance--;
- if (exp >= SPELL_EXP_MASTER) chance--;
- }
-
- /* Return the chance */
- return mod_spell_chance_2(chance);
-}
-
-
-
-/*
- * Determine if a spell is "okay" for the player to cast or study
- * The spell must be legible, not forgotten, and also, to cast,
- * it must be known, and to study, it must not be known.
- */
-bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
-{
- magic_type *s_ptr;
-
- /* Access the spell */
- if (!is_magic(use_realm))
- {
- s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
- }
- else
- {
- s_ptr = &mp_ptr->info[use_realm - 1][spell];
- }
-
- /* Spell is illegal */
- if (s_ptr->slevel > p_ptr->lev) return (FALSE);
-
- /* Spell is forgotten */
- if ((use_realm == p_ptr->realm2) ?
- (p_ptr->spell_forgotten2 & (1L << spell)) :
- (p_ptr->spell_forgotten1 & (1L << spell)))
- {
- /* Never okay */
- return (FALSE);
- }
-
- if (p_ptr->pclass == CLASS_SORCERER) return (TRUE);
- if (p_ptr->pclass == CLASS_RED_MAGE) return (TRUE);
-
- /* Spell is learned */
- if ((use_realm == p_ptr->realm2) ?
- (p_ptr->spell_learned2 & (1L << spell)) :
- (p_ptr->spell_learned1 & (1L << spell)))
- {
- /* Always true */
- return (!study_pray);
- }
-
- /* Okay to study, not to cast */
- return (!learned);
-}
-
-
-
-/*
- * Extra information on a spell -DRS-
- *
- * We can use up to 14 characters of the buffer 'p'
- *
- * The strings in this function were extracted from the code in the
- * functions "do_cmd_cast()" and "do_cmd_pray()" and may be dated.
- */
-static void spell_info(char *p, int spell, int use_realm)
-{
- int plev = p_ptr->lev;
-
- /* See below */
- int orb = plev + (plev / ((p_ptr->pclass == CLASS_PRIEST ||
- p_ptr->pclass == CLASS_HIGH_MAGE ||
- p_ptr->pclass == CLASS_SORCERER) ? 2 : 4));
-
- int burst = plev + (plev / ((p_ptr->pclass == CLASS_MAGE ||
- p_ptr->pclass == CLASS_HIGH_MAGE ||
- p_ptr->pclass == CLASS_SORCERER) ? 2 : 4));
-#ifdef JP
- cptr s_dam = "»½ý:";
- cptr s_dur = "´ü´Ö:";
- cptr s_range = "ÈÏ°Ï:";
- cptr s_heal = "²óÉü:";
- cptr s_random = "¥é¥ó¥À¥à";
- cptr s_delay = "ÃÙ±ä:";
-#else
- cptr s_dam = "dam ";
- cptr s_dur = "dur ";
- cptr s_range = "range ";
- cptr s_heal = "heal ";
- cptr s_random = "random";
- cptr s_delay = "delay ";
-#endif
- /* Default */
- strcpy(p, "");
-
- /* Analyze the spell */
- switch (use_realm)
- {
- case REALM_LIFE: /* Life */
- switch (spell)
- {
- case 0: sprintf(p, " %s2d10", s_heal); break;
- case 1: sprintf(p, " %s12+d12", s_dur); break;
- case 2: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5)); break;
- case 3: sprintf(p, " %s%d", s_dam, 10 + (plev / 2)); break;
- case 5: sprintf(p, " %s4d10", s_heal); break;
- case 9: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 1) / 5)); break;
- case 10: sprintf(p, " %s8d10", s_heal); break;
- case 11: sprintf(p, " %s20+d20", s_dur); break;
- case 14: sprintf(p, " %s300", s_heal); break;
- case 18: sprintf(p, " %sd%d", s_dam, 5 * plev); break;
- case 20: sprintf(p, " %s%dd15", s_dam, 5 + ((plev - 1) / 3)); break;
- case 21: sprintf(p, " %s15+d21", s_delay); break;
- case 29: sprintf(p, " %s2000", s_heal); break;
- case 31: sprintf(p, " %s%d+d%d", s_dur,(plev/2), (plev/2)); break;
- }
- break;
-
- case REALM_SORCERY: /* Sorcery */
- switch (spell)
- {
- case 1: sprintf(p, " %s10", s_range); break;
- case 3: sprintf(p, " %s%d", s_dam, 10 + (plev / 2)); break;
- case 5: sprintf(p, " %s%d", s_range, plev * 5); break;
- case 13: sprintf(p, " %s%d+d%d", s_dur, plev, plev + 20); break;
- case 18: sprintf(p, " %s25+d30", s_dur); break;
- case 22: sprintf(p, " %s15+d21", s_delay); break;
- case 23: sprintf(p, " %s%d", s_range, plev / 2 + 10); break;
- case 25: sprintf(p, " %s7d7+%d", s_dam, plev); break;
-#ifdef JP
- case 26: sprintf(p, " ºÇÂç½ÅÎÌ:%d.%dkg", lbtokg1(plev * 15),lbtokg2(plev * 15)); break;
-#else
- case 26: sprintf(p, " max wgt %d", plev * 15 / 10); break;
-#endif
- case 27: sprintf(p, " %s25+d30", s_dur); break;
- case 31: sprintf(p, " %s4+d4", s_dur); break;
- }
- break;
-
- case REALM_NATURE: /* Nature */
- switch (spell)
- {
-#ifdef JP
- case 1: sprintf(p, " %s%dd4 ¼ÍÄø%d", s_dam, (3 + ((plev - 1) / 5)), plev/6+2); break;
-#else
- case 1: sprintf(p, " %s%dd4 rng %d", s_dam, (3 + ((plev - 1) / 5)), plev/6+2); break;
-#endif
- case 4: sprintf(p, " %s%d", s_dam, 10 + (plev / 2)); break;
- case 6: sprintf(p, " %s20+d20", s_dur); break;
- case 7: sprintf(p, " %s2d8", s_heal); break;
- case 9: sprintf(p, " %s%dd8", s_dam, (3 + ((plev - 5) / 4))); break;
- case 11: sprintf(p, " %s%dd8", s_dam, (5 + ((plev - 5) / 4))); break;
- case 12: sprintf(p, " %s6d8", s_dam); break;
- case 15: sprintf(p, " %s500", s_heal); break;
- case 17: sprintf(p, " %s20+d30", s_dur); break;
- case 18: sprintf(p, " %s20+d20", s_dur); break;
-#ifdef JP
- case 24: sprintf(p, " Ⱦ·Â:10"); break;
-#else
- case 24: sprintf(p, " rad 10"); break;
-#endif
- case 26: sprintf(p, " %s%d", s_dam, 70 + plev * 3 / 2); break;
- case 27: sprintf(p, " %s%d", s_dam, 90 + plev * 3 / 2); break;
- case 28: sprintf(p, " %s%d", s_dam, 100 + plev * 3 / 2); break;
- case 29: sprintf(p, " %s75", s_dam); break;
- case 31: sprintf(p, " %s%d+%d", s_dam, 4 * plev, 100 + plev); break;
- }
- break;
-
- case REALM_CHAOS: /* Chaos */
- switch (spell)
- {
- case 0: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5)); break;
- case 2: sprintf(p, " %s%d", s_dam, 10 + (plev / 2)); break;
- case 4: sprintf(p, " %s3d5+%d", s_dam, burst); break;
- case 5: sprintf(p, " %s%dd8", s_dam, (6 + ((plev - 5) / 4))); break;
- case 6: sprintf(p, " %s%dd8", s_dam, (8 + ((plev - 5) / 4))); break;
- case 7: sprintf(p, " %s%d", s_range, plev * 5); break;
- case 8: sprintf(p, " %s", s_random); break;
- case 9: sprintf(p, " %s%dd8", s_dam, (10 + ((plev - 5) / 4))); break;
- case 10: sprintf(p, " %s%d", s_dam, (60 + plev)/2); break;
- case 11: sprintf(p, " %s%dd8", s_dam, (11 + ((plev - 5) / 4))); break;
- case 12: sprintf(p, " %s%d", s_dam, 55 + plev); break;
- case 15: sprintf(p, " %s%d", s_dam, 99 + plev*2); break;
- case 17: sprintf(p, " %s%dd8", s_dam, (5 + (plev / 10))); break;
- case 19: sprintf(p, " %s%d", s_dam, 70 + plev); break;
- case 21: sprintf(p, " %s%d", s_dam, 120 + plev*2); break;
- case 24: sprintf(p, " %s%dd8", s_dam, (9 + (plev / 10))); break;
-#ifdef JP
- case 25: sprintf(p, " %s³Æ%d", s_dam, plev * 2); break;
-#else
- case 25: sprintf(p, " dam %d each", plev * 2); break;
-#endif
- case 26: sprintf(p, " %s%d", s_dam, 150 + plev*3/2); break;
- case 27: sprintf(p, " %s150 / 250", s_dam); break;
- case 29: sprintf(p, " %s%d", s_dam, 300 + (plev * 4)); break;
- case 30: sprintf(p, " %s%ld", s_dam, p_ptr->chp); break;
- case 31: sprintf(p, " %s3 * 175", s_dam); break;
- }
- break;
-
- case REALM_DEATH: /* Death */
- switch (spell)
- {
- case 1: sprintf(p, " %s%dd3", s_dam, (3 + ((plev - 1) / 5))); break;
- case 3: sprintf(p, " %s%d", s_dam, 10 + (plev / 2)); break;
- case 5: sprintf(p, " %s20+d20", s_dur); break;
- case 8: sprintf(p, " %s3d6+%d", s_dam, burst); break;
- case 9: sprintf(p, " %s%dd8", s_dam, (8 + ((plev - 5) / 4))); break;
- case 10: sprintf(p, " %s%d", s_dam, 30+plev); break;
-#ifdef JP
- case 13: sprintf(p, " »:%d+d%d", plev * 2, plev * 2); break;
-#else
- case 13: sprintf(p, " d %d+d%d", plev * 2, plev * 2); break;
-#endif
- case 16: sprintf(p, " %s25+d25", s_dur); break;
- case 17: sprintf(p, " %s", s_random); break;
- case 18: sprintf(p, " %s%dd8", s_dam, (4 + ((plev - 5) / 4))); break;
- case 19: sprintf(p, " %s25+d25", s_dur); break;
- case 21: sprintf(p, " %s3*100", s_dam); break;
- case 22: sprintf(p, " %sd%d", s_dam, plev * 3); break;
- case 23: sprintf(p, " %s%d", s_dam, 100 + plev * 2); break;
- case 27: sprintf(p, " %s%d+d%d", s_dur,10+plev/2, 10+plev/2); break;
- case 30: sprintf(p, " %s666", s_dam); break;
- case 31: sprintf(p, " %s%d+d%d", s_dur, (plev / 2), (plev / 2)); break;
- }
- break;
-
- case REALM_TRUMP: /* Trump */
- switch (spell)
- {
- case 0: sprintf(p, " %s10", s_range); break;
- case 2: sprintf(p, " %s", s_random); break;
- case 4: sprintf(p, " %s%d", s_range, plev * 4); break;
- case 5: sprintf(p, " %s25+d30", s_dur); break;
-#ifdef JP
- case 8: sprintf(p, " ºÇÂç½ÅÎÌ:%d.%d", lbtokg1(plev * 15 / 10),lbtokg2(plev * 15 / 10)); break;
-#else
- case 8: sprintf(p, " max wgt %d", plev * 15 / 10); break;
-#endif
- case 13: sprintf(p, " %s%d", s_range, plev / 2 + 10); break;
- case 14: sprintf(p, " %s15+d21", s_delay); break;
- case 26: sprintf(p, " %s%d", s_heal, plev * 10 + 200); break;
-#ifdef JP
- case 28: sprintf(p, " %s³Æ%d", s_dam, plev * 2); break;
-#else
- case 28: sprintf(p, " %s%d each", s_dam, plev * 2); break;
-#endif
- }
- break;
-
- case REALM_ARCANE: /* Arcane */
- switch (spell)
- {
- case 0: sprintf(p, " %s%dd3", s_dam, 3 + ((plev - 1) / 5)); break;
- case 4: sprintf(p, " %s10", s_range); break;
- case 5: sprintf(p, " %s2d%d", s_dam, plev / 2); break;
- case 7: sprintf(p, " %s2d8", s_heal); break;
- case 14:
- case 15:
- case 16:
- case 17: sprintf(p, " %s20+d20", s_dur); break;
- case 18: sprintf(p, " %s4d8", s_heal); break;
- case 19: sprintf(p, " %s%d", s_range, plev * 5); break;
- case 21: sprintf(p, " %s6d8", s_dam); break;
- case 24: sprintf(p, " %s24+d24", s_dur); break;
- case 28: sprintf(p, " %s%d", s_dam, 75 + plev); break;
- case 30: sprintf(p, " %s15+d21", s_delay); break;
- case 31: sprintf(p, " %s25+d30", s_dur); break;
- }
- break;
-
- case REALM_ENCHANT: /* Craft */
- switch (spell)
- {
- case 0: sprintf(p, " %s100+d100", s_dur); break;
- case 1: sprintf(p, " %s80+d80", s_dur); break;
- case 3:
- case 4:
- case 6:
- case 7:
- case 10:
- case 18: sprintf(p, " %s20+d20", s_dur); break;
- case 5: sprintf(p, " %s25+d25", s_dur); break;
- case 8: sprintf(p, " %s24+d24", s_dur); break;
- case 11: sprintf(p, " %s25+d25", s_dur); break;
- case 13: sprintf(p, " %s%d+d25", s_dur, plev * 3); break;
- case 15: sprintf(p, " %s%d+d%d", s_dur, plev/2, plev/2); break;
- case 16: sprintf(p, " %s25+d30", s_dur); break;
- case 17: sprintf(p, " %s30+d20", s_dur); break;
- case 19: sprintf(p, " %s%d+d%d", s_dur, plev, plev+20); break;
- case 20: sprintf(p, " %s50+d50", s_dur); break;
- case 23: sprintf(p, " %s20+d20", s_dur); break;
- case 31: sprintf(p, " %s13+d13", s_dur); break;
- }
- break;
-
- case REALM_DAEMON: /* Daemon */
- switch (spell)
- {
- case 0: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5)); break;
- case 2: sprintf(p, " %s12+d12", s_dur); break;
- case 3: sprintf(p, " %s20+d20", s_dur); break;
- case 5: sprintf(p, " %s%dd8", s_dam, (6 + ((plev - 5) / 4))); break;
- case 7: sprintf(p, " %s3d6+%d", s_dam, burst); break;
- case 10: sprintf(p, " %s20+d20", s_dur); break;
- case 11: sprintf(p, " %s%dd8", s_dam, (11 + ((plev - 5) / 4))); break;
- case 12: sprintf(p, " %s%d", s_dam, 55 + plev); break;
- case 14: sprintf(p, " %s%d", s_dam, 100 + plev*3/2); break;
- case 16: sprintf(p, " %s30+d25", s_dur); break;
- case 17: sprintf(p, " %s20+d20", s_dur); break;
- case 18: sprintf(p, " %s%d", s_dam, 55 + plev); break;
- case 19: sprintf(p, " %s%d", s_dam, 80 + plev*3/2); break;
- case 20: sprintf(p, " %s%d+d%d", s_dur,10+plev/2, 10+plev/2); break;
- case 21: sprintf(p, " %sd%d+d%d", s_dam, 2 * plev, 2 * plev); break;
- case 22: sprintf(p, " %s%d", s_dam, 100 + plev*2); break;
- case 24: sprintf(p, " %s25+d25", s_dur); break;
- case 25: sprintf(p, " %s20+d20", s_dur); break;
- case 26: sprintf(p, " %s%d+%d", s_dam, 25+plev/2, 25+plev/2); break;
- case 29: sprintf(p, " %s%d", s_dam, plev*15); break;
- case 30: sprintf(p, " %s600", s_dam); break;
- case 31: sprintf(p, " %s15+d15", s_dur); break;
- }
- break;
-
- case REALM_CRUSADE: /* Crusade */
- switch (spell)
- {
- case 0: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5)); break;
- case 5: sprintf(p, " %s%d", s_range, 25+plev/2); break;
-#ifdef JP
- case 6: sprintf(p, " %s³Æ%dd2", s_dam, 3+((plev-1)/9)); break;
-#else
- case 6: sprintf(p, " %s%dd2 each", s_dam, 3+((plev-1)/9)); break;
-#endif
- case 9: sprintf(p, " %s3d6+%d", s_dam, orb); break;
- case 10: sprintf(p, " %sd%d", s_dam, plev); break;
- case 12: sprintf(p, " %s24+d24", s_dur); break;
- case 13: sprintf(p, " %sd25+%d", s_dur, 3 * plev); break;
- case 14: sprintf(p, " %s%d", s_dam, plev*5); break;
-#ifdef JP
- case 15: sprintf(p, " »:d%d/²ó:100", 6 * plev); break;
-#else
- case 15: sprintf(p, " dam:d%d/h100", 6 * plev); break;
-#endif
- case 18: sprintf(p, " %s18+d18", s_dur); break;
- case 19: sprintf(p, " %sd%d", s_dam, 4 * plev); break;
- case 20: sprintf(p, " %sd%d", s_dam, 4 * plev); break;
- case 22: sprintf(p, " %s%d", s_dam, 2 * plev+100); break;
- case 24: sprintf(p, " %s25+d25", s_dur); break;
- case 28: sprintf(p, " %s10+d10", s_dur); break;
-#ifdef JP
- case 29: sprintf(p, " %s³Æ%d", s_dam, plev*3+25); break;
-#else
- case 29: sprintf(p, " %s%d each", s_dam, plev*3+25); break;
-#endif
-#ifdef JP
- case 30: sprintf(p, " ²ó100/»%d+%d", plev * 4, plev*11/2); break;
-#else
- case 30: sprintf(p, " h100/dm%d+%d", plev * 4, plev*11/2); break;
-#endif
- }
- break;
-
- case REALM_MUSIC: /* Music */
- switch (spell)
- {
- case 2 : sprintf(p, " %s%dd4", s_dam, 4 + ((plev - 1) / 5)); break;
- case 4 : sprintf(p, " %s2d6", s_heal); break;
- case 9 : sprintf(p, " %sd%d", s_dam, plev * 3 / 2); break;
- case 13: sprintf(p, " %s%dd7", s_dam, 10 + (plev / 5)); break;
- case 20: sprintf(p, " %sd%d+d%d", s_dam, plev * 3, plev * 3); break;
- case 22: sprintf(p, " %s%dd10", s_dam, 15 + ((plev - 1) / 2)); break;
- case 27: sprintf(p, " %sd%d", s_dam, plev * 3); break;
- case 28: sprintf(p, " %s15d10", s_heal); break;
- case 30: sprintf(p, " %s%dd10", s_dam, 50 + plev); break;
- }
+ /* Goodness or evilness gives a penalty to failure rate */
+ switch (use_realm)
+ {
+ case REALM_NATURE:
+ if ((p_ptr->align > 50) || (p_ptr->align < -50)) chance += penalty;
break;
- default:
-#ifdef JP
- sprintf(p, "̤ÃΤΥ¿¥¤¥×: %d", use_realm);
-#else
- sprintf(p, "Unknown type: %d.", use_realm);
-#endif
+ case REALM_LIFE: case REALM_CRUSADE:
+ if (p_ptr->align < -20) chance += penalty;
+ break;
+ case REALM_DEATH: case REALM_DAEMON: case REALM_HEX:
+ if (p_ptr->align > 20) chance += penalty;
+ break;
+ }
+
+ /* Minimum failure rate */
+ if (chance < minfail) chance = minfail;
+
+ /* Stunning makes spells harder */
+ if (p_ptr->stun > 50) chance += 25;
+ else if (p_ptr->stun) chance += 15;
+
+ /* Always a 5 percent chance of working */
+ if (chance > 95) chance = 95;
+
+ if ((use_realm == p_ptr->realm1) || (use_realm == p_ptr->realm2)
+ || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
+ {
+ s16b exp = experience_of_spell(spell, use_realm);
+ if (exp >= SPELL_EXP_EXPERT) chance--;
+ if (exp >= SPELL_EXP_MASTER) chance--;
+ }
+
+ /* Return the chance */
+ return mod_spell_chance_2(chance);
+}
+
+
+
+/*
+ * Determine if a spell is "okay" for the player to cast or study
+ * The spell must be legible, not forgotten, and also, to cast,
+ * it must be known, and to study, it must not be known.
+ */
+bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
+{
+ const magic_type *s_ptr;
+
+ /* Access the spell */
+ if (!is_magic(use_realm))
+ {
+ s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
+ }
+ else
+ {
+ s_ptr = &mp_ptr->info[use_realm - 1][spell];
+ }
+
+ /* Spell is illegal */
+ if (s_ptr->slevel > p_ptr->lev) return (FALSE);
+
+ /* Spell is forgotten */
+ if ((use_realm == p_ptr->realm2) ?
+ (p_ptr->spell_forgotten2 & (1L << spell)) :
+ (p_ptr->spell_forgotten1 & (1L << spell)))
+ {
+ /* Never okay */
+ return (FALSE);
+ }
+
+ if (p_ptr->pclass == CLASS_SORCERER) return (TRUE);
+ if (p_ptr->pclass == CLASS_RED_MAGE) return (TRUE);
+
+ /* Spell is learned */
+ if ((use_realm == p_ptr->realm2) ?
+ (p_ptr->spell_learned2 & (1L << spell)) :
+ (p_ptr->spell_learned1 & (1L << spell)))
+ {
+ /* Always true */
+ return (!study_pray);
}
+
+ /* Okay to study, not to cast */
+ return (!learned);
}
void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
{
int i, spell, exp_level, increment = 64;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
cptr comment;
char info[80];
char out_val[160];
if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && p_ptr->wizard)
-#ifdef JP
-msg_print("·Ù¹ð¡ª print_spell ¤¬Îΰè¤Ê¤·¤Ë¸Æ¤Ð¤ì¤¿");
-#else
- msg_print("Warning! print_spells called with null realm");
-#endif
-
+ msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm"));
/* Title the list */
prt("", y, x);
if (use_realm == REALM_HISSATSU)
-#ifdef JP
- strcpy(buf," Lv MP");
-#else
- strcpy(buf," Lv SP");
-#endif
+ strcpy(buf,_(" Lv MP", " Lv SP"));
else
-#ifdef JP
- strcpy(buf,"½ÏÎýÅÙ Lv MP ¼ºÎ¨ ¸ú²Ì");
-#else
- strcpy(buf,"Profic Lv SP Fail Effect");
-#endif
+ strcpy(buf,_("熟練度 Lv MP 失率 効果", "Profic Lv SP Fail Effect"));
-#ifdef JP
-put_str("̾Á°", y, x + 5);
-put_str(buf, y, x + 29);
-#else
- put_str("Name", y, x + 5);
+ put_str(_("名前", "Name"), y, x + 5);
put_str(buf, y, x + 29);
-#endif
if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) increment = 0;
else if (use_realm == p_ptr->realm1) increment = 0;
if (use_menu && target_spell)
{
if (i == (target_spell-1))
-#ifdef JP
- strcpy(out_val, " ¡Õ ");
-#else
- strcpy(out_val, " > ");
-#endif
+ strcpy(out_val, _(" 》 ", " > "));
else
strcpy(out_val, " ");
}
/* Skip illegible spells */
if (s_ptr->slevel >= 99)
{
-#ifdef JP
-strcat(out_val, format("%-30s", "(ȽÆÉÉÔǽ)"));
-#else
- strcat(out_val, format("%-30s", "(illegible)"));
-#endif
-
- c_prt(TERM_L_DARK, out_val, y + i + 1, x);
- continue;
+ strcat(out_val, format("%-30s", _("(判読不能)", "(illegible)")));
+ c_prt(TERM_L_DARK, out_val, y + i + 1, x);
+ continue;
}
/* XXX XXX Could label spells above the players level */
/* Get extra info */
- spell_info(info, spell, use_realm);
+ strcpy(info, do_spell(use_realm, spell, SPELL_INFO));
/* Use that info */
comment = info;
{
if (s_ptr->slevel > p_ptr->max_plv)
{
-#ifdef JP
-comment = " ̤ÃÎ";
-#else
- comment = " unknown";
-#endif
-
+ comment = _("未知", "unknown");
line_attr = TERM_L_BLUE;
}
else if (s_ptr->slevel > p_ptr->lev)
{
-#ifdef JP
-comment = " ˺µÑ";
-#else
- comment = " forgotten";
-#endif
-
+ comment = _("忘却", "forgotten");
line_attr = TERM_YELLOW;
}
}
else if ((use_realm != p_ptr->realm1) && (use_realm != p_ptr->realm2))
{
-#ifdef JP
-comment = " ̤ÃÎ";
-#else
- comment = " unknown";
-#endif
-
+ comment = _("未知", "unknown");
line_attr = TERM_L_BLUE;
}
else if ((use_realm == p_ptr->realm1) ?
((p_ptr->spell_forgotten1 & (1L << spell))) :
((p_ptr->spell_forgotten2 & (1L << spell))))
{
-#ifdef JP
-comment = " ˺µÑ";
-#else
- comment = " forgotten";
-#endif
-
+ comment = _("忘却", "forgotten");
line_attr = TERM_YELLOW;
}
else if (!((use_realm == p_ptr->realm1) ?
(p_ptr->spell_learned1 & (1L << spell)) :
(p_ptr->spell_learned2 & (1L << spell))))
{
-#ifdef JP
-comment = " ̤ÃÎ";
-#else
- comment = " unknown";
-#endif
-
+ comment = _("未知", "unknown");
line_attr = TERM_L_BLUE;
}
else if (!((use_realm == p_ptr->realm1) ?
(p_ptr->spell_worked1 & (1L << spell)) :
(p_ptr->spell_worked2 & (1L << spell))))
{
-#ifdef JP
-comment = " ̤·Ð¸³";
-#else
- comment = " untried";
-#endif
-
+ comment = _("未経験", "untried");
line_attr = TERM_L_GREEN;
}
if (use_realm == REALM_HISSATSU)
{
strcat(out_val, format("%-25s %2d %4d",
- spell_names[technic2magic(use_realm)-1][spell], /* realm, spell */
+ do_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
s_ptr->slevel, need_mana));
}
else
{
- strcat(out_val, format("%-25s%c%-4s %2d %4d %3d%%%s",
- spell_names[technic2magic(use_realm)-1][spell], /* realm, spell */
+ strcat(out_val, format("%-25s%c%-4s %2d %4d %3d%% %s",
+ do_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
(max ? '!' : ' '), ryakuji,
s_ptr->slevel, need_mana, spell_chance(spell, use_realm), comment));
}
case TV_DEATH_BOOK:
case TV_TRUMP_BOOK:
case TV_ARCANE_BOOK:
- case TV_ENCHANT_BOOK:
+ case TV_CRAFT_BOOK:
case TV_DAEMON_BOOK:
case TV_CRUSADE_BOOK:
case TV_MUSIC_BOOK:
case TV_HISSATSU_BOOK:
+ case TV_HEX_BOOK:
{
return (TRUE);
}
object_type *o_ptr;
char o_name[MAX_NLEN];
- /* Multishadow effects is determined by turn */
- if( p_ptr->multishadow && (turn & 1) )return 0;
+ if (CHECK_MULTISHADOW()) return 0;
if (p_ptr->inside_arena) return 0;
if (!o_ptr->k_idx) continue;
/* Hack -- for now, skip artifacts */
- if (artifact_p(o_ptr) || o_ptr->art_name) continue;
+ if (object_is_artifact(o_ptr)) continue;
/* Give this item slot a shot at death */
if ((*typ)(o_ptr))
object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
/* Message */
-#ifdef JP
-msg_format("%s(%c)¤¬%s²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª",
-#else
- msg_format("%sour %s (%c) %s destroyed!",
-#endif
+ msg_format(_("%s(%c)が%s壊れてしまった!", "%sour %s (%c) %s destroyed!"),
#ifdef JP
o_name, index_to_label(i),
((o_ptr->number > 1) ?
- ((amt == o_ptr->number) ? "Á´Éô" :
- (amt > 1 ? "²¿¸Ä¤«" : "°ì¸Ä")) : "") );
+ ((amt == o_ptr->number) ? "全部" :
+ (amt > 1 ? "何個か" : "一個")) : "") );
#else
((o_ptr->number > 1) ?
((amt == o_ptr->number) ? "All of y" :
#ifdef JP
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
- msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
+ msg_print("やりやがったな!");
#endif
/* Potions smash open */
/* Nothing to damage */
if (!o_ptr->k_idx) return (FALSE);
- if (o_ptr->tval <= TV_WEAPON_END) return (FALSE);
+ if (!object_is_armour(o_ptr)) return (FALSE);
/* No damage left to be done */
if (o_ptr->ac + o_ptr->to_a <= 0) return (FALSE);
/* Object resists */
if (have_flag(flgs, TR_IGNORE_ACID))
{
-#ifdef JP
-msg_format("¤·¤«¤·%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", o_name);
-#else
- msg_format("Your %s is unaffected!", o_name);
-#endif
-
-
+ msg_format(_("しかし%sには効果がなかった!", "Your %s is unaffected!"), o_name);
return (TRUE);
}
/* Message */
-#ifdef JP
-msg_format("%s¤¬¥À¥á¡¼¥¸¤ò¼õ¤±¤¿¡ª", o_name);
-#else
- msg_format("Your %s is damaged!", o_name);
-#endif
-
+ msg_format(_("%sがダメージを受けた!", "Your %s is damaged!"), o_name);
/* Damage the item */
o_ptr->to_a--;
/*
* Hurt the player with Acid
*/
-int acid_dam(int dam, cptr kb_str, int monspell)
+int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_acid) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_acid)) &&
- one_in_(HURT_CHANCE))
- (void)do_dec_stat(A_CHR);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_acid)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_CHR);
- /* If any armor gets hit, defend the player */
- if (minus_ac()) dam = (dam + 1) / 2;
+ /* If any armor gets hit, defend the player */
+ if (minus_ac()) dam = (dam + 1) / 2;
+ }
/* Take damage */
- get_damage=take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_acid))
+ if (!aura && !(double_resist && p_ptr->resist_acid))
inven_damage(set_acid_destroy, inv);
return get_damage;
}
/*
* Hurt the player with electricity
*/
-int elec_dam(int dam, cptr kb_str, int monspell)
+int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_elec) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_elec)) &&
- one_in_(HURT_CHANCE))
- (void)do_dec_stat(A_DEX);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_elec)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_DEX);
+ }
/* Take damage */
- get_damage=take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_elec))
+ if (!aura && !(double_resist && p_ptr->resist_elec))
inven_damage(set_elec_destroy, inv);
return get_damage;
/*
* Hurt the player with Fire
*/
-int fire_dam(int dam, cptr kb_str, int monspell)
+int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_fire) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_fire)) &&
- one_in_(HURT_CHANCE))
- (void)do_dec_stat(A_STR);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_fire)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_STR);
+ }
/* Take damage */
- get_damage=take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_fire))
+ if (!aura && !(double_resist && p_ptr->resist_fire))
inven_damage(set_fire_destroy, inv);
return get_damage;
/*
* Hurt the player with Cold
*/
-int cold_dam(int dam, cptr kb_str, int monspell)
+int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_cold) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_cold)) &&
- one_in_(HURT_CHANCE))
- (void)do_dec_stat(A_STR);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_cold)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_STR);
+ }
/* Take damage */
- get_damage=take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_cold))
+ if (!aura && !(double_resist && p_ptr->resist_cold))
inven_damage(set_cold_destroy, inv);
return get_damage;
item_tester_no_ryoute = TRUE;
/* Select a piece of armour */
- item_tester_hook = item_tester_hook_armour;
+ item_tester_hook = object_is_armour;
/* Get an item */
-#ifdef JP
-q = "¤É¤ÎËɶñ¤Ë»¬»ß¤á¤ò¤·¤Þ¤¹¤«¡©";
-s = "»¬»ß¤á¤Ç¤¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Rustproof which piece of armour? ";
- s = "You have nothing to rustproof.";
-#endif
+ q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
+ s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return FALSE;
add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
- if ((o_ptr->to_a < 0) && !cursed_p(o_ptr))
+ if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
{
#ifdef JP
-msg_format("%s¤Ï¿·ÉÊƱÍͤˤʤä¿¡ª",o_name);
+msg_format("%sは新品同様になった!",o_name);
#else
msg_format("%s %s look%s as good as new!",
((item >= 0) ? "Your" : "The"), o_name,
}
#ifdef JP
-msg_format("%s¤ÏÉå¿©¤·¤Ê¤¯¤Ê¤Ã¤¿¡£", o_name);
+msg_format("%sは腐食しなくなった。", o_name);
#else
msg_format("%s %s %s now protected against corrosion.",
((item >= 0) ? "Your" : "The"), o_name,
object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
/* Attempt a saving throw for artifacts */
- if ((o_ptr->art_name || artifact_p(o_ptr)) && (randint0(100) < 50))
+ if (object_is_artifact(o_ptr) && (randint0(100) < 50))
{
/* Cool */
#ifdef JP
-msg_format("%s¤¬%s¤òÊñ¤ß¹þ¤â¤¦¤È¤·¤¿¤¬¡¢%s¤Ï¤½¤ì¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
-"¶²ÉݤΰŹõ¥ª¡¼¥é", "Ëɶñ", o_name);
+msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
+"恐怖の暗黒オーラ", "防具", o_name);
#else
msg_format("A %s tries to %s, but your %s resists the effects!",
"terrible black aura", "surround your armor", o_name);
else
{
/* Oops */
-#ifdef JP
-msg_format("¶²ÉݤΰŹõ¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤Î%s¤òÊñ¤ß¹þ¤ó¤À¡ª", o_name);
-#else
- msg_format("A terrible black aura blasts your %s!", o_name);
-#endif
-
+ msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
chg_virtue(V_ENCHANT, -5);
/* Blast the armor */
/*
* Curse the players weapon
*/
-bool curse_weapon(bool force, int slot)
+bool curse_weapon_object(bool force, object_type *o_ptr)
{
int i;
-
- object_type *o_ptr;
-
char o_name[MAX_NLEN];
-
- /* Curse the weapon */
- o_ptr = &inventory[slot];
-
/* Nothing to curse */
if (!o_ptr->k_idx) return (FALSE);
-
/* Describe */
object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
/* Attempt a saving throw */
- if ((artifact_p(o_ptr) || o_ptr->art_name) && (randint0(100) < 50) && !force)
+ if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
{
/* Cool */
#ifdef JP
-msg_format("%s¤¬%s¤òÊñ¤ß¹þ¤â¤¦¤È¤·¤¿¤¬¡¢%s¤Ï¤½¤ì¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
-"¶²ÉݤΰŹõ¥ª¡¼¥é", "Éð´ï", o_name);
+ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
+ "恐怖の暗黒オーラ", "武器", o_name);
#else
msg_format("A %s tries to %s, but your %s resists the effects!",
- "terrible black aura", "surround your weapon", o_name);
+ "terrible black aura", "surround your weapon", o_name);
#endif
-
}
/* not artifact or failed save... */
else
{
/* Oops */
-#ifdef JP
-if (!force) msg_format("¶²ÉݤΰŹõ¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤Î%s¤òÊñ¤ß¹þ¤ó¤À¡ª", o_name);
-#else
- if (!force) msg_format("A terrible black aura blasts your %s!", o_name);
-#endif
-
+ if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
chg_virtue(V_ENCHANT, -5);
/* Shatter the weapon */
for (i = 0; i < TR_FLAG_SIZE; i++)
o_ptr->art_flags[i] = 0;
-
/* Curse it */
o_ptr->curse_flags = TRC_CURSED;
return (TRUE);
}
+bool curse_weapon(bool force, int slot)
+{
+ /* Curse the weapon */
+ return curse_weapon_object(force, &inventory[slot]);
+}
+
/*
* Enchant some bolts
if (o_ptr->tval != TV_BOLT) continue;
/* Skip artifacts and ego-items */
- if (o_ptr->art_name || artifact_p(o_ptr) || ego_item_p(o_ptr))
+ if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
continue;
/* Skip cursed/broken items */
- if (cursed_p(o_ptr) || broken_p(o_ptr)) continue;
+ if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
/* Randomize */
if (randint0(100) < 75) continue;
/* Message */
-#ifdef JP
-msg_print("¥¯¥í¥¹¥Ü¥¦¤ÎÌ𤬱ê¤Î¥ª¡¼¥é¤ËÊñ¤Þ¤ì¤¿¡ª");
-#else
- msg_print("Your bolts are covered in a fiery aura!");
-#endif
-
+ msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
/* Ego-item */
o_ptr->name2 = EGO_FLAME;
if (flush_failure) flush();
/* Fail */
-#ifdef JP
-msg_print("±ê¤Ç¶¯²½¤¹¤ë¤Î¤Ë¼ºÇÔ¤·¤¿¡£");
-#else
- msg_print("The fiery enchantment failed.");
-#endif
-
+ msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
/* Notice */
return (TRUE);
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;
}
{
/* Placing the new monster failed */
if (place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
+ {
m_list[hack_m_idx_ii] = back_m;
+
+ /* 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;
p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
- if (!cave_teleportable_bold(y, x, FALSE) ||
+ if (!cave_player_teleportable_bold(y, x, 0L) ||
(distance(y, x, py, px) > plev / 2 + 10) ||
(!randint0(plev / 10 + 10)))
{
p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
- teleport_player((plev + 2) * 2, TRUE);
+ teleport_player((plev + 2) * 2, TELEPORT_PASSIVE);
/* Failed */
return FALSE;
}
else
{
- teleport_player_to(y, x, TRUE, FALSE);
+ teleport_player_to(y, x, 0L);
/* Success */
return TRUE;
if (dimension_door_aux(x, y)) return TRUE;
-#ifdef JP
- msg_print("ÀºÎ¤«¤éʪ¼Á³¦¤ËÌá¤ë»þ¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¡ª");
-#else
- msg_print("You fail to exit the astral plane correctly!");
-#endif
+ msg_print(_("精霊界から物質界に戻る時うまくいかなかった!", "You fail to exit the astral plane correctly!"));
return TRUE;
}
if (dimension_door_aux(x, y)) return TRUE;
-#ifdef JP
- msg_print("¶À¤ÎÀ¤³¦¤ò¤¦¤Þ¤¯Ä̤ì¤Ê¤«¤Ã¤¿¡ª");
-#else
- msg_print("You fail to pass the mirror plane correctly!");
-#endif
+ msg_print(_("鏡の世界をうまく通れなかった!", "You fail to pass the mirror plane correctly!"));
return TRUE;
}
item_tester_hook = item_tester_hook_recharge;
/* Get an item */
-#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤«¤éËâÎϤòµÛ¼ý¤·¤Þ¤¹¤«¡©";
-s = "ËâÎϤòµÛ¼ý¤Ç¤¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
-#else
- q = "Drain which item? ";
- s = "You have nothing to drain.";
-#endif
+ q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
+ s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
}
k_ptr = &k_info[o_ptr->k_idx];
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
if (o_ptr->tval == TV_ROD)
{
{
if (o_ptr->timeout > (o_ptr->number - 1) * k_ptr->pval)
{
-#ifdef JP
-msg_print("½¼Å¶Ãæ¤Î¥í¥Ã¥É¤«¤éËâÎϤòµÛ¼ý¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£");
-#else
- msg_print("You can't absorb energy from a discharged rod.");
-#endif
-
+ msg_print(_("充填中のロッドから魔力を吸収することはできません。", "You can't absorb energy from a discharged rod."));
}
else
{
item = inven_carry(q_ptr);
/* Message */
-#ifdef JP
- msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
-#else
- msg_print("You unstack your staff.");
-#endif
-
+ msg_print(_("杖をまとめなおした。", "You unstack your staff."));
}
}
else
{
-#ifdef JP
-msg_print("µÛ¼ý¤Ç¤¤ëËâÎϤ¬¤¢¤ê¤Þ¤»¤ó¡ª");
-#else
- msg_print("There's no energy there to absorb!");
-#endif
-
+ msg_print(_("吸収できる魔力がありません!", "There's no energy there to absorb!"));
}
if (!o_ptr->pval) o_ptr->ident |= IDENT_EMPTY;
}
if (fail)
{
/* Artifacts are never destroyed. */
- if (artifact_p(o_ptr))
+ if (object_is_fixed_artifact(o_ptr))
{
object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("ËâÎϤ¬µÕή¤·¤¿¡ª%s¤Ï´°Á´¤ËËâÎϤò¼º¤Ã¤¿¡£", o_name);
-#else
- msg_format("The recharging backfires - %s is completely drained!", o_name);
-#endif
-
+ msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
/* Artifact rods. */
if (o_ptr->tval == TV_ROD)
{
if (o_ptr->tval == TV_ROD)
{
-#ifdef JP
-msg_print("¥í¥Ã¥É¤ÏÇË»¤òÌȤ줿¤¬¡¢ËâÎϤÏÁ´¤Æ¼º¤Ê¤ï¤ì¤¿¡£");
-#else
- msg_format("You save your rod from destruction, but all charges are lost.", o_name);
-#endif
-
+ msg_format(_("ロッドは破損を免れたが、魔力は全て失なわれた。",
+ "You save your rod from destruction, but all charges are lost."), o_name);
o_ptr->timeout = k_ptr->pval * o_ptr->number;
}
else if (o_ptr->tval == TV_WAND)
{
-#ifdef JP
-msg_format("%s¤ÏÇË»¤òÌȤ줿¤¬¡¢ËâÎϤ¬Á´¤Æ¼º¤ï¤ì¤¿¡£", o_name);
-#else
- msg_format("You save your %s from destruction, but all charges are lost.", o_name);
-#endif
-
+ msg_format(_("%sは破損を免れたが、魔力が全て失われた。", "You save your %s from destruction, but all charges are lost."), o_name);
o_ptr->pval = 0;
}
/* Staffs aren't drained. */
{
if (o_ptr->number > 1)
{
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬°ìËܲõ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes one of your %s!", o_name);
-#endif
-
+ msg_format(_("乱暴な魔法のために%sが一本壊れた!", "Wild magic consumes one of your %s!"), o_name);
/* Reduce rod stack maximum timeout, drain wands. */
if (o_ptr->tval == TV_ROD) o_ptr->timeout = MIN(o_ptr->timeout, k_ptr->pval * (o_ptr->number - 1));
else if (o_ptr->tval == TV_WAND) o_ptr->pval = o_ptr->pval * (o_ptr->number - 1) / o_ptr->number;
-
}
else
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬²¿Ëܤ«²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
+ {
+ msg_format(_("乱暴な魔法のために%sが何本か壊れた!", "Wild magic consumes your %s!"), o_name);
+ }
+
/* Reduce and describe inventory */
if (item >= 0)
{
if (fail_type == 3)
{
if (o_ptr->number > 1)
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬Á´¤Æ²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes all your %s!", o_name);
-#endif
-
+ msg_format(_("乱暴な魔法のために%sが全て壊れた!", "Wild magic consumes all your %s!"), o_name);
else
-#ifdef JP
-msg_format("Íð˽¤ÊËâË¡¤Î¤¿¤á¤Ë%s¤¬²õ¤ì¤¿¡ª", o_name);
-#else
- msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
-
+ msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
/* Reduce and describe inventory */
if (item >= 0)
case RACE_NIBELUNG:
case RACE_DARK_ELF:
case RACE_MIND_FLAYER:
- case RACE_KUTA:
+ case RACE_KUTAR:
case RACE_S_FAIRY:
summon_kin_type = 'h';
break;
}
return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
}
+
+void massacre(int py, int px)
+{
+ int x, y;
+ cave_type *c_ptr;
+ monster_type *m_ptr;
+ int dir;
+
+ for (dir = 0; dir < 8; dir++)
+ {
+ y = py + ddy_ddd[dir];
+ x = px + ddx_ddd[dir];
+ c_ptr = &cave[y][x];
+
+ /* Get the monster */
+ m_ptr = &m_list[c_ptr->m_idx];
+
+ /* Hack -- attack monsters */
+ if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
+ py_attack(y, x, 0);
+ }
+}