mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 01:55:10 -07:00
Merge fdd7d4eac0 into 12299abcc8
This commit is contained in:
commit
3ccfc1f4ea
18 changed files with 124 additions and 3 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue