OSDN Git Service

Normal objects also are defined their activation type in k_info.txt.
authoriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 31 Jan 2013 18:40:15 +0000 (18:40 +0000)
committeriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 31 Jan 2013 18:40:15 +0000 (18:40 +0000)
lib/edit/k_info.txt
src/artifact.c
src/cmd6.c
src/defines.h
src/externs.h
src/init1.c
src/object1.c
src/object2.c
src/tables.c
src/types.h

index 72b1116..970ca13 100644 (file)
@@ -1593,6 +1593,7 @@ W:35:0:2:3000
 A:50/1
 P:0:0d0:0:0:15
 F:RES_ELEC | IGNORE_ELEC | ACTIVATE
+U:RESIST_ELEC
 
 N:136:¥¹¥Ô¡¼¥É:ÎÐÃìÀФÎ
 E:Speed:Beryl
@@ -1683,6 +1684,7 @@ W:35:0:2:3000
 A:50/1
 P:0:0d0:0:0:15
 F:RES_FIRE | IGNORE_FIRE | ACTIVATE
+U:RESIST_FIRE
 
 N:147:»À:¥¸¥ã¥¹¥Ñ¡¼¤Î
 E:Acid:Jasper
@@ -1692,6 +1694,7 @@ W:35:0:2:3000
 A:50/1
 P:0:0d0:0:0:15
 F:RES_ACID | IGNORE_ACID | ACTIVATE
+U:RESIST_ACID
 
 N:148:ɹ:ÀÄÎÜÍþ¤Î
 E:Ice:Lapis Lazuli
@@ -1701,6 +1704,7 @@ W:35:0:2:3000
 A:50/1
 P:0:0d0:0:0:15
 F:RES_COLD | IGNORE_COLD | ACTIVATE
+U:RESIST_COLD
 
 N:149:¶ìǺ:¥¯¥¸¥ã¥¯ÀФÎ
 E:Woe:Malachite
@@ -4217,6 +4221,7 @@ A:60/8
 P:40:2d4:-2:0:10
 F:RES_ACID |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of utterly black scales, against which no metal or wood can rest.
 D:ÌÚ¤ä¶â°¤¬ÂѤ¨¤é¤ì¤Ê¤¤¤«¤Î¤è¤¦¤Ê¼¿¹õ¤ÎÎÚ³»¤À¡£
 
@@ -4229,6 +4234,7 @@ A:40/8
 P:40:2d4:-2:0:10
 F:RES_ELEC |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales as blue as sapphires, emitting eerie sparks and flashes as 
 D:$you move about in it.
 D:Ã夿¼Ô¤¬Æ°¤¯¤ÈÉÔµ¤Ì£¤Ê°ðºÊ¤È¸÷¤òÊü¤Ä¡¢¥µ¥Õ¥¡¥¤¥¢¤Î¤è¤¦¤ËÀĤ¤ÎÚ³»¤À¡£
@@ -4242,6 +4248,7 @@ A:50/8
 P:40:2d4:-2:0:10
 F:RES_COLD |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales, coldly gleaming in frosty white.  A shiver runs down 
 D:$through your spine even as you look at it.
 D:Îäø¤ÊÇò¤ËÎ䤿¤¯¤­¤é¤á¤¯ÎÚ³»¤À¡£¤½¤ì¤ò¸«¤ë»þ¡¢Çضڤ¬´¨¤¯¤Ê¤ë¡£
@@ -4255,6 +4262,7 @@ A:80/8
 P:40:2d4:-2:0:10
 F:RES_FIRE |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales, with all the reds of every fire ever lit.  The scar 
 D:$tissue from an old burn aches as you put this armour on.
 D:¾ï¤Ëdz¤¨¤ë±ê¤ËÀÖ¤¯ºÌ¤é¤ì¤¿ÎÚ³»¤À¡£¤³¤ì¤òÃå¤ë¤È¸Å¤¤²Ð½ýÀפ¬Äˤࡣ
@@ -4268,6 +4276,7 @@ A:70/8
 P:40:2d4:-2:0:10
 F:RES_POIS |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 #D:$A suit of scales, glistening in sickly green, out from which falls the 
 #D:$skeleton of a rat who touched it and died in agony.
 #D:ÉÂŪ¤ÊÎФ˸÷¤ëÎÚ³»¤Ç¡¢¤½¤ì¤Ë¿¨¤ì¤¿¥Í¥º¥ß¤Ï¶ìÄˤ˻à¤ó¤ÇÇò¹ü²½¤¹¤ë¡£
