OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[hengband/hengband.git] / src / realm-arcane.c
index 2cbcf5a..186104f 100644 (file)
@@ -7,15 +7,15 @@
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
        bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
        bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
 
-       int dir;
-       int plev = p_ptr->lev;
+       DIRECTION dir;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -24,8 +24,8 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
 
                {
-                       int dice = 3 + (plev - 1) / 5;
-                       int sides = 3;
+                       DICE_NUMBER dice = 3 + (plev - 1) / 5;
+                       DICE_SID sides = 3;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -57,7 +57,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -73,7 +73,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -105,9 +105,9 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
 
                {
-                       int dice = 2;
-                       int sides = plev / 2;
-                       int rad = plev / 10 + 1;
+                       DICE_NUMBER dice = 2;
+                       DICE_SID sides = plev / 2;
+                       POSITION rad = plev / 10 + 1;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -137,8 +137,8 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("怪我と体力を少し回復させる。", "Heals cut and HP a little.");
 
                {
-                       int dice = 2;
-                       int sides = 8;
+                       DICE_NUMBER dice = 2;
+                       DICE_SID sides = 8;
 
                        if (info) return info_heal(dice, sides, 0);
                        if (cast) (void)cure_light_wounds(dice, sides);
@@ -150,7 +150,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -180,7 +180,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -197,7 +197,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -213,7 +213,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -308,8 +308,8 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("怪我と体力を中程度回復させる。", "Heals cut and HP more.");
 
                {
-                       int dice = 4;
-                       int sides = 8;
+                       DICE_NUMBER dice = 4;
+                       DICE_SID sides = 8;
 
                        if (info) return info_heal(dice, sides, 0);
                        if (cast) (void)cure_serious_wounds(4, 8);
@@ -349,8 +349,8 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
 
                {
-                       int dice = 1;
-                       int sides = 30;
+                       DICE_NUMBER dice = 1;
+                       DICE_SID sides = 30;
                        int base = 20;
 
                        if (info) return info_damage(dice, sides, base);
@@ -369,8 +369,8 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
 
                {
-                       int dice = 6;
-                       int sides = 8;
+                       DICE_NUMBER dice = 6;
+                       DICE_SID sides = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -419,7 +419,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (!summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                               if (!summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
                                {
                                        msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
                                }
@@ -464,7 +464,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = 75 + plev;
-                       int rad = 2;
+                       POSITION rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -493,7 +493,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -511,13 +511,13 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        int base = 15;
-                       int sides = 20;
+                       DICE_SID sides = 20;
 
                        if (info) return info_delay(base, sides);
 
                        if (cast)
                        {
-                               if (!word_of_recall()) return NULL;
+                               if (!recall_player(p_ptr, randint0(21) + 15)) return NULL;
                        }
                }
                break;
@@ -529,7 +529,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        int base = 25;
-                       int sides = 30;
+                       DICE_SID sides = 30;
 
                        if (info) return info_duration(base, sides);