OSDN Git Service

[Refactor] #38997 turn_undead() に player_type * 引数を追加. / Add player_type * argument...
[hengband/hengband.git] / src / realm-life.c
index 1e67dd8..09bd8ec 100644 (file)
@@ -1,7 +1,12 @@
 #include "angband.h"
 #include "cmd-spell.h"
-#include "projection.h"
 #include "spells-status.h"
+#include "spells-floor.h"
+#include "spells.h"
+#include "player-status.h"
+#include "player-effects.h"
+#include "floor.h"
+#include "targeting.h"
 
 /*!
 * @brief 生命領域魔法の各処理を行う
@@ -9,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;
@@ -17,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)
        {
@@ -28,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;
 
@@ -42,7 +47,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_blessed(randint1(base) + base, FALSE);
+                               set_blessed(caster_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
@@ -106,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;
 
@@ -116,7 +121,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               set_poisoned(0);
+                               set_poisoned(caster_ptr, 0);
                        }
                }
                break;
@@ -127,7 +132,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               set_food(PY_FOOD_MAX - 1);
+                               set_food(caster_ptr, PY_FOOD_MAX - 1);
                        }
                }
                break;
@@ -136,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;
 
@@ -165,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;
 
@@ -181,8 +186,8 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_oppose_cold(randint1(base) + base, FALSE);
-                               set_oppose_fire(randint1(base) + base, FALSE);
+                               set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
+                               set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
@@ -198,7 +203,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               map_area(rad);
+                               map_area(caster_ptr, rad);
                        }
                }
                break;
@@ -210,7 +215,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               turn_undead();
+                               turn_undead(caster_ptr);
                        }
                }
                break;
@@ -222,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;
 
@@ -234,7 +239,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               warding_glyph();
+                               warding_glyph(caster_ptr);
                        }
                }
                break;
@@ -243,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;
 
@@ -254,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;
@@ -322,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;
@@ -339,7 +344,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               alter_reality();
+                               reserve_alter_reality(caster_ptr);
                        }
                }
                break;
@@ -355,7 +360,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               warding_glyph();
+                               warding_glyph(caster_ptr);
                                glyph_creation();
                        }
                }
@@ -368,7 +373,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               num_repro += MAX_REPRO;
+                               p_ptr->current_floor_ptr->num_repro += MAX_REPRO;
                        }
                }
                break;
@@ -401,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;
@@ -413,7 +418,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               wiz_lite(FALSE);
+                               wiz_lite(p_ptr, FALSE);
                        }
                }
                break;
@@ -425,8 +430,8 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               (void)restore_all_status();
-                               restore_level();
+                               (void)restore_all_status(caster_ptr);
+                               restore_level(caster_ptr);
                        }
                }
                break;
@@ -438,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;
 
@@ -466,13 +471,13 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        if (cast)
                        {
                                TIME_EFFECT v = randint1(base) + base;
-                               set_fast(v, FALSE);
-                               set_oppose_acid(v, FALSE);
-                               set_oppose_elec(v, FALSE);
-                               set_oppose_fire(v, FALSE);
-                               set_oppose_cold(v, FALSE);
-                               set_oppose_pois(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;