@@ -4283,6 +4292,7 @@ A:100/16
 P:40:2d4:-2:0:10
 F:RES_ACID | RES_ELEC | RES_FIRE | RES_COLD | RES_POIS
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales that throbs with angry energies; it takes all your energy 
 D:$to master the Elements fighting an endless war trapped inside.
 D:Åܤê¤Î¥¨¥Í¥ë¥®¡¼¤ËÌ®ÂǤÄÎÚ³»¤Ç¡¢³»¤ÎÃæ¤ËÊá¤é¤ï¤ì±Ê±ó¤ËÀ襤³¤±¤ë¥¨¥ì¥á¥ó¥Èã
@@ -4298,6 +4308,7 @@ A:65/16
 P:40:2d4:-2:0:10
 F:RES_LITE | RES_DARK |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 
 N:407:¥í¡¼¥É¥é¥´¥ó¡¦¥¹¥±¥¤¥ë¥á¥¤¥ë
 E:Law Dragon Scale Mail~
@@ -4308,6 +4319,7 @@ A:80/16
 P:40:2d4:-2:0:10
 F:RES_SOUND | RES_SHARDS |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales in stern blue and silver.  You feel the slightest tremor 
 D:$as you touch it, like massed trumpets heard and cyclones felt from afar.
 D:¸·½Í¤ÊÀĤȶä¤ÎÎÚ³»¤À¡£¤½¤ì¤Ë¿¨¤ì¤ë¤È¡¢¥È¥é¥ó¥Ú¥Ã¥È¤Î½¸ÃĤαéÁÕ¤¬Ê¹¤³¤¨¤ë¤«
@@ -4322,6 +4334,7 @@ A:55/8
 P:40:2d4:-2:0:10
 F:RES_CONF |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales, gleaming in rich engraved bronze.  The more you look at 
 D:$the the maze of whorls and lines that close inspection reveal on its 
 D:$surface, the less sense you are able to make of them.
@@ -4337,6 +4350,7 @@ A:65/8
 P:40:2d4:-2:0:10
 F:RES_SOUND |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales in mirror-like gold.  You hear nothing unusual as you 
 D:$wear this armour, yet your ears ache as though in the midst of a 
 D:$cacophony.
@@ -4352,6 +4366,7 @@ A:75/16
 P:40:2d4:-2:0:10
 F:RES_CHAOS | RES_DISEN |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales.  Every shape, in every color imaginable, riot and 
 D:$contend upon its surface as you stare in fascination.
 D:ÎÚ³»¤À¡£Ì¥ÏǤµ¤ì¤Æ¸«¤Ä¤á¤ë¤È¡¢¤½¤ÎɽÌ̤ÇÁÛÁü¤Ç¤­¤ë¸Â¤ê¤Î¿§¤ò¤È¤ëÍÍ¡¹¤Ê·Á
@@ -4366,6 +4381,7 @@ A:90/16
 P:40:2d4:-2:0:10
 F:RES_CHAOS | RES_DISEN | RES_SOUND | RES_SHARDS |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BR_DRAGON
 D:$A suit of scales.  Featureless grey to casual inspection, yet a closer 
 D:$look reveals patterns within patterns of iridescence that throb with 
 D:$leashed energies bound as though by chains of adamant.
@@ -4383,6 +4399,7 @@ F:RES_ACID | RES_FIRE | RES_COLD | RES_ELEC | RES_POIS |
 F:RES_NETHER | RES_NEXUS | RES_CHAOS | RES_LITE | RES_DARK |
 F:RES_SHARDS | RES_SOUND | RES_DISEN | RES_CONF |
 F:ACTIVATE | IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
+U:BA_MISS_3
 D:$A suit with scales of every color, surrounded in a nimbus of perfectly 
 D:$untramelled yet inextricably intermingled and utterly mastered powers 
 D:$elemental and ethereal.
index 0e61620..da88b01 100644 (file)
@@ -1989,6 +1989,47 @@ static const activation_type* find_activation_info(const object_type *o_ptr)
        return NULL;
 }
 
