OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[hengband/hengband.git] / src / realm-daemon.c
index f6f49ab..0ca0221 100644 (file)
@@ -9,16 +9,15 @@
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_daemon_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 ");
 
-       int dir;
-       int plev = p_ptr->lev;
+       DIRECTION dir;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -27,8 +26,8 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
 
                {
-                       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);
 
@@ -46,7 +45,7 @@ cptr do_daemon_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);
 
@@ -95,7 +94,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
 
                {
-                       int power = plev;
+                       PLAYER_LEVEL power = plev;
 
                        if (info) return info_power(power);
 
@@ -114,8 +113,8 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
 
                {
-                       int dice = 6 + (plev - 5) / 4;
-                       int sides = 8;
+                       DICE_NUMBER dice = 6 + (plev - 5) / 4;
+                       DICE_SID sides = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -135,7 +134,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (!summon_specific(-1, p_ptr->y, p_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                               if (!summon_specific(-1, p_ptr->y, p_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
                                {
                                        msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
                                }
@@ -149,9 +148,9 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        "Fires a ball of evil power. Hurts good monsters greatly.");
 
                {
-                       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())
@@ -184,7 +183,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               control_one_demon(dir, power);
+                               control_one_demon(dir, plev);
                        }
                }
                break;
@@ -194,7 +193,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
 
                {
-                       int rad = DETECT_RAD_MAP;
+                       POSITION rad = DETECT_RAD_MAP;
 
                        if (info) return info_radius(rad);
 
@@ -226,8 +225,8 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("プラズマのボルトもしくはビームを放つ。", "Fires a bolt or beam of plasma.");
 
                {
-                       int dice = 11 + (plev - 5) / 4;
-                       int sides = 8;
+                       DICE_NUMBER dice = 11 + (plev - 5) / 4;
+                       DICE_SID sides = 8;
 
                        if (info) return info_damage(dice, sides, 0);
 
@@ -246,7 +245,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = plev + 55;
-                       int rad = 2;
+                       POSITION rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -277,7 +276,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = plev * 3 / 2 + 100;
-                       int rad = plev / 20 + 2;
+                       POSITION rad = plev / 20 + 2;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -297,32 +296,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               bool pet = !one_in_(3);
-                               u32b flg = 0L;
-
-                               if (pet) flg |= PM_FORCE_PET;
-                               else flg |= PM_NO_PET;
-                               if (!(pet && (plev < 50))) flg |= PM_ALLOW_GROUP;
-
-                               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, plev * 2 / 3 + randint1(plev / 2), SUMMON_DEMON, flg))
-                               {
-                                       msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
-
-                                       if (pet)
-                                       {
-                                               msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
-                                       }
-                                       else
-                                       {
-                                               msg_print(_("「卑しき者よ、我は汝の下僕にあらず! お前の魂を頂くぞ!」",
-                                                       "'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'"));
-                                       }
-                               }
-                               else
-                               {
-                                       msg_print(_("悪魔は現れなかった。", "No demons arrive."));
-                               }
-                               break;
+                               cast_summon_demon(plev * 2 / 3 + randint1(plev / 2));
                        }
                }
                break;
@@ -333,7 +307,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        int base = 30;
-                       int sides = 25;
+                       DICE_SID sides = 25;
 
                        if (info) return info_duration(base, sides);
 
@@ -374,7 +348,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = (55 + plev) * 2;
-                       int rad = 3;
+                       POSITION rad = 3;
 
                        if (info) return info_damage(0, 0, dam / 2);
 
@@ -392,7 +366,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = plev * 3 / 2 + 80;
-                       int rad = 2 + plev / 40;
+                       POSITION rad = 2 + plev / 40;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -447,7 +421,7 @@ cptr do_daemon_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);
 
@@ -511,7 +485,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        HIT_POINT dam = 50 + plev;
                        int power = 20 + plev;
-                       int rad = 3 + plev / 20;
+                       POSITION rad = 3 + plev / 20;
 
                        if (info) return format("%s%d+%d", s_dam, dam / 2, dam / 2);
 
@@ -555,7 +529,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = plev * 15;
-                       int rad = plev / 5;
+                       POSITION rad = plev / 5;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -575,7 +549,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                {
                        HIT_POINT dam = 600;
-                       int rad = 0;
+                       POSITION rad = 0;
 
                        if (info) return info_damage(0, 0, dam);