added a new tag to transforms(( keyword ... uynt ...meaning until your(the sources controller) next turn.
this should allow players to code cards with the detain ability of rtr correctly, as well as a handful of similar cards in the unsupported text.
detain is coded
auto={1}{t}:target(creature|opponentBattlefield) transforms((Detained,newability[cantattack],newability[cantblock],newability[noactivatedability])) uynt
enjoy
This commit is contained in:
@@ -3948,10 +3948,13 @@ public:
|
|||||||
vector<string> newAbilitiesList;
|
vector<string> newAbilitiesList;
|
||||||
bool newAbilityFound;
|
bool newAbilityFound;
|
||||||
bool aForever;
|
bool aForever;
|
||||||
|
bool UYNT;
|
||||||
|
int myCurrentTurn;
|
||||||
|
|
||||||
ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string> newAbilitiesList,bool newAbilityFound = false,bool aForever = false);
|
ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string> newAbilitiesList,bool newAbilityFound = false,bool aForever = false ,bool UYNT = false);
|
||||||
int addToGame();
|
int addToGame();
|
||||||
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
|
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
|
||||||
|
int testDestroy();
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
ATransformer * clone() const;
|
ATransformer * clone() const;
|
||||||
@@ -3971,8 +3974,9 @@ public:
|
|||||||
map<Damageable *, vector<MTGAbility *> > newAbilities;
|
map<Damageable *, vector<MTGAbility *> > newAbilities;
|
||||||
bool newAbilityFound;
|
bool newAbilityFound;
|
||||||
bool aForever;
|
bool aForever;
|
||||||
|
bool UYNT;
|
||||||
|
|
||||||
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "",bool newpowerfound = false,string newtoughness = "",bool newtoughnessfound = false,vector<string>newAbilitiesList = vector<string>(),bool newAbilityFound = false,bool aForever = false);
|
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "",bool newpowerfound = false,string newtoughness = "",bool newtoughnessfound = false,vector<string>newAbilitiesList = vector<string>(),bool newAbilityFound = false,bool aForever = false, bool UYNT = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
ATransformerInstant * clone() const;
|
ATransformerInstant * clone() const;
|
||||||
|
|||||||
@@ -3566,8 +3566,8 @@ AAlterCost::~AAlterCost()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ATransformer
|
// ATransformer
|
||||||
ATransformer::ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string> newAbilitiesList,bool newAbilityFound,bool aForever) :
|
ATransformer::ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string> newAbilitiesList,bool newAbilityFound,bool aForever, bool aUntilNext) :
|
||||||
MTGAbility(observer, id, source, target),newpower(newpower),newpowerfound(newpowerfound),newtoughness(newtoughness),newtoughnessfound(newtoughnessfound),newAbilitiesList(newAbilitiesList),newAbilityFound(newAbilityFound),aForever(aForever)
|
MTGAbility(observer, id, source, target),newpower(newpower),newpowerfound(newpowerfound),newtoughness(newtoughness),newtoughnessfound(newtoughnessfound),newAbilitiesList(newAbilitiesList),newAbilityFound(newAbilityFound),aForever(aForever),UYNT(aUntilNext)
|
||||||
{
|
{
|
||||||
|
|
||||||
PopulateAbilityIndexVector(abilities, sabilities);
|
PopulateAbilityIndexVector(abilities, sabilities);
|
||||||
@@ -3576,7 +3576,7 @@ ATransformer::ATransformer(GameObserver* observer, int id, MTGCardInstance * sou
|
|||||||
{
|
{
|
||||||
colors.push_back(source->chooseacolor);
|
colors.push_back(source->chooseacolor);
|
||||||
}
|
}
|
||||||
|
myCurrentTurn = 1000;
|
||||||
//this subkeyword adds a color without removing the existing colors.
|
//this subkeyword adds a color without removing the existing colors.
|
||||||
addNewColors = (sabilities.find("newcolors") != string::npos);
|
addNewColors = (sabilities.find("newcolors") != string::npos);
|
||||||
remove = (stypes.find("removealltypes") != string::npos);
|
remove = (stypes.find("removealltypes") != string::npos);
|
||||||
@@ -3608,6 +3608,8 @@ ATransformer::ATransformer(GameObserver* observer, int id, MTGCardInstance * sou
|
|||||||
|
|
||||||
int ATransformer::addToGame()
|
int ATransformer::addToGame()
|
||||||
{
|
{
|
||||||
|
if(UYNT)
|
||||||
|
myCurrentTurn = game->turn;
|
||||||
MTGCardInstance * _target = NULL;
|
MTGCardInstance * _target = NULL;
|
||||||
Interruptible * action = (Interruptible *) target;
|
Interruptible * action = (Interruptible *) target;
|
||||||
if (action && action->type == ACTION_SPELL && action->state == NOT_RESOLVED)
|
if (action && action->type == ACTION_SPELL && action->state == NOT_RESOLVED)
|
||||||
@@ -3781,6 +3783,19 @@ for (it = types.begin(); it != types.end(); it++)
|
|||||||
return rNewToughness;
|
return rNewToughness;
|
||||||
return rNewPower;
|
return rNewPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ATransformer::testDestroy()
|
||||||
|
{
|
||||||
|
if(UYNT)
|
||||||
|
{
|
||||||
|
if(myCurrentTurn != 1000 && game->turn > myCurrentTurn && source->controller()->getId() == game->currentPlayer->getId())
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return MTGAbility::testDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
int ATransformer::destroy()
|
int ATransformer::destroy()
|
||||||
{
|
{
|
||||||
if(aForever)
|
if(aForever)
|
||||||
@@ -3882,10 +3897,10 @@ ATransformer::~ATransformer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//ATransformerInstant
|
//ATransformerInstant
|
||||||
ATransformerInstant::ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types, string abilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string>newAbilitiesList,bool newAbilityFound,bool aForever) :
|
ATransformerInstant::ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types, string abilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string>newAbilitiesList,bool newAbilityFound,bool aForever,bool aUntilNext) :
|
||||||
InstantAbility(observer, id, source, target),newpower(newpower),newpowerfound(newpowerfound),newtoughness(newtoughness),newtoughnessfound(newtoughnessfound),newAbilitiesList(newAbilitiesList),newAbilityFound(newAbilityFound),aForever(aForever)
|
InstantAbility(observer, id, source, target),newpower(newpower),newpowerfound(newpowerfound),newtoughness(newtoughness),newtoughnessfound(newtoughnessfound),newAbilitiesList(newAbilitiesList),newAbilityFound(newAbilityFound),aForever(aForever),UYNT(aUntilNext)
|
||||||
{
|
{
|
||||||
ability = NEW ATransformer(game, id, source, target, types, abilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound,aForever);
|
ability = NEW ATransformer(game, id, source, target, types, abilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound,aForever,aUntilNext);
|
||||||
aType = MTGAbility::STANDARD_BECOMES;
|
aType = MTGAbility::STANDARD_BECOMES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2036,6 +2036,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
bool oneShot = false;
|
bool oneShot = false;
|
||||||
bool forceForever = false;
|
bool forceForever = false;
|
||||||
|
bool untilYourNextTurn = false;
|
||||||
found = s.find("ueot");
|
found = s.find("ueot");
|
||||||
if (found != string::npos)
|
if (found != string::npos)
|
||||||
forceUEOT = true;
|
forceUEOT = true;
|
||||||
@@ -2045,6 +2046,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
found = s.find("forever");
|
found = s.find("forever");
|
||||||
if (found != string::npos)
|
if (found != string::npos)
|
||||||
forceForever = true;
|
forceForever = true;
|
||||||
|
found = s.find("uynt");
|
||||||
|
if (found != string::npos)
|
||||||
|
untilYourNextTurn = true;
|
||||||
//Prevent Damage
|
//Prevent Damage
|
||||||
const string preventDamageKeywords[] = { "preventallcombatdamage", "preventallnoncombatdamage", "preventalldamage", "fog" };
|
const string preventDamageKeywords[] = { "preventallcombatdamage", "preventallnoncombatdamage", "preventalldamage", "fog" };
|
||||||
const int preventDamageTypes[] = {0, 2, 1, 0}; //TODO enum ?
|
const int preventDamageTypes[] = {0, 2, 1, 0}; //TODO enum ?
|
||||||
@@ -2438,9 +2442,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oneShot || forceUEOT || forceForever)
|
if (oneShot || forceUEOT || forceForever)
|
||||||
return NEW ATransformerInstant(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector<string>(),false,forceForever);
|
return NEW ATransformerInstant(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector<string>(),false,forceForever,untilYourNextTurn);
|
||||||
|
|
||||||
return NEW ATransformer(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector<string>(),false,forceForever);
|
return NEW ATransformer(observer, id, card, target, stypes, sabilities,newPower,ptFound,newToughness,ptFound,vector<string>(),false,forceForever,untilYourNextTurn);
|
||||||
}
|
}
|
||||||
|
|
||||||
//bloodthirst
|
//bloodthirst
|
||||||
@@ -2529,9 +2533,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oneShot || forceUEOT || forceForever)
|
if (oneShot || forceUEOT || forceForever)
|
||||||
return NEW ATransformerInstant(observer, id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound,forceForever);
|
return NEW ATransformerInstant(observer, id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound,forceForever,untilYourNextTurn);
|
||||||
|
|
||||||
return NEW ATransformer(observer, id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound);
|
return NEW ATransformer(observer, id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound,forceForever,untilYourNextTurn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user