}
if (p_ptr->prace == RACE_BEASTMAN)
{
- if (randint(5) == 1) level_mutation = TRUE;
+ if (one_in_(5)) level_mutation = TRUE;
}
level_inc_stat = TRUE;
}
/* Drop a dead corpse? */
- if ((randint(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) == 1) &&
+ if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) &&
((r_ptr->flags9 & RF9_DROP_CORPSE) ||
(r_ptr->flags9 & RF9_DROP_SKELETON)) &&
!(p_ptr->inside_arena || p_ptr->inside_battle || (m_ptr->smart & SM_CLONED) || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
/* Lots of damage in one blow */
if ((0 - ((m_ptr->maxhp) / 4)) > m_ptr->hp)
{
- if (randint(5) == 1) corpse = TRUE;
+ if (one_in_(5)) corpse = TRUE;
}
else
{
- if (randint(5) != 1) corpse = TRUE;
+ if (!one_in_(5)) corpse = TRUE;
}
}
if (m_ptr->r_idx == MON_DAWN &&
!(p_ptr->inside_arena || p_ptr->inside_battle))
{
- if (randint(7) != 1)
+ if (!one_in_(7))
{
int wy = py, wx = px;
int attempts = 100;
if (m_ptr->r_idx == MON_OBERON)
{
- if (randint(3) == 1)
+ if (one_in_(3))
{
a_idx = ART_THRAIN;
chance = 33;
}
else if (m_ptr->r_idx == MON_SAURON)
{
- if (randint(10) == 1)
+ if (one_in_(10))
{
a_idx = ART_POWER;
chance = 100;
}
else if (m_ptr->r_idx == MON_BRAND)
{
- if (randint(3) != 1)
+ if (!one_in_(3))
{
a_idx = ART_BRAND;
chance = 25;
}
else if (m_ptr->r_idx == MON_CORWIN)
{
- if (randint(3) != 1)
+ if (!one_in_(3))
{
a_idx = ART_GRAYSWANDIR;
chance = 33;
if ((r_ptr->flags3 & RF3_RES_ALL) && dam > 0)
{
dam /= 100;
- if((dam == 0) && (randint(3) == 1)) dam = 1;
+ if((dam == 0) && one_in_(3)) dam = 1;
}
if (m_ptr->invulner)
#endif
}
}
- else if (!(randint(PENETRATE_INVULNERABILITY) == 1))
+ else if (!one_in_(PENETRATE_INVULNERABILITY))
{
return (0);
}
monster_desc(m_name, m_ptr, 0x100);
/* Don't kill Amberites */
- if ((r_ptr->flags3 & RF3_AMBERITE) && (randint(2) == 1))
+ if ((r_ptr->flags3 & RF3_AMBERITE) && one_in_(2))
{
int curses = 1 + randint(3);
bool stop_ty = FALSE;
chg_virtue(V_VITALITY, -2);
}
- if ((r_ptr->flags1 & RF1_UNIQUE) & (randint(3)==1))
+ if ((r_ptr->flags1 & RF1_UNIQUE) && one_in_(3))
chg_virtue(V_INDIVIDUALISM, -1);
if (m_ptr->r_idx == MON_BEGGAR || m_ptr->r_idx == MON_LEPER)
if ((r_ptr->flags3 & RF3_ANIMAL) && !(r_ptr->flags3 & RF3_EVIL) && !(r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) && !(r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) && !(r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
{
- if (randint(4)==1) chg_virtue(V_NATURE, -1);
+ if (one_in_(4)) chg_virtue(V_NATURE, -1);
}
if((r_ptr->flags1 & RF1_UNIQUE) && record_destroy_uniq)
else if (!(p_ptr->lev % 13)) nasty_chance = 3;
else if (!(p_ptr->lev % 14)) nasty_chance = 12;
- if (randint(nasty_chance) == 1)
+ if (one_in_(nasty_chance))
type = randint(20); /* Allow the 'nasty' effects */
else
type = randint(15) + 5; /* Or disallow them */
effect = chaos_rewards[p_ptr->chaos_patron][type];
- if ((randint(6) == 1) && !chosen_reward)
+ if (one_in_(6) && !chosen_reward)
{
#ifdef JP
msg_format("%^s¤ÏË«Èþ¤È¤·¤Æ¤¢¤Ê¤¿¤òÆÍÁ³ÊÑ°Û¤µ¤»¤¿¡£",
msg_print("'Stay, mortal, and let me mold thee.'");
#endif
- if ((randint(3) == 1) && !(chaos_stats[p_ptr->chaos_patron] < 0))
+ if (one_in_(3) && !(chaos_stats[p_ptr->chaos_patron] < 0))
do_inc_stat(chaos_stats[p_ptr->chaos_patron]);
else
do_inc_stat(rand_int(6));
msg_print("'I grow tired of thee, mortal.'");
#endif
- if ((randint(3) == 1) && !(chaos_stats[p_ptr->chaos_patron] < 0))
+ if (one_in_(3) && !(chaos_stats[p_ptr->chaos_patron] < 0))
do_dec_stat(chaos_stats[p_ptr->chaos_patron]);
else
(void)do_dec_stat(rand_int(6));
#endif
break;
case 3:
- if (randint(2) == 1)
+ if (one_in_(2))
{
if (!buki_motteruka(INVEN_RARM)) break;
object_desc(o_name, &inventory[INVEN_RARM], TRUE, 0);
}
activate_hi_summon(py, px, FALSE);
(void)activate_ty_curse(FALSE, &count);
- if (randint(2) == 1) (void)curse_weapon(FALSE, INVEN_RARM);
- if (randint(2) == 1) (void)curse_armor();
+ if (one_in_(2)) (void)curse_weapon(FALSE, INVEN_RARM);
+ if (one_in_(2)) (void)curse_armor();
break;
case REW_DESTRUCT:
#ifdef JP