m_ptr->fy = ny;
m_ptr->fx = nx;
+ /* Forget the counter target */
+ reset_target(m_ptr);
+
/* Update the monster (new location) */
update_mon(m_idx, TRUE);
i = inkey();
if (i == ESCAPE)
{
+ /* Free the "dun" array */
+ C_KILL(dun, max_d_idx, s16b);
+
screen_load();
return 0;
}
else bell();
}
screen_load();
+
+ /* Free the "dun" array */
+ C_KILL(dun, max_d_idx, s16b);
+
return select_dungeon;
}
/*
+ * Check if an object is nameless weapon or armour
+ */
+bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
+{
+ if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2 || o_ptr->xtra3)
+ return FALSE;
+
+ switch (o_ptr->tval)
+ {
+ case TV_SWORD:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_DIGGING:
+ case TV_BOW:
+ case TV_BOLT:
+ case TV_ARROW:
+ case TV_SHOT:
+ case TV_DRAG_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_SOFT_ARMOR:
+ case TV_SHIELD:
+ case TV_CLOAK:
+ case TV_CROWN:
+ case TV_HELM:
+ case TV_BOOTS:
+ case TV_GLOVES:
+ {
+ return (TRUE);
+ }
+ }
+
+ return (FALSE);
+}
+
+
+/*
* Break the curse of an item
*/
static void break_curse(object_type *o_ptr)
msg_print("The enchantment failed.");
#endif
- if (randint(3)==1) chg_virtue(V_ENCHANT, -1);
+ if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
}
else
chg_virtue(V_ENCHANT, 1);
item_tester_no_ryoute = TRUE;
/* Enchant weapon/armour */
- item_tester_hook = item_tester_hook_weapon_armour;
+ item_tester_hook = item_tester_hook_nameless_weapon_armour;
/* Get an item */
#ifdef JP
msg_print("The enchantment failed.");
#endif
- if (randint(3)==1) chg_virtue(V_ENCHANT, -1);
+ if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
}
else
chg_virtue(V_ENCHANT, 1);
/* Back-fire */
- if (rand_int(recharge_strength) == 0)
+ if (one_in_(recharge_strength))
{
/* Activate the failure code. */
fail = TRUE;
if (recharge_strength < 0) recharge_strength = 0;
/* Back-fire */
- if (rand_int(recharge_strength) == 0)
+ if (one_in_(recharge_strength))
{
/* Activate the failure code. */
fail = TRUE;
/* 10% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD)
{
- if (randint(10) == 1) fail_type = 2;
+ if (one_in_(10)) fail_type = 2;
else fail_type = 1;
}
/* 75% chance to blow up one wand, otherwise draining. */
else if (o_ptr->tval == TV_WAND)
{
- if (randint(3) != 1) fail_type = 2;
+ if (!one_in_(3)) fail_type = 2;
else fail_type = 1;
}
/* 50% chance to blow up one staff, otherwise no effect. */
else if (o_ptr->tval == TV_STAFF)
{
- if (randint(2) == 1) fail_type = 2;
+ if (one_in_(2)) fail_type = 2;
else fail_type = 0;
}
}
/* 33% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD)
{
- if (randint(3) == 1) fail_type = 2;
+ if (one_in_(3)) fail_type = 2;
else fail_type = 1;
}
/* 20% chance of the entire stack, else destroy one wand. */
else if (o_ptr->tval == TV_WAND)
{
- if (randint(5) == 1) fail_type = 3;
+ if (one_in_(5)) fail_type = 3;
else fail_type = 2;
}
/* Blow up one staff. */
if (o_ptr->tval == TV_ROD)
{
#ifdef JP
-msg_print("ËâÎϤ¬µÕÊ®¼Í¤·¤Æ¡¢¥í¥Ã¥É¤«¤é¤µ¤é¤ËËâÎϤòµÛ¤¤¼è¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
+msg_print("ËâÎϤòµÛ¤¤¼è¤ë¤Î¤Ë¼ºÇÔ¤·¤¿¡£¥í¥Ã¥É¤ÎËâÎϤÏÁ´¤Æȯ»¶¤·¤Æ¤·¤Þ¤Ã¤¿¡£");
#else
- msg_print("The recharge backfires, draining the rod further!");
+ msg_print("You failed to absorb magic power. All magic power of your rod had gone!");
#endif
if (o_ptr->timeout < 10000)
return TRUE;
}
- if (!(o_ptr->art_name || o_ptr->name1 || o_ptr->name2) || (randint(3) == 1))
+ if (!(o_ptr->art_name || o_ptr->name1 || o_ptr->name2) || one_in_(3))
{
/* Describe */
#ifdef JP
if (double_resist) dam = (dam + 2) / 3;
if ((!(double_resist || p_ptr->resist_acid)) &&
- randint(HURT_CHANCE) == 1)
+ one_in_(HURT_CHANCE))
(void)do_dec_stat(A_CHR);
/* If any armor gets hit, defend the player */
if (double_resist) dam = (dam + 2) / 3;
if ((!(double_resist || p_ptr->resist_elec)) &&
- randint(HURT_CHANCE) == 1)
+ one_in_(HURT_CHANCE))
(void)do_dec_stat(A_DEX);
/* Take damage */
if (double_resist) dam = (dam + 2) / 3;
if ((!(double_resist || p_ptr->resist_fire)) &&
- randint(HURT_CHANCE) == 1)
+ one_in_(HURT_CHANCE))
(void)do_dec_stat(A_STR);
/* Take damage */
if (double_resist) dam = (dam + 2) / 3;
if ((!(double_resist || p_ptr->resist_cold)) &&
- randint(HURT_CHANCE) == 1)
+ one_in_(HURT_CHANCE))
(void)do_dec_stat(A_STR);
/* Take damage */
recharge_strength = ((power > lev/2) ? (power - lev/2) : 0) / 5;
/* Back-fire */
- if (rand_int(recharge_strength) == 0)
+ if (one_in_(recharge_strength))
{
/* Activate the failure code. */
fail = TRUE;
if (recharge_strength < 0) recharge_strength = 0;
/* Back-fire */
- if (rand_int(recharge_strength) == 0)
+ if (one_in_(recharge_strength))
{
/* Activate the failure code. */
fail = TRUE;
/* 10% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD)
{
- if (randint(10) == 1) fail_type = 2;
+ if (one_in_(10)) fail_type = 2;
else fail_type = 1;
}
/* 75% chance to blow up one wand, otherwise draining. */
else if (o_ptr->tval == TV_WAND)
{
- if (randint(3) != 1) fail_type = 2;
+ if (!one_in_(3)) fail_type = 2;
else fail_type = 1;
}
/* 50% chance to blow up one staff, otherwise no effect. */
else if (o_ptr->tval == TV_STAFF)
{
- if (randint(2) == 1) fail_type = 2;
+ if (one_in_(2)) fail_type = 2;
else fail_type = 0;
}
}
/* 33% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD)
{
- if (randint(3) == 1) fail_type = 2;
+ if (one_in_(3)) fail_type = 2;
else fail_type = 1;
}
/* 20% chance of the entire stack, else destroy one wand. */
else if (o_ptr->tval == TV_WAND)
{
- if (randint(5) == 1) fail_type = 3;
+ if (one_in_(5)) fail_type = 3;
else fail_type = 2;
}
/* Blow up one staff. */