OSDN Git Service

[Refactor] #39321 do_spell() を exe_spell() に改名.
authordeskull <deskull@users.sourceforge.jp>
Wed, 31 Jul 2019 13:22:30 +0000 (22:22 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 31 Jul 2019 13:22:30 +0000 (22:22 +0900)
src/cmd-dump.c
src/cmd-hissatsu.c
src/cmd-spell.c
src/cmd-spell.h
src/core.c
src/player-status.c
src/realm-hex.c
src/spells-status.c
src/spells3.c

index b85f703..466d862 100644 (file)
@@ -4515,7 +4515,7 @@ static void do_cmd_knowledge_spell_exp(void)
                        if (s_ptr->slevel >= 99) continue;
                        spell_exp = p_ptr->spell_exp[i];
                        exp_level = spell_exp_level(spell_exp);
-                       fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
+                       fprintf(fff, "%-25s ", exe_spell(p_ptr->realm1, i, SPELL_NAME));
                        if (p_ptr->realm1 == REALM_HISSATSU)
                                fprintf(fff, "[--]");
                        else
@@ -4546,7 +4546,7 @@ static void do_cmd_knowledge_spell_exp(void)
 
                        spell_exp = p_ptr->spell_exp[i + 32];
                        exp_level = spell_exp_level(spell_exp);
-                       fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
+                       fprintf(fff, "%-25s ", exe_spell(p_ptr->realm2, i, SPELL_NAME));
                        if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
                        else fprintf(fff, " ");
                        fprintf(fff, "%s", exp_level_str[exp_level]);
index 842a6a7..55ddead 100644 (file)
@@ -227,7 +227,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
 
                                        /* Dump the spell --(-- */
                                        strcat(psi_desc, format(" %-18s%2d %3d",
-                                               do_spell(REALM_HISSATSU, i, SPELL_NAME),
+                                               exe_spell(REALM_HISSATSU, i, SPELL_NAME),
                                                spell.slevel, spell.smana));
                                        prt(psi_desc, y + (line%17) + (line >= 17), x+(line/17)*30);
                                        prt("", y + (line%17) + (line >= 17) + 1, x+(line/17)*30);
@@ -282,7 +282,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
                        char tmp_val[160];
 
                        /* Prompt */
-                       (void) strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), do_spell(REALM_HISSATSU, j, SPELL_NAME));
+                       (void) strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), exe_spell(REALM_HISSATSU, j, SPELL_NAME));
 
                        /* Belay that order */
                        if (!get_check(tmp_val)) continue;
@@ -352,7 +352,7 @@ void do_cmd_hissatsu(void)
 
        sound(SOUND_ZAP);
 
-       if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
+       if (!exe_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
 
        take_turn(p_ptr, 100);
 
@@ -418,7 +418,7 @@ void do_cmd_gain_hissatsu(void)
 
                p_ptr->spell_learned1 |= (1L << i);
                p_ptr->spell_worked1 |= (1L << i);
-               msg_format(_("%sの技を覚えた。", "You have learned the special attack of %s."), do_spell(REALM_HISSATSU, i, SPELL_NAME));
+               msg_format(_("%sの技を覚えた。", "You have learned the special attack of %s."), exe_spell(REALM_HISSATSU, i, SPELL_NAME));
                for (j = 0; j < 64; j++)
                {
                        /* Stop at the first empty space */
index d673c70..68073f6 100644 (file)
@@ -272,7 +272,7 @@ static bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
  * @param mode 求める処理
  * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はNULLポインタを返す。
  */
-concptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
+concptr exe_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
 {
        switch (realm)
        {
@@ -537,11 +537,11 @@ static int get_spell(SPELL_IDX *sn, concptr prompt, OBJECT_SUBTYPE_VALUE sval, b
                        jverb(prompt, jverb_buf, JVERB_AND);
                        /* 英日切り替え機能に対応 */
                        (void)strnfmt(tmp_val, 78, "%s(MP%d, 失敗率%d%%)を%sますか? ",
-                               do_spell(use_realm, spell, SPELL_NAME), need_mana,
+                               exe_spell(use_realm, spell, SPELL_NAME), need_mana,
                                spell_chance(spell, use_realm), jverb_buf);
 #else
                        (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ",
-                               prompt, do_spell(use_realm, spell, SPELL_NAME), need_mana,
+                               prompt, exe_spell(use_realm, spell, SPELL_NAME), need_mana,
                                spell_chance(spell, use_realm));
 #endif
 
@@ -734,7 +734,7 @@ void do_cmd_browse(void)
                Term_erase(14, 12, 255);
                Term_erase(14, 11, 255);
 
-               roff_to_buf(do_spell(use_realm, spell, SPELL_DESC), 62, temp, sizeof(temp));
+               roff_to_buf(exe_spell(use_realm, spell, SPELL_DESC), 62, temp, sizeof(temp));
 
                for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
                {
@@ -935,7 +935,7 @@ void do_cmd_study(void)
                int max_exp = (spell < 32) ? SPELL_EXP_MASTER : SPELL_EXP_EXPERT;
                int old_exp = p_ptr->spell_exp[spell];
                int new_rank = EXP_LEVEL_UNSKILLED;
-               concptr name = do_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME);
+               concptr name = exe_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME);
 
                if (old_exp >= max_exp)
                {
@@ -991,16 +991,16 @@ void do_cmd_study(void)
                if (mp_ptr->spell_book == TV_MUSIC_BOOK)
                {
                        msg_format("%sを学んだ。",
-                               do_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME));
+                               exe_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME));
                }
                else
                {
                        msg_format("%sの%sを学んだ。",
-                               do_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME), p);
+                               exe_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME), p);
                }
 #else
                msg_format("You have learned the %s of %s.",
-                       p, do_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME));
+                       p, exe_spell(increment ? p_ptr->realm2 : p_ptr->realm1, spell % 32, SPELL_NAME));
 #endif
        }
 
