test fix equipment

also added some primitive fixes, added macro for fabricate
This commit is contained in:
Anthony Calosa
2017-01-25 18:29:27 +08:00
parent 5c3a064746
commit 60f6c683a3
6 changed files with 34 additions and 20 deletions
+1 -1
View File
@@ -7795,7 +7795,7 @@ const string AEquip::getMenuText()
int AEquip::testDestroy()
{
if (source->target && !game->isInPlay(source->target))
unequip();
//unequip();//testfix for equipment when the card it equip moves to other battlefield
if (!game->connectRule)
{
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
+10 -3
View File
@@ -773,9 +773,9 @@ void GameObserver::gameStateBasedEffects()
////////////////////////////////////////////////////
//Unattach Equipments that dont have valid targets//
////////////////////////////////////////////////////
if ((card->target) && card->hasType(Subtypes::TYPE_EQUIPMENT))
if (!card->isCreature() && card->hasType(Subtypes::TYPE_EQUIPMENT))
{
if(card->target && isInPlay(card->target) && (card->target)->protectedAgainst(card))//protection from quality
if(isInPlay(card))
{
for (size_t i = 1; i < mLayers->actionLayer()->mObjects.size(); i++)
{
@@ -783,7 +783,14 @@ void GameObserver::gameStateBasedEffects()
AEquip * eq = dynamic_cast<AEquip*> (a);
if (eq && eq->source == card)
{
((AEquip*)a)->unequip();
if(card->target)//unattach equipments from cards that has protection from quality ex. protection from artifacts
{
if((card->target)->protectedAgainst(card))
((AEquip*)a)->unequip();
}
if(card->controller())
((AEquip*)a)->getActionTc()->Owner = card->controller();
//fix for equip ability when the equipment changed controller...
}
}
}