OSDN Git Service

[Refactor] #37353 コメント整理。 update_mon()をupdate_monster()に改名。 / Refactor comments and...
[hengband/hengband.git] / src / realm-daemon.c
index 4dc2f55..71939c0 100644 (file)
@@ -18,7 +18,7 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
        static const char s_dam[] = _("損傷:", "dam ");
 
        DIRECTION dir;
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -27,8 +27,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 +46,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 +95,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 +114,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);
 
@@ -149,9 +149,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 +184,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 +194,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 +226,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 +246,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 +277,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 +297,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 +308,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 +349,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 +367,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 +422,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 +486,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 +530,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 +550,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);