@@ -1243,7 +1243,7 @@ void do_cmd_cast(void)
                }
 
                /* Failure casting may activate some side effect */
-               do_spell(realm, spell, SPELL_FAIL);
+               exe_spell(realm, spell, SPELL_FAIL);
 
 
                if ((o_ptr->tval == TV_CHAOS_BOOK) && (randint1(100) < spell))
@@ -1279,7 +1279,7 @@ void do_cmd_cast(void)
        else
        {
                /* Canceled spells cost neither a current_world_ptr->game_turn nor mana */
-               if (!do_spell(realm, spell, SPELL_CAST)) return;
+               if (!exe_spell(realm, spell, SPELL_CAST)) return;
 
                if (randint1(100) < chance)
                        chg_virtue(p_ptr, V_CHANCE, 1);
index d96a581..d1b3f4f 100644 (file)
@@ -17,7 +17,7 @@ extern const u32b fake_spell_flags[4];
 #define SPELL_FAIL   4
 #define SPELL_STOP   5
 #define SPELL_CONT   6
-extern concptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
+extern concptr exe_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
 
 extern concptr info_string_dice(concptr str, DICE_NUMBER dice, DICE_SID sides, int base);
 extern concptr info_damage(DICE_NUMBER dice, DICE_SID sides, int base);
index 9b60697..0a5918a 100644 (file)
@@ -1188,7 +1188,7 @@ static void check_music(void)
        { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
 
        /* Do any effects of continual song */
-       do_spell(REALM_MUSIC, spell, SPELL_CONT);
+       exe_spell(REALM_MUSIC, spell, SPELL_CONT);
 }
 
 /*!
index 2c57e56..47649ef 100644 (file)
@@ -4310,9 +4310,9 @@ static void calc_spells(player_type *creature_ptr)
                        }
 
 #ifdef JP
-                       msg_format("%sの%sを忘れてしまった。", do_spell(which, j % 32, SPELL_NAME), p);
+                       msg_format("%sの%sを忘れてしまった。", exe_spell(which, j % 32, SPELL_NAME), p);
 #else
-                       msg_format("You have forgotten the %s of %s.", p, do_spell(which, j % 32, SPELL_NAME));
+                       msg_format("You have forgotten the %s of %s.", p, exe_spell(which, j % 32, SPELL_NAME));
 #endif
 
 
@@ -4367,9 +4367,9 @@ static void calc_spells(player_type *creature_ptr)
                        }
 
 #ifdef JP
-                       msg_format("%sの%sを忘れてしまった。", do_spell(which, j % 32, SPELL_NAME), p);
+                       msg_format("%sの%sを忘れてしまった。", exe_spell(which, j % 32, SPELL_NAME), p);
 #else
-                       msg_format("You have forgotten the %s of %s.", p, do_spell(which, j % 32, SPELL_NAME));
+                       msg_format("You have forgotten the %s of %s.", p, exe_spell(which, j % 32, SPELL_NAME));
 #endif
 
 
@@ -4440,9 +4440,9 @@ static void calc_spells(player_type *creature_ptr)
                        }
 
 #ifdef JP
-                       msg_format("%sの%sを思い出した。", do_spell(which, j % 32, SPELL_NAME), p);
+                       msg_format("%sの%sを思い出した。", exe_spell(which, j % 32, SPELL_NAME), p);
 #else
-                       msg_format("You have remembered the %s of %s.", p, do_spell(which, j % 32, SPELL_NAME));
+                       msg_format("You have remembered the %s of %s.", p, exe_spell(which, j % 32, SPELL_NAME));
 #endif
 
 
index b2075c8..a2847ff 100644 (file)
@@ -48,7 +48,7 @@ bool stop_hex_spell_all(void)
 
        for (i = 0; i < 32; i++)
        {
-               if (hex_spelling(i)) do_spell(REALM_HEX, i, SPELL_STOP);
+               if (hex_spelling(i)) exe_spell(REALM_HEX, i, SPELL_STOP);
        }
 
        CASTING_HEX_FLAGS(p_ptr) = 0;
@@ -104,7 +104,7 @@ bool stop_hex_spell(void)
                                if (hex_spelling(spell))
                                {
                                        Term_erase(x, y + n + 1, 255);
-                                       put_str(format("%c)  %s", I2A(n), do_spell(REALM_HEX, spell, SPELL_NAME)), y + n + 1, x + 2);
+                                       put_str(format("%c)  %s", I2A(n), exe_spell(REALM_HEX, spell, SPELL_NAME)), y + n + 1, x + 2);
                                        sp[n++] = spell;
                                }
                        }
@@ -128,7 +128,7 @@ bool stop_hex_spell(void)
        {
                int n = sp[A2I(choice)];
 
-               do_spell(REALM_HEX, n, SPELL_STOP);
+               exe_spell(REALM_HEX, n, SPELL_STOP);
                CASTING_HEX_FLAGS(p_ptr) &= ~(1L << n);
                CASTING_HEX_NUM(p_ptr)--;
        }
@@ -236,7 +236,7 @@ void check_hex(void)
        {
                if (hex_spelling(spell))
                {
-                       do_spell(REALM_HEX, spell, SPELL_CONT);
+                       exe_spell(REALM_HEX, spell, SPELL_CONT);
                }
        }
 }
@@ -265,8 +265,8 @@ void revenge_spell(void)
 
        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: exe_spell(REALM_HEX, HEX_PATIENCE, SPELL_CONT); break;
+               case 2: exe_spell(REALM_HEX, HEX_REVENGE, SPELL_CONT); break;
        }
 }
 
@@ -821,7 +821,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if ((!o_ptr->k_idx) || (!object_is_cursed(o_ptr)))
                        {
-                               do_spell(REALM_HEX, spell, SPELL_STOP);
+                               exe_spell(REALM_HEX, spell, SPELL_STOP);
                                CASTING_HEX_FLAGS(p_ptr) &= ~(1L << spell);
                                CASTING_HEX_NUM(p_ptr)--;
                                if (!SINGING_SONG_ID(p_ptr)) set_action(p_ptr, ACTION_NONE);
@@ -908,7 +908,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (!flag)
                        {
-                               msg_format(_("%sの呪文の詠唱をやめた。", "Finish casting '%^s'."), do_spell(REALM_HEX, HEX_RESTORE, SPELL_NAME));
+                               msg_format(_("%sの呪文の詠唱をやめた。", "Finish casting '%^s'."), exe_spell(REALM_HEX, HEX_RESTORE, SPELL_NAME));
                                CASTING_HEX_FLAGS(p_ptr) &= ~(1L << HEX_RESTORE);
                                if (cont) CASTING_HEX_NUM(p_ptr)--;
                                if (CASTING_HEX_NUM(p_ptr)) p_ptr->action = ACTION_NONE;
index 8b3e01f..f428512 100644 (file)
@@ -173,7 +173,7 @@ void stop_singing(player_type *creature_ptr)
        if (creature_ptr->action == ACTION_SING) set_action(p_ptr, ACTION_NONE);
 
        /* Message text of each song or etc. */
-       do_spell(REALM_MUSIC, SINGING_SONG_ID(creature_ptr), SPELL_STOP);
+       exe_spell(REALM_MUSIC, SINGING_SONG_ID(creature_ptr), SPELL_STOP);
 
        SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
        SINGING_SONG_ID(creature_ptr) = 0;
index 186a137..81f424e 100644 (file)
@@ -2360,7 +2360,7 @@ void display_spell_list(void)
                                s_ptr = &mp_ptr->info[((j < 1) ? p_ptr->realm1 : p_ptr->realm2) - 1][i % 32];
                        }
 
