bool Player::hasSkill(const QString &skill_name, bool include_lose) const{ if (!include_lose) { if (!hasEquipSkill(skill_name)) { const Skill *skill = Sanguosha->getSkill(skill_name); if (phase == Player::NotActive) { const Player *current = NULL; foreach (const Player *p, getAliveSiblings()) { if (p->getPhase() != Player::NotActive) { current = p; break; } } if (current && current->hasSkill("huoshui") && hp >= (max_hp + 1) / 2 && (!skill || !skill->isAttachedLordSkill())) return false; if (current && current->hasSkill("neo2013huoshui") && current->getEquips().length() >= getEquips().length() && (!skill || !skill->isAttachedLordSkill())) return false; } if (getMark("Qingcheng" + skill_name) > 0) return false; if (skill_name != "chanyuan" && hasSkill("chanyuan") && hp == 1 && (!skill || !skill->isAttachedLordSkill())) return false; } } return head_skills.value(skill_name, false) || deputy_skills.value(skill_name, false) || acquired_skills.contains(skill_name); }
bool Player::hasSkill(const QString &skill_name, bool include_lose) const{ if (!include_lose) { if (!hasEquipSkill(skill_name) && ((hasFlag("huoshui") && getHp() >= (getMaxHp() + 1) / 2) || getMark("Qingcheng" + skill_name) > 0)) return false; } return skills.contains(skill_name) || acquired_skills.contains(skill_name); }
bool Player::hasSkill(const QString &skill_name, bool include_lose) const{ if (!include_lose) { if (!hasEquipSkill(skill_name)) { const Skill *skill = Sanguosha->getSkill(skill_name); if (skill && !Sanguosha->correctSkillValidity(this, skill)) return false; } } return skills.contains(skill_name) || acquired_skills.contains(skill_name); }