{
int k, ac;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- ac = r_ptr->ac;
- if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
/* Percentile dice */
- k = randint0(100);
+ k = randint1(100);
/* Snipers with high-concentration reduce instant miss percentage.*/
k += p_ptr->concent;
/* Hack -- Instant miss or hit */
- if (k < 10) return (k < 5);
+ if (k <= 5) return (FALSE);
+ if (k > 95) return (TRUE);
if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
if (one_in_(20)) return (FALSE);
/* Never hit */
if (chance <= 0) return (FALSE);
+ ac = r_ptr->ac;
+ if (p_ptr->concent)
+ {
+ ac *= (8 - p_ptr->concent);
+ ac /= 8;
+ }
+
+ if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
+
/* Invisible monsters are harder to hit */
if (!vis) chance = (chance + 1) / 2;
* @param dam 現在算出中のダメージ値
* @return クリティカル修正が入ったダメージ値
*/
-s16b critical_shot(int weight, int plus_ammo, int plus_bow, int dam)
+HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam)
{
int i, k;
object_type *j_ptr = &inventory[INVEN_BOW];
if (k < 900)
{
-#ifdef JP
- msg_print("手ごたえがあった!");
-#else
- msg_print("It was a good hit!");
-#endif
-
+ msg_print(_("手ごたえがあった!", "It was a good hit!"));
dam += (dam / 2);
}
else if (k < 1350)
{
-#ifdef JP
- msg_print("かなりの手ごたえがあった!");
-#else
- msg_print("It was a great hit!");
-#endif
-
+ msg_print(_("かなりの手ごたえがあった!", "It was a great hit!"));
dam *= 2;
}
else
{
-#ifdef JP
- msg_print("会心の一撃だ!");
-#else
- msg_print("It was a superb hit!");
-#endif
-
+ msg_print(_("会心の一撃だ!", "It was a superb hit!"));
dam *= 3;
}
}
* @param mode オプションフラグ
* @return クリティカル修正が入ったダメージ値
*/
-s16b critical_norm(int weight, int plus, int dam, s16b meichuu, int mode)
+HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode)
{
int i, k;
if (k < 400)
{
-#ifdef JP
- msg_print("手ごたえがあった!");
-#else
- msg_print("It was a good hit!");
-#endif
+ msg_print(_("手ごたえがあった!", "It was a good hit!"));
dam = 2 * dam + 5;
}
else if (k < 700)
{
-#ifdef JP
- msg_print("かなりの手ごたえがあった!");
-#else
- msg_print("It was a great hit!");
-#endif
-
+ msg_print(_("かなりの手ごたえがあった!", "It was a great hit!"));
dam = 2 * dam + 10;
}
else if (k < 900)
{
-#ifdef JP
- msg_print("会心の一撃だ!");
-#else
- msg_print("It was a superb hit!");
-#endif
-
+ msg_print(_("会心の一撃だ!", "It was a superb hit!"));
dam = 3 * dam + 15;
}
else if (k < 1300)
{
-#ifdef JP
- msg_print("最高の会心の一撃だ!");
-#else
- msg_print("It was a *GREAT* hit!");
-#endif
-
+ msg_print(_("最高の会心の一撃だ!", "It was a *GREAT* hit!"));
dam = 3 * dam + 20;
}
else
{
-#ifdef JP
- msg_print("比類なき最高の会心の一撃だ!");
-#else
- msg_print("It was a *SUPERB* hit!");
-#endif
-
+ msg_print(_("比類なき最高の会心の一撃だ!", "It was a *SUPERB* hit!"));
dam = ((7 * dam) / 2) + 25;
}
}
* @param m_ptr 目標モンスターの構造体参照ポインタ
* @return スレイング加味後の倍率(/10倍)
*/
-static int mult_slaying(int mult, const u32b* flgs, const monster_type* m_ptr)
+static MULTIPLY mult_slaying(MULTIPLY mult, const BIT_FLAGS* flgs, const monster_type* m_ptr)
{
static const struct slay_table_t {
int slay_flag;
- u32b affect_race_flag;
- int slay_mult;
+ BIT_FLAGS affect_race_flag;
+ MULTIPLY slay_mult;
size_t flag_offset;
size_t r_flag_offset;
} slay_table[] = {
* @param m_ptr 目標モンスターの構造体参照ポインタ
* @return スレイング加味後の倍率(/10倍)
*/
-static int mult_brand(int mult, const u32b* flgs, const monster_type* m_ptr)
+static MULTIPLY mult_brand(MULTIPLY mult, const BIT_FLAGS* flgs, const monster_type* m_ptr)
{
static const struct brand_table_t {
int brand_flag;
- u32b resist_mask;
- u32b hurt_flag;
+ BIT_FLAGS resist_mask;
+ BIT_FLAGS hurt_flag;
} brand_table[] = {
{TR_BRAND_ACID, RFR_EFF_IM_ACID_MASK, 0U },
{TR_BRAND_ELEC, RFR_EFF_IM_ELEC_MASK, 0U },
* Note that most brands and slays are x3, except Slay Animal (x2),\n
* Slay Evil (x2), and Kill dragon (x5).\n
*/
-s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown)
+s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
{
- int mult = 10;
+ MULTIPLY mult = 10;
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
/* Extract the flags */
object_flags(o_ptr, flgs);
* @param x 対象となるマスのX座標
* @return なし
*/
-static void discover_hidden_things(int y, int x)
+static void discover_hidden_things(POSITION y, POSITION x)
{
- s16b this_o_idx, next_o_idx = 0;
-
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
cave_type *c_ptr;
/* Access the grid */
*/
void search(void)
{
- int i, chance;
+ DIRECTION i;
+ PERCENTAGE chance;
/* Start with base search ability */
chance = p_ptr->skill_srh;
/* Sometimes, notice things */
if (randint0(100) < chance)
{
- discover_hidden_things(py + ddy_ddd[i], px + ddx_ddd[i]);
+ discover_hidden_things(p_ptr->y + ddy_ddd[i], p_ptr->x + ddx_ddd[i]);
}
}
}
#ifdef JP
if ((o_ptr->name1 == ART_CRIMSON) && (p_ptr->pseikaku == SEIKAKU_COMBAT))
{
- msg_format("こうして、%sは『クリムゾン』を手に入れた。", player_name);
+ msg_format("こうして、%sは『クリムゾン』を手に入れた。", p_ptr->name);
msg_print("しかし今、『混沌のサーペント』の放ったモンスターが、");
- msg_format("%sに襲いかかる...", player_name);
+ msg_format("%sに襲いかかる...", p_ptr->name);
}
else
{
*/
void carry(bool pickup)
{
- cave_type *c_ptr = &cave[py][px];
+ cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
s16b this_o_idx, next_o_idx = 0;
/* Describe the object */
else if (!pickup)
{
-#ifdef JP
- msg_format("%sがある。", o_name);
-#else
- msg_format("You see %s.", o_name);
-#endif
-
+ msg_format(_("%sがある。", "You see %s."), o_name);
}
/* Note that the pack is too full */
else if (!inven_carry_okay(o_ptr))
{
-#ifdef JP
- msg_format("ザックには%sを入れる隙間がない。", o_name);
-#else
- msg_format("You have no room for %s.", o_name);
-#endif
-
+ msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
}
/* Pick up the item (if requested and allowed) */
if (carry_query_flag)
{
char out_val[MAX_NLEN+20];
-#ifdef JP
- sprintf(out_val, "%sを拾いますか? ", o_name);
-#else
- sprintf(out_val, "Pick up %s? ", o_name);
-#endif
-
+ sprintf(out_val, _("%sを拾いますか? ", "Pick up %s? "), o_name);
okay = get_check(out_val);
}
*/
static void hit_trap_pit(int trap_feat_type)
{
- int dam;
+ HIT_POINT dam;
cptr trap_name = "";
cptr spike_name = "";
* @param turn 状態異常の追加ターン量
* @return なし
*/
-static void hit_trap_set_abnormal_status(cptr trap_message, bool resist, bool (*set_status)(int turn), int turn)
+static void hit_trap_set_abnormal_status(cptr trap_message, bool resist, bool (*set_status)(IDX), IDX turn_aux)
{
msg_print(trap_message);
if (!resist)
{
- set_status(turn);
+ set_status(turn_aux);
}
}
static void hit_trap(bool break_trap)
{
int i, num, dam;
- int x = px, y = py;
+ int x = p_ptr->x, y = p_ptr->y;
/* Get the cave grid */
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
-
-#ifdef JP
- cptr name = "トラップ";
-#else
- cptr name = "a trap";
-#endif
+ cptr name = _("トラップ", "a trap");
/* Disturb the player */
disturb(0, 1);
{
if (p_ptr->levitation)
{
-#ifdef JP
- msg_print("落とし戸を飛び越えた。");
-#else
- msg_print("You fly over a trap door.");
-#endif
-
+ msg_print(_("落とし戸を飛び越えた。", "You fly over a trap door."));
}
else
{
-#ifdef JP
- msg_print("落とし戸に落ちた!");
+ msg_print(_("落とし戸に落ちた!", "You have fallen through a trap door!"));
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
- msg_print("くっそ~!");
-#else
- msg_print("You have fallen through a trap door!");
-#endif
+ msg_print(_("くっそ~!", ""));
sound(SOUND_FALL);
dam = damroll(2, 8);
-#ifdef JP
- name = "落とし戸";
-#else
- name = "a trap door";
-#endif
+ name = _("落とし戸", "a trap door");
take_hit(DAMAGE_NOESCAPE, dam, name, -1);
if (autosave_l && (p_ptr->chp >= 0))
do_cmd_save_game(TRUE);
-#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "落とし戸に落ちた");
-#else
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You have fallen through a trap door!");
-#endif
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("落とし戸に落ちた", "You have fallen through a trap door!"));
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
/* Leaving */
case TRAP_TY_CURSE:
{
-#ifdef JP
- msg_print("何かがピカッと光った!");
-#else
- msg_print("There is a flash of shimmering light!");
-#endif
-
+ msg_print(_("何かがピカッと光った!", "There is a flash of shimmering light!"));
num = 2 + randint1(3);
for (i = 0; i < num; i++)
{
case TRAP_TELEPORT:
{
-#ifdef JP
- msg_print("テレポート・トラップにひっかかった!");
-#else
- msg_print("You hit a teleport trap!");
-#endif
-
+ msg_print(_("テレポート・トラップにひっかかった!", "You hit a teleport trap!"));
teleport_player(100, TELEPORT_PASSIVE);
break;
}
case TRAP_FIRE:
{
-#ifdef JP
- msg_print("炎に包まれた!");
-#else
- msg_print("You are enveloped in flames!");
-#endif
-
+ msg_print(_("炎に包まれた!", "You are enveloped in flames!"));
dam = damroll(4, 6);
-#ifdef JP
- (void)fire_dam(dam, "炎のトラップ", -1, FALSE);
-#else
- (void)fire_dam(dam, "a fire trap", -1, FALSE);
-#endif
-
+ (void)fire_dam(dam, _("炎のトラップ", "a fire trap"), -1, FALSE);
break;
}
case TRAP_ACID:
{
-#ifdef JP
- msg_print("酸が吹きかけられた!");
-#else
- msg_print("You are splashed with acid!");
-#endif
-
+ msg_print(_("酸が吹きかけられた!", "You are splashed with acid!"));
dam = damroll(4, 6);
-#ifdef JP
- (void)acid_dam(dam, "酸のトラップ", -1, FALSE);
-#else
- (void)acid_dam(dam, "an acid trap", -1, FALSE);
-#endif
-
+ (void)acid_dam(dam, _("酸のトラップ", "an acid trap"), -1, FALSE);
break;
}
hit_trap_set_abnormal_status(
_("黒いガスに包み込まれた!", "A black gas surrounds you!"),
p_ptr->resist_blind,
- set_blind, p_ptr->blind + randint0(50) + 25);
+ set_blind, p_ptr->blind + (TIME_EFFECT)randint0(50) + 25);
break;
}
hit_trap_set_abnormal_status(
_("きらめくガスに包み込まれた!", "A gas of scintillating colors surrounds you!"),
p_ptr->resist_conf,
- set_confused, p_ptr->confused + randint0(20) + 10);
+ set_confused, p_ptr->confused + (TIME_EFFECT)randint0(20) + 10);
break;
}
hit_trap_set_abnormal_status(
_("刺激的な緑色のガスに包み込まれた!", "A pungent green gas surrounds you!"),
p_ptr->resist_pois || IS_OPPOSE_POIS(),
- set_poisoned, p_ptr->poisoned + randint0(20) + 10);
+ set_poisoned, p_ptr->poisoned + (TIME_EFFECT)randint0(20) + 10);
break;
}
case TRAP_SLEEP:
{
-#ifdef JP
- msg_print("奇妙な白い霧に包まれた!");
-#else
- msg_print("A strange white mist surrounds you!");
-#endif
-
+ msg_print(_("奇妙な白い霧に包まれた!", "A strange white mist surrounds you!"));
if (!p_ptr->free_act)
{
-#ifdef JP
-msg_print("あなたは眠りに就いた。");
-#else
- msg_print("You fall asleep.");
-#endif
-
+ msg_print(_("あなたは眠りに就いた。", "You fall asleep."));
if (ironman_nightmare)
{
-#ifdef JP
-msg_print("身の毛もよだつ光景が頭に浮かんだ。");
-#else
- msg_print("A horrible vision enters your mind.");
-#endif
-
-
- /* Pick a nightmare */
- get_mon_num_prep(get_nightmare, NULL);
+ msg_print(_("身の毛もよだつ光景が頭に浮かんだ。", "A horrible vision enters your mind."));
/* Have some nightmares */
- have_nightmare(get_mon_num(MAX_DEPTH));
+ sanity_blast(NULL, FALSE);
- /* Remove the monster restriction */
- get_mon_num_prep(NULL, NULL);
}
(void)set_paralyzed(p_ptr->paralyzed + randint0(10) + 5);
}
case TRAP_TRAPS:
{
-#ifdef JP
-msg_print("まばゆい閃光が走った!");
-#else
- msg_print("There is a bright flash of light!");
-#endif
-
+ msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
/* Make some new traps */
project(0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID, -1);
case TRAP_ALARM:
{
-#ifdef JP
- msg_print("けたたましい音が鳴り響いた!");
-#else
- msg_print("An alarm sounds!");
-#endif
+ msg_print(_("けたたましい音が鳴り響いた!", "An alarm sounds!"));
aggravate_monsters(0);
case TRAP_OPEN:
{
-#ifdef JP
- msg_print("大音響と共にまわりの壁が崩れた!");
-#else
- msg_print("Suddenly, surrounding walls are opened!");
-#endif
+ msg_print(_("大音響と共にまわりの壁が崩れた!", "Suddenly, surrounding walls are opened!"));
(void)project(0, 3, y, x, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
(void)project(0, 3, y, x - 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
(void)project(0, 3, y, x + 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
int evil_idx = 0, good_idx = 0;
int lev;
-#ifdef JP
- msg_print("突然天界の戦争に巻き込まれた!");
-#else
- msg_print("Suddenly, you are surrounded by immotal beings!");
-#endif
+ msg_print(_("突然天界の戦争に巻き込まれた!", "Suddenly, you are surrounded by immotal beings!"));
/* Summon Demons and Angels */
for (lev = dun_level; lev >= 20; lev -= 1 + lev/16)
if (!in_bounds(y1, x1)) continue;
/* Require line of projection */
- if (!projectable(py, px, y1, x1)) continue;
+ if (!projectable(p_ptr->y, p_ptr->x, y1, x1)) continue;
if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
evil_idx = hack_m_idx_ii;
case TRAP_PIRANHA:
{
-#ifdef JP
- msg_print("突然壁から水が溢れ出した!ピラニアがいる!");
-#else
- msg_print("Suddenly, the room is filled with water with piranhas!");
-#endif
+ msg_print(_("突然壁から水が溢れ出した!ピラニアがいる!", "Suddenly, the room is filled with water with piranhas!"));
/* Water fills room */
fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
if (break_trap && is_trap(c_ptr->feat))
{
cave_alter_feat(y, x, FF_DISARM);
-#ifdef JP
- msg_print("トラップを粉砕した。");
-#else
- msg_print("You destroyed the trap.");
-#endif
+ msg_print(_("トラップを粉砕した。", "You destroyed the trap."));
}
}
* @return なし
*/
static void touch_zap_player_aux(monster_type *m_ptr, bool immune, int flags_offset, int r_flags_offset, u32b aura_flag,
- int (*dam_func)(int dam, cptr kb_str, int monspell, bool aura), cptr message)
+ int (*dam_func)(HIT_POINT dam, cptr kb_str, int monspell, bool aura), cptr message)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
*/
static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
{
- int k, bonus, chance;
+ HIT_POINT k;
+ int bonus, chance;
int n_weight = 0;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
char m_name[80];
- int dss, ddd;
+ int dice_num, dice_side;
cptr atk_desc;
switch (attack)
{
case MUT2_SCOR_TAIL:
- dss = 3;
- ddd = 7;
+ dice_num = 3;
+ dice_side = 7;
n_weight = 5;
-#ifdef JP
- atk_desc = "尻尾";
-#else
- atk_desc = "tail";
-#endif
+ atk_desc = _("尻尾", "tail");
break;
case MUT2_HORNS:
- dss = 2;
- ddd = 6;
+ dice_num = 2;
+ dice_side = 6;
n_weight = 15;
-#ifdef JP
- atk_desc = "角";
-#else
- atk_desc = "horns";
-#endif
+ atk_desc = _("角", "horns");
break;
case MUT2_BEAK:
- dss = 2;
- ddd = 4;
+ dice_num = 2;
+ dice_side = 4;
n_weight = 5;
-#ifdef JP
- atk_desc = "クチバシ";
-#else
- atk_desc = "beak";
-#endif
+ atk_desc = _("クチバシ", "beak");
break;
case MUT2_TRUNK:
- dss = 1;
- ddd = 4;
+ dice_num = 1;
+ dice_side = 4;
n_weight = 35;
-#ifdef JP
- atk_desc = "象の鼻";
-#else
- atk_desc = "trunk";
-#endif
+ atk_desc = _("象の鼻", "trunk");
break;
case MUT2_TENTACLES:
- dss = 2;
- ddd = 5;
+ dice_num = 2;
+ dice_side = 5;
n_weight = 5;
-#ifdef JP
- atk_desc = "触手";
-#else
- atk_desc = "tentacles";
-#endif
+ atk_desc = _("触手", "tentacles");
break;
default:
- dss = ddd = n_weight = 1;
-#ifdef JP
- atk_desc = "未定義の部位";
-#else
- atk_desc = "undefined body part";
-#endif
+ dice_num = dice_side = n_weight = 1;
+ atk_desc = _("未定義の部位", "undefined body part");
}
{
/* Sound */
sound(SOUND_HIT);
+ msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
-#ifdef JP
- msg_format("%sを%sで攻撃した。", m_name, atk_desc);
-#else
- msg_format("You hit %s with your %s.", m_name, atk_desc);
-#endif
-
-
- k = damroll(ddd, dss);
+ k = damroll(dice_num, dice_side);
k = critical_norm(n_weight, bonus, k, (s16b)bonus, 0);
/* Apply the player damage bonuses */
k = mon_damage_mod(m_ptr, k, FALSE);
/* Complex message */
- if (p_ptr->wizard)
- {
-#ifdef JP
- msg_format("%d/%d のダメージを与えた。", k, m_ptr->hp);
-#else
- msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
-#endif
-
- }
+ msg_format_wizard(CHEAT_MONSTER,
+ _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"),
+ k, m_ptr->hp - k, m_ptr->maxhp, m_ptr->max_maxhp);
/* Anger the monster */
if (k > 0) anger_monster(m_ptr);
sound(SOUND_MISS);
/* Message */
-#ifdef JP
- msg_format("ミス! %sにかわされた。", m_name);
-#else
- msg_format("You miss %s.", m_name);
-#endif
-
+ msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
}
}
* @details
* If no "weapon" is available, then "punch" the monster one time.
*/
-static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
+static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, BIT_FLAGS mode)
{
- int num = 0, k, bonus, chance, vir;
+ int num = 0, bonus, chance, vir;
+ HIT_POINT k;
cave_type *c_ptr = &cave[y][x];
{
if ((r_ptr->level + 10) > p_ptr->lev)
{
- int tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
- int sval = inventory[INVEN_RARM+hand].sval;
+ OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
+ OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+hand].sval;
int now_exp = p_ptr->weapon_exp[tval][sval];
if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
{
- int amount = 0;
+ SUB_EXP amount = 0;
if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
else if (now_exp < WEAPON_EXP_SKILLED) amount = 10;
else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 1;
if (p_ptr->wizard && cheat_xtra)
{
-#ifdef JP
- msg_print("攻撃を再選択しました。");
-#else
- msg_print("Attack re-selected.");
-#endif
+ msg_print(_("攻撃を再選択しました。", "Attack re-selected."));
}
}
else
{
if (r_ptr->flags1 & RF1_MALE)
{
-#ifdef JP
- msg_format("%sに金的膝蹴りをくらわした!", m_name);
-#else
- msg_format("You hit %s in the groin with your knee!", m_name);
-#endif
-
+ msg_format(_("%sに金的膝蹴りをくらわした!", "You hit %s in the groin with your knee!"), m_name);
sound(SOUND_PAIN);
special_effect = MA_KNEE;
}
if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
my_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
{
-#ifdef JP
- msg_format("%sの足首に関節蹴りをくらわした!", m_name);
-#else
- msg_format("You kick %s in the ankle.", m_name);
-#endif
-
+ msg_format(_("%sの足首に関節蹴りをくらわした!", "You kick %s in the ankle."), m_name);
special_effect = MA_SLOW;
}
else msg_format(ma_ptr->desc, m_name);
}
if (p_ptr->special_defense & KAMAE_SUZAKU) weight = 4;
- if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
+ if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
{
- weight += (p_ptr->magic_num1[0]/30);
+ weight += (P_PTR_KI / 30);
if (weight > 20) weight = 20;
}
if ((special_effect == MA_KNEE) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
{
-#ifdef JP
- msg_format("%^sは苦痛にうめいている!", m_name);
-#else
- msg_format("%^s moans in agony!", m_name);
-#endif
-
+ msg_format(_("%^sは苦痛にうめいている!", "%^s moans in agony!"), m_name);
stun_effect = 7 + randint1(13);
resist_stun /= 3;
}
(randint1(p_ptr->lev) > r_ptr->level) &&
m_ptr->mspeed > 60)
{
-#ifdef JP
- msg_format("%^sは足をひきずり始めた。", m_name);
-#else
- msg_format("%^s starts limping slower.", m_name);
-#endif
-
+ msg_format(_("%^sは足をひきずり始めた。", "%^s starts limping slower."), m_name);
m_ptr->mspeed -= 10;
}
}
{
if (set_monster_stunned(c_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr)))
{
-#ifdef JP
- msg_format("%^sはフラフラになった。", m_name);
-#else
- msg_format("%^s is stunned.", m_name);
-#endif
+ msg_format(_("%^sはフラフラになった。", "%^s is stunned."), m_name);
}
else
{
-#ifdef JP
- msg_format("%^sはさらにフラフラになった。", m_name);
-#else
- msg_format("%^s is more stunned.", m_name);
-#endif
+ msg_format(_("%^sはさらにフラフラになった。", "%^s is more stunned."), m_name);
}
}
}
if ((o_ptr->name1 == ART_CHAINSWORD) && !one_in_(2))
{
char chainsword_noise[1024];
-#ifdef JP
- if (!get_rnd_line("chainswd_j.txt", 0, chainsword_noise))
-#else
- if (!get_rnd_line("chainswd.txt", 0, chainsword_noise))
-#endif
+ if (!get_rnd_line(_("chainswd_j.txt", "chainswd.txt"), 0, chainsword_noise))
{
msg_print(chainsword_noise);
}
if (o_ptr->name1 == ART_VORPAL_BLADE)
{
-#ifdef JP
- msg_print("目にも止まらぬヴォーパルブレード、手錬の早業!");
-#else
- msg_print("Your Vorpal Blade goes snicker-snack!");
-#endif
+ msg_print(_("目にも止まらぬヴォーパルブレード、手錬の早業!", "Your Vorpal Blade goes snicker-snack!"));
}
else
{
-#ifdef JP
- msg_format("%sをグッサリ切り裂いた!", m_name);
-#else
- msg_format("Your weapon cuts deep into %s!", m_name);
-#endif
+ msg_format(_("%sをグッサリ切り裂いた!", "Your weapon cuts deep into %s!"), m_name);
}
/* Try to increase the damage */
mult++;
}
- k *= mult;
+ k *= (HIT_POINT)mult;
/* Ouch! */
if (((r_ptr->flagsr & RFR_RES_ALL) ? k/100 : k) > m_ptr->hp)
{
-#ifdef JP
- msg_format("%sを真っ二つにした!", m_name);
-#else
- msg_format("You cut %s in half!", m_name);
-#endif
+ msg_format(_("%sを真っ二つにした!", "You cut %s in half!"), m_name);
}
else
{
switch (mult)
{
-#ifdef JP
- case 2: msg_format("%sを斬った!", m_name); break;
- case 3: msg_format("%sをぶった斬った!", m_name); break;
- case 4: msg_format("%sをメッタ斬りにした!", m_name); break;
- case 5: msg_format("%sをメッタメタに斬った!", m_name); break;
- case 6: msg_format("%sを刺身にした!", m_name); break;
- case 7: msg_format("%sを斬って斬って斬りまくった!", m_name); break;
- default: msg_format("%sを細切れにした!", m_name); break;
-#else
- case 2: msg_format("You gouge %s!", m_name); break;
- case 3: msg_format("You maim %s!", m_name); break;
- case 4: msg_format("You carve %s!", m_name); break;
- case 5: msg_format("You cleave %s!", m_name); break;
- case 6: msg_format("You smite %s!", m_name); break;
- case 7: msg_format("You eviscerate %s!", m_name); break;
- default: msg_format("You shred %s!", m_name); break;
-#endif
+ case 2: msg_format(_("%sを斬った!", "You gouge %s!"), m_name); break;
+ case 3: msg_format(_("%sをぶった斬った!", "You maim %s!"), m_name); break;
+ case 4: msg_format(_("%sをメッタ斬りにした!", "You carve %s!"), m_name); break;
+ case 5: msg_format(_("%sをメッタメタに斬った!", "You cleave %s!"), m_name); break;
+ case 6: msg_format(_("%sを刺身にした!", "You smite %s!"), m_name); break;
+ case 7: msg_format(_("%sを斬って斬って斬りまくった!", "You eviscerate %s!"), m_name); break;
+ default: msg_format(_("%sを細切れにした!", "You shred %s!"), m_name); break;
}
}
drain_result = drain_result * 3 / 2;
if (zantetsu_mukou)
{
-#ifdef JP
- msg_print("こんな軟らかいものは切れん!");
-#else
- msg_print("You cannot cut such a elastic thing!");
-#endif
+ msg_print(_("こんな軟らかいものは切れん!", "You cannot cut such a elastic thing!"));
k = 0;
}
if (e_j_mukou)
{
-#ifdef JP
- msg_print("蜘蛛は苦手だ!");
-#else
- msg_print("Spiders are difficult for you to deal with!");
-#endif
+ msg_print(_("蜘蛛は苦手だ!", "Spiders are difficult for you to deal with!"));
k /= 2;
}
/* Get stunned */
if (MON_STUNNED(m_ptr))
{
-#ifdef JP
- msg_format("%sはひどくもうろうとした。", m_name);
-#else
- msg_format("%s is more dazed.", m_name);
-#endif
-
+ msg_format(_("%sはひどくもうろうとした。", "%s is more dazed."), m_name);
tmp /= 2;
}
else
{
-#ifdef JP
- msg_format("%s はもうろうとした。", m_name);
-#else
- msg_format("%s is dazed.", m_name);
-#endif
+ msg_format(_("%s はもうろうとした。", "%s is dazed."), m_name);
}
/* Apply stun */
}
else
{
-#ifdef JP
- msg_format("%s には効果がなかった。", m_name);
-#else
- msg_format("%s is not effected.", m_name);
-#endif
+ msg_format(_("%s には効果がなかった。", "%s is not effected."), m_name);
}
}
if ((randint1(randint1(r_ptr->level/7)+5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
{
k = m_ptr->hp + 1;
-#ifdef JP
- msg_format("%sの急所を突き刺した!", m_name);
-#else
- msg_format("You hit %s on a fatal spot!", m_name);
-#endif
+ msg_format(_("%sの急所を突き刺した!", "You hit %s on a fatal spot!"), m_name);
}
else k = 1;
}
{
k *= 5;
drain_result *= 2;
-#ifdef JP
- msg_format("刃が%sに深々と突き刺さった!", m_name);
-#else
- msg_format("You critically injured %s!", m_name);
-#endif
+ msg_format(_("刃が%sに深々と突き刺さった!", "You critically injured %s!"), m_name);
}
else if (((m_ptr->hp < maxhp/2) && one_in_((p_ptr->num_blow[0]+p_ptr->num_blow[1]+1)*10)) || ((one_in_(666) || ((backstab || fuiuchi) && one_in_(11))) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2)))
{
{
k = MAX(k*5, m_ptr->hp/2);
drain_result *= 2;
-#ifdef JP
- msg_format("%sに致命傷を負わせた!", m_name);
-#else
- msg_format("You fatally injured %s!", m_name);
-#endif
+ msg_format(_("%sに致命傷を負わせた!", "You fatally injured %s!"), m_name);
}
else
{
k = m_ptr->hp + 1;
-#ifdef JP
- msg_format("刃が%sの急所を貫いた!", m_name);
-#else
- msg_format("You hit %s on a fatal spot!", m_name);
-#endif
+ msg_format(_("刃が%sの急所を貫いた!", "You hit %s on a fatal spot!"), m_name);
}
}
}
- /* Complex message */
- if (p_ptr->wizard || cheat_xtra)
- {
-#ifdef JP
- msg_format("%d/%d のダメージを与えた。", k, m_ptr->hp);
-#else
- msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
-#endif
- }
+ msg_format_wizard(CHEAT_MONSTER,
+ _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"), k,
+ m_ptr->hp - k, m_ptr->maxhp, m_ptr->max_maxhp);
if (k <= 0) can_drain = FALSE;
if (mon_take_hit(c_ptr->m_idx, k, fear, NULL))
{
*mdeath = TRUE;
- if ((p_ptr->pclass == CLASS_BERSERKER) && energy_use)
+ if ((p_ptr->pclass == CLASS_BERSERKER) && p_ptr->energy_use)
{
if (p_ptr->migite && p_ptr->hidarite)
{
- if (hand) energy_use = energy_use*3/5+energy_use*num*2/(p_ptr->num_blow[hand]*5);
- else energy_use = energy_use*num*3/(p_ptr->num_blow[hand]*5);
+ if (hand) p_ptr->energy_use = p_ptr->energy_use*3/5+p_ptr->energy_use*num*2/(p_ptr->num_blow[hand]*5);
+ else p_ptr->energy_use = p_ptr->energy_use*num*3/(p_ptr->num_blow[hand]*5);
}
else
{
- energy_use = energy_use*num/p_ptr->num_blow[hand];
+ p_ptr->energy_use = p_ptr->energy_use*num/p_ptr->num_blow[hand];
}
}
if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
-#ifdef JP
- msg_print("またつまらぬものを斬ってしまった...");
-#else
- msg_print("Sigh... Another trifling thing I've cut....");
-#endif
+ msg_print(_("またつまらぬものを斬ってしまった...", "Sigh... Another trifling thing I've cut...."));
break;
}
{
if (is_human)
{
- int to_h = o_ptr->to_h;
- int to_d = o_ptr->to_d;
+ HIT_PROB to_h = o_ptr->to_h;
+ HIT_POINT to_d = o_ptr->to_d;
int i, flag;
flag = 1;
if (o_ptr->to_h != to_h || o_ptr->to_d != to_d)
{
-#ifdef JP
- msg_print("妖刀は血を吸って強くなった!");
-#else
- msg_print("Muramasa sucked blood, and became more powerful!");
-#endif
+ msg_print(_("妖刀は血を吸って強くなった!", "Muramasa sucked blood, and became more powerful!"));
o_ptr->to_h = to_h;
o_ptr->to_d = to_d;
}
if (cheat_xtra)
{
-#ifdef JP
- msg_format("Draining left: %d", drain_left);
-#else
- msg_format("Draining left: %d", drain_left);
-#endif
-
+ msg_format(_("Draining left: %d", "Draining left: %d"), drain_left);
}
if (drain_left)
if (drain_msg)
{
-#ifdef JP
- msg_format("刃が%sから生命力を吸い取った!", m_name);
-#else
- msg_format("Your weapon drains life from %s!", m_name);
-#endif
-
+ msg_format(_("刃が%sから生命力を吸い取った!", "Your weapon drains life from %s!"), m_name);
drain_msg = FALSE;
}
if (p_ptr->special_attack & ATTACK_CONFUSE)
{
p_ptr->special_attack &= ~(ATTACK_CONFUSE);
-#ifdef JP
- msg_print("手の輝きがなくなった。");
-#else
- msg_print("Your hands stop glowing.");
-#endif
+ msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
p_ptr->redraw |= (PR_STATUS);
}
if (r_ptr->flags3 & RF3_NO_CONF)
{
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_NO_CONF;
-
-#ifdef JP
- msg_format("%^sには効果がなかった。", m_name);
-#else
- msg_format("%^s is unaffected.", m_name);
-#endif
+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
}
else if (randint0(100) < r_ptr->level)
{
-#ifdef JP
- msg_format("%^sには効果がなかった。", m_name);
-#else
- msg_format("%^s is unaffected.", m_name);
-#endif
-
+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
}
else
{
-#ifdef JP
- msg_format("%^sは混乱したようだ。", m_name);
-#else
- msg_format("%^s appears confused.", m_name);
-#endif
-
+ msg_format(_("%^sは混乱したようだ。", "%^s appears confused."), m_name);
(void)set_monster_confused(c_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5);
}
}
if (r_ptr->flags1 & RF1_UNIQUE)
{
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
-#ifdef JP
- msg_format("%^sには効果がなかった。", m_name);
-#else
- msg_format("%^s is unaffected!", m_name);
-#endif
-
+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), m_name);
resists_tele = TRUE;
}
else if (r_ptr->level > randint1(100))
{
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
-#ifdef JP
- msg_format("%^sは抵抗力を持っている!", m_name);
-#else
- msg_format("%^s resists!", m_name);
-#endif
-
+ msg_format(_("%^sは抵抗力を持っている!", "%^s resists!"), m_name);
resists_tele = TRUE;
}
}
if (!resists_tele)
{
-#ifdef JP
- msg_format("%^sは消えた!", m_name);
-#else
- msg_format("%^s disappears!", m_name);
-#endif
-
+ msg_format(_("%^sは消えた!", "%^s disappears!"), m_name);
teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
num = num_blow + 1; /* Can't hit it anymore! */
*mdeath = TRUE;
{
if (polymorph_monster(y, x))
{
-#ifdef JP
- msg_format("%^sは変化した!", m_name);
-#else
- msg_format("%^s changes!", m_name);
-#endif
-
+ msg_format(_("%^sは変化した!", "%^s changes!"), m_name);
*fear = FALSE;
weak = FALSE;
}
else
{
-#ifdef JP
- msg_format("%^sには効果がなかった。", m_name);
-#else
- msg_format("%^s is unaffected.", m_name);
-#endif
+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
}
/* Hack -- Get new monster */
}
else if (o_ptr->name1 == ART_G_HAMMER)
{
- monster_type *m_ptr = &m_list[c_ptr->m_idx];
+ monster_type *target_ptr = &m_list[c_ptr->m_idx];
- if (m_ptr->hold_o_idx)
+ if (target_ptr->hold_o_idx)
{
- object_type *q_ptr = &o_list[m_ptr->hold_o_idx];
+ object_type *q_ptr = &o_list[target_ptr->hold_o_idx];
char o_name[MAX_NLEN];
object_desc(o_name, q_ptr, OD_NAME_ONLY);
q_ptr->held_m_idx = 0;
q_ptr->marked = OM_TOUCHED;
- m_ptr->hold_o_idx = q_ptr->next_o_idx;
+ target_ptr->hold_o_idx = q_ptr->next_o_idx;
q_ptr->next_o_idx = 0;
-#ifdef JP
- msg_format("%sを奪った。", o_name);
-#else
- msg_format("You snatched %s.", o_name);
-#endif
+ msg_format(_("%sを奪った。", "You snatched %s."), o_name);
inven_carry(q_ptr);
}
}
if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE) && one_in_(3))
{
- u32b flgs[TR_FLAG_SIZE];
+ u32b flgs_aux[TR_FLAG_SIZE];
/* Sound */
sound(SOUND_HIT);
/* Message */
-#ifdef JP
- msg_format("ミス! %sにかわされた。", m_name);
-#else
- msg_format("You miss %s.", m_name);
-#endif
+ msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
/* Message */
-#ifdef JP
- msg_print("振り回した大鎌が自分自身に返ってきた!");
-#else
- msg_print("Your scythe returns to you!");
-#endif
+ msg_print(_("振り回した大鎌が自分自身に返ってきた!", "Your scythe returns to you!"));
/* Extract the flags */
- object_flags(o_ptr, flgs);
+ object_flags(o_ptr, flgs_aux);
k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
{
if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && (mult < 25))
mult = 25;
- if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (p_ptr->msp / 30)))
+ if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs_aux, TR_FORCE_WEAPON)) && (p_ptr->csp > (p_ptr->msp / 30)))
{
p_ptr->csp -= (1+(p_ptr->msp / 30));
p_ptr->redraw |= (PR_MANA);
mult = mult * 3 / 2 + 20;
}
- k *= mult;
+ k *= (HIT_POINT)mult;
k /= 10;
}
if (one_in_(6))
{
int mult = 2;
-#ifdef JP
- msg_format("グッサリ切り裂かれた!");
-#else
- msg_format("Your weapon cuts deep into yourself!");
-#endif
+ msg_format(_("グッサリ切り裂かれた!", "Your weapon cuts deep into yourself!"));
/* Try to increase the damage */
while (one_in_(4))
{
mult++;
}
- k *= mult;
+ k *= (HIT_POINT)mult;
}
k += (p_ptr->to_d[hand] + o_ptr->to_d);
-
if (k < 0) k = 0;
-#ifdef JP
- take_hit(DAMAGE_FORCE, k, "死の大鎌", -1);
-#else
- take_hit(DAMAGE_FORCE, k, "Death scythe", -1);
-#endif
-
+ take_hit(DAMAGE_FORCE, k, _("死の大鎌", "Death scythe"), -1);
redraw_stuff();
}
else
sound(SOUND_MISS);
/* Message */
-#ifdef JP
- msg_format("ミス! %sにかわされた。", m_name);
-#else
- msg_format("You miss %s.", m_name);
-#endif
+ msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
}
}
backstab = FALSE;
if (weak && !(*mdeath))
{
-#ifdef JP
- msg_format("%sは弱くなったようだ。", m_name);
-#else
- msg_format("%^s seems weakened.", m_name);
-#endif
+ msg_format(_("%sは弱くなったようだ。", "%^s seems weakened."), m_name);
}
if (drain_left != MAX_VAMPIRIC_DRAIN)
{
/* Mega-Hack -- apply earthquake brand */
if (do_quake)
{
- earthquake(py, px, 10);
+ earthquake(p_ptr->y, p_ptr->x, 10);
if (!cave[y][x].m_idx) *mdeath = TRUE;
}
}
* @details
* If no "weapon" is available, then "punch" the monster one time.
*/
-bool py_attack(int y, int x, int mode)
+bool py_attack(int y, int x, BIT_FLAGS mode)
{
bool fear = FALSE;
bool mdeath = FALSE;
/* Disturb the player */
disturb(0, 1);
- energy_use = 100;
+ p_ptr->energy_use = 100;
if (!p_ptr->migite && !p_ptr->hidarite &&
!(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
{
-#ifdef JP
- msg_format("%s攻撃できない。", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "両手がふさがって" : "");
-#else
- msg_print("You cannot do attacking.");
-#endif
+ msg_format(_("%s攻撃できない。", "You cannot do attacking."),
+ (empty_hands(FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
return FALSE;
}
{
if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
{
-#ifdef JP
- msg_print("拙者、おなごは斬れぬ!");
-#else
- msg_print("I can not attack women!");
-#endif
+ msg_print(_("拙者、おなごは斬れぬ!", "I can not attack women!"));
return FALSE;
}
}
if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
{
-#ifdef JP
- msg_print("なぜか攻撃することができない。");
-#else
- msg_print("Something prevent you from attacking.");
-#endif
+ msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
return FALSE;
}
if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
if (stormbringer)
{
-#ifdef JP
- msg_format("黒い刃は強欲に%sを攻撃した!", m_name);
-#else
- msg_format("Your black blade greedily attacks %s!", m_name);
-#endif
+ msg_format(_("黒い刃は強欲に%sを攻撃した!", "Your black blade greedily attacks %s!"), m_name);
chg_virtue(V_INDIVIDUALISM, 1);
chg_virtue(V_HONOUR, -1);
chg_virtue(V_JUSTICE, -1);
}
else if (p_ptr->pclass != CLASS_BERSERKER)
{
-#ifdef JP
- if (get_check("本当に攻撃しますか?"))
-#else
- if (get_check("Really hit it? "))
-#endif
+ if (get_check(_("本当に攻撃しますか?", "Really hit it? ")))
{
chg_virtue(V_INDIVIDUALISM, 1);
chg_virtue(V_HONOUR, -1);
}
else
{
-#ifdef JP
- msg_format("%sを攻撃するのを止めた。", m_name);
-#else
- msg_format("You stop to avoid hitting %s.", m_name);
-#endif
+ msg_format(_("%sを攻撃するのを止めた。", "You stop to avoid hitting %s."), m_name);
return FALSE;
}
}
{
/* Message */
if (m_ptr->ml)
-#ifdef JP
- msg_format("恐くて%sを攻撃できない!", m_name);
-#else
- msg_format("You are too afraid to attack %s!", m_name);
-#endif
-
+ msg_format(_("恐くて%sを攻撃できない!", "You are too afraid to attack %s!"), m_name);
else
-#ifdef JP
- msg_format ("そっちには何か恐いものがいる!");
-#else
- msg_format ("There is something scary in your way!");
-#endif
+ msg_format (_("そっちには何か恐いものがいる!", "There is something scary in your way!"));
/* Disturb the monster */
(void)set_monster_csleep(c_ptr->m_idx, 0);
sound(SOUND_FLEE);
/* Message */
-#ifdef JP
- msg_format("%^sは恐怖して逃げ出した!", m_name);
-#else
- msg_format("%^s flees in terror!", m_name);
-#endif
-
+ msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
}
if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
{
if (!is_pattern_tile_cur && !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
{
-#ifdef JP
- if (get_check("パターンの上を歩き始めると、全てを歩かなければなりません。いいですか?"))
-#else
- if (get_check("If you start walking the Pattern, you must walk the whole way. Ok? "))
-#endif
+ if (get_check(_("パターンの上を歩き始めると、全てを歩かなければなりません。いいですか?",
+ "If you start walking the Pattern, you must walk the whole way. Ok? ")))
return TRUE;
else
return FALSE;
}
else
{
-#ifdef JP
- msg_print("パターンの上を歩くにはスタート地点から歩き始めなくてはなりません。");
-#else
- msg_print("You must start walking the Pattern from the startpoint.");
-#endif
+ msg_print(_("パターンの上を歩くにはスタート地点から歩き始めなくてはなりません。",
+ "You must start walking the Pattern from the startpoint."));
return FALSE;
}
return TRUE;
else
{
-#ifdef JP
- msg_print("パターンの上は正しい順序で歩かねばなりません。");
-#else
- msg_print("You must walk the Pattern in correct order.");
-#endif
-
+ msg_print(_("パターンの上は正しい順序で歩かねばなりません。", "You must walk the Pattern in correct order."));
return FALSE;
}
}
{
if (!is_pattern_tile_new)
{
-#ifdef JP
- msg_print("パターンを踏み外してはいけません。");
-#else
- msg_print("You may not step off from the Pattern.");
-#endif
-
+ msg_print(_("パターンを踏み外してはいけません。", "You may not step off from the Pattern."));
return FALSE;
}
else
{
if (!is_pattern_tile_cur)
{
-#ifdef JP
- msg_print("パターンの上を歩くにはスタート地点から歩き始めなくてはなりません。");
-#else
- msg_print("You must start walking the Pattern from the startpoint.");
-#endif
+ msg_print(_("パターンの上を歩くにはスタート地点から歩き始めなくてはなりません。",
+ "You must start walking the Pattern from the startpoint."));
return FALSE;
}
break;
default:
if (p_ptr->wizard)
-#ifdef JP
- msg_format("おかしなパターン歩行、%d。", pattern_type_cur);
-#else
- msg_format("Funny Pattern walking, %d.", pattern_type_cur);
-#endif
+ msg_format(_("おかしなパターン歩行、%d。", "Funny Pattern walking, %d."), pattern_type_cur);
return TRUE; /* Goof-up */
}
else
{
if (!is_pattern_tile_new)
-#ifdef JP
- msg_print("パターンを踏み外してはいけません。");
-#else
- msg_print("You may not step off from the Pattern.");
-#endif
+ msg_print(_("パターンを踏み外してはいけません。", "You may not step off from the Pattern."));
else
-#ifdef JP
- msg_print("パターンの上は正しい順序で歩かねばなりません。");
-#else
- msg_print("You must walk the Pattern in correct order.");
-#endif
+ msg_print(_("パターンの上は正しい順序で歩かねばなりません。", "You must walk the Pattern in correct order."));
return FALSE;
}
* @param mpe_mode 移動オプションフラグ
* @return プレイヤーが死亡やフロア離脱を行わず、実際に移動が可能ならばTRUEを返す。
*/
-bool move_player_effect(int ny, int nx, u32b mpe_mode)
+bool move_player_effect(POSITION ny, POSITION nx, u32b mpe_mode)
{
cave_type *c_ptr = &cave[ny][nx];
feature_type *f_ptr = &f_info[c_ptr->feat];
if (!(mpe_mode & MPE_STAYING))
{
- int oy = py;
- int ox = px;
+ POSITION oy = p_ptr->y;
+ POSITION ox = p_ptr->x;
cave_type *oc_ptr = &cave[oy][ox];
- int om_idx = oc_ptr->m_idx;
- int nm_idx = c_ptr->m_idx;
+ IDX om_idx = oc_ptr->m_idx;
+ IDX nm_idx = c_ptr->m_idx;
/* Move the player */
- py = ny;
- px = nx;
+ p_ptr->y = ny;
+ p_ptr->x = nx;
/* Hack -- For moving monster or riding player's moving */
if (!(mpe_mode & MPE_DONT_SWAP_MON))
(!have_flag(f_ptr->flags, FF_PROJECT) ||
(!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP))))
{
-#ifdef JP
- msg_print("ここでは素早く動けない。");
-#else
- msg_print("You cannot run in here.");
-#endif
+ msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
set_action(ACTION_NONE);
}
}
{
if (music_singing(MUSIC_WALL))
{
- (void)project(0, 0, py, px, (60 + p_ptr->lev), GF_DISINTEGRATE,
+ (void)project(0, 0, p_ptr->y, p_ptr->x, (60 + p_ptr->lev), GF_DISINTEGRATE,
PROJECT_KILL | PROJECT_ITEM, -1);
if (!player_bold(ny, nx) || p_ptr->is_dead || p_ptr->leaving) return FALSE;
/* Disturb */
disturb(0, 1);
- energy_use = 0;
+ p_ptr->energy_use = 0;
/* Hack -- Enter store */
command_new = SPECIAL_KEY_STORE;
}
/* Disturb */
disturb(0, 1);
- energy_use = 0;
+ p_ptr->energy_use = 0;
/* Hack -- Enter building */
command_new = SPECIAL_KEY_BUILDING;
}
/* Disturb */
disturb(0, 1);
- energy_use = 0;
+ p_ptr->energy_use = 0;
/* Hack -- Enter quest level */
command_new = SPECIAL_KEY_QUEST;
}
if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
{
/* Message */
-#ifdef JP
- msg_print("トラップだ!");
-#else
- msg_print("You found a trap!");
-#endif
+ msg_print(_("トラップだ!", "You found a trap!"));
/* Pick a trap */
- disclose_grid(py, px);
+ disclose_grid(p_ptr->y, p_ptr->x);
}
/* Hit the trap */
{
if (alert_trap_detect)
{
-#ifdef JP
- msg_print("* 注意:この先はトラップの感知範囲外です! *");
-#else
- msg_print("*Leaving trap detect region!*");
-#endif
+ msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
}
if (disturb_trap_detect) disturb(0, 1);
* any monster which might be in the destination grid. Previously,\n
* moving into walls was "free" and did NOT hit invisible monsters.\n
*/
-void move_player(int dir, bool do_pickup, bool break_trap)
+void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
{
/* Find the result of moving */
- int y = py + ddy[dir];
- int x = px + ddx[dir];
+ POSITION y = p_ptr->y + ddy[dir];
+ POSITION x = p_ptr->x + ddx[dir];
/* Examine the destination */
cave_type *c_ptr = &cave[y][x];
}
p_ptr->leaving = TRUE;
- energy_use = 100;
+ p_ptr->energy_use = 100;
return;
}
if (!is_hostile(m_ptr) &&
!(p_ptr->confused || p_ptr->image || !m_ptr->ml || p_ptr->stun ||
((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
- pattern_seq(py, px, y, x) && (p_can_enter || p_can_kill_walls))
+ pattern_seq(p_ptr->y, p_ptr->x, y, x) && (p_can_enter || p_can_kill_walls))
{
/* Disturb the monster */
(void)set_monster_csleep(c_ptr->m_idx, 0);
py_attack(y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(cave[py][px].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(cave[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
{
do_past = TRUE;
}
else
{
-#ifdef JP
- msg_format("%^sが邪魔だ!", m_name);
-#else
- msg_format("%^s is in your way!", m_name);
-#endif
-
- energy_use = 0;
+ msg_format(_("%^sが邪魔だ!", "%^s is in your way!"), m_name);
+ p_ptr->energy_use = 0;
oktomove = FALSE;
}
{
if (riding_r_ptr->flags1 & RF1_NEVER_MOVE)
{
-#ifdef JP
- msg_print("動けない!");
-#else
- msg_print("Can't move!");
-#endif
- energy_use = 0;
+ msg_print(_("動けない!", "Can't move!"));
+ p_ptr->energy_use = 0;
oktomove = FALSE;
disturb(0, 1);
}
else if (MON_MONFEAR(riding_m_ptr))
{
- char m_name[80];
+ char steed_name[80];
/* Acquire the monster name */
- monster_desc(m_name, riding_m_ptr, 0);
+ monster_desc(steed_name, riding_m_ptr, 0);
/* Dump a message */
-#ifdef JP
- msg_format("%sが恐怖していて制御できない。", m_name);
-#else
- msg_format("%^s is too scared to control.", m_name);
-#endif
+ msg_format(_("%sが恐怖していて制御できない。", "%^s is too scared to control."), steed_name);
oktomove = FALSE;
disturb(0, 1);
}
!(riding_r_ptr->flags7 & RF7_AQUATIC) &&
(have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE)))
{
-#ifdef JP
- msg_format("%sの上に行けない。", f_name + f_info[get_feat_mimic(c_ptr)].name);
-#else
- msg_print("Can't swim.");
-#endif
- energy_use = 0;
+ msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(c_ptr)].name);
+ p_ptr->energy_use = 0;
oktomove = FALSE;
disturb(0, 1);
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
-#ifdef JP
- msg_format("%sから上がれない。", f_name + f_info[get_feat_mimic(&cave[py][px])].name);
-#else
- msg_print("Can't land.");
-#endif
- energy_use = 0;
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
+ p_ptr->energy_use = 0;
oktomove = FALSE;
disturb(0, 1);
}
else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
-#ifdef JP
- msg_format("%sの上に行けない。", f_name + f_info[get_feat_mimic(c_ptr)].name);
-#else
- msg_print("Too hot to go through.");
-#endif
- energy_use = 0;
+ msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(c_ptr)].name);
+ p_ptr->energy_use = 0;
oktomove = FALSE;
disturb(0, 1);
}
if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
{
- char m_name[80];
- monster_desc(m_name, riding_m_ptr, 0);
-#ifdef JP
- msg_format("%sが朦朧としていてうまく動けない!",m_name);
-#else
- msg_format("You cannot control stunned %s!",m_name);
-#endif
+ char steed_name[80];
+ monster_desc(steed_name, riding_m_ptr, 0);
+ msg_format(_("%sが朦朧としていてうまく動けない!", "You cannot control stunned %s!"), steed_name);
oktomove = FALSE;
disturb(0, 1);
}
else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation)
{
-#ifdef JP
- msg_format("空を飛ばないと%sの上には行けない。", f_name + f_info[get_feat_mimic(c_ptr)].name);
-#else
- msg_format("You need to fly to go through the %s.", f_name + f_info[get_feat_mimic(c_ptr)].name);
-#endif
-
- energy_use = 0;
+ msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(c_ptr)].name);
+ p_ptr->energy_use = 0;
running = 0;
oktomove = FALSE;
}
*/
else if (have_flag(f_ptr->flags, FF_TREE) && !p_can_kill_walls)
{
- if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) energy_use *= 2;
+ if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) p_ptr->energy_use *= 2;
}
#ifdef ALLOW_EASY_DISARM /* TNB */
/* Boundary floor mimic */
if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
{
-#ifdef JP
- msg_print("それ以上先には進めないようだ。");
-#else
- msg_print("You feel you cannot go any more.");
-#endif
+ msg_print(_("それ以上先には進めないようだ。", "You feel you cannot go any more."));
}
/* Wall (or secret door) */
/* Boundary floor mimic */
if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
{
-#ifdef JP
- msg_print("それ以上先には進めない。");
-#else
- msg_print("You cannot go any more.");
-#endif
-
+ msg_print(_("それ以上先には進めない。", "You cannot go any more."));
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- energy_use = 0;
+ p_ptr->energy_use = 0;
}
/* Wall (or secret door) */
* typing mistakes should not cost you a turn...
*/
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- energy_use = 0;
+ p_ptr->energy_use = 0;
}
}
}
/* Normal movement */
- if (oktomove && !pattern_seq(py, px, y, x))
+ if (oktomove && !pattern_seq(p_ptr->y, p_ptr->x, y, x))
{
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
{
- energy_use = 0;
+ p_ptr->energy_use = 0;
}
/* To avoid a loop with running */
{
if (!process_warning(x, y))
{
- energy_use = 25;
+ p_ptr->energy_use = 25;
return;
}
}
if (do_past)
{
-#ifdef JP
- msg_format("%sを押し退けた。", m_name);
-#else
- msg_format("You push past %s.", m_name);
-#endif
+ msg_format(_("%sを押し退けた。", "You push past %s."), m_name);
}
/* Change oldpx and oldpy to place the player well when going back to big mode */
/*
* The direction we are running
*/
-static byte find_current;
+static DIRECTION find_current;
/*
* The direction we came from
*/
-static byte find_prevdir;
+static DIRECTION find_prevdir;
/*
* We are looking for open area
deepleft = deepright = FALSE;
shortright = shortleft = FALSE;
- p_ptr->run_py = py;
- p_ptr->run_px = px;
+ p_ptr->run_py = p_ptr->y;
+ p_ptr->run_px = p_ptr->x;
/* Find the destination grid */
- row = py + ddy[dir];
- col = px + ddx[dir];
+ row = p_ptr->y + ddy[dir];
+ col = p_ptr->x + ddx[dir];
ignore_avoid_run = cave_have_flag_bold(row, col, FF_AVOID_RUN);
i = chome[dir];
/* Check for walls */
- if (see_wall(cycle[i+1], py, px))
+ if (see_wall(cycle[i+1], p_ptr->y, p_ptr->x))
{
find_breakleft = TRUE;
shortleft = TRUE;
}
/* Check for walls */
- if (see_wall(cycle[i-1], py, px))
+ if (see_wall(cycle[i-1], p_ptr->y, p_ptr->x))
{
find_breakright = TRUE;
shortright = TRUE;
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(cave[py][px].info & CAVE_UNSAFE))
+ if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
-#ifdef JP
- msg_print("* 注意:この先はトラップの感知範囲外です! *");
-#else
- msg_print("*Leaving trap detect region!*");
-#endif
+ msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
}
if (disturb_trap_detect)
new_dir = cycle[chome[prev_dir] + i];
/* New location */
- row = py + ddy[new_dir];
- col = px + ddx[new_dir];
+ row = p_ptr->y + ddy[new_dir];
+ col = p_ptr->x + ddx[new_dir];
/* Access grid */
c_ptr = &cave[row][col];
for (i = -max; i < 0; i++)
{
/* Unknown grid or non-wall */
- if (!see_wall(cycle[chome[prev_dir] + i], py, px))
+ if (!see_wall(cycle[chome[prev_dir] + i], p_ptr->y, p_ptr->x))
{
/* Looking to break right */
if (find_breakright)
for (i = max; i > 0; i--)
{
/* Unknown grid or non-wall */
- if (!see_wall(cycle[chome[prev_dir] + i], py, px))
+ if (!see_wall(cycle[chome[prev_dir] + i], p_ptr->y, p_ptr->x))
{
/* Looking to break left */
if (find_breakleft)
else
{
/* Get next location */
- row = py + ddy[option];
- col = px + ddx[option];
+ row = p_ptr->y + ddy[option];
+ col = p_ptr->x + ddx[option];
/* Don't see that it is closed off. */
/* This could be a potential corner or an intersection. */
}
/* About to hit a known wall, stop */
- if (see_wall(find_current, py, px))
+ if (see_wall(find_current, p_ptr->y, p_ptr->x))
{
return (TRUE);
}
ignore_avoid_run = TRUE;
/* Hack -- do not start silly run */
- if (see_wall(dir, py, px))
+ if (see_wall(dir, p_ptr->y, p_ptr->x))
{
/* Message */
-#ifdef JP
- msg_print("その方向には走れません。");
-#else
- msg_print("You cannot run in that direction.");
-#endif
+ msg_print(_("その方向には走れません。", "You cannot run in that direction."));
/* Disturb */
disturb(0, 0);
if (--running <= 0) return;
/* Take time */
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Move the player, using the "pickup" flag */
#ifdef ALLOW_EASY_DISARM /* TNB */
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(cave[py][px].info & CAVE_UNSAFE))
+ if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
-#ifdef JP
- msg_print("* 注意:この先はトラップの感知範囲外です! *");
-#else
- msg_print("*Leaving trap detect region!*");
-#endif
+ msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
}
if (disturb_trap_detect)
int dir = cycle[chome[prev_dir] + i];
/* New location */
- int row = py + ddy[dir];
- int col = px + ddx[dir];
+ int row = p_ptr->y + ddy[dir];
+ int col = p_ptr->x + ddx[dir];
/* Access grid */
c_ptr = &cave[row][col];
}
/* Travel cost of current grid */
- cost = travel.cost[py][px];
+ cost = travel.cost[p_ptr->y][p_ptr->x];
/* Determine travel direction */
for (i = 0; i < 8; ++ i) {
- int dir_cost = travel.cost[py+ddy_ddd[i]][px+ddx_ddd[i]];
+ int dir_cost = travel.cost[p_ptr->y+ddy_ddd[i]][p_ptr->x+ddx_ddd[i]];
if (dir_cost < cost)
{
if (!new_dir) return (0);
/* Access newly move grid */
- c_ptr = &cave[py+ddy[new_dir]][px+ddx[new_dir]];
+ c_ptr = &cave[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(c_ptr->feat)) return (0);
{
if (travel.run == 255)
{
-#ifdef JP
- msg_print("道筋が見つかりません!");
-#else
- msg_print("No route is found!");
-#endif
+ msg_print(_("道筋が見つかりません!", "No route is found!"));
travel.y = travel.x = 0;
}
disturb(0, 1);
return;
}
- energy_use = 100;
+ p_ptr->energy_use = 100;
move_player(travel.dir, always_pickup, FALSE);
- if ((py == travel.y) && (px == travel.x))
+ if ((p_ptr->y == travel.y) && (p_ptr->x == travel.x))
{
travel.run = 0;
travel.y = travel.x = 0;