-                       strcpy(name, do_spell((j < 1) ? p_ptr->realm1 : p_ptr->realm2, i % 32, SPELL_NAME));
+                       strcpy(name, exe_spell((j < 1) ? p_ptr->realm1 : p_ptr->realm2, i % 32, SPELL_NAME));
 
                        /* Illegible */
                        if (s_ptr->slevel >= 99)
@@ -2725,7 +2725,7 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                /* XXX XXX Could label spells above the players level */
 
                /* Get extra info */
-               strcpy(info, do_spell(use_realm, spell, SPELL_INFO));
+               strcpy(info, exe_spell(use_realm, spell, SPELL_INFO));
 
                /* Use that info */
                comment = info;
@@ -2778,13 +2778,13 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                if (use_realm == REALM_HISSATSU)
                {
                        strcat(out_val, format("%-25s %2d %4d",
-                           do_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
+                           exe_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
                            s_ptr->slevel, need_mana));
                }
                else
                {
                        strcat(out_val, format("%-25s%c%-4s %2d %4d %3d%% %s",
-                           do_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
+                           exe_spell(use_realm, spell, SPELL_NAME), /* realm, spell */
                            (max ? '!' : ' '), ryakuji,
                            s_ptr->slevel, need_mana, spell_chance(spell, use_realm), comment));
                }