Ejemplo n.º 1
0
bool sword_disenchant(void)
{
    bool result = FALSE;
    int  r = _rank();
    int  i;

    for (i = 0; i < _MAX_ESSENCE; i++)
    {
        int n = _essences[i];
        
        if (!n) continue;
        if (i == TR_SPEED) continue;
        if (res_save(RES_DISEN, 70)) continue;
        
        _essences[i] -= MAX(1, _essences[i] * randint1(r) / 20);
        if (_essences[i] < n)
            result = TRUE;
    }
    if (result)
    {
        p_ptr->update |= PU_BONUS;
        msg_print("You feel power draining from your body!");
    }
    return result;
}
Ejemplo n.º 2
0
bool res_save_inventory(int which)
{
    int power = res_is_low(which) ? 66 : 41;

    /* Mercy for racial vulnerabilities:
        ResCt  Old% New%
        =====  ==== ====
          1    24.2 35.2
          2     1.5 16.7
          3     0.0  7.4
          4          3.7
          5          1.9
          6          0.0
    */
    if (prace_is_(RACE_ENT) && which == RES_FIRE)
        power = 54;
    if (prace_is_(RACE_ANDROID) && which == RES_ELEC)
        power = 54;

    return res_save(which, power);
}
Ejemplo n.º 3
0
bool res_save_default(int which)
{
    int power = res_is_low(which) ? 55 : 33;
    return res_save(which, power);
}