bool ViewAsSkill::isAvailable() const{ switch(ClientInstance->getStatus()){ case Client::Playing: return isEnabledAtPlay(); case Client::Responsing: return isEnabledAtResponse(); default: return false; } }
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; } }
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; } }