+
+/* Dragon breath activation */
+static bool activate_dragon_breath(object_type *o_ptr)
+{
+       u32b flgs[4]; /* for resistance flags */
+       int type[20];
+       cptr name[20];
+       int i, dir, t, n = 0;
+
+       if (!get_aim_dir(&dir)) return FALSE;
+
+       object_flags(o_ptr, flgs);
+
+       for (i = 0; dragonbreath_info[i].flag != 0; i++)
+       {
+               if (have_flag(flgs, dragonbreath_info[i].flag))
+               {
+                       type[n] = dragonbreath_info[i].type;
+                       name[n] = dragonbreath_info[i].name;
+                       n++;
+               }
+       }
+
+       /* Paranoia */
+       if (n == 0) return FALSE;
+
+       /* Stop speaking */
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+       t = randint0(n);
+#ifdef JP
+       msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", name[t]);
+#else
+       msg_format("You breathe %s.", name[n]);
+#endif
+       fire_ball(type[t], dir, 250, -4);
+
+       return TRUE;
+}
+
+
 bool activate_random_artifact(object_type *o_ptr)
 {
        int plev = p_ptr->lev;
@@ -2307,7 +2348,7 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_print("You breathe the elements.");
 #endif
-                       fire_ball(GF_MISSILE, dir, 300, 4);
+                       fire_ball(GF_MISSILE, dir, 300, -4);
                        break;
                }
 
@@ -2443,7 +2484,7 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_print("You breathe the elements.");
 #endif
-                       fire_ball(GF_MISSILE, dir, 300, 4);
+                       fire_ball(GF_MISSILE, dir, 300, -4);
 #ifdef JP
                        msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
 #else
@@ -2487,6 +2528,11 @@ bool activate_random_artifact(object_type *o_ptr)
                        }
                        break;
                }
+               case ACT_BR_DRAGON:
+               {
+                       if (!activate_dragon_breath(o_ptr)) return FALSE;
+                       break;
+               }
 
                /* Activate for other offensive action */
 
@@ -3093,6 +3139,11 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_format("The %s grows black.", name);
 #endif
+                       if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
+                       {
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_ball(GF_ACID, dir, 100, 2);
+                       }
                        (void)set_oppose_acid(randint1(20) + 20, FALSE);
                        break;
                }
@@ -3104,6 +3155,11 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_format("The %s grows red.", name);
 #endif
+                       if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
+                       {
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_ball(GF_FIRE, dir, 100, 2);
+                       }
                        (void)set_oppose_fire(randint1(20) + 20, FALSE);
                        break;
                }
@@ -3115,6 +3171,11 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_format("The %s grows white.", name);
 #endif
+                       if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
+                       {
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_ball(GF_COLD, dir, 100, 2);
+                       }
                        (void)set_oppose_cold(randint1(20) + 20, FALSE);
                        break;
                }
@@ -3126,6 +3187,11 @@ bool activate_random_artifact(object_type *o_ptr)
 #else
                        msg_format("The %s grows blue.", name);
 #endif
+                       if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
+                       {
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_ball(GF_ELEC, dir, 100, 2);
+                       }
                        (void)set_oppose_elec(randint1(20) + 20, FALSE);
                        break;
                }
index eb7d05e..3b63406 100644 (file)
@@ -3941,6 +3941,7 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
        return w1 <= w2;
 }
 
+
 /*
  * Activate a wielded object.  Wielded objects never stack.
  * And even if they did, activatable objects never stack.
@@ -4053,7 +4054,8 @@ static void do_cmd_activate_aux(int item)
        }
 
        /* Some lights need enough fuel for activation */
-       if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
+       if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
+               ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
        {
 #ifdef JP
                msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
@@ -4123,7 +4125,8 @@ static void do_cmd_activate_aux(int item)
        }
 
        /* Activate object */
-       if (o_ptr->xtra2 && (object_is_artifact(o_ptr) || object_is_ego(o_ptr)))
+       /* if (o_ptr->xtra2 && (object_is_artifact(o_ptr) || object_is_ego(o_ptr))) */
+       if (o_ptr->xtra2)
        {
                (void)activate_random_artifact(o_ptr);
 
@@ -4134,276 +4137,7 @@ static void do_cmd_activate_aux(int item)
                return;
        }
 
