This commit is contained in:
Skagra42 2026-09-20 15:39:03 -07:00 committed by GitHub
commit 3ccfc1f4ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 124 additions and 3 deletions

View file

@ -1085,6 +1085,11 @@ Server_AbstractPlayer::cmdCreateToken(const Command_CreateToken &cmd, ResponseCo
ges.enqueueGameEvent(event, playerId);
}
if (card->getDoesntUntapOnce() != targetCard->getDoesntUntapOnce()) {
card->setAttribute(AttrDoesntUntapOnce, QVariant(targetCard->getDoesntUntapOnce()).toString(), &event);
ges.enqueueGameEvent(event, playerId);
}
// Copy counters
QMapIterator<int, int> i(targetCard->getCounters());
while (i.hasNext()) {
@ -1442,6 +1447,7 @@ Server_AbstractPlayer::cmdDumpZone(const Command_DumpZone &cmd, ResponseContaine
cardInfo->set_annotation(card->getAnnotation().toStdString());
cardInfo->set_destroy_on_zone_change(card->getDestroyOnZoneChange());
cardInfo->set_doesnt_untap(card->getDoesntUntap());
cardInfo->set_doesnt_untap_once(card->getDoesntUntapOnce());
QMapIterator<int, int> cardCounterIterator(card->getCounters());
while (cardCounterIterator.hasNext()) {
@ -1554,6 +1560,7 @@ Server_AbstractPlayer::cmdRevealCards(const Command_RevealCards &cmd, ResponseCo
cardInfo->set_annotation(card->getAnnotation().toStdString());
cardInfo->set_destroy_on_zone_change(card->getDestroyOnZoneChange());
cardInfo->set_doesnt_untap(card->getDoesntUntap());
cardInfo->set_doesnt_untap_once(card->getDoesntUntapOnce());
QMapIterator<int, int> cardCounterIterator(card->getCounters());
while (cardCounterIterator.hasNext()) {

View file

@ -32,7 +32,8 @@
Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false),
facedown(false), destroyOnZoneChange(false), doesntUntap(false), parentCard(0), stashedCard(nullptr)
facedown(false), destroyOnZoneChange(false), doesntUntap(false), doesntUntapOnce(false), parentCard(0),
stashedCard(nullptr)
{
}
@ -63,10 +64,16 @@ void Server_Card::resetState(bool keepAnnotations)
setAnnotation(QString());
}
setDoesntUntap(false);
setDoesntUntapOnce(false);
}
QString Server_Card::setAttribute(CardAttribute attribute, const QString &avalue, bool allCards)
{
if (attribute == AttrTapped && avalue != "1" && allCards && doesntUntapOnce) {
setDoesntUntapOnce(false);
return QVariant(tapped).toString();
}
if (attribute == AttrTapped && avalue != "1" && allCards && doesntUntap) {
return QVariant(tapped).toString();
}
@ -106,6 +113,9 @@ QString Server_Card::setAttribute(CardAttribute attribute, const QString &avalue
case AttrDoesntUntap:
setDoesntUntap(avalue == "1");
break;
case AttrDoesntUntapOnce:
setDoesntUntapOnce(avalue == "1");
break;
}
if (event) {
event->set_attr_value(avalue.toStdString());
@ -203,6 +213,9 @@ void Server_Card::getInfo(ServerInfo_Card *info)
if (doesntUntap) {
info->set_doesnt_untap(true);
}
if (doesntUntapOnce) {
info->set_doesnt_untap_once(true);
}
QMapIterator<int, int> cardCounterIterator(counters);
while (cardCounterIterator.hasNext()) {

View file

@ -49,6 +49,7 @@ private:
QString annotation;
bool destroyOnZoneChange;
bool doesntUntap;
bool doesntUntapOnce;
Server_Card *parentCard;
QList<Server_Card *> attachedCards;
@ -127,6 +128,10 @@ public:
{
return doesntUntap;
}
bool getDoesntUntapOnce() const
{
return doesntUntapOnce;
}
bool getDestroyOnZoneChange() const
{
return destroyOnZoneChange;
@ -203,6 +208,10 @@ public:
{
doesntUntap = _doesntUntap;
}
void setDoesntUntapOnce(bool _doesntUntapOnce)
{
doesntUntapOnce = _doesntUntapOnce;
}
void setParentCard(Server_Card *_parentCard);
void addAttachedCard(Server_Card *card)
{