OSDN Git Service

Integrate Weaponsmith objects' activation into general one
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 4 Feb 2013 10:21:03 +0000 (10:21 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 4 Feb 2013 10:21:03 +0000 (10:21 +0000)
src/artifact.c
src/cmd6.c
src/object1.c

index 1c1fd5a..d7e3fa9 100644 (file)
@@ -1980,6 +1980,19 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
 
 int activation_index(object_type *o_ptr)
 {
+       /* Give priority to weaponsmith's essential activations */
+       if (object_is_smith(o_ptr))
+       {
+               switch (o_ptr->xtra3-1)
+               {
+               case ESSENCE_TMP_RES_ACID: return ACT_RESIST_ACID;
+               case ESSENCE_TMP_RES_ELEC: return ACT_RESIST_ELEC;
+               case ESSENCE_TMP_RES_FIRE: return ACT_RESIST_FIRE;
+               case ESSENCE_TMP_RES_COLD: return ACT_RESIST_COLD;
+               case TR_IMPACT: return ACT_QUAKE;
+               }
+       }
+
        if (object_is_fixed_artifact(o_ptr))
        {
                return a_info[o_ptr->name1].act_idx;
index a06cd43..14adf22 100644 (file)
@@ -4102,43 +4102,6 @@ static void do_cmd_activate_aux(int item)
        /* Sound */
        sound(SOUND_ZAP);
 
-       /* Give priority to weaponsmith's essential activations */
-       if (object_is_smith(o_ptr))
-       {
-               switch (o_ptr->xtra3-1)
-               {
-               case ESSENCE_TMP_RES_ACID:
-                       (void)set_oppose_acid(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_ELEC:
-                       (void)set_oppose_elec(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_FIRE:
-                       (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_COLD:
-                       (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case TR_IMPACT:
-                       earthquake(py, px, 5);
-                       o_ptr->timeout = 100 + randint1(100);
-                       
-                       /* Window stuff */
-                       p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-                       /* Done */
-                       return;
-               }
-       }
-
        /* Activate object */
        if (activation_index(o_ptr))
        {
index 1964eba..246d499 100644 (file)
@@ -463,51 +463,6 @@ cptr item_activation(object_type *o_ptr)
        if (!(have_flag(flgs, TR_ACTIVATE))) return ("nothing");
 #endif
 
-       /*
-        * We need to deduce somehow that it is a random artifact -- one
-        * problem: It could be a random artifact which has NOT YET received
-        * a name. Thus we eliminate other possibilities instead of checking
-        * for art_name
-        */
-
-       /* Give priority to weaponsmith's essential activations */
-       if (object_is_smith(o_ptr))
-       {
-               switch (o_ptr->xtra3 - 1)
-               {
-               case ESSENCE_TMP_RES_ACID:
-#ifdef JP
-                       return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
-#else
-                       return "resist acid every 50+d50 turns";
-#endif
-               case ESSENCE_TMP_RES_ELEC:
-#ifdef JP
-                       return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
-#else
-                       return "resist elec every 50+d50 turns";
-#endif
-               case ESSENCE_TMP_RES_FIRE:
-#ifdef JP
-                       return "²Ð¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
-#else
-                       return "resist fire every 50+d50 turns";
-#endif
-               case ESSENCE_TMP_RES_COLD:
-#ifdef JP
-                       return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
-#else
-                       return "resist cold every 50+d50 turns";
-#endif
-               case TR_IMPACT:
-#ifdef JP
-                       return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
-#else
-                       return "earthquake every 100+d100 turns";
-#endif
-               }
-       }
-
        /* Get an explain of an activation */
        if (activation_index(o_ptr))
        {