* 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;
int y = 1;
int x = 18;
- int minfail = 0;
- int plev = p_ptr->lev;
- int chance = 0;
+ PERCENTAGE minfail = 0;
+ PLAYER_LEVEL plev = p_ptr->lev;
+ PERCENTAGE chance = 0;
int ask = TRUE, mode = 0;
int spellnum[MAX_MONSPELLS];
char ch;
char comment[80];
s32b f4 = 0, f5 = 0, f6 = 0;
cptr p = _("魔法", "magic");
-
+ COMMAND_CODE code;
monster_power spell;
bool flag, redraw;
int menu_line = (use_menu ? 1 : 0);
#ifdef ALLOW_REPEAT /* TNB */
/* Get the spell, if available */
- if (repeat_pull(sn))
+
+ if (repeat_pull(&code))
{
/* Success */
return (TRUE);
}
+ *sn = (SPELL_IDX)code;
#endif /* ALLOW_REPEAT -- TNB */
ask = isupper(choice);
/* Lowercase */
- if (ask) choice = tolower(choice);
+ if (ask) choice = (char)tolower(choice);
/* Extract request */
i = (islower(choice) ? A2I(choice) : -1);
#ifdef ALLOW_REPEAT /* TNB */
- repeat_push(*sn);
+ repeat_push((COMMAND_CODE)spellnum[i]);
#endif /* ALLOW_REPEAT -- TNB */
*/
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 damage = 0;
- bool pet = success;
- bool no_trump = FALSE;
- u32b p_mode, u_mode = 0L, g_mode;
+ DIRECTION dir;
+ PLAYER_LEVEL plev = pseudo_plev();
+ PLAYER_LEVEL summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2);
+ HIT_POINT damage = 0;
+ bool pet = success;
+ bool no_trump = FALSE;
+ BIT_FLAGS p_mode, u_mode = 0L, g_mode;
if (pet)
{
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;
}
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;
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);
}
}
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:
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];
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);
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:
{
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!"));
}
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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!"));
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)
{
*/
bool do_cmd_cast_learned(void)
{
- int n = 0;
- int chance;
- int minfail = 0;
- int plev = p_ptr->lev;
- monster_power spell;
- bool cast;
- int need_mana;
+ SPELL_IDX n = 0;
+ PERCENTAGE chance;
+ PERCENTAGE minfail = 0;
+ PLAYER_LEVEL plev = p_ptr->lev;
+ monster_power spell;
+ bool cast;
+ MANA_POINT need_mana;
/* not if confused */
*/
/*
*/
-void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode)
+void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, BIT_FLAGS mode)
{
switch (mode)
{