예제 #1
0
/* Confirm 1 or 2 whip weapons for whip techniques. Fail if no whip
   is worn, or if a non-whip weapon is warn. Do not fail if shields
   or capture balls are equipped. Handle empty inventory slots. */
static bool _whip_check(void)
{
    bool result = FALSE;
    int i;

    for (i = 0; i < MAX_HANDS; i++)
    {
        object_type *o = NULL;
        if (p_ptr->weapon_info[i].wield_how != WIELD_NONE)
            o = equip_obj(p_ptr->weapon_info[i].slot);
        if (o)
        {
            if (object_is_(o, TV_HAFTED, SV_WHIP))
                result = TRUE; /* Found a whip weapon */
            else
                return FALSE; /* Found a non-whip weapon */
        }
    }
    return result;
}
예제 #2
0
static bool _create_ammo_p(object_type *o_ptr)
{
    if (o_ptr->tval == TV_JUNK || o_ptr->tval == TV_SKELETON) return TRUE;
    if (object_is_(o_ptr, TV_CORPSE, SV_SKELETON)) return TRUE;
    return FALSE;
}
예제 #3
0
/*
 * Refuel the players torch (from the pack or floor)
 */
static bool _is_torch(object_type *o_ptr) {
    return object_is_(o_ptr, TV_LITE, SV_LITE_TORCH);
}
예제 #4
0
static _blow_info_t _get_blow_info(int hand)
{
    _blow_info_t result = {0};
    int          arm = hand / 2;
    object_type *o_ptr = equip_obj(p_ptr->weapon_info[hand].slot);

    if (!o_ptr) return result;

    /* TODO: Use race_ptr and class_ptr instead of this giant switch ... */
    switch (p_ptr->pclass)
    {
    case CLASS_WARRIOR:
        result.num = 600; result.wgt = 70; result.mul = 50 + p_ptr->lev/2;
        break;

    case CLASS_MAULER:
        result.num = 175; result.wgt = 280; result.mul = 75; break;

    case CLASS_BERSERKER:
        result.num = 600; result.wgt = 70; result.mul = 75; break;

    case CLASS_RAGE_MAGE:
        result.num = 300; result.wgt = 70; result.mul = 30; break;
                    
    case CLASS_MAGE:
    case CLASS_NECROMANCER:
    case CLASS_BLOOD_MAGE:
    case CLASS_HIGH_MAGE:
    case CLASS_BLUE_MAGE:
        result.num = 400; result.wgt = 100; result.mul = 20; break;

    case CLASS_WARLOCK:
        result.num = 400; result.wgt = 100; result.mul = 35;
        switch (p_ptr->psubclass)
        {
        case WARLOCK_DRAGONS:
            if ( p_ptr->riding
              && (object_is_(o_ptr, TV_POLEARM, SV_LANCE) || object_is_(o_ptr, TV_POLEARM, SV_HEAVY_LANCE)) )
            {
                result.mul = 65;
            }
            break;
        case WARLOCK_ANGELS:
        case WARLOCK_DEMONS:
            result.num = 450;
            break;
        case WARLOCK_HOUNDS:
            result.num = 475;
            break;
        case WARLOCK_GIANTS:
            result.wgt = 200;
            result.mul = 50 + p_ptr->lev/5;
            result.num = 500;
            break;
        }
        break;

    case CLASS_PSION:
        result.num = 400; result.wgt = 100; result.mul = 30; break;

    case CLASS_PRIEST:
    case CLASS_MAGIC_EATER:
    case CLASS_MINDCRAFTER:
        result.num = 500; result.wgt = 100; result.mul = 35; break;

    case CLASS_DEVICEMASTER:
        result.num = 400; result.wgt = 100; result.mul = 35;
        if (p_ptr->psubclass == DEVICEMASTER_POTIONS || p_ptr->psubclass == DEVICEMASTER_SCROLLS)
            result.num = 500;
        break;

    case CLASS_ROGUE:
        result.num = 525; result.wgt = 40; result.mul = 30;
        if (o_ptr->weight < 50) result.num = 600;
        break;

    case CLASS_SCOUT:
        result.num = 400; result.wgt = 70; result.mul = 25; break;

    case CLASS_RANGER:
        result.num = 500; result.wgt = 70; result.mul = 40; break;

    case CLASS_PALADIN:
    case CLASS_SAMURAI:
        result.num = 550; result.wgt = 70; result.mul = 45; break;

    case CLASS_MYSTIC:
        result.num = 100; result.wgt = 100; result.mul = 10; break;

    case CLASS_WEAPONSMITH:
    case CLASS_RUNE_KNIGHT:
        result.num = 525; result.wgt = 150; result.mul = 55; break;

    case CLASS_WEAPONMASTER:
        result.num = weaponmaster_get_max_blows(o_ptr, hand); 
        result.wgt = 70; result.mul = 50; break;

    case CLASS_WARRIOR_MAGE:
    case CLASS_RED_MAGE:
        result.num = 525; result.wgt = 70; result.mul = 30; break;

    case CLASS_CHAOS_WARRIOR:
        result.num = 550; result.wgt = 70; result.mul = 45; break;

    case CLASS_MONK:
        result.num = 500; result.wgt = 60; result.mul = 30; break;

    case CLASS_TOURIST:
    case CLASS_TIME_LORD:
        result.num = 400; result.wgt = 100; result.mul = 30; break;

    case CLASS_ARCHAEOLOGIST:
        result.num = 400; result.wgt = 70; result.mul = 30;
        if (archaeologist_is_favored_weapon(o_ptr))
        {
            result.num = 500;
            result.mul = 40;
        }
        break;

    case CLASS_BLOOD_KNIGHT:
        result.num = 300; result.wgt = 150; result.mul = 30; break;

    case CLASS_DUELIST:
        result.num = 100; result.wgt = 70; result.mul = 40; break;
                    
    case CLASS_IMITATOR:
        result.num = 550; result.wgt = 70; result.mul = 40; break;

    case CLASS_WILD_TALENT:
        result.num = 450; result.wgt = 70; result.mul = 40; break;

    case CLASS_BEASTMASTER:
        result.num = 500; result.wgt = 70; result.mul = 35; break;

    case CLASS_CAVALRY:
    {
        u32b flgs[TR_FLAG_SIZE];
        object_flags(o_ptr, flgs);
        if (p_ptr->riding && have_flag(flgs, TR_RIDING)) {result.num = 550; result.wgt = 70; result.mul = 65;}
        else {result.num = 500; result.wgt = 100; result.mul = 35;}
        break;
    }
    case CLASS_SORCERER:
        result.num = 100; result.wgt = 1; result.mul = 10; break;

    case CLASS_ARCHER:
    case CLASS_BARD:
        result.num = 450; result.wgt = 70; result.mul = 20; break;

    case CLASS_FORCETRAINER:
        result.num = 400; result.wgt = 60; result.mul = 20; break;

    case CLASS_MIRROR_MASTER:
    case CLASS_SNIPER:
        result.num = 400; result.wgt = 100; result.mul = 30; break;

    case CLASS_NINJA:
        result.num = 425; result.wgt = 20; result.mul = 10; break;

    case CLASS_MONSTER:
        result.num = 500; result.wgt = 70; result.mul = 50;
        if (prace_is_(RACE_MON_LICH)) 
        {
            result.num = 400;
            result.mul = 30;
        }
        else if (prace_is_(RACE_MON_POSSESSOR))
        {
            result.num = 400;
        }
        else if (prace_is_(RACE_MON_MIMIC)) 
        {
            result.num = 400;
        }
        else if (prace_is_(RACE_MON_TROLL))
        {
            result.num = 550;
        }
        else if (prace_is_(RACE_MON_GIANT))
        {
            result.num = 550;
            result.mul = 50 + p_ptr->lev/5;
            result.wgt = 200;
            if (giant_is_(GIANT_HRU) && p_ptr->lev >= 40)
                result.mul = 80;
        }
        else if ( prace_is_(RACE_MON_JELLY)
               || demon_is_(DEMON_KHORNE) )  
        {
            result.num = 600;
            result.mul = 50 + p_ptr->lev/5;
        }
        else if (prace_is_(RACE_MON_LEPRECHAUN)) 
        {
            result.num = 300;
            result.mul = 20;
        }
        else if (prace_is_(RACE_MON_SWORD))
        {
            result.num = 525;
            if (p_ptr->lev >= 45) /* Death Scythes retaliate! */
                result.num = 300;
        }
        else if (prace_is_(RACE_MON_GOLEM))
        {
            result.num = 100;
        }
        break;
    }

    if (hex_spelling(HEX_XTRA_MIGHT) || hex_spelling(HEX_BUILDING) || p_ptr->tim_building_up)
    {
        result.wgt /= 2;
        result.mul += 20;
    }

    /* Xorns and Mariliths have multiple sets of arms */
    if (arm > 0)
        result.num -= 100;
    if (result.num < 100)
        result.num = 100;

    if (o_ptr->tval == TV_SWORD && o_ptr->sval == SV_POISON_NEEDLE) 
        result.num = 100;

    return result;
}