OSDN Git Service

[Refactor] #38997 turn_undead() に player_type * 引数を追加. / Add player_type * argument...
[hengband/hengband.git] / src / realm-life.c
index cc49b78..09bd8ec 100644 (file)
@@ -14,7 +14,7 @@
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -22,7 +22,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
        bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
 
        DIRECTION dir;
-       PLAYER_LEVEL plev = p_ptr->lev;
+       PLAYER_LEVEL plev = caster_ptr->lev;
 
        switch (spell)
        {
@@ -33,7 +33,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        DICE_NUMBER dice = 2;
                        DICE_SID sides = 10;
                        if (info) return info_heal(dice, sides, 0);
-                       if (cast) (void)cure_light_wounds(dice, sides);                 
+                       if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
                }
                break;
 
@@ -47,7 +47,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_blessed(p_ptr, randint1(base) + base, FALSE);
+                               set_blessed(caster_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
@@ -111,7 +111,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        DICE_SID sides = 10;
 
                        if (info) return info_heal(dice, sides, 0);
-                       if (cast) (void)cure_serious_wounds(dice, sides);
+                       if (cast) (void)cure_serious_wounds(caster_ptr, dice, sides);
                }
                break;
 
@@ -121,7 +121,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               set_poisoned(p_ptr, 0);
+                               set_poisoned(caster_ptr, 0);
                        }
                }
                break;
@@ -132,7 +132,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               set_food(p_ptr, PY_FOOD_MAX - 1);
+                               set_food(caster_ptr, PY_FOOD_MAX - 1);
                        }
                }
                break;
@@ -141,7 +141,7 @@ concptr 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) (void)remove_curse();
+                       if (cast) (void)remove_curse(caster_ptr);
                }
                break;
 
@@ -170,7 +170,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        DICE_SID sides = 10;
 
                        if (info) return info_heal(dice, sides, 0);
-                       if (cast) (void)cure_critical_wounds(damroll(dice, sides));
+                       if (cast) (void)cure_critical_wounds(caster_ptr, damroll(dice, sides));
                }
                break;
 
@@ -186,8 +186,8 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
-                               set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
+                               set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
+                               set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
@@ -203,7 +203,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               map_area(rad);
+                               map_area(caster_ptr, rad);
                        }
                }
                break;
@@ -215,7 +215,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               turn_undead();
+                               turn_undead(caster_ptr);
                        }
                }
                break;
@@ -227,7 +227,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        int heal = 300;
                        if (info) return info_heal(0, 0, heal);
-                       if (cast) (void)cure_critical_wounds(heal);
+                       if (cast) (void)cure_critical_wounds(caster_ptr, heal);
                }
                break;
 
@@ -239,7 +239,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               warding_glyph();
+                               warding_glyph(caster_ptr);
                        }
                }
                break;
@@ -248,7 +248,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("*解呪*", "Dispel Curse");
                if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
                {
-                       if (cast) (void)remove_all_curse();
+                       if (cast) (void)remove_all_curse(caster_ptr);
                }
                break;
 
@@ -259,7 +259,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (!ident_spell(FALSE)) return NULL;
+                               if (!ident_spell(caster_ptr, FALSE)) return NULL;
                        }
                }
                break;
@@ -327,7 +327,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!recall_player(p_ptr, randint0(21) + 15)) return NULL;
+                               if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
                        }
                }
                break;
@@ -344,7 +344,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               alter_reality();
+                               reserve_alter_reality(caster_ptr);
                        }
                }
                break;
@@ -360,7 +360,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               warding_glyph();
+                               warding_glyph(caster_ptr);
                                glyph_creation();
                        }
                }
@@ -373,7 +373,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               current_floor_ptr->num_repro += MAX_REPRO;
+                               p_ptr->current_floor_ptr->num_repro += MAX_REPRO;
                        }
                }
                break;
@@ -406,7 +406,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               mass_genocide_undead(power, TRUE);
+                               mass_genocide_undead(caster_ptr, power, TRUE);
                        }
                }
                break;
@@ -418,7 +418,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               wiz_lite(FALSE);
+                               wiz_lite(p_ptr, FALSE);
                        }
                }
                break;
@@ -430,8 +430,8 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               (void)restore_all_status();
-                               restore_level(p_ptr);
+                               (void)restore_all_status(caster_ptr);
+                               restore_level(caster_ptr);
                        }
                }
                break;
@@ -443,7 +443,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        int heal = 2000;
                        if (info) return info_heal(0, 0, heal);
-                       if (cast) (void)cure_critical_wounds(heal);
+                       if (cast) (void)cure_critical_wounds(caster_ptr, heal);
                }
                break;
 
@@ -471,13 +471,13 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        if (cast)
                        {
                                TIME_EFFECT v = randint1(base) + base;
-                               set_fast(p_ptr, v, FALSE);
-                               set_oppose_acid(p_ptr, v, FALSE);
-                               set_oppose_elec(p_ptr, v, FALSE);
-                               set_oppose_fire(p_ptr, v, FALSE);
-                               set_oppose_cold(p_ptr, v, FALSE);
-                               set_oppose_pois(p_ptr, v, FALSE);
-                               set_ultimate_res(v, FALSE);
+                               set_fast(caster_ptr, v, FALSE);
+                               set_oppose_acid(caster_ptr, v, FALSE);
+                               set_oppose_elec(caster_ptr, v, FALSE);
+                               set_oppose_fire(caster_ptr, v, FALSE);
+                               set_oppose_cold(caster_ptr, v, FALSE);
+                               set_oppose_pois(caster_ptr, v, FALSE);
+                               set_ultimate_res(caster_ptr, v, FALSE);
                        }
                }
                break;