Merge pull request #923 from kevlahnota/master

Revert Functionality
This commit is contained in:
Anthony Calosa
2017-02-03 21:46:21 +08:00
committed by GitHub
6 changed files with 65 additions and 43 deletions
+18 -24
View File
@@ -29396,7 +29396,7 @@ type=Instant
[/card]
[card]
name=Dismiss into Dream
auto=lord(creature|opponentbattlefield) transforms((Illusion,newability[while(restriction{cardistargeted}) sacrifice]))
auto=lord(creature|opponentbattlefield) transforms((Illusion,newability[@targeted(this):sacrifice]))
text=Enchantment. -- Each creature your opponents control is an Illusion in addition to its other types and has "When this creature becomes the target of a spell or ability, sacrifice it."
mana={6}{U}
type=Enchantment
@@ -36811,8 +36811,7 @@ subtype=Aura
[/card]
[card]
name=Evil Twin
auto=may copy NotATarget(creature)
auto=while(restriction{copiedacard}) transforms((,newability[{U}{B}{T}:destroy target(creature[share!name!])])) forever
auto=may copy NotATarget(creature) and!( transforms((,newability[{U}{B}{T}:destroy target(creature[share!name!])])) forever )!
text=You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature."
mana={2}{U}{B}
type=Creature
@@ -42891,7 +42890,7 @@ toughness=2
[/card]
[card]
name=Frost Walker
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=When Frost Walker becomes the target of a spell or ability, sacrifice it.
mana={1}{U}
type=Creature
@@ -45593,8 +45592,7 @@ toughness=1
[/card]
[card]
name=Gigantoplasm
auto=may copy NotATarget(creature)
auto=while(restriction{copiedacard}) {X}:name(Base X) transforms((,setpower=X,settoughness=X)) ueot
auto=may copy NotATarget(creature) and!( {X}:name(Base X) transforms((,setpower=X,settoughness=X)) ueot )!
text=You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X."
mana={3}{U}
type=Creature
@@ -48238,7 +48236,7 @@ toughness=2
[card]
name=Gossamer Phantasm
abilities=flying
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Flying -- When Gossamer Phantasm becomes the target of a spell or ability, sacrifice it.
mana={1}{U}
type=Creature
@@ -56001,7 +55999,7 @@ toughness=4
[card]
name=Illusionary Servant
abilities=flying
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Flying -- When Illusionary Servant becomes the target of a spell or ability, sacrifice it.
mana={1}{U}{U}
type=Creature
@@ -71355,8 +71353,7 @@ toughness=2
[/card]
[card]
name=Mercurial Pretender
auto=may copy NotATarget(creature)
auto=while(restriction{copiedacard}) transforms((,newability[{2}{U}{U}:moveto(ownerhand)])) forever
auto=may copy NotATarget(creature) and!( transforms((,newability[{2}{U}{U}:moveto(ownerhand)])) forever )!
text=You may have Mercurial Pretender enter the battlefield as a copy of any creature you control except it gains "{2}{U}{U}: Return this creature to its owner's hand."
mana={4}{U}
type=Creature
@@ -83979,7 +83976,7 @@ toughness=1
[card]
name=Phantasmal Abomination
abilities=defender
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Defender -- When Phantasmal Abomination becomes the target of a spell or ability, sacrifice it.
mana={1}{U}{U}
type=Creature
@@ -83989,7 +83986,7 @@ toughness=5
[/card]
[card]
name=Phantasmal Bear
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=When Phantasmal Bear becomes the target of a spell or ability, sacrifice it.
mana={U}
type=Creature
@@ -84000,7 +83997,7 @@ toughness=2
[card]
name=Phantasmal Dragon
abilities=flying
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Flying -- When Phantasmal Dragon becomes the target of a spell or ability, sacrifice it.
mana={2}{U}{U}
type=Creature
@@ -84032,8 +84029,7 @@ toughness=1
[/card]
[card]
name=Phantasmal Image
auto=may copy NotATarget(creature)
auto=while(restriction{copiedacard}) transforms((Illusion,newability[while(restriction{cardistargeted}) sacrifice])) forever
auto=may copy NotATarget(creature) and!( transforms((Illusion,newability[@targeted(this):sacrifice])) forever )!
text=You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it."
mana={1}{U}
type=Creature
@@ -84104,7 +84100,7 @@ toughness=2
[/card]
[card]
name=Phantom Beast
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=When Phantom Beast becomes the target of a spell or ability, sacrifice it.
mana={3}{U}
type=Creature
@@ -87302,8 +87298,7 @@ type=Sorcery
[/card]
[card]
name=Progenitor Mimic
auto=may copy NotATarget(creature)
auto=while(restriction{copiedacard}) transforms((,newability[@each my upkeep:all(this) ifnot cantargetcard(*[token]) then clone])) forever
auto=may copy NotATarget(creature) and!( transforms((,newability[@each my upkeep:all(this) ifnot cantargetcard(*[token]) then clone])) forever )!
text=You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield except it gains "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature."
mana={4}{G}{U}
type=Creature
@@ -104645,7 +104640,7 @@ type=Instant
[/card]
[card]
name=Skulking Fugitive
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=When Skulking Fugitive becomes the target of a spell or ability, sacrifice it.
mana={2}{B}
type=Creature
@@ -104656,7 +104651,7 @@ toughness=4
[card]
name=Skulking Ghost
abilities=flying
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Flying -- When Skulking Ghost becomes the target of a spell or ability, sacrifice it.
mana={1}{B}
type=Creature
@@ -104667,7 +104662,7 @@ toughness=1
[card]
name=Skulking Knight
abilities=flanking
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=Flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.) -- When Skulking Knight becomes the target of a spell or ability, sacrifice it.
mana={2}{B}
type=Creature
@@ -115539,7 +115534,7 @@ type=Artifact
[/card]
[card]
name=Tar Pit Warrior
auto=while(restriction{cardistargeted}) sacrifice
auto=@targeted(this):sacrifice
text=When Tar Pit Warrior becomes the target of a spell or ability, sacrifice it.
mana={2}{B}
type=Creature
@@ -125811,8 +125806,7 @@ toughness=4
[/card]
[card]
name=Vesuva
auto=may copy notatarget(land)
auto=while(restriction{copiedacard}) tap(noevent)
auto=may copy notatarget(land) and!( tap(noevent) )!
text=You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield.
type=Land
[/card]
+1
View File
@@ -3848,6 +3848,7 @@ public:
spell->source->isToken = 1;
spell->source->fresh = 1;
spell->source->entersBattlefield = 1;
spell->source->tokCard = spell->source->clone();
if(spell->source->getMTGId() == 0)
{//fix missing art: if token creator is put inside ability$!!$ who, then try to get the stored source card
if(((MTGCardInstance*)source)->storedSourceCard)
+2 -1
View File
@@ -48,7 +48,7 @@ public:
vector<MTGCardInstance*>parentCards;
vector<MTGCardInstance*>childrenCards;
vector<MTGAbility *>cardsAbilities;
vector<MTGAbility *>cardsAbilitiesFilter;
//vector<MTGAbility *>cardsAbilitiesFilter;
int setAttacker(int value);
int setDefenser(MTGCardInstance * c);
@@ -121,6 +121,7 @@ public:
Player * previousController;
MTGGameZone * getCurrentZone();
MTGGameZone * previousZone;
MTGCardInstance * tokCard;
MTGCardInstance * previous;
MTGCardInstance * next;
MTGAbility * TokenAndAbility;
+28 -13
View File
@@ -1550,10 +1550,13 @@ int AACopier::resolve()
bool tokencopied = false;
if(_target->isToken || (_target->isACopier && _target->hasCopiedToken))
tokencopied = true;
if(tokencopied && !_target->isACopier)
/*this solves one thing.. if you copy a nontoken card with dragon breath attached that gives haste*/
source->hasCopiedToken = tokencopied;
/*since we look for the real card it will not copy granted haste ability however for token we copy all*/
/*but how to do backup for token so we just copy the backup???*/
if(tokencopied && !_target->isACopier && !_target->getMTGId())
{
source->copy(_target);
source->copy(_target->tokCard);
//if the token doesn't have cda/dynamic pt then allow this...
if(!_target->isCDA)
{
@@ -1578,7 +1581,6 @@ int AACopier::resolve()
source->copy(_target);
}
source->isACopier = true;
source->hasCopiedToken = tokencopied;
source->copiedID = _target->copiedID;
if(_target->isMorphed)
{
@@ -1607,7 +1609,7 @@ int AACopier::resolve()
TokenandAbilityClone->addToGame();
}
}
if(source->isACopier)
if(source)
{
source->GrantedAndAbility = andAbility;
AbilityFactory af(game);
@@ -4102,12 +4104,23 @@ int AACloner::resolve()
if (!_target)
return 0;
// Use id of the card to have the same image as the original
MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardById(_target->getId()));
MTGCard * clone = NULL;
// If its a copier and copied a token then copy what it is
if(_target->isACopier && _target->hasCopiedToken)
clone = _target;
if(_target->isToken || _target->hasCopiedToken)
{
if(_target->getMTGId() > 0)//not generated token
clone = MTGCollection()->getCardById(_target->getMTGId());
else
{
clone = _target->tokCard;
clone->data = _target->tokCard;//?wtf
}
}
else
clone = MTGCollection()->getCardById(_target->copiedID);
if(!clone)
source = _target;
Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller();
@@ -4134,6 +4147,8 @@ int AACloner::resolve()
spell->source->entersBattlefield = 1;
spell->source->model = spell->source;
spell->source->model->data = spell->source;
spell->source->tokCard = spell->source->clone();
spell->source->TokenAndAbility = _target->TokenAndAbility;//token andAbility
//if the token doesn't have cda/dynamic pt then allow this...
if((_target->isToken) && (!_target->isCDA))
{
@@ -4165,11 +4180,11 @@ int AACloner::resolve()
{
spell->source->addType(*it);
}
if(_target->TokenAndAbility)
if(spell->source->TokenAndAbility)
{//the source copied a token with andAbility
MTGAbility * TokenandAbilityClone = _target->TokenAndAbility->clone();
MTGAbility * TokenandAbilityClone = spell->source->TokenAndAbility->clone();
TokenandAbilityClone->target = spell->source;
if(_target->TokenAndAbility->oneShot)
if(spell->source->TokenAndAbility->oneShot)
{
TokenandAbilityClone->resolve();
SAFE_DELETE(TokenandAbilityClone);
+1 -1
View File
@@ -1149,7 +1149,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder
MTGCard * fcard = MTGCollection()->getCardByName(kcard->name);
quad = WResourceManager::Instance()->RetrieveCard(fcard);
}
if (kcard && kcard->hasCopiedToken)
if (kcard && kcard->hasCopiedToken && !quad.get())
{
MTGCard * tcard = MTGCollection()->getCardById(abs(kcard->copiedID));
quad = thumb ? WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_THUMB, 1, abs(kcard->copiedID))
+15 -4
View File
@@ -99,11 +99,20 @@ void MTGCardInstance::copy(MTGCardInstance * card)
MTGCard * source = NULL;
if(card->isToken || card->hasCopiedToken)
{
source = card;
if(card->getMTGId() > 0)//not generated token
source = MTGCollection()->getCardById(card->getMTGId());
else
{
source = card->tokCard;
source->data = card->tokCard;//?wtf
}
}
else
source = MTGCollection()->getCardById(card->copiedID);
if(!source)
source = card;
CardPrimitive * data = source->data;
basicAbilities = data->basicAbilities;
types.clear();//reset types.. fix copying man lands... the copier becomes an unanimated land...
@@ -135,6 +144,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
origpower = card->origpower;//for flip
origtoughness = card->origtoughness;//for flip
TokenAndAbility = card->TokenAndAbility;//token andAbility
tokCard = card->tokCard;
//Now this is dirty...
int backupid = mtgid;
@@ -142,7 +152,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
mtgid = source->getId();
MTGCardInstance * oldStored = this->storedSourceCard;
//test copy filtered
cardsAbilitiesFilter.clear();
/*cardsAbilitiesFilter.clear();
for(unsigned int i = 0;i < card->cardsAbilities.size();i++)
{
MTGAbility * a = dynamic_cast<MTGAbility *>(card->cardsAbilities[i]);
@@ -150,7 +160,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
{
cardsAbilitiesFilter.push_back(a);
}
}
}*/
if(observer->players[1]->playMode == Player::MODE_TEST_SUITE)
mtgid = backupid; // there must be a way to get the token id...
@@ -288,6 +298,7 @@ void MTGCardInstance::initMTGCI()
owner = NULL;
counters = NEW Counters(this);
previousZone = NULL;
tokCard = NULL;
previous = NULL;
next = NULL;
TokenAndAbility = NULL;
@@ -299,7 +310,7 @@ void MTGCardInstance::initMTGCI()
exileEffects = false;
currentZone = NULL;
cardsAbilities = vector<MTGAbility *>();
cardsAbilitiesFilter = vector<MTGAbility *>();
//cardsAbilitiesFilter = vector<MTGAbility *>();
data = this; //an MTGCardInstance point to itself for data, allows to update it without killing the underlying database item
if (observer && basicAbilities[(int)Constants::CHANGELING])