OSDN Git Service

KILL_EVILは強すぎるフラグであり軽々しく与えていい物ではないため, 切り
[hengband/hengband.git] / src / artifact.c
index b8f8bf5..8b25c75 100644 (file)
@@ -1915,9 +1915,9 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
                /* Mark the item as fully known */
                o_ptr->ident |= (IDENT_MENTAL);
 
-               (void)screen_object(o_ptr, TRUE);
+               (void)screen_object(o_ptr, 0L);
 
-               if (!get_string(ask_msg, dummy_name, sizeof dummy_name, FALSE)
+               if (!get_string(ask_msg, dummy_name, sizeof dummy_name)
                    || !dummy_name[0])
                {
                        /* Cancelled */
@@ -2984,7 +2984,7 @@ bool activate_random_artifact(object_type * o_ptr)
                        msg_print("It twists space around you...");
 #endif
 
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        o_ptr->timeout = 45;
                        break;
                }
@@ -3017,6 +3017,35 @@ bool activate_random_artifact(object_type * o_ptr)
 }
 
 
+void get_bloody_moon_flags(object_type *o_ptr)
+{
+       int dummy, i;
+
+       for (i = 0; i < TR_FLAG_SIZE; i++)
+               o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
+
+       dummy = randint1(2) + randint1(2);
+       for (i = 0; i < dummy; i++)
+       {
+               int flag = randint0(26);
+               if (flag >= 20) add_flag(o_ptr->art_flags, TR_KILL_UNDEAD + flag - 20);
+               else if (flag == 19) add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
+               else if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
+               else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
+       }
+
+       dummy = randint1(2);
+       for (i = 0; i < dummy; i++) one_resistance(o_ptr);
+
+       for (i = 0; i < 2; i++)
+       {
+               int tmp = randint0(11);
+               if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
+               else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
+       }
+}
+
+
 void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
 {
        bool give_resistance = FALSE, give_power = FALSE;
@@ -3038,6 +3067,7 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
                        return;
                }
        }
+
        if (o_ptr->name1 == ART_MURAMASA)
        {
                if (p_ptr->pclass != CLASS_SAMURAI)
@@ -3055,24 +3085,7 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
 
        if (o_ptr->name1 == ART_BLOOD)
        {
-               int dummy, i;
-               dummy = randint1(2)+randint1(2);
-               for (i = 0; i < dummy; i++)
-               {
-                       int flag = randint0(19);
-                       if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
-                       else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
-               }
-               dummy = randint1(2);
-               for (i = 0; i < dummy; i++)
-                       one_resistance(o_ptr);
-               dummy = 2;
-               for (i = 0; i < dummy; i++)
-               {
-                       int tmp = randint0(11);
-                       if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
-                       else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
-               }
+               get_bloody_moon_flags(o_ptr);
        }
 
        if (a_ptr->gen_flags & (TRG_XTRA_POWER)) give_power = TRUE;
@@ -3099,7 +3112,7 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
 /*
  * Create the artifact of the specified number
  */
-void create_named_art(int a_idx, int y, int x)
+bool create_named_art(int a_idx, int y, int x)
 {
        object_type forge;
        object_type *q_ptr;
@@ -3111,13 +3124,13 @@ void create_named_art(int a_idx, int y, int x)
        q_ptr = &forge;
 
        /* Ignore "empty" artifacts */
-       if (!a_ptr->name) return;
+       if (!a_ptr->name) return FALSE;
 
        /* Acquire the "kind" index */
        i = lookup_kind(a_ptr->tval, a_ptr->sval);
 
        /* Oops */
-       if (!i) return;
+       if (!i) return FALSE;
 
        /* Create the artifact */
        object_prep(q_ptr, i);
@@ -3145,6 +3158,12 @@ void create_named_art(int a_idx, int y, int x)
 
        random_artifact_resistance(q_ptr, a_ptr);
 
+       /*
+        * drop_near()Æâ¤ÇÉáÄ̤θÇÄꥢ¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤¬½Å¤Ê¤é¤Ê¤¤À­¼Á¤Ë°Í¸¤¹¤ë.
+        * ²¾¤Ë2¸Ä°Ê¾å¸ºß²Äǽ¤«¤ÄÁõÈ÷Éʰʳ°¤Î¸ÇÄꥢ¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤¬ºîÀ®¤µ¤ì¤ì¤Ð
+        * ¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤϿ®ÍѤǤ­¤Ê¤¯¤Ê¤ë.
+        */
+
        /* Drop the artifact from heaven */
-       (void)drop_near(q_ptr, -1, y, x);
+       return drop_near(q_ptr, -1, y, x) ? TRUE : FALSE;
 }