OSDN Git Service

* [Refactor] #37353 型の置換(cmd4.c) / Type replacement.
[hengband/hengband.git] / src / realm-life.c
index 0f6ec7e..c866ac7 100644 (file)
@@ -7,7 +7,7 @@
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -15,7 +15,7 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
        bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
 
        DIRECTION dir;
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -23,8 +23,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("軽傷の治癒", "Cure Light Wounds");
                if (desc) return _("怪我と体力を少し回復させる。", "Heals cut and HP a little.");
                {
-                       int dice = 2;
-                       int sides = 10;
+                       DICE_NUMBER dice = 2;
+                       DICE_SID sides = 10;
                        if (info) return info_heal(dice, sides, 0);
                        if (cast) (void)cure_light_wounds(dice, sides);                 
                }
@@ -49,8 +49,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("軽傷", "Cause Light Wounds");
                if (desc) return _("1体のモンスターに小ダメージを与える。抵抗されると無効。", "Wounds a monster a little unless resisted.");
                {
-                       int dice = 3 + (plev - 1) / 5;
-                       int sides = 4;
+                       DICE_NUMBER dice = 3 + (plev - 1) / 5;
+                       DICE_SID sides = 4;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -66,8 +66,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("光の召喚", "Call Light");
                if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
                {
-                       int dice = 2;
-                       int sides = plev / 2;
+                       DICE_NUMBER dice = 2;
+                       DICE_SID sides = plev / 2;
                        POSITION rad = plev / 10 + 1;
 
                        if (info) return info_damage(dice, sides, 0);
@@ -100,8 +100,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("重傷の治癒", "Cure Medium Wounds");
                if (desc) return _("怪我と体力を中程度回復させる。", "Heals cut and HP more.");
                {
-                       int dice = 4;
-                       int sides = 10;
+                       DICE_NUMBER dice = 4;
+                       DICE_SID sides = 10;
 
                        if (info) return info_heal(dice, sides, 0);
                        if (cast) (void)cure_serious_wounds(dice, sides);
@@ -134,13 +134,7 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("解呪", "Remove Curse");
                if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
                {
-                       if (cast)
-                       {
-                               if (remove_curse())
-                               {
-                                       msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
-                               }
-                       }
+                       if (cast) (void)remove_curse();
                }
                break;
 
@@ -148,8 +142,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("重傷", "Cause Medium Wounds");
                if (desc) return _("1体のモンスターに中ダメージを与える。抵抗されると無効。", "Wounds a monster unless resisted.");
                {
-                       int sides = 8 + (plev - 5) / 4;
-                       int dice = 8;
+                       DICE_SID sides = 8 + (plev - 5) / 4;
+                       DICE_NUMBER dice = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -165,8 +159,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("致命傷の治癒", "Cure Critical Wounds");
                if (desc) return _("体力を大幅に回復させ、負傷と朦朧状態も全快する。", "Heals cut, stun and HP greatly.");
                {
-                       int dice = 8;
-                       int sides = 10;
+                       DICE_NUMBER dice = 8;
+                       DICE_SID sides = 10;
 
                        if (info) return info_heal(dice, sides, 0);
                        if (cast) (void)cure_critical_wounds(damroll(dice, sides));
@@ -246,15 +240,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
        case 16:
                if (name) return _("*解呪*", "Dispel Curse");
                if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
-
                {
-                       if (cast)
-                       {
-                               if (remove_all_curse())
-                               {
-                                       msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
-                               }
-                       }
+                       if (cast) (void)remove_all_curse();
                }
                break;
 
@@ -275,8 +262,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("視界内の全てのアンデッドにダメージを与える。", "Damages all undead monsters in sight.");
 
                {
-                       int dice = 1;
-                       int sides = plev * 5;
+                       DICE_NUMBER dice = 1;
+                       DICE_SID sides = plev * 5;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -308,8 +295,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("1体のモンスターに大ダメージを与える。抵抗されると無効。", "Wounds a monster critically unless resisted.");
 
                {
-                       int dice = 5 + (plev - 5) / 3;
-                       int sides = 15;
+                       DICE_NUMBER dice = 5 + (plev - 5) / 3;
+                       DICE_SID sides = 15;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -327,13 +314,13 @@ cptr do_life_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;
@@ -344,7 +331,7 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        int base = 15;
-                       int sides = 20;
+                       DICE_SID sides = 20;
 
                        if (info) return info_delay(base, sides);