-       /* Hack -- Dragon Scale Mail can be activated as well */
-       if (o_ptr->tval == TV_DRAG_ARMOR)
-       {
-               /* Get a direction for breathing (or abort) */
-               if (!get_aim_dir(&dir)) return;
-
-               if (music_singing_any()) stop_singing();
-               if (hex_spelling_any()) stop_hex_spell_all();
-
-               /* Branch on the sub-type */
-               switch (o_ptr->sval)
-               {
-                       case SV_DRAGON_BLUE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe lightning.");
-#endif
-
-                               fire_ball(GF_ELEC, dir, 100, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_WHITE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe frost.");
-#endif
-
-                               fire_ball(GF_COLD, dir, 110, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_BLACK:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe acid.");
-#endif
-
-                               fire_ball(GF_ACID, dir, 130, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_GREEN:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe poison gas.");
-#endif
-
-                               fire_ball(GF_POIS, dir, 150, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_RED:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe fire.");
-#endif
-
-                               fire_ball(GF_FIRE, dir, 200, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_MULTIHUED:
-                       {
-                               chance = randint0(5);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1) ? "°ðºÊ" :
-                                           ((chance == 2) ? "Î䵤" :
-                                            ((chance == 3) ? "»À" :
-                                             ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1) ? "lightning" :
-                                           ((chance == 2) ? "frost" :
-                                            ((chance == 3) ? "acid" :
-                                             ((chance == 4) ? "poison gas" : "fire")))));
-#endif
-
-                               fire_ball(((chance == 1) ? GF_ELEC :
-                                          ((chance == 2) ? GF_COLD :
-                                           ((chance == 3) ? GF_ACID :
-                                            ((chance == 4) ? GF_POIS : GF_FIRE)))),
-                                         dir, 250, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_BRONZE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe confusion.");
-#endif
-
-                               fire_ball(GF_CONFUSION, dir, 120, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_GOLD:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe sound.");
-#endif
-
-                               fire_ball(GF_SOUND, dir, 130, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_CHAOS:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1 ? "chaos" : "disenchantment")));
-#endif
-
-                               fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
-                                         dir, 220, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_LAW:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1 ? "sound" : "shards")));
-#endif
-
-                               fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
-                                         dir, 230, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_BALANCE:
-                       {
-                               chance = randint0(4);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
-                                          ((chance == 1) ? "¥«¥ª¥¹" :
-                                           ((chance == 2) ? "Îô²½" :
-                                            ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1) ? "chaos" :
-                                           ((chance == 2) ? "disenchantment" :
-                                            ((chance == 3) ? "sound" : "shards"))));
-#endif
-
-                               fire_ball(((chance == 1) ? GF_CHAOS :
-                                          ((chance == 2) ? GF_DISENCHANT :
-                                           ((chance == 3) ? GF_SOUND : GF_SHARDS))),
-                                         dir, 250, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_SHINING:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 0 ? "light" : "darkness")));
-#endif
-
-                               fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_POWER:
-                       {
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe the elements.");
-#endif
-
-                               fire_ball(GF_MISSILE, dir, 300, -3);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-               }
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Success */
-               return;
-       }
-
-       else if (o_ptr->tval == TV_RING)
-       {
-               /* Get a direction for breathing (or abort) */
-               if (!get_aim_dir(&dir)) return;
-
-               switch (o_ptr->sval)
-               {
-                       case SV_RING_ACID:
-                       {
-                               fire_ball(GF_ACID, dir, 100, 2);
-                               (void)set_oppose_acid(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_ICE:
-                       {
-                               fire_ball(GF_COLD, dir, 100, 2);
-                               (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_FLAMES:
-                       {
-                               fire_ball(GF_FIRE, dir, 100, 2);
-                               (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_ELEC:
-                       {
-                               fire_ball(GF_ELEC, dir, 100, 2);
-                               (void)set_oppose_elec(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-               }
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Success */
-               return;
-       }
-
+       /* Special items */
        else if (o_ptr->tval == TV_WHISTLE)
        {
                if (music_singing_any()) stop_singing();
index bfc9e38..652c08f 100644 (file)
 #define ACT_BA_ACID_1           37
 #define ACT_BR_FIRE             38
 #define ACT_BR_COLD             39
+#define ACT_BR_DRAGON           40
 /* 33 - 50 unused */
 #define ACT_CONFUSE             51
 #define ACT_SLEEP               52
index c57bcb3..d53f743 100644 (file)
@@ -117,6 +117,7 @@ extern cptr monster_powers_short[MAX_MONSPELLS];
 extern cptr ident_info[];
 extern mbe_info_type mbe_info[];
 extern byte feature_action_flags[FF_FLAG_MAX];
+extern dragonbreath_type dragonbreath_info[];
 extern activation_type activation_info[];
 
 /* variable.c */
index 892be56..a5f057a 100644 (file)
@@ -1846,6 +1846,40 @@ static errr grab_one_kind_flag(object_kind *k_ptr, cptr what)
        return (1);
 }
 
+/*
+ * Grab one activation index flag
+ */
+static byte grab_one_activation_flag(cptr what)
+{
+       int i;
+
+       for (i = 0; ; i++)
+       {
+               if (activation_info[i].flag == NULL) break;
+
+               if (streq(what, activation_info[i].flag))
+               {
+                       return activation_info[i].index;
+               }
+       }
+
+       i = atoi(what);
+        if (i > 0)
+        {
+                return ((byte) i);
+        }
+
+       /* Oops */
+#ifdef JP
+       msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what);
+#else
+       msg_format("Unknown activation flag '%s'.", what);
+#endif
+
+       /* Error */
+       return (0);
+}
+
 
 /*
  * Initialize the "k_info" array, by parsing an ascii "template" file
@@ -2073,6 +2107,21 @@ errr parse_k_info(char *buf, header *head)
                k_ptr->to_a =  ta;
        }
 
+       /* Hack -- Process 'U' for activation index */
+       else if (buf[0] == 'U')
+       {
+               byte n;
+               n = grab_one_activation_flag(buf + 2);
+               if (n > 0)
+               {
+                       k_ptr->act_idx = n;
+               }
+               else
+               {
+                       return (5);
+               }
+       }
+
        /* Hack -- Process 'F' for flags */
        else if (buf[0] == 'F')
        {
@@ -2139,40 +2188,6 @@ static errr grab_one_artifact_flag(artifact_type *a_ptr, cptr what)
        return (1);
 }
 
-/*
- * Grab one activation index flag
- */
-static byte grab_one_activation_flag(cptr what)
-{
-       int i;
-
-       for (i = 0; ; i++)
-       {
-               if (activation_info[i].flag == NULL) break;
-
-               if (streq(what, activation_info[i].flag))
-               {
-                       return activation_info[i].index;
-               }
-       }
-
-       i = atoi(what);
-        if (i > 0)
-        {
-                return ((byte) i);
-        }
-
-       /* Oops */
-#ifdef JP
-       msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what);
-#else
-       msg_format("Unknown activation flag '%s'.", what);
-#endif
-
-       /* Error */
-       return (0);
-}
-
 
 /*
  * Initialize the "a_info" array, by parsing an ascii "template" file
index e5f9322..e0dab5a 100644 (file)
@@ -330,12 +330,37 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 }
 
 
+cptr item_activation_dragon_breath(object_type *o_ptr)
+{
+       static char desc[256];
+       u32b flgs[4]; /* for resistance flags */
+       int i, n = 0;
+
+       object_flags(o_ptr, flgs);
+       strcpy(desc, _("", "breath "));
+
+       for (i = 0; dragonbreath_info[i].flag != 0; i++)
+       {
+               if (have_flag(flgs, dragonbreath_info[i].flag))
+               {
+                       if (n > 0) strcat(desc, _("¡¢", ", "));
+                       strcat(desc, dragonbreath_info[i].name);
+                       n++;
+               }
+       }
+
+       strcat(desc, _("¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè"," every 200+d200 turns"));
+
+       return (desc);
+}
+
 /*
  * Determine the "Activation" (if any) for an artifact
  * Return a string, or NULL for "no activation"
  */
 cptr item_activation(object_type *o_ptr)
 {
+       static char *buf[256];
        u32b flgs[TR_FLAG_SIZE];
 
        /* Extract the flags */
@@ -403,8 +428,9 @@ cptr item_activation(object_type *o_ptr)
                if (!o_ptr->xtra2) o_ptr->xtra2 = e_info[o_ptr->name2].act_idx;
        }
 
-       if ((object_is_artifact(o_ptr) || object_is_ego(o_ptr)) &&
-               (o_ptr->xtra2))
+       /* Get an explain of an activation */
+       /* if ((object_is_artifact(o_ptr) || object_is_ego(o_ptr)) && (o_ptr->xtra2)) */
+       if (o_ptr->xtra2)
        {
                switch (o_ptr->xtra2)
                {
@@ -458,7 +484,7 @@ cptr item_activation(object_type *o_ptr)
                        case ACT_DISP_EVIL:
                                return "¼Ù°­Â໶(x5) : 100+d100 ¥¿¡¼¥óËè";
                        case ACT_BA_MISS_3:
-                               return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 500 ¥¿¡¼¥óËè";
+                               return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
                        case ACT_DISP_GOOD:
                                return "Á±ÎÉÂ໶(x5) : 100+d100 ¥¿¡¼¥óËè";
                        case ACT_BO_MANA:
@@ -493,6 +519,8 @@ cptr item_activation(object_type *o_ptr)
                                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
                                        return "Î䵤¤Î¥Ö¥ì¥¹ (200) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 200 ¥¿¡¼¥óËè";
                                return "Î䵤¤Î¥Ö¥ì¥¹ (200) : 250 ¥¿¡¼¥óËè";
+                       case ACT_BR_DRAGON:
+                               return item_activation_dragon_breath(o_ptr);
 
                        case ACT_CONFUSE:
                                return "¥Ñ¥Ë¥Ã¥¯¡¦¥â¥ó¥¹¥¿¡¼ : 15 ¥¿¡¼¥óËè";
@@ -584,12 +612,20 @@ cptr item_activation(object_type *o_ptr)
                        case ACT_HELO_SPEED:
                                return "»Îµ¤¹âÍÈ, ¥¹¥Ô¡¼¥É(´ü´Ö 50+d50¥¿¡¼¥ó) : 100+d200 ¥¿¡¼¥óËè";
                        case ACT_RESIST_ACID:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
+                                       return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ­ : 40+d40 ¥¿¡¼¥óËè";
                                return "»À¤Ø¤ÎÂÑÀ­(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
                        case ACT_RESIST_FIRE:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
+                                       return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 40+d40 ¥¿¡¼¥óËè";
                                return "²Ð±ê¤Ø¤ÎÂÑÀ­(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
                        case ACT_RESIST_COLD:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
+                                       return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 40+d40 ¥¿¡¼¥óËè";
                                return "Î䵤¤Ø¤ÎÂÑÀ­(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
                        case ACT_RESIST_ELEC:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
+                                       return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ­ : 40+d40 ¥¿¡¼¥óËè";
                                return "ÅÅ·â¤Ø¤ÎÂÑÀ­(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
                        case ACT_RESIST_POIS:
                                return "ÆǤؤÎÂÑÀ­(´ü´Ö 20+d20) : 40+d40 ¥¿¡¼¥óËè";
@@ -715,7 +751,7 @@ cptr item_activation(object_type *o_ptr)
                        case ACT_DISP_EVIL:
                                return "dispel evil (x5) every 100+d100 turns";
                        case ACT_BA_MISS_3:
-                               return "elemental breath (300) every 500 turns";
+                               return "elemental breath (300) every 200+d200 turns";
                        case ACT_DISP_GOOD:
                                return "dispel good (x5) every 100+d100 turns";
                        case ACT_BO_MANA:
@@ -750,6 +786,8 @@ cptr item_activation(object_type *o_ptr)
                                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
                                        return "breath of cold (200) and resist cold every 200 turns";
                                return "cold breath (200) every 250 turns";
+                       case ACT_BR_DRAGON:
+                               return item_activation_dragon_breath(o_ptr);
 
                        case ACT_CONFUSE:
                                return "confuse monster every 15 turns";
@@ -842,12 +880,20 @@ cptr item_activation(object_type *o_ptr)
                        case ACT_HELO_SPEED:
                                return "hero and +10 to speed (50) every 100+200d turns";
                        case ACT_RESIST_ACID:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
+                                       return "ball of acid (100) and resist acid every 40+d40 turns";
                                return "resist acid (dur 20+d20) every 40+d40 turns";
                        case ACT_RESIST_FIRE:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
+                                       return "ball of fire (100) and resist fire every 40+d40 turns";
                                return "resist fire (dur 20+d20) every 40+d40 turns";
                        case ACT_RESIST_COLD:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
+                                       return "ball of cold (100) and resist cold every 40+d40 turns";
                                return "resist cold (dur 20+d20) every 40+d40 turns";
                        case ACT_RESIST_ELEC:
+                               if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
+                                       return "ball of elec (100) and resist elec every 40+d40 turns";
                                return "resist thunder (dur 20+d20) every 40+d40 turns";
                        case ACT_RESIST_POIS:
                                return "resist poison (dur 20+d20) every 40+d40 turns";
@@ -927,43 +973,7 @@ cptr item_activation(object_type *o_ptr)
                }
        }
 
-       if (o_ptr->tval == TV_RING)
-       {
-               switch (o_ptr->sval)
-               {
-                       case SV_RING_FLAMES:
-#ifdef JP
-return "¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë (100) ¤È²Ð¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
-#else
-                               return "ball of fire (100) and resist fire every 50+d50 turns";
-#endif
-
-                       case SV_RING_ICE:
-#ifdef JP
-return "¥¢¥¤¥¹¡¦¥Ü¡¼¥ë (100) ¤ÈÎ䵤¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
-#else
-                               return "ball of cold (100) and resist cold every 50+d50 turns";
-#endif
-
-                       case SV_RING_ACID:
-#ifdef JP
-return "¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë (100) ¤È»À¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
-#else
-                               return "ball of acid (100) and resist acid every 50+d50 turns";
-#endif
-
-                       case SV_RING_ELEC:
-#ifdef JP
-return "¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë (100) ¤ÈÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50 ¥¿¡¼¥óËè";
-#else
-                               return "ball of elec (100) and resist elec every 50+d50 turns";
-#endif
-
-                       default:
-                               return NULL;
-               }
-       }
-
+       /* Special items */
        if (o_ptr->tval == TV_WHISTLE)
        {
 #ifdef JP
@@ -982,143 +992,12 @@ return "
 #endif
        }
 
-       /* Require dragon scale mail */
-#ifdef JP
-if (o_ptr->tval != TV_DRAG_ARMOR) return ("´ñ̯¤Ê¸÷");
-#else
-       if (o_ptr->tval != TV_DRAG_ARMOR) return ("a strange glow");
-#endif
-
-
-       /* Branch on the sub-type */
-       switch (o_ptr->sval)
-       {
-               case SV_DRAGON_BLUE:
-               {
-#ifdef JP
-return "°ðºÊ¤Î¥Ö¥ì¥¹(100) : 150+d150 ¥¿¡¼¥óËè";
-#else
-                       return "breathe lightning (100) every 150+d150 turns";
-#endif
-
-               }
-               case SV_DRAGON_WHITE:
-               {
-#ifdef JP
-return "Î䵤¤Î¥Ö¥ì¥¹(110) : 150+d150 ¥¿¡¼¥óËè";
-#else
-                       return "breathe frost (110) every 150+d150 turns";
-#endif
-
-               }
-               case SV_DRAGON_BLACK:
-               {
-#ifdef JP
-return "»À¤Î¥Ö¥ì¥¹(130) : 150+d150 ¥¿¡¼¥óËè";
-#else
-                       return "breathe acid (130) every 150+d150 turns";
-#endif
-
-               }
-               case SV_DRAGON_GREEN:
-               {
-#ifdef JP
-return "ÆǤΥ¬¥¹¤Î¥Ö¥ì¥¹(150) : 180+d180 ¥¿¡¼¥óËè";
-#else
-                       return "breathe poison gas (150) every 180+d180 turns";
-#endif
-
-               }
-               case SV_DRAGON_RED:
-               {
-#ifdef JP
-return "²Ð±ê¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe fire (200) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_MULTIHUED:
-               {
-#ifdef JP
-return "Ëü¿§¤Î¥Ö¥ì¥¹(250) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe multi-hued (250) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_BRONZE:
-               {
-#ifdef JP
-return "º®Íð¤Î¥Ö¥ì¥¹(120) : 180+d180 ¥¿¡¼¥óËè";
-#else
-                       return "breathe confusion (120) every 180+d180 turns";
-#endif
-
-               }
-               case SV_DRAGON_GOLD:
-               {
-#ifdef JP
-return "¹ì²»¤Î¥Ö¥ì¥¹(130) : 180+d180 ¥¿¡¼¥óËè";
-#else
-                       return "breathe sound (130) every 180+d180 turns";
-#endif
-
-               }
-               case SV_DRAGON_CHAOS:
-               {
-#ifdef JP
-return "¥«¥ª¥¹/Îô²½¤Î¥Ö¥ì¥¹(220) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe chaos/disenchant (220) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_LAW:
-               {
-#ifdef JP
-return "¹ì²»/ÇËÊҤΥ֥쥹(230) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe sound/shards (230) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_BALANCE:
-               {
-#ifdef JP
-return "¥Ð¥é¥ó¥¹¤Î¥Ö¥ì¥¹ (250) 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe balance (250) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_SHINING:
-               {
-#ifdef JP
-return "Á®¸÷/°Å¹õ¤Î¥Ö¥ì¥¹(200) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe light/darkness (200) every 200+d200 turns";
-#endif
-
-               }
-               case SV_DRAGON_POWER:
-               {
-#ifdef JP
-return "¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹(300) : 200+d200 ¥¿¡¼¥óËè";
-#else
-                       return "breathe the elements (300) every 200+d200 turns";
-#endif
-
-               }
-       }
-
        /* Oops */
 #ifdef JP
-return "¶õµ¤¤Î©";
+       return "²¿¤âµ¯¤­¤Ê¤¤";
 #else
-       return "breathe air";
+       return "Nothing";
 #endif
-
 }
 
 
index 52f0bb9..424dd1a 100644 (file)
@@ -1873,6 +1873,9 @@ void object_prep(object_type *o_ptr, int k_idx)
        o_ptr->dd = k_ptr->dd;
        o_ptr->ds = k_ptr->ds;
 
+       /* Default activation */
+       if (k_ptr->act_idx > 0) o_ptr->xtra2 = k_ptr->act_idx;
+
        /* Hack -- worthless items are always "broken" */
        if (k_info[o_ptr->k_idx].cost <= 0) o_ptr->ident |= (IDENT_BROKEN);
 
index f1cfb55..7f710a1 100644 (file)
@@ -6658,6 +6658,27 @@ byte feature_action_flags[FF_FLAG_MAX] =
 
 
 /*
+ * Define flags, effect type, name for dragon breath activation
+ */
+dragonbreath_type dragonbreath_info[] = {
+       { TR_RES_ACID, GF_ACID, _("»À", "acid") },
+       { TR_RES_ELEC, GF_ELEC, _("ÅÅ·â", "lightning") },
+       { TR_RES_FIRE, GF_FIRE, _("²Ð±ê", "fire") },
+       { TR_RES_COLD, GF_COLD, _("Î䵤", "cold") },
+       { TR_RES_POIS, GF_POIS, _("ÆÇ", "poison") },
+       { TR_RES_LITE, GF_LITE, _("Á®¸÷", "light") },
+       { TR_RES_DARK, GF_DARK, _("°Å¹õ", "dark") },
+       { TR_RES_SHARDS, GF_SHARDS, _("ÇËÊÒ", "shard") },
+       { TR_RES_CONF, GF_CONFUSION, _("º®Íð", "confusion") },
+       { TR_RES_SOUND, GF_SOUND, _("¹ì²»", "sound") },
+       { TR_RES_NEXUS, GF_NEXUS, _("°ø²Ìº®Íð", "nexus") },
+       { TR_RES_NETHER, GF_NETHER, _("ÃϹö", "nether") },
+       { TR_RES_CHAOS, GF_CHAOS, _("¥«¥ª¥¹", "chaos") },
+       { TR_RES_DISEN, GF_DISENCHANT, _("Îô²½", "disenchant") },
+       { 0, 0, NULL }
+};
+
+/*
  * Define flags, levels, values of activations
  */
 activation_type activation_info[] =
@@ -6686,7 +6707,7 @@ activation_type activation_info[] =
        { "CALL_CHAOS", ACT_CALL_CHAOS, 70, 5000, {350, 0} },
        { "ROCKET", ACT_ROCKET, 70, 5000, {400, 0} },
        { "DISP_EVIL", ACT_DISP_EVIL, 50, 4000, {100, 100} },
-       { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {500, 0} },
+       { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {200, 200} },
        { "DISP_GOOD", ACT_DISP_GOOD, 50, 3500, {100, 100} },
        { "BO_MANA", ACT_BO_MANA, 40, 1500, {90, 90} },
        { "BA_WATER", ACT_BA_WATER, 50, 2000, {250, 0} },
@@ -6701,6 +6722,7 @@ activation_type activation_info[] =
        { "BA_ACID_1", ACT_BA_ACID_1, 30, 1000, {12, 12} },
        { "BR_FIRE", ACT_BR_FIRE, 50, 5000, {-1, 0} },
        { "BR_COLD", ACT_BR_COLD, 50, 5000, {-1, 0} },
+       { "BR_DRAGON", ACT_BR_DRAGON, 70, 10000, { 200, 200 } },
 
        { "CONFUSE", ACT_CONFUSE, 10, 500, {15, 0} },
        { "SLEEP", ACT_SLEEP, 10, 750, {55, 0} },
index 0213759..2fa51ae 100644 (file)
@@ -153,6 +153,8 @@ struct object_kind
        bool aware;                     /* The player is "aware" of the item's effects */
 
        bool tried;                     /* The player has "tried" one of the items */
+
+       byte act_idx;           /* Activative ability index */
 };
 
 
@@ -1720,3 +1722,9 @@ typedef struct {
                int dice;
        } timeout;
 } activation_type;
+
+typedef struct {
+       int flag;
+       int type;
+       cptr name;
+} dragonbreath_type;