#include "angband.h"
#include "cmd-magiceat.h"
+#include "cmd-mane.h"
#include "cmd-zapwand.h"
#include "cmd-pet.h"
#include "melee.h"
#include "player-status.h"
#include "spells-status.h"
#include "spells-object.h"
-
-/*!
- * @brief 魔法系コマンドを実行できるかの判定を返す
- * @return 魔法系コマンドを使用可能ならTRUE、不可能ならば理由をメッセージ表示してFALSEを返す。
- */
-static bool can_do_cmd_cast(void)
-{
- if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
- {
- msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
- msg_print(NULL);
- return FALSE;
- }
- else if (p_ptr->anti_magic)
- {
- msg_print(_("反魔法バリアが魔法を邪魔した!", "An anti-magic shell disrupts your magic!"));
- return FALSE;
- }
- else if (p_ptr->shero)
- {
- msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
- return FALSE;
- }
- else
- return TRUE;
-}
+#include "spells-floor.h"
+#include "cmd-spell.h"
+#include "realm-hex.h"
/*!
* @brief 修行僧の構え設定処理
int i;
char buf[80];
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて構えられない!", "Too confused."));
- return FALSE;
- }
+ if (cmd_limit_confused(p_ptr)) return FALSE;
screen_save();
prt(_(" a) 構えをとく", " a) No form"), 2, 20);
}
prt("", 1, 0);
- prt(_(" どの構えをとりますか?", " Choose Form: "), 1, 14);
+ prt(_(" どの構えをとりますか?", " Choose Stance: "), 1, 14);
while(1)
{
set_action(ACTION_NONE);
}
else
- msg_print(_("もともと構えていない。", "You are not assuming a posture."));
+ msg_print(_("もともと構えていない。", "You are not in a special stance."));
screen_load();
return TRUE;
}
if (p_ptr->special_defense & (KAMAE_GENBU << new_kamae))
{
- msg_print(_("構え直した。", "You reassume a posture."));
+ msg_print(_("構え直した。", "You reassume a stance."));
}
else
{
p_ptr->special_defense &= ~(KAMAE_MASK);
p_ptr->update |= (PU_BONUS);
p_ptr->redraw |= (PR_STATE);
- msg_format(_("%sの構えをとった。", "You assume a posture of %s form."),kamae_shurui[new_kamae].desc);
+ msg_format(_("%sの構えをとった。", "You assume the %s stance."),kamae_shurui[new_kamae].desc);
p_ptr->special_defense |= (KAMAE_GENBU << new_kamae);
}
p_ptr->redraw |= PR_STATE;
int i;
char buf[80];
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて構えられない!", "Too confused."));
- return FALSE;
- }
+ if (cmd_limit_confused(p_ptr)) return FALSE;
if (p_ptr->stun)
{
{
if (p_ptr->lev >= kata_shurui[i].min_level)
{
- sprintf(buf,_(" %c) %sの型 %s", " %c) Form of %-12s %s"),I2A(i+1), kata_shurui[i].desc, kata_shurui[i].info);
+ sprintf(buf,_(" %c) %sの型 %s", " %c) Stance of %-12s %s"),I2A(i+1), kata_shurui[i].desc, kata_shurui[i].info);
prt(buf, 3+i, 20);
}
}
prt("", 1, 0);
- prt(_(" どの型で構えますか?", " Choose Form: "), 1, 14);
+ prt(_(" どの型で構えますか?", " Choose Stance: "), 1, 14);
while(1)
{
set_action(ACTION_NONE);
}
else
- msg_print(_("もともと構えていない。", "You are not assuming posture."));
+ msg_print(_("もともと構えていない。", "You are not in a special stance."));
screen_load();
return TRUE;
}
if (p_ptr->special_defense & (KATA_IAI << new_kata))
{
- msg_print(_("構え直した。", "You reassume a posture."));
+ msg_print(_("構え直した。", "You reassume a stance."));
}
else
{
p_ptr->special_defense &= ~(KATA_MASK);
p_ptr->update |= (PU_BONUS | PU_MONSTERS);
- msg_format(_("%sの型で構えた。", "You assume a posture of %s form."),kata_shurui[new_kata].desc);
+ msg_format(_("%sの型で構えた。", "You assume the %s stance."),kata_shurui[new_kata].desc);
p_ptr->special_defense |= (KATA_IAI << new_kata);
}
p_ptr->redraw |= (PR_STATE | PR_STATUS);
PLAYER_LEVEL level; //!<体得レベル
int cost;
int stat;
- int fail;
+ PERCENTAGE fail;
int number;
};
static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
{
PLAYER_LEVEL min_level = pd_ptr->level;
- int difficulty = pd_ptr->fail;
+ PERCENTAGE difficulty = pd_ptr->fail;
int i;
int val;
int sum = 0;
- int stat = p_ptr->stat_cur[pd_ptr->stat];
+ BASE_STATUS stat = p_ptr->stat_cur[pd_ptr->stat];
/* No chance for success */
if ((p_ptr->lev < min_level) || p_ptr->confused)
/* Calculate difficulty */
if (p_ptr->stun)
{
- difficulty += p_ptr->stun;
+ difficulty += (PERCENTAGE)p_ptr->stun;
}
else if (p_ptr->lev > min_level)
{
- int lev_adj = ((p_ptr->lev - min_level) / 3);
+ PERCENTAGE lev_adj = (PERCENTAGE)((p_ptr->lev - min_level) / 3);
if (lev_adj > 10) lev_adj = 10;
difficulty -= lev_adj;
}
}
-static int racial_cost;
+static int racial_cost;
/*!
* @brief レイシャル・パワーの発動の判定処理
msg_format(_("この能力を使用するにはレベル %d に達していなければなりません。",
"You need to attain level %d to use this power."), min_level);
- p_ptr->energy_use = 0;
- return 0;
+ free_turn(p_ptr);
+ return FALSE;
}
- /* Too confused */
- else if (p_ptr->confused)
+ if (cmd_limit_confused(p_ptr))
{
- msg_print(_("混乱していてその能力は使えない。", "You are too confused to use this power."));
- p_ptr->energy_use = 0;
- return 0;
+ free_turn(p_ptr);
+ return FALSE;
}
/* Risk death? */
{
if (!get_check(_("本当に今の衰弱した状態でこの能力を使いますか?", "Really use the power in your weakened state? ")))
{
- p_ptr->energy_use = 0;
- return 0;
+ free_turn(p_ptr);
+ return FALSE;
}
}
}
/* take time and pay the price */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
/* Success? */
if (randint1(p_ptr->stat_cur[use_stat]) >= ((difficulty / 2) + randint1(difficulty / 2)))
}
case CLASS_CHAOS_WARRIOR:
{
- msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
- slow_monsters(p_ptr->lev);
- stun_monsters(p_ptr->lev * 4);
- confuse_monsters(p_ptr->lev * 4);
- turn_monsters(p_ptr->lev * 4);
- stasis_monsters(p_ptr->lev * 4);
+ return confusing_light(p_ptr);
break;
}
case CLASS_MONK:
{
if (!(empty_hands(TRUE) & EMPTY_HAND_RARM))
{
- msg_print(_("素手じゃないとできません。", "You need to be bare hand."));
+ msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
return FALSE;
}
if (p_ptr->riding)
case CLASS_MINDCRAFTER:
case CLASS_FORCETRAINER:
{
- if (total_friends)
- {
- msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
- return FALSE;
- }
- msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
-
- p_ptr->csp += (3 + p_ptr->lev/20);
- if (p_ptr->csp >= p_ptr->msp)
- {
- p_ptr->csp = p_ptr->msp;
- p_ptr->csp_frac = 0;
- }
- p_ptr->redraw |= (PR_MANA);
- break;
+ return clear_mind(p_ptr);
}
case CLASS_TOURIST:
{
if (command == -3) {
if (!import_magic_device()) return FALSE;
} else if (command == -4) {
- if (!can_do_cmd_cast()) return FALSE;
+ if (cmd_limit_cast(p_ptr)) return FALSE;
if (!do_cmd_magic_eater(FALSE, TRUE)) return FALSE;
}
break;
/* Singing is already stopped */
if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return FALSE;
- stop_singing();
+ stop_singing(p_ptr);
p_ptr->energy_use = 10;
break;
}
case CLASS_RED_MAGE:
{
- if (!can_do_cmd_cast()) return FALSE;
+ if (cmd_limit_cast(p_ptr)) return FALSE;
handle_stuff();
do_cmd_cast();
handle_stuff();
- if (!p_ptr->paralyzed && can_do_cmd_cast())
+ if (!p_ptr->paralyzed && !cmd_limit_cast(p_ptr))
do_cmd_cast();
break;
}
{
if (command == -3)
{
- int max_csp = MAX(p_ptr->msp*4, p_ptr->lev*5+5);
-
- if (total_friends)
- {
- msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
- return FALSE;
- }
- if (p_ptr->special_defense & KATA_MASK)
- {
- msg_print(_("今は構えに集中している。", "You need concentration on your form."));
- return FALSE;
- }
- msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
-
- p_ptr->csp += p_ptr->msp / 2;
- if (p_ptr->csp >= max_csp)
- {
- p_ptr->csp = max_csp;
- p_ptr->csp_frac = 0;
- }
- p_ptr->redraw |= (PR_MANA);
+ concentration(p_ptr);
}
else if (command == -4)
{
{
set_action(ACTION_LEARN);
}
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
break;
}
case CLASS_CAVALRY:
{
- GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_ptr;
- monster_race *r_ptr;
- int rlev;
-
- if (p_ptr->riding)
- {
- msg_print(_("今は乗馬中だ。", "You ARE riding."));
- return FALSE;
- }
- if (!do_riding(TRUE)) return TRUE;
- m_ptr = &m_list[p_ptr->riding];
- r_ptr = &r_info[m_ptr->r_idx];
- monster_desc(m_name, m_ptr, 0);
- msg_format(_("%sに乗った。", "You ride on %s."),m_name);
- if (is_pet(m_ptr)) break;
- rlev = r_ptr->level;
- if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
- if (rlev > 60) rlev = 60+(rlev-60)/2;
- if ((randint1(p_ptr->skill_exp[GINOU_RIDING] / 120 + p_ptr->lev * 2 / 3) > rlev)
- && one_in_(2) && !p_ptr->inside_arena && !p_ptr->inside_battle
- && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
- && (rlev < p_ptr->lev * 3 / 2 + randint0(p_ptr->lev / 5)))
- {
- msg_format(_("%sを手なずけた。", "You tame %s."),m_name);
- set_pet(m_ptr);
- }
- else
- {
- msg_format(_("%sに振り落とされた!", "You have thrown off by %s."),m_name);
- rakuba(1,TRUE);
-
- /* Paranoia */
- /* 落馬処理に失敗してもとにかく乗馬解除 */
- p_ptr->riding = 0;
- }
- break;
+ return rodeo(p_ptr);
}
case CLASS_BERSERKER:
{
default:
msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
}
return TRUE;
num = 0;
- if (p_ptr->confused)
+ if (cmd_limit_confused(p_ptr))
{
- msg_print(_("混乱していて特殊能力を使えません!", "You are too confused to use any powers!"));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
case CLASS_HIGH_MAGE:
if (p_ptr->realm1 == REALM_HEX)
{
- strcpy(power_desc[num].name, _("詠唱をやめる", "Stop spelling"));
+ strcpy(power_desc[num].name, _("詠唱をやめる", "Stop spell casting"));
power_desc[num].level = 1;
power_desc[num].cost = 0;
power_desc[num].stat = A_INT;
}
case CLASS_MONK:
{
- strcpy(power_desc[num].name, _("構える", "Assume a Posture"));
+ strcpy(power_desc[num].name, _("構える", "Assume a Stance"));
power_desc[num].level = 25;
power_desc[num].cost = 0;
power_desc[num].stat = A_DEX;
power_desc[num].fail = 0;
power_desc[num++].number = -3;
- strcpy(power_desc[num].name, _("型", "Assume a Posture"));
+ strcpy(power_desc[num].name, _("型", "Assume a Stance"));
power_desc[num].level = 25;
power_desc[num].cost = 0;
power_desc[num].stat = A_DEX;
if (!repeat_pull(&i) || i<0 || i>=num) {
if (use_menu) screen_save();
- /* Get a spell from the user */
choice = (always_show_list || use_menu) ? ESCAPE:1;
while (!flag)
case '0':
{
screen_load();
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
TERM_LEN x1, y1;
strcpy(dummy, "");
-
- /* Show list */
redraw = TRUE;
if (!use_menu) screen_save();
/* Abort if needed */
if (!flag)
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
repeat_push(i);
}
else p_ptr->csp -= actual_racial_cost;
- /* Redraw mana and hp */
p_ptr->redraw |= (PR_HP | PR_MANA);
-
p_ptr->window |= (PW_PLAYER | PW_SPELL);
}
}
- else p_ptr->energy_use = 0;
+ else free_turn(p_ptr);
/* Success */
return;