OSDN Git Service

[Refactor] #37353 未使用構造体 dun_type 削除。 / Delete dun_type, unused structure.
[hengband/hengband.git] / src / realm-death.c
index d547d02..136e198 100644 (file)
@@ -1,5 +1,9 @@
 #include "angband.h"
 #include "cmd-spell.h"
+#include "projection.h"
+#include "spells-summon.h"
+#include "spells-status.h"
+#include "avatar.h"
 
 
 
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_death_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;
 
-       static const char s_dam[] = _("損傷:", "dam ");
-       static const char s_random[] = _("ランダム", "random");
-
-       int dir;
-       int plev = p_ptr->lev;
+       DIRECTION dir;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -29,7 +30,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -46,9 +47,9 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        "Fires a tiny ball of evil power which hurts good monsters greatly.");
 
                {
-                       int dice = 3 + (plev - 1) / 5;
-                       int sides = 4;
-                       int rad = 0;
+                       DICE_NUMBER dice = 3 + (plev - 1) / 5;
+                       DICE_SID sides = 4;
+                       POSITION rad = 0;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -89,7 +90,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("近くの邪悪なモンスターを感知する。", "Detects all evil monsters in your vicinity.");
 
                {
-                       int rad = DETECT_RAD_DEFAULT;
+                       POSITION rad = DETECT_RAD_DEFAULT;
 
                        if (info) return info_radius(rad);
 
@@ -106,7 +107,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = 10 + plev / 2;
-                       int rad = 2;
+                       POSITION rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -167,8 +168,8 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               fear_monster(dir, power);
-                               stun_monster(dir, power);
+                               fear_monster(dir, plev);
+                               stun_monster(dir, plev);
                        }
                }
                break;
@@ -186,7 +187,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               control_one_undead(dir, power);
+                               control_one_undead(dir, plev);
                        }
                }
                break;
@@ -196,9 +197,9 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("生命のある者のHPと最大HP双方にダメージを与える効果のある球を放つ。", "Fires a ball which damages to both HP and MaxHP of living monsters.");
 
                {
-                       int dice = 3;
-                       int sides = 6;
-                       int rad = (plev < 30) ? 2 : 3;
+                       DICE_NUMBER dice = 3;
+                       DICE_SID sides = 6;
+                       POSITION rad = (plev < 30) ? 2 : 3;
                        int base;
 
                        if (IS_WIZARD_CLASS())
@@ -223,8 +224,8 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
 
                {
-                       int dice = 8 + (plev - 5) / 4;
-                       int sides = 8;
+                       DICE_NUMBER dice = 8 + (plev - 5) / 4;
+                       DICE_SID sides = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -243,7 +244,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = (30 + plev) * 2;
-                       int rad = plev / 10 + 2;
+                       POSITION rad = plev / 10 + 2;
 
                        if (info) return info_damage(0, 0, dam / 2);
 
@@ -290,8 +291,8 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        "Absorbs some HP from a monster and gives them to you by bolt. You will also gain nutritional sustenance from this.");
 
                {
-                       int dice = 1;
-                       int sides = plev * 2;
+                       DICE_NUMBER dice = 1;
+                       DICE_SID sides = plev * 2;
                        int base = plev * 2;
 
                        if (info) return info_damage(dice, sides, base);
@@ -380,7 +381,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("ランダムで様々な効果が起こる。", "Causes random effects.");
 
                {
-                       if (info) return s_random;
+                       if (info) return KWD_RANDOM;
 
                        if (cast)
                        {
@@ -396,8 +397,8 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("暗黒のボルトもしくはビームを放つ。", "Fires a bolt or beam of darkness.");
 
                {
-                       int dice = 4 + (plev - 5) / 4;
-                       int sides = 8;
+                       DICE_NUMBER dice = 4 + (plev - 5) / 4;
+                       DICE_SID sides = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -449,7 +450,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        HIT_POINT dam = 100;
 
-                       if (info) return format("%s3*%d", s_dam, dam);
+                       if (info) return format("%s3*%d", KWD_DAM, dam);
 
                        if (cast)
                        {
@@ -474,7 +475,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("視界内の生命のあるモンスターにダメージを与える。", "Damages all living monsters in sight.");
 
                {
-                       int sides = plev * 3;
+                       DICE_SID sides = plev * 3;
 
                        if (info) return info_damage(1, sides, 0);
 
@@ -491,7 +492,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = 100 + plev * 2;
-                       int rad = 4;
+                       POSITION rad = 4;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -537,7 +538,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                if (pet) flg |= PM_FORCE_PET;
                                else flg |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-                               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (plev * 3) / 2, type, flg))
+                               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (plev * 3) / 2, type, flg, '\0'))
                                {
                                        msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
                                                "Cold winds begin to blow around you, carrying with them the stench of decay..."));
@@ -633,7 +634,7 @@ cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = 666;
-                       int rad = 3;
+                       POSITION rad = 3;
 
                        if (info) return info_damage(0, 0, dam);