Fixed several bugs, fixed several primitives, improved affnity for other types of cards, improved flip ability for token, added some new primitives from MAT set.

This commit is contained in:
Vittorio Alfieri
2023-05-23 20:29:43 +02:00
parent 1488bbc0f6
commit 675705a6e5
11 changed files with 616 additions and 334 deletions

View File

@@ -739,15 +739,15 @@ void GameObserver::gameStateBasedEffects()
if(card->hasType(Subtypes::TYPE_PLANESWALKER) && (!card->counters||!card->counters->hasCounter("loyalty",0,0)))
players[i]->game->putInGraveyard(card);
if(card->hasType(Subtypes::TYPE_BATTLE) && (!card->counters||!card->counters->hasCounter("defense",0,0))){
if(!card->isDefeated){
card->isDefeated = true;
WEvent * e = NEW WEventCardDefeated(card);
receiveEvent(e);
if(!card->isDefeated){
card->isDefeated = true;
WEvent * e = NEW WEventCardDefeated(card);
receiveEvent(e);
}
}
if(!card->isCreature() && card->hasType(Subtypes::TYPE_PLANESWALKER) && card->counters->hasCounter("loyalty", 0, 0))
if(!card->isCreature() && card->hasType(Subtypes::TYPE_PLANESWALKER) && card->counters->hasCounter("loyalty", 0, 0))
card->life = card->counters->hasCounter("loyalty", 0, 0)->nb;
if(!card->isCreature() && card->hasType(Subtypes::TYPE_BATTLE) && card->counters->hasCounter("defense", 0, 0))
if(!card->isCreature() && card->hasType(Subtypes::TYPE_BATTLE) && card->counters->hasCounter("defense", 0, 0))
card->life = card->counters->hasCounter("defense", 0, 0)->nb;
if(card->myPair && !isInPlay(card->myPair))
{
@@ -1285,6 +1285,7 @@ void GameObserver::Affinity()
bool DoReduceIncrease = false;
if (
(card->has(Constants::AFFINITYARTIFACTS) ||
card->has(Constants::AFFINITYENCHANTMENTS) ||
card->has(Constants::AFFINITYFOREST) ||
card->has(Constants::AFFINITYGREENCREATURES) ||
card->has(Constants::AFFINITYISLAND) ||
@@ -1292,6 +1293,16 @@ void GameObserver::Affinity()
card->has(Constants::AFFINITYPLAINS) ||
card->has(Constants::AFFINITYSWAMP) ||
card->has(Constants::CONDUITED) ||
card->has(Constants::AFFINITYALLCREATURES) ||
card->has(Constants::AFFINITYCONTROLLERCREATURES) ||
card->has(Constants::AFFINITYOPPONENTCREATURES) ||
card->has(Constants::AFFINITYALLDEADCREATURES) ||
card->has(Constants::AFFINITYPARTY) ||
card->has(Constants::AFFINITYBASICLANDTYPES) ||
card->has(Constants::AFFINITYTWOBASICLANDTYPES) ||
card->has(Constants::AFFINITYGRAVECREATURES) ||
card->has(Constants::AFFINITYATTACKINGCREATURES) ||
card->has(Constants::AFFINITYGRAVEINSTSORC) ||
card->getIncreasedManaCost()->getConvertedCost() ||
card->getReducedManaCost()->getConvertedCost() ||
NewAffinityFound || checkAuraP)