Added / fixed some primitives, updated missing cards by set list, added new "reconfigure" ability based on "equip" one.
This commit is contained in:
@@ -9650,6 +9650,7 @@ AEquip::AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaC
|
||||
{
|
||||
aType = MTGAbility::STANDARD_EQUIP;
|
||||
isAttach = restrictions != ActivatedAbility::AS_SORCERY;
|
||||
isReconfiguration = false;
|
||||
}
|
||||
|
||||
int AEquip::unequip()
|
||||
@@ -9678,6 +9679,8 @@ int AEquip::unequip()
|
||||
}
|
||||
game->removeObserver(currentAbilities[i]);
|
||||
}
|
||||
if(isReconfiguration && !source->hasType(Subtypes::TYPE_CREATURE))
|
||||
source->addType(Subtypes::TYPE_CREATURE);
|
||||
currentAbilities.clear();
|
||||
WEvent * e = NEW WEventCardUnattached(source);
|
||||
game->receiveEvent(e);
|
||||
@@ -9686,6 +9689,8 @@ int AEquip::unequip()
|
||||
|
||||
int AEquip::equip(MTGCardInstance * equipped)
|
||||
{
|
||||
if(isReconfiguration && source->hasType(Subtypes::TYPE_CREATURE))
|
||||
source->removeType(Subtypes::TYPE_CREATURE);
|
||||
source->target = equipped;
|
||||
source->target->equipment += 1;
|
||||
source->parentCards.push_back(equipped);
|
||||
@@ -9768,6 +9773,8 @@ const string AEquip::getMenuText()
|
||||
{
|
||||
if (isAttach)
|
||||
return "Attach";
|
||||
else if (isReconfiguration)
|
||||
return "Reconfigure Attach";
|
||||
else
|
||||
return "Equip";
|
||||
}
|
||||
|
||||
@@ -3644,7 +3644,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
if ((s.find("equipment") == string::npos) && (s.find("equipped") == string::npos)) // Fix a bug on parser when reading the substring "equip" with a different meaning.
|
||||
return NEW AEquip(observer, id, card);
|
||||
}
|
||||
|
||||
|
||||
//Reconfiguration
|
||||
found = s.find("reconfigure");
|
||||
if (found != string::npos)
|
||||
{
|
||||
AEquip* a = NEW AEquip(observer, id, card);
|
||||
a->isReconfiguration = true;
|
||||
return a;
|
||||
}
|
||||
|
||||
// TODO: deprecate this ability in favor of retarget
|
||||
//Equipment (attach)
|
||||
found = s.find("attach");
|
||||
|
||||
Reference in New Issue
Block a user