예제 #1
0
bool ViewAsSkill::isAvailable() const{
    switch(ClientInstance->getStatus()){
    case Client::Playing: return isEnabledAtPlay();
    case Client::Responsing: return isEnabledAtResponse();
    default:
        return false;
    }
}
예제 #2
0
bool ViewAsSkill::isAvailable(const Player* invoker,
                              CardUseStruct::CardUseReason reason, 
                              const QString &pattern) const{
    if (!invoker->hasSkill(objectName()))
        return false;
    switch (reason) {
    case CardUseStruct::CARD_USE_REASON_PLAY: return isEnabledAtPlay(invoker);
    case CardUseStruct::CARD_USE_REASON_RESPONSE: return isEnabledAtResponse(invoker, pattern);
    default:
        return false;
    }
}
예제 #3
0
bool ViewAsSkill::isAvailable(const Player *invoker, CardUseStruct::CardUseReason reason, const QString &pattern) const{
    if (!inherits("TransferSkill") && !invoker->hasSkill(objectName())
            && !invoker->hasFlag(objectName())) { // For Shuangxiong
        return false;
    }
    switch (reason) {
    case CardUseStruct::CARD_USE_REASON_PLAY: return isEnabledAtPlay(invoker);
    case CardUseStruct::CARD_USE_REASON_RESPONSE:
    case CardUseStruct::CARD_USE_REASON_RESPONSE_USE: return isEnabledAtResponse(invoker, pattern);
    default:
        return false;
    }
}