OSDN Git Service

[Refactor] #37353 空白整理。 / Refactor spaces.
[hengband/hengband.git] / src / mind.c
index ac8cf2f..6aa219b 100644 (file)
  * 特殊技能を揃えて実装している。
  */
 
-
-
 #include "angband.h"
+#include "melee.h"
+#include "projection.h"
+#include "spells-summon.h"
+#include "avatar.h"
+#include "player-status.h"
+#include "spells-status.h"
 
 /*! 特殊技能の一覧テーブル */
 mind_power const mind_powers[5] =
@@ -289,7 +293,7 @@ mind_power const mind_powers[5] =
 };
 
 /*! 特殊能力の解説文字列 */
-static cptr const mind_tips[5][MAX_MIND_POWERS] =
+static concptr const mind_tips[5][MAX_MIND_POWERS] =
 {
 #ifdef JP
 {
@@ -537,13 +541,13 @@ static cptr const mind_tips[5][MAX_MIND_POWERS] =
 void mindcraft_info(char *p, int use_mind, int power)
 {
 #ifdef JP
-       cptr s_dam = "損傷:";
-       cptr s_dur = "期間:";
-       cptr s_range = "範囲:";
+       concptr s_dam = "損傷:";
+       concptr s_dur = "期間:";
+       concptr s_range = "範囲:";
 #else
-       cptr s_dam = "dam ";
-       cptr s_dur = "dur ";
-       cptr s_range = "range ";
+       concptr s_dam = "dam ";
+       concptr s_dur = "dur ";
+       concptr s_range = "range ";
 #endif
        PLAYER_LEVEL plev = p_ptr->lev;
 
@@ -688,7 +692,7 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
        char            choice;
        char            out_val[160];
        char            comment[80];
-       cptr            p;
+       concptr            p;
        COMMAND_CODE code;
        mind_type       spell;
        const mind_power      *mind_ptr;
@@ -852,8 +856,8 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                                put_str(format(_("Lv   %s   失率 効果", "Lv   %s   Fail Info"),
                                        ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
 
-                               has_weapon[0] = buki_motteruka(INVEN_RARM);
-                               has_weapon[1] = buki_motteruka(INVEN_LARM);
+                               has_weapon[0] = has_melee_weapon(INVEN_RARM);
+                               has_weapon[1] = has_melee_weapon(INVEN_LARM);
 
                                /* Dump the spells */
                                for (i = 0; i < MAX_MIND_POWERS; i++)
@@ -948,8 +952,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                        {
                                /* Hide list */
                                redraw = FALSE;
-
-                               /* Restore the screen */
                                screen_load();
                        }
 
@@ -994,8 +996,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                /* Stop the loop */
                flag = TRUE;
        }
-
-       /* Restore the screen */
        if (redraw && !only_browse) screen_load();
 
        p_ptr->window |= (PW_SPELL);
@@ -1268,7 +1268,7 @@ static bool cast_force_spell(int spell)
                bool success = FALSE;
 
                for (i = 0; i < 1 + boost/100; i++)
-                       if (summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_PHANTOM, PM_FORCE_PET))
+                       if (summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_PHANTOM, PM_FORCE_PET, '\0'))
                                success = TRUE;
                if (success)
                {
@@ -1446,7 +1446,7 @@ static bool cast_mirror_spell(int spell)
 
                /* mirror of recall */
        case 17:
-               return word_of_recall();
+               return recall_player(p_ptr, randint0(21) + 15);
                /* multi-shadow */
        case 18:
                set_multishadow(6 + randint1(6), FALSE);
@@ -1650,7 +1650,7 @@ static bool cast_ninja_spell(int spell)
        {
                monster_type *m_ptr;
                MONSTER_IDX m_idx;
-               char m_name[80];
+               GAME_TEXT m_name[MAX_NLEN];
                int i;
                int path_n;
                u16b path_g[512];
@@ -1694,13 +1694,8 @@ static bool cast_ninja_spell(int spell)
                /* Wake the monster up */
                (void)set_monster_csleep(m_idx, 0);
 
-               /* Update the monster (new location) */
                update_monster(m_idx, TRUE);
-
-               /* Redraw the old grid */
                lite_spot(target_row, target_col);
-
-               /* Redraw the new grid */
                lite_spot(ty, tx);
 
                if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
@@ -1791,7 +1786,7 @@ void do_cmd_mind(void)
        mind_type       spell;
        bool            cast;
        int             use_mind, mana_cost;
-       cptr            p;
+       concptr            p;
        bool            on_mirror = FALSE;
 
        /* not if confused */
@@ -1835,9 +1830,9 @@ void do_cmd_mind(void)
        {
                if (heavy_armor()) chance += 20;
                if (p_ptr->icky_wield[0]) chance += 20;
-               else if (buki_motteruka(INVEN_RARM)) chance += 10;
+               else if (has_melee_weapon(INVEN_RARM)) chance += 10;
                if (p_ptr->icky_wield[1]) chance += 20;
-               else if (buki_motteruka(INVEN_LARM)) chance += 10;
+               else if (has_melee_weapon(INVEN_LARM)) chance += 10;
                if (n == 5)
                {
                        int j;