void Analeptic::onEffect(const CardEffectStruct &effect) const{ Room *room = effect.to->getRoom(); room->setEmotion(effect.to, "analeptic"); if (effect.to->hasFlag("Global_Dying") && Sanguosha->getCurrentCardUseReason() != CardUseStruct::CARD_USE_REASON_PLAY) room->recover(effect.to, RecoverStruct(effect.from, this)); else room->addPlayerMark(effect.to, "drank"); }
void onDamaged(ServerPlayer *target, const DamageStruct &damage) const { Room *room = target->getRoom(); for (int i = 1; i <= damage.damage; i++) { ServerPlayer *current = room->getCurrent(); if (!current || current->isDead() || current->getPhase() == Player::NotActive) break; if (room->askForSkillInvoke(target, objectName(), QVariant::fromValue(current))) { room->broadcastSkillInvoke(objectName()); room->addPlayerMark(current, "@hengjiang"); } } }
void Analeptic::onEffect(const CardEffectStruct &effect) const{ Room *room = effect.to->getRoom(); room->setEmotion(effect.to, "analeptic"); if (effect.to->hasFlag("Global_Dying")) { // recover hp RecoverStruct recover; recover.card = this; recover.who = effect.from; room->recover(effect.to, recover); } else { room->addPlayerMark(effect.to, "drank"); } }