OSDN Git Service

[Refactor] #37783 (2.2.1.5) 「魅了」と「支配」処理の分化作業中。 / Differentiating "charm" and "control".
[hengband/hengband.git] / src / artifact.c
index 4adf206..ae01c1e 100644 (file)
@@ -33,26 +33,6 @@ static int weakening_artifact(object_type *o_ptr);
 
 
 /*!
- * @brief 対象のオブジェクトにランダムな能力維持を一つ付加する。/ Choose one random sustain
- * @details 重複の抑止はない。
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return なし
- */
-void one_sustain(object_type *o_ptr)
-{
-       switch (randint0(6))
-       {
-               case 0: add_flag(o_ptr->art_flags, TR_SUST_STR); break;
-               case 1: add_flag(o_ptr->art_flags, TR_SUST_INT); break;
-               case 2: add_flag(o_ptr->art_flags, TR_SUST_WIS); break;
-               case 3: add_flag(o_ptr->art_flags, TR_SUST_DEX); break;
-               case 4: add_flag(o_ptr->art_flags, TR_SUST_CON); break;
-               case 5: add_flag(o_ptr->art_flags, TR_SUST_CHR); break;
-       }
-}
-
-
-/*!
  * @brief 対象のオブジェクトにランダムな上位耐性を一つ付加する。/ Choose one random high resistance
  * @details 重複の抑止はない。候補は毒、閃光、暗黒、破片、盲目、混乱、地獄、因果混乱、カオス、劣化、恐怖のいずれか。
  * @param o_ptr 対象のオブジェクト構造体ポインタ
@@ -248,7 +228,7 @@ void one_activation(object_type *o_ptr)
                                break;
                        case ACT_BA_COLD_1:
                        case ACT_BA_FIRE_1:
-                       case ACT_DRAIN_1:
+                       case ACT_HYPODYNAMIA_1:
                        case ACT_TELE_AWAY:
                        case ACT_ESP:
                        case ACT_RESIST_ALL:
@@ -263,8 +243,8 @@ void one_activation(object_type *o_ptr)
                        case ACT_ID_PLAIN:
                                chance = 75;
                                break;
-                       case ACT_DRAIN_2:
-                       case ACT_VAMPIRE_1:
+                       case ACT_HYPODYNAMIA_2:
+                       case ACT_DRAIN_1:
                        case ACT_BO_MISS_2:
                        case ACT_BA_FIRE_2:
                        case ACT_REST_EXP:
@@ -274,7 +254,7 @@ void one_activation(object_type *o_ptr)
                        case ACT_BA_COLD_3:
                        case ACT_BA_ELEC_3:
                        case ACT_WHIRLWIND:
-                       case ACT_VAMPIRE_2:
+                       case ACT_DRAIN_2:
                        case ACT_CHARM_ANIMAL:
                                chance = 50;
                                break;
@@ -1620,11 +1600,11 @@ static void give_activation_power(object_type *o_ptr)
                        else if (one_in_(13))
                                type = ACT_SUMMON_UNDEAD;
                        else if (one_in_(9))
-                               type = ACT_VAMPIRE_2;
+                               type = ACT_DRAIN_2;
                        else if (one_in_(6))
                                type = ACT_CHARM_UNDEAD;
                        else
-                               type = ACT_VAMPIRE_1;
+                               type = ACT_DRAIN_1;
                        break;
 
                case BIAS_LAW:
@@ -2213,7 +2193,7 @@ static bool activate_dragon_breath(object_type *o_ptr)
 
        t = randint0(n);
        msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
-       fire_ball(type[t], dir, 250, -4);
+       fire_breath(type[t], dir, 250, 4);
 
        return TRUE;
 }
@@ -2387,28 +2367,28 @@ bool activate_random_artifact(object_type *o_ptr)
                        break;
                }
                
-               case ACT_DRAIN_1:
+               case ACT_HYPODYNAMIA_1:
                {
                        msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
                        if (!get_aim_dir(&dir)) return FALSE;
-                       if (drain_life(dir, 100))
+                       if (hypodynamic_bolt(dir, 100))
                        break;
                }
 
-               case ACT_DRAIN_2:
+               case ACT_HYPODYNAMIA_2:
                {
                        msg_print(_("黒く輝いている...", "It glows black..."));
                        if (!get_aim_dir(&dir)) return FALSE;
-                       drain_life(dir, 120);
+                       hypodynamic_bolt(dir, 120);
                        break;
                }
 
-               case ACT_VAMPIRE_1:
+               case ACT_DRAIN_1:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
                        for (dummy = 0; dummy < 3; dummy++)
                        {
-                               if (drain_life(dir, 50))
+                               if (hypodynamic_bolt(dir, 50))
                                hp_player(50);
                        }
                        break;
@@ -2446,12 +2426,12 @@ bool activate_random_artifact(object_type *o_ptr)
                        break;
                }
 
-               case ACT_VAMPIRE_2:
+               case ACT_DRAIN_2:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
                        for (dummy = 0; dummy < 3; dummy++)
                        {
-                               if (drain_life(dir, 100))
+                               if (hypodynamic_bolt(dir, 100))
                                hp_player(100);
                        }
                        break;
@@ -2484,7 +2464,7 @@ bool activate_random_artifact(object_type *o_ptr)
                {
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
-                       fire_ball(GF_MISSILE, dir, 300, -4);
+                       fire_breath(GF_MISSILE, dir, 300, 4);
                        break;
                }
 
@@ -2580,7 +2560,7 @@ bool activate_random_artifact(object_type *o_ptr)
                {
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
-                       fire_ball(GF_MISSILE, dir, 300, -4);
+                       fire_breath(GF_MISSILE, dir, 300, 4);
                        msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
                        (void)set_afraid(0);
                        (void)set_hero(randint1(50) + 50, FALSE);
@@ -2597,7 +2577,7 @@ bool activate_random_artifact(object_type *o_ptr)
                case ACT_BR_FIRE:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
-                       fire_ball(GF_FIRE, dir, 200, -2);
+                       fire_breath(GF_FIRE, dir, 200, 2);
                        if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
                        {
                                (void)set_oppose_fire(randint1(20) + 20, FALSE);
@@ -2607,7 +2587,7 @@ bool activate_random_artifact(object_type *o_ptr)
                case ACT_BR_COLD:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
-                       fire_ball(GF_COLD, dir, 200, -2);
+                       fire_breath(GF_COLD, dir, 200, 2);
                        if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
                        {
                                (void)set_oppose_cold(randint1(20) + 20, FALSE);
@@ -2708,14 +2688,14 @@ bool activate_random_artifact(object_type *o_ptr)
                case ACT_CHARM_ANIMAL:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
-                       (void)charm_animal(dir, plev * 2);
+                       (void)charm_animal(dir, plev);
                        break;
                }
 
                case ACT_CHARM_UNDEAD:
                {
                        if (!get_aim_dir(&dir)) return FALSE;
-                       (void)control_one_undead(dir, plev * 2);
+                       (void)control_one_undead(dir, plev);
                        break;
                }
 
@@ -2754,7 +2734,7 @@ bool activate_random_artifact(object_type *o_ptr)
                case ACT_SUMMON_ELEMENTAL:
                {
                        bool pet = one_in_(3);
-                       u32b mode = 0L;
+                       BIT_FLAGS mode = 0L;
 
                        if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
                        if (pet) mode |= PM_FORCE_PET;
@@ -2775,7 +2755,7 @@ bool activate_random_artifact(object_type *o_ptr)
                case ACT_SUMMON_DEMON:
                {
                        bool pet = one_in_(3);
-                       u32b mode = 0L;
+                       BIT_FLAGS mode = 0L;
 
                        if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
                        if (pet) mode |= PM_FORCE_PET;
@@ -2797,7 +2777,7 @@ bool activate_random_artifact(object_type *o_ptr)
                {
                        bool pet = one_in_(3);
                        int type;
-                       u32b mode = 0L;
+                       BIT_FLAGS mode = 0L;
 
                        type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
 
@@ -2822,7 +2802,7 @@ bool activate_random_artifact(object_type *o_ptr)
 
                case ACT_SUMMON_HOUND:
                {
-                       u32b mode = PM_ALLOW_GROUP;
+                       BIT_FLAGS mode = PM_ALLOW_GROUP;
                        bool pet = !one_in_(5);
                        if (pet) mode |= PM_FORCE_PET;
                        else mode |= PM_NO_PET;
@@ -2850,7 +2830,7 @@ bool activate_random_artifact(object_type *o_ptr)
 
                case ACT_SUMMON_OCTOPUS:
                {
-                       u32b mode = PM_ALLOW_GROUP;
+                       BIT_FLAGS mode = PM_ALLOW_GROUP;
                        bool pet = !one_in_(5);
                        if (pet) mode |= PM_FORCE_PET;
 
@@ -3618,7 +3598,7 @@ bool activate_random_artifact(object_type *o_ptr)
                {
                        int num = 1;
                        int i;
-                       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+                       BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
                        int tx, ty;
 
                        /* Only for Crimson */