*/
#include "angband.h"
+#include "monsterrace-hook.h"
+#include "player-status.h"
#define TECHNIC_HISSATSU (REALM_HISSATSU - MIN_TECHNIC)
{
SPELL_IDX i;
int j = 0;
- int num = 0;
- int y = 1;
- int x = 15;
- int plev = p_ptr->lev;
- int ask = TRUE;
- char choice;
- char out_val[160];
+ int num = 0;
+ POSITION y = 1;
+ POSITION x = 15;
+ PLAYER_LEVEL plev = p_ptr->lev;
+ int ask = TRUE;
+ char choice;
+ char out_val[160];
SPELL_IDX sentaku[32];
- cptr p = _("必殺剣", "special attack");
+ concptr p = _("必殺剣", "special attack");
COMMAND_CODE code;
magic_type spell;
- bool flag, redraw;
+ bool flag, redraw;
int menu_line = (use_menu ? 1 : 0);
/* Assume cancelled */
*sn = (-1);
-#ifdef ALLOW_REPEAT /* TNB */
-
/* Get the spell, if available */
if (repeat_pull(&code))
{
}
}
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Nothing chosen yet */
flag = FALSE;
/* Show list */
redraw = TRUE;
-
- /* Save the screen */
if (!use_menu) screen_save();
/* Display a list of spells */
{
/* Hide list */
redraw = FALSE;
-
- /* Restore the screen */
screen_load();
}
/* Stop the loop */
flag = TRUE;
}
-
- /* Restore the screen */
if (redraw) screen_load();
- /* Show choices */
p_ptr->window |= (PW_SPELL);
-
- /* Window stuff */
- window_stuff();
-
+ handle_stuff();
/* Abort if needed */
if (!flag) return (FALSE);
/* Save the choice */
(*sn) = j;
-#ifdef ALLOW_REPEAT /* TNB */
-
repeat_push((COMMAND_CODE)j);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Success */
return (TRUE);
}
SPELL_IDX n = 0;
magic_type spell;
-
- /* not if confused */
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて集中できない!", "You are too confused!"));
- return;
- }
- if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+ if (cmd_limit_confused(p_ptr)) return;
+ if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
{
if (flush_failure) flush();
msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
/* Cast the spell */
if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
- /* Take a turn */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Use some mana */
p_ptr->csp -= spell.smana;
/* Limit */
if (p_ptr->csp < 0) p_ptr->csp = 0;
-
- /* Redraw mana */
p_ptr->redraw |= (PR_MANA);
- /* Window stuff */
p_ptr->window |= (PW_PLAYER);
p_ptr->window |= (PW_SPELL);
}
int i, j;
object_type *o_ptr;
- cptr q, s;
+ concptr q, s;
bool gain = FALSE;
return;
}
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて読めない!", "You are too confused!"));
- return;
- }
+ if (cmd_limit_confused(p_ptr)) return;
if (!(p_ptr->new_spells))
{
item_tester_tval = TV_HISSATSU_BOOK;
- /* Get an item */
q = _("どの書から学びますか? ", "Study which book? ");
s = _("読める書がない。", "You have no books that you can read.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ if (!o_ptr) return;
for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
{
if (!gain)
msg_print(_("何も覚えられなかった。", "You were not able to learn any special attacks."));
- /* Take a turn */
else
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
p_ptr->update |= (PU_SPELLS);
}
/* Zammaken (Nonliving Evil) */
if (mode == HISSATSU_ZANMA)
{
- if (!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
+ if (!monster_living(m_ptr->r_idx) && (r_ptr->flags3 & RF3_EVIL))
{
if (mult < 15) mult = 25;
else if (mult < 50) mult = MIN(50, mult+20);
}
/* Bloody Maelstrom */
- if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
+ if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(m_ptr->r_idx))
{
MULTIPLY tmp = MIN(100, MAX(10, p_ptr->cut / 10));
if (mult < tmp) mult = tmp;