From 59e7ccb1f0d3741e946f42669aa676f85e07129d Mon Sep 17 00:00:00 2001 From: habu Date: Mon, 4 Feb 2013 10:21:03 +0000 Subject: [PATCH] Integrate Weaponsmith objects' activation into general one --- src/artifact.c | 13 +++++++++++++ src/cmd6.c | 37 ------------------------------------- src/object1.c | 45 --------------------------------------------- 3 files changed, 13 insertions(+), 82 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 1c1fd5a58..d7e3fa910 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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; diff --git a/src/cmd6.c b/src/cmd6.c index a06cd4352..14adf22fb 100644 --- a/src/cmd6.c +++ b/src/cmd6.c @@ -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)) { diff --git a/src/object1.c b/src/object1.c index 1964eba89..246d499a0 100644 --- a/src/object1.c +++ b/src/object1.c @@ -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)) { -- 2.11.0