added auraward, added event for unattach, added statebased check for protection from quality
auraward -> an exception for protection from quality used for aura, like flickering ward added event for unattach added state based check for protection from quality. 702.16c A permanent or player with protection can’t be enchanted by Auras that have the stated quality. Such Auras attached to the permanent or player with protection will be put into their owners’ graveyards as a state-based action. 702.16d A permanent with protection can’t be equipped by Equipment that have the stated quality or fortified by Fortifications that have the stated quality. Such Equipment or Fortifications become unattached from that permanent as a state-based action, but remain on the battlefield.
This commit is contained in:
@@ -9246,6 +9246,7 @@ type=Artifact
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Black Ward
|
name=Black Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=protection from black
|
auto=protection from black
|
||||||
text=Enchant creature -- Enchanted creature has protection from black. This effect doesn't remove Black Ward.
|
text=Enchant creature -- Enchanted creature has protection from black. This effect doesn't remove Black Ward.
|
||||||
@@ -10887,6 +10888,7 @@ type=Instant
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Blue Ward
|
name=Blue Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=protection from blue
|
auto=protection from blue
|
||||||
text=Enchant creature -- Enchanted creature has protection from blue. This effect doesn't remove Blue Ward.
|
text=Enchant creature -- Enchanted creature has protection from blue. This effect doesn't remove Blue Ward.
|
||||||
@@ -16532,6 +16534,7 @@ toughness=2
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Cho-Manno's Blessing
|
name=Cho-Manno's Blessing
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
abilities=flash
|
abilities=flash
|
||||||
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
||||||
@@ -35073,6 +35076,7 @@ toughness=2
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Flickering Ward
|
name=Flickering Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
||||||
auto={W}:moveTo(ownerhand)
|
auto={W}:moveTo(ownerhand)
|
||||||
@@ -35150,6 +35154,7 @@ toughness=2
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Floating Shield
|
name=Floating Shield
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
||||||
auto={S}:protection from white target(creature)
|
auto={S}:protection from white target(creature)
|
||||||
@@ -42027,6 +42032,7 @@ subtype=Aura
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Green Ward
|
name=Green Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=protection from green
|
auto=protection from green
|
||||||
text=Enchant creature -- Enchanted creature has protection from green. This effect doesn't remove Green Ward.
|
text=Enchant creature -- Enchanted creature has protection from green. This effect doesn't remove Green Ward.
|
||||||
@@ -71570,6 +71576,7 @@ toughness=3
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Pentarch Ward
|
name=Pentarch Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend
|
||||||
auto=draw:1
|
auto=draw:1
|
||||||
@@ -73677,6 +73684,7 @@ type=Sorcery
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Pledge of Loyalty
|
name=Pledge of Loyalty
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=aslongas(*[red]|mybattlefield) protection from red
|
auto=aslongas(*[red]|mybattlefield) protection from red
|
||||||
auto=aslongas(*[green]|mybattlefield) protection from green
|
auto=aslongas(*[green]|mybattlefield) protection from green
|
||||||
@@ -78553,6 +78561,7 @@ type=Sorcery
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Red Ward
|
name=Red Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=protection from red
|
auto=protection from red
|
||||||
text=Enchant creature -- Enchanted creature has protection from red. This effect doesn't remove Red Ward.
|
text=Enchant creature -- Enchanted creature has protection from red. This effect doesn't remove Red Ward.
|
||||||
@@ -99792,6 +99801,7 @@ toughness=1
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Tattoo Ward
|
name=Tattoo Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=1/1
|
auto=1/1
|
||||||
auto=protection from(enchantment)
|
auto=protection from(enchantment)
|
||||||
@@ -112787,6 +112797,7 @@ type=Instant
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=White Ward
|
name=White Ward
|
||||||
|
abilities=auraward
|
||||||
target=creature
|
target=creature
|
||||||
auto=protection from white
|
auto=protection from white
|
||||||
text=Enchant creature -- Enchanted creature has protection from white. This effect doesn't remove White Ward.
|
text=Enchant creature -- Enchanted creature has protection from white. This effect doesn't remove White Ward.
|
||||||
|
|||||||
@@ -229,7 +229,8 @@ class Constants
|
|||||||
SPELLMASTERY = 111,
|
SPELLMASTERY = 111,
|
||||||
NOLIFEGAIN = 112,
|
NOLIFEGAIN = 112,
|
||||||
NOLIFEGAINOPPONENT = 113,
|
NOLIFEGAINOPPONENT = 113,
|
||||||
NB_BASIC_ABILITIES = 114,
|
AURAWARD = 114,
|
||||||
|
NB_BASIC_ABILITIES = 115,
|
||||||
|
|
||||||
|
|
||||||
RARITY_S = 'S', //Special Rarity
|
RARITY_S = 'S', //Special Rarity
|
||||||
|
|||||||
@@ -273,6 +273,12 @@ struct WEventEmptyManaPool : public WEvent {
|
|||||||
WEventEmptyManaPool(ManaPool * source);
|
WEventEmptyManaPool(ManaPool * source);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//event when card-equipment unattached
|
||||||
|
struct WEventCardUnattached : public WEventCardUpdate {
|
||||||
|
WEventCardUnattached(MTGCardInstance * card);
|
||||||
|
virtual Targetable * getTarget(int target);
|
||||||
|
};
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream&, const WEvent&);
|
std::ostream& operator<<(std::ostream&, const WEvent&);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5428,6 +5428,8 @@ int AEquip::unequip()
|
|||||||
game->removeObserver(currentAbilities[i]);
|
game->removeObserver(currentAbilities[i]);
|
||||||
}
|
}
|
||||||
currentAbilities.clear();
|
currentAbilities.clear();
|
||||||
|
WEvent * e = NEW WEventCardUnattached(source);
|
||||||
|
game->receiveEvent(e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -617,6 +617,24 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
card->myPair->myPair = NULL;
|
card->myPair->myPair = NULL;
|
||||||
card->myPair = NULL;
|
card->myPair = NULL;
|
||||||
}
|
}
|
||||||
|
////////////////////////////////////////////////////
|
||||||
|
//Unattach Equipments that dont have valid targets//
|
||||||
|
////////////////////////////////////////////////////
|
||||||
|
if ((card->target) && card->hasType(Subtypes::TYPE_EQUIPMENT))
|
||||||
|
{
|
||||||
|
if(card->target && isInPlay(card->target) && (card->target)->protectedAgainst(card))//protection from quality
|
||||||
|
{
|
||||||
|
for (size_t i = 1; i < mLayers->actionLayer()->mObjects.size(); i++)
|
||||||
|
{
|
||||||
|
MTGAbility * a = ((MTGAbility *) mLayers->actionLayer()->mObjects[i]);
|
||||||
|
AEquip * eq = dynamic_cast<AEquip*> (a);
|
||||||
|
if (eq && eq->source == card)
|
||||||
|
{
|
||||||
|
((AEquip*)a)->unequip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
//Remove auras that don't have a valid target anymore//
|
//Remove auras that don't have a valid target anymore//
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
@@ -624,6 +642,8 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
{
|
{
|
||||||
if(card->target && !isInPlay(card->target))
|
if(card->target && !isInPlay(card->target))
|
||||||
players[i]->game->putInGraveyard(card);
|
players[i]->game->putInGraveyard(card);
|
||||||
|
if(card->target && isInPlay(card->target) && (card->target)->protectedAgainst(card) && !card->has(Constants::AURAWARD))//protection from quality except aura cards like flickering ward
|
||||||
|
players[i]->game->putInGraveyard(card);
|
||||||
}
|
}
|
||||||
card->enchanted = false;
|
card->enchanted = false;
|
||||||
if (card->target && isInPlay(card->target) && !card->hasType(Subtypes::TYPE_EQUIPMENT) && card->hasSubtype(Subtypes::TYPE_AURA))
|
if (card->target && isInPlay(card->target) && !card->hasType(Subtypes::TYPE_EQUIPMENT) && card->hasSubtype(Subtypes::TYPE_AURA))
|
||||||
|
|||||||
@@ -406,6 +406,8 @@ int GuiPlay::receiveEventPlus(WEvent * e)
|
|||||||
}
|
}
|
||||||
else if (dynamic_cast<WEventCardChangeType*> (e))
|
else if (dynamic_cast<WEventCardChangeType*> (e))
|
||||||
Replace();
|
Replace();
|
||||||
|
else if (dynamic_cast<WEventCardUnattached*> (e))
|
||||||
|
Replace();
|
||||||
Replace();
|
Replace();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
|||||||
"evadebigger",
|
"evadebigger",
|
||||||
"spellmastery",
|
"spellmastery",
|
||||||
"nolifegain",
|
"nolifegain",
|
||||||
"nolifegainopponent"
|
"nolifegainopponent",
|
||||||
|
"auraward"
|
||||||
};
|
};
|
||||||
|
|
||||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||||
|
|||||||
@@ -157,6 +157,11 @@ WEventEmptyManaPool::WEventEmptyManaPool(ManaPool * source) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WEventCardUnattached::WEventCardUnattached(MTGCardInstance * card) :
|
||||||
|
WEventCardUpdate(card)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
WEventCombatStepChange::WEventCombatStepChange(CombatStep step) :
|
WEventCombatStepChange::WEventCombatStepChange(CombatStep step) :
|
||||||
WEvent(), step(step)
|
WEvent(), step(step)
|
||||||
{
|
{
|
||||||
@@ -305,6 +310,12 @@ Targetable * WEventcardDraw::getTarget(Player * player)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Targetable * WEventCardUnattached::getTarget(int target)
|
||||||
|
{
|
||||||
|
if (target) return card;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
std::ostream& WEvent::toString(std::ostream& out) const
|
std::ostream& WEvent::toString(std::ostream& out) const
|
||||||
{
|
{
|
||||||
return out << "EVENT";
|
return out << "EVENT";
|
||||||
|
|||||||
Reference in New Issue
Block a user