for (i = 0; i < 32; i++)
{
- u32b spell = 1L << i;
- if (hex_spelling(spell)) do_spell(REALM_HEX, spell, SPELL_STOP);
+ if (hex_spelling(i)) do_spell(REALM_HEX, i, SPELL_STOP);
}
- p_ptr->magic_num1[0] = 0;
- p_ptr->magic_num2[0] = 0;
+ CASTING_HEX_FLAGS(p_ptr) = 0;
+ CASTING_HEX_NUM(p_ptr) = 0;
/* Print message */
if (p_ptr->action == ACTION_SPELL) set_action(ACTION_NONE);
}
/* Stop all spells */
- else if ((p_ptr->magic_num2[0] == 1) || (p_ptr->lev < 35))
+ else if ((CASTING_HEX_NUM(p_ptr) == 1) || (p_ptr->lev < 35))
{
return stop_hex_spell_all();
}
{
#ifdef JP
strnfmt(out_val, 78, "どの呪文の詠唱を中断しますか?(呪文 %c-%c, 'l'全て, ESC)",
- I2A(0), I2A(p_ptr->magic_num2[0] - 1));
+ I2A(0), I2A(CASTING_HEX_NUM(p_ptr) - 1));
#else
strnfmt(out_val, 78, "Which spell do you stop casting? (Spell %c-%c, 'l' to all, ESC)",
- I2A(0), I2A(p_ptr->magic_num2[0] - 1));
+ I2A(0), I2A(CASTING_HEX_NUM(p_ptr) - 1));
#endif
screen_save();
}
if (!get_com(out_val, &choice, TRUE)) break;
- if (isupper(choice)) choice = tolower(choice);
+ if (isupper(choice)) choice = (char)tolower(choice);
if (choice == 'l') /* All */
{
screen_load();
return stop_hex_spell_all();
}
- if ((choice < I2A(0)) || (choice > I2A(p_ptr->magic_num2[0] - 1))) continue;
+ if ((choice < I2A(0)) || (choice > I2A(CASTING_HEX_NUM(p_ptr) - 1))) continue;
flag = TRUE;
}
}
int n = sp[A2I(choice)];
do_spell(REALM_HEX, n, SPELL_STOP);
- p_ptr->magic_num1[0] &= ~(1L << n);
- p_ptr->magic_num2[0]--;
+ CASTING_HEX_FLAGS(p_ptr) &= ~(1L << n);
+ CASTING_HEX_NUM(p_ptr)--;
}
/* Redraw status */
/* Spells spelled by player */
if (p_ptr->realm1 != REALM_HEX) return;
- if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
+ if (!CASTING_HEX_FLAGS(p_ptr) && !p_ptr->magic_num1[1]) return;
if (p_ptr->magic_num1[1])
{
/* Culcurates final mana cost */
need_mana_frac = 0;
s64b_div(&need_mana, &need_mana_frac, 0, 3); /* Divide by 3 */
- need_mana += (p_ptr->magic_num2[0] - 1);
+ need_mana += (CASTING_HEX_NUM(p_ptr) - 1);
/* Not enough mana */
/* Paranoia */
k_max = MIN(k_max, MAX_KEEP);
- if (p_ptr->magic_num2[0] < k_max) return FALSE;
+ if (CASTING_HEX_NUM(p_ptr) < k_max) return FALSE;
return TRUE;
}
void revenge_spell(void)
{
if (p_ptr->realm1 != REALM_HEX) return;
- if (p_ptr->magic_num2[2] <= 0) return;
+ if (HEX_REVENGE_TURN(p_ptr) <= 0) return;
- switch(p_ptr->magic_num2[1])
+ switch(HEX_REVENGE_TYPE(p_ptr))
{
- case 1: do_spell(REALM_HEX, HEX_PATIENCE, SPELL_CONT); break;
- case 2: do_spell(REALM_HEX, HEX_REVENGE, SPELL_CONT); break;
+ case 1: do_spell(REALM_HEX, HEX_PATIENCE, SPELL_CONT); break;
+ case 2: do_spell(REALM_HEX, HEX_REVENGE, SPELL_CONT); break;
}
}
* @param dam 蓄積されるダメージ量
* @return なし
*/
-void revenge_store(int dam)
+void revenge_store(HIT_POINT dam)
{
if (p_ptr->realm1 != REALM_HEX) return;
- if (p_ptr->magic_num2[2] <= 0) return;
+ if (HEX_REVENGE_TURN(p_ptr) <= 0) return;
- p_ptr->magic_num1[2] += dam;
+ HEX_REVENGE_POWER(p_ptr) += dam;
}
/*!
* @param m_idx 判定の対象となるモンスターID
* @return 反テレポートの効果が適用されるならTRUEを返す
*/
-bool teleport_barrier(int m_idx)
+bool teleport_barrier(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
* @param m_idx 判定の対象となるモンスターID
* @return 反魔法の効果が適用されるならTRUEを返す
*/
-bool magic_barrier(int m_idx)
+bool magic_barrier(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
* @param m_idx 判定の対象となるモンスターID
* @return 反増殖の効果が適用されるならTRUEを返す
*/
-bool multiply_barrier(int m_idx)
+bool multiply_barrier(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];