virtual bool trigger(TriggerEvent event, ServerPlayer *diaochan, QVariant &data) const{ Room *room = diaochan->getRoom(); if(event == PhaseChange && diaochan->getPhase() == Player::Discard){ ServerPlayer *target = room->getTag("LihunTarget").value<PlayerStar>(); if(!target || target->isDead()) return false; int hp = target->isAlive() ? target->getHp() : 0; if(diaochan->getCards("he").length() <= hp){ foreach(const Card *card, diaochan->getCards("he")){ room->moveCardTo(card, target, Player::Hand, room->getCardPlace(card->getEffectiveId()) == Player::Hand ? false : true); } }
bool viewFilter(const Card *to_select) const { Room *room = Sanguosha->currentRoom(); ServerPlayer *player = room->getCardOwner(to_select->getId()); return player != NULL && player->getHp() == 1 && to_select->isKindOf("Jink"); }