diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index af1f5be8e..9d8364692 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -3076,8 +3076,9 @@ toughness=6 [/card] [card] name=Angel of Jubilation -abilities=flying,cantpaylifeorsaccreatures +abilities=flying,cantpaylife auto=lord(other creature[-black]|mybattlefield) 1/1 +auto=lord(creature) cantbesacrified text=Flying -- Other nonblack creatures you control get +1/+1. -- Players can't pay life or sacrifice creatures to cast spells or activate abilities. mana={1}{W}{W}{W} type=Creature diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index d11f06148..ef9547b56 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -244,8 +244,9 @@ class Constants DEVOID = 123, CANTCHANGELIFE = 124, COMBATTOUGHNESS = 125, - CANTPAYLIFEORSACCREATURES = 126, - NB_BASIC_ABILITIES = 127, + CANTPAYLIFE = 126, + CANTBESACRIFIED = 127, + NB_BASIC_ABILITIES = 128, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index 31c772b84..e6940f0d7 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -246,8 +246,8 @@ int LifeCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if (_target->controller()->life <= 0 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) || - _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) || + _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return 0; } @@ -286,8 +286,8 @@ int SpecificLifeCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && - !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) && - !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && + !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return 1; } @@ -336,15 +336,15 @@ int LifeorManaCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if ( _target->controller()->life <= 1 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) || - _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) || + _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return _target->controller()->getManaPool()->canAfford(getManaCost()); } else if((_target->controller()->life > 1 || _target->controller()->getManaPool()->canAfford(getManaCost())) && (!_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && - !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) && - !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))) + !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && + !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE))) { return 1; } @@ -936,11 +936,8 @@ ExtraCost("Select creature to offer", _tc) int Offering::canPay() { - if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) - { + if (target && target->has(Constants::CANTBESACRIFIED)) return 0; - } if (target && (!source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost())))) { @@ -1001,13 +998,8 @@ SacrificeCost::SacrificeCost(TargetChooser *_tc) int SacrificeCost::canPay() { - if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) - { - if (target && target->isCreature()) - return 0; - } - + if (target && target->has(Constants::CANTBESACRIFIED)) + return 0; return 1; } diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 8199569b6..543493675 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -156,7 +156,8 @@ const char* Constants::MTGBasicAbilities[] = { "devoid", "cantchangelife", "combattoughness", - "cantpaylifeorsaccreatures" + "cantpaylife", + "cantbesacrified" }; map Constants::MTGBasicAbilitiesMap;