X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmspells3.c;h=6eebf3bff7007a35dc4172c18ef12a87259208b7;hb=ce135fa63c3eb78d8c8bac6a6bc61e1e8f2d0f0b;hp=c56fcfddb16a0b68524f519797a3dd38775b7842;hpb=f3b0c2d3886c629c86de60c4943727d4137ce737;p=hengband%2Fhengband.git diff --git a/src/mspells3.c b/src/mspells3.c index c56fcfddb..6eebf3bff 100644 --- a/src/mspells3.c +++ b/src/mspells3.c @@ -17,8 +17,8 @@ /*! * @brief 文字列に青魔導師の呪文の攻撃力を加える -* @param r_idx モンスターの種族ID * @param SPELL_NUM 呪文番号 +* @param plev プレイヤーレベル * @param msg 表示する文字列 * @param tmp 返すメッセージを格納する配列 * @return なし @@ -44,7 +44,6 @@ void set_bluemage_damage(int SPELL_NUM, int plev, cptr msg, char* tmp) static void learned_info(char *p, int power) { int plev = pseudo_plev(); - int hp = p_ptr->chp; #ifdef JP cptr s_dam = " 損傷:%s"; @@ -200,7 +199,7 @@ static void learned_info(char *p, int power) * when you run it. It's probably easy to fix but I haven't tried,\n * sorry.\n */ -static int get_learned_power(int *sn) +static int get_learned_power(SPELL_IDX *sn) { int i = 0; int num = 0; @@ -216,11 +215,7 @@ static int get_learned_power(int *sn) char out_val[160]; char comment[80]; s32b f4 = 0, f5 = 0, f6 = 0; -#ifdef JP -cptr p = "魔法"; -#else - cptr p = "magic"; -#endif + cptr p = _("魔法", "magic"); monster_power spell; bool flag, redraw; @@ -297,11 +292,7 @@ cptr p = "魔法"; } else { -#ifdef JP - sprintf(comment, "[A]ボルト, [B]ボール, [C]ブレス, [D]召喚, [E]その他:"); -#else - sprintf(comment, "[A] bolt, [B] ball, [C] breath, [D] summoning, [E] others:"); -#endif + sprintf(comment, _("[A]ボルト, [B]ボール, [C]ブレス, [D]召喚, [E]その他:", "[A] bolt, [B] ball, [C] breath, [D] summoning, [E] others:")); while (TRUE) { if (!get_com(comment, &ch, TRUE)) @@ -360,21 +351,13 @@ cptr p = "魔法"; } if (i == num) { -#ifdef JP - msg_print("その種類の魔法は覚えていない!"); -#else - msg_print("You don't know any spell of this type."); -#endif + msg_print(_("その種類の魔法は覚えていない!", "You don't know any spell of this type.")); return (FALSE); } /* Build a prompt (accept all spells) */ (void)strnfmt(out_val, 78, -#ifdef JP - "(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", -#else - "(%c-%c, *=List, ESC=exit) Use which %s? ", -#endif + _("(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "), I2A(0), I2A(num - 1), p); if (use_menu) screen_save(); @@ -465,17 +448,8 @@ cptr p = "魔法"; /* Display a list of spells */ prt("", y, x); -#ifdef JP -put_str("名前", y, x + 5); -#else - put_str("Name", y, x + 5); -#endif - -#ifdef JP -put_str("MP 失率 効果", y, x + 33); -#else - put_str("SP Fail Info", y, x + 32); -#endif + put_str(_("名前", "Name"), y, x + 5); + put_str(_("MP 失率 効果", "SP Fail Info"), y, x + 33); /* Dump the spells */ @@ -528,11 +502,7 @@ put_str("MP 失率 効果", y, x + 33); if (use_menu) { -#ifdef JP - if (i == (menu_line-1)) strcpy(psi_desc, " 》"); -#else - if (i == (menu_line-1)) strcpy(psi_desc, " > "); -#endif + if (i == (menu_line-1)) strcpy(psi_desc, _(" 》", " > ")); else strcpy(psi_desc, " "); } else sprintf(psi_desc, " %c)", I2A(i)); @@ -568,7 +538,7 @@ put_str("MP 失率 効果", y, x + 33); ask = isupper(choice); /* Lowercase */ - if (ask) choice = tolower(choice); + if (ask) choice = (char)tolower(choice); /* Extract request */ i = (islower(choice) ? A2I(choice) : -1); @@ -590,12 +560,7 @@ put_str("MP 失率 効果", y, x + 33); char tmp_val[160]; /* Prompt */ -#ifdef JP - (void) strnfmt(tmp_val, 78, "%sの魔法を唱えますか?", monster_powers[spellnum[i]].name); -#else - (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[spellnum[i]].name); -#endif - + (void) strnfmt(tmp_val, 78, _("%sの魔法を唱えますか?", "Use %s? "), monster_powers[spellnum[i]].name); /* Belay that order */ if (!get_check(tmp_val)) continue; @@ -643,7 +608,6 @@ static bool cast_learned_spell(int spell, bool success) int dir; int plev = pseudo_plev(); int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2); - int hp = p_ptr->chp; int damage = 0; bool pet = success; bool no_trump = FALSE; @@ -673,13 +637,13 @@ static bool cast_learned_spell(int spell, bool success) break; case MS_DISPEL: { - int m_idx; + MONSTER_IDX m_idx; if (!target_set(TARGET_KILL)) return FALSE; m_idx = cave[target_row][target_col].m_idx; if (!m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; - if (!projectable(py, px, target_row, target_col)) break; + if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break; dispel_monster_status(m_idx); break; } @@ -692,8 +656,6 @@ static bool cast_learned_spell(int spell, bool success) break; case MS_SHOOT: { - object_type *o_ptr = NULL; - if (!get_aim_dir(&dir)) return FALSE; msg_print(_("矢を放った。", "You fire an arrow.")); @@ -810,7 +772,7 @@ static bool cast_learned_spell(int spell, bool success) msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia.")); damage = monspell_bluemage_damage((MS_BR_INERTIA), plev, DAM_ROLL); - fire_ball(GF_INERTIA, dir, damage, (plev > 40 ? -3 : -2)); + fire_ball(GF_INERTIAL, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_GRAVITY: if (!get_aim_dir(&dir)) return FALSE; @@ -1138,7 +1100,7 @@ static bool cast_learned_spell(int spell, bool success) if (!target_set(TARGET_KILL)) return FALSE; if (!cave[target_row][target_col].m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; - if (!projectable(py, px, target_row, target_col)) break; + if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break; m_ptr = &m_list[cave[target_row][target_col].m_idx]; r_ptr = &r_info[m_ptr->r_idx]; monster_desc(m_name, m_ptr, 0); @@ -1158,7 +1120,7 @@ static bool cast_learned_spell(int spell, bool success) } } msg_format(_("%sを引き戻した。", "You command %s to return."), m_name); - teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE); + teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE); break; } case MS_TELE_AWAY: @@ -1168,7 +1130,7 @@ static bool cast_learned_spell(int spell, bool success) break; case MS_TELE_LEVEL: { - int target_m_idx; + MONSTER_IDX target_m_idx; monster_type *m_ptr; monster_race *r_ptr; char m_name[80]; @@ -1177,7 +1139,7 @@ static bool cast_learned_spell(int spell, bool success) target_m_idx = cave[target_row][target_col].m_idx; if (!target_m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; - if (!projectable(py, px, target_row, target_col)) break; + if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break; m_ptr = &m_list[target_m_idx]; r_ptr = &r_info[m_ptr->r_idx]; monster_desc(m_name, m_ptr, 0); @@ -1214,7 +1176,7 @@ static bool cast_learned_spell(int spell, bool success) break; case MS_RAISE_DEAD: msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead.")); - (void)animate_dead(0, py, px); + (void)animate_dead(0, p_ptr->y, p_ptr->x); break; case MS_S_KIN: { @@ -1223,7 +1185,7 @@ static bool cast_learned_spell(int spell, bool success) msg_print(_("援軍を召喚した。", "You summon minions.")); for (k = 0;k < 1; k++) { - if (summon_kin_player(summon_lev, py, px, (pet ? PM_FORCE_PET : 0L))) + if (summon_kin_player(summon_lev, p_ptr->y, p_ptr->x, (pet ? PM_FORCE_PET : 0L))) { if (!pet) msg_print(_("召喚された仲間は怒っている!", "Summoned fellows are angry!")); } @@ -1240,7 +1202,7 @@ static bool cast_learned_spell(int spell, bool success) msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!")); for (k = 0 ;k < 1 ; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, p_mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_CYBER, p_mode)) { if (!pet) msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!")); @@ -1256,7 +1218,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("仲間を召喚した。", "You summon help.")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, p_mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, p_mode)) { if (!pet) msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!")); @@ -1272,7 +1234,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("モンスターを召喚した!", "You summon monsters!")); for (k = 0;k < plev / 15 + 2; k++) - if(summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, (p_mode | u_mode))) + if(summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, (p_mode | u_mode))) { if (!pet) msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!")); @@ -1288,7 +1250,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("アリを召喚した。", "You summon ants.")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!")); @@ -1304,7 +1266,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("蜘蛛を召喚した。", "You summon spiders.")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!")); @@ -1320,7 +1282,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("ハウンドを召喚した。", "You summon hounds.")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!")); @@ -1336,7 +1298,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("ヒドラを召喚した。", "You summon a hydras.")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, (g_mode | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode))) { if (!pet) msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!")); @@ -1352,7 +1314,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("天使を召喚した!", "You summon an angel!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANGEL, (g_mode | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode))) { if (!pet) msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!")); @@ -1368,7 +1330,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DEMON, (g_mode | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode))) { if (!pet) msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!")); @@ -1384,7 +1346,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode))) { if (!pet) msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!")); @@ -1400,7 +1362,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("ドラゴンを召喚した!", "You summon a dragon!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, (g_mode | p_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode))) { if (!pet) msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!")); @@ -1416,7 +1378,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode))) { if (!pet) msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!")); @@ -1432,7 +1394,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode))) { if (!pet) msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!")); @@ -1448,7 +1410,7 @@ static bool cast_learned_spell(int spell, bool success) int k; msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode))) { if (!pet) msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!")); @@ -1462,20 +1424,20 @@ static bool cast_learned_spell(int spell, bool success) case MS_S_UNIQUE: { int k, count = 0; - msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!")); + msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!")); for (k = 0;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE))) { count++; - if (!pet) - msg_print(_("召喚されたユニーク・モンスターは怒っている!", "Summoned special opponents are angry!")); + if (!pet) + msg_print(_("召喚されたユニーク・モンスターは怒っている!", "Summoned special opponents are angry!")); } for (k = count;k < 1; k++) - if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE))) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE))) { count++; - if (!pet) - msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!")); + if (!pet) + msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!")); } if (!count) { @@ -1501,7 +1463,7 @@ static bool cast_learned_spell(int spell, bool success) */ bool do_cmd_cast_learned(void) { - int n = 0; + SPELL_IDX n = 0; int chance; int minfail = 0; int plev = p_ptr->lev; @@ -1513,12 +1475,7 @@ bool do_cmd_cast_learned(void) /* not if confused */ if (p_ptr->confused) { -#ifdef JP -msg_print("混乱していて唱えられない!"); -#else - msg_print("You are too confused!"); -#endif - + msg_print(_("混乱していて唱えられない!", "You are too confused!")); return TRUE; } @@ -1533,22 +1490,12 @@ msg_print("混乱していて唱えられない!"); if (need_mana > p_ptr->csp) { /* Warning */ -#ifdef JP -msg_print("MPが足りません。"); -#else - msg_print("You do not have enough mana to use this power."); -#endif - + msg_print(_("MPが足りません。", "You do not have enough mana to use this power.")); if (!over_exert) return FALSE; /* Verify */ -#ifdef JP -if (!get_check("それでも挑戦しますか? ")) return FALSE; -#else - if (!get_check("Attempt it anyway? ")) return FALSE; -#endif - + if (!get_check(_("それでも挑戦しますか? ", "Attempt it anyway? "))) return FALSE; } /* Spell failure chance */ @@ -1588,11 +1535,7 @@ if (!get_check("それでも挑戦しますか? ")) return FALSE; if (randint0(100) < chance) { if (flush_failure) flush(); -#ifdef JP -msg_print("魔法をうまく唱えられなかった。"); -#else - msg_print("You failed to concentrate hard enough!"); -#endif + msg_print(_("魔法をうまく唱えられなかった。", "You failed to concentrate hard enough!")); sound(SOUND_FAIL); @@ -1625,12 +1568,7 @@ msg_print("魔法をうまく唱えられなかった。"); p_ptr->csp_frac = 0; /* Message */ -#ifdef JP -msg_print("精神を集中しすぎて気を失ってしまった!"); -#else - msg_print("You faint from the effort!"); -#endif - + msg_print(_("精神を集中しすぎて気を失ってしまった!", "You faint from the effort!")); /* Hack -- Bypass free action */ (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1)); @@ -1643,12 +1581,7 @@ msg_print("精神を集中しすぎて気を失ってしまった!"); bool perm = (randint0(100) < 25); /* Message */ -#ifdef JP -msg_print("体を悪くしてしまった!"); -#else - msg_print("You have damaged your health!"); -#endif - + msg_print(_("体を悪くしてしまった!", "You have damaged your health!")); /* Reduce constitution */ (void)dec_stat(A_CON, 15 + randint1(10), perm); @@ -1656,7 +1589,7 @@ msg_print("体を悪くしてしまった!"); } /* Take a turn */ - energy_use = 100; + p_ptr->energy_use = 100; /* Window stuff */ p_ptr->redraw |= (PR_MANA); @@ -1680,11 +1613,7 @@ void learn_spell(int monspell) if (randint1(p_ptr->lev + 70) > monster_powers[monspell].level + 40) { p_ptr->magic_num2[monspell] = 1; -#ifdef JP - msg_format("%sを学習した!", monster_powers[monspell].name); -#else - msg_format("You have learned %s!", monster_powers[monspell].name); -#endif + msg_format(_("%sを学習した!", "You have learned %s!"), monster_powers[monspell].name); gain_exp(monster_powers[monspell].level * monster_powers[monspell].smana); /* Sound */