Ejemplo n.º 1
0
bool Analeptic::IsAvailable(const Player *player, const Card *analeptic){
    Analeptic *newanal = new Analeptic(Card::NoSuit, 0);
    newanal->deleteLater();
    if (player->isCardLimited(analeptic == NULL ? newanal : analeptic, Card::MethodUse)
        || player->isProhibited(player, analeptic == NULL ? newanal : analeptic))
            return false;

    return player->usedTimes("Analeptic") <= Sanguosha->correctCardTarget(TargetModSkill::Residue, player, analeptic == NULL ? newanal : analeptic);
}
bool Analeptic::IsAvailable(const Player *player, const Card *analeptic) {
    Analeptic *newanaleptic = new Analeptic(Card::NoSuit, 0);
    newanaleptic->deleteLater();
#define THIS_ANALEPTIC (analeptic == NULL ? newanaleptic : analeptic)
    if (player->isCardLimited(THIS_ANALEPTIC, Card::MethodUse) || player->isProhibited(player, THIS_ANALEPTIC))
        return false;

    return player->usedTimes("Analeptic") <= Sanguosha->correctCardTarget(TargetModSkill::Residue, player, THIS_ANALEPTIC);
#undef THIS_ANALEPTIC
}