as requested by doc, added a tag for lords to allow an over-ride for effect so theyre not removed from the game by GameObserver until the lords remove it themselves.
ie: Card Name: Quick Sliver Mana Cost: Converted Mana Cost:2 Types:Creature — Sliver Card Text:Flash Any player may cast Sliver cards as though they had flash. without an over-ride testdestroy removes the observer before it can be any use to us. i only enabled this for the lords/this'es....
This commit is contained in:
@@ -109,6 +109,7 @@ public:
|
||||
int allowedToAltCast(MTGCardInstance* card, Player* player);
|
||||
int oneShot;
|
||||
int forceDestroy;
|
||||
int forcedAlive;
|
||||
bool canBeInterrupted;
|
||||
ManaCost* cost;
|
||||
ManaCost* alternative;
|
||||
|
||||
@@ -701,7 +701,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
{
|
||||
size_t found;
|
||||
trim(s);
|
||||
|
||||
//TODO This block redundant with calling function
|
||||
if (!card && spell)
|
||||
card = spell->source;
|
||||
@@ -1017,6 +1016,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return multi;
|
||||
}
|
||||
|
||||
int forcedalive = 0;
|
||||
//force an ability to ignore destroy while source is still valid.
|
||||
//allow the lords to remove the ability instead of gameobserver checks.
|
||||
found = s.find("forcedalive");
|
||||
if (found != string::npos)
|
||||
forcedalive = 1;
|
||||
|
||||
//rather dirty way to stop thises and lords from conflicting with each other.
|
||||
size_t lord = string::npos;
|
||||
for (size_t j = 0; j < kLordKeywordsCount; ++j)
|
||||
@@ -1105,6 +1111,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
if (result)
|
||||
{
|
||||
result->oneShot = oneShot;
|
||||
a->forcedAlive = forcedalive;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1238,7 +1245,10 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
result = NULL;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
result->oneShot = oneShot;
|
||||
a->forcedAlive = forcedalive;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return NULL;
|
||||
@@ -1650,7 +1660,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
found = s.find("forever");
|
||||
if (found != string::npos)
|
||||
forceFOREVER = 1;
|
||||
|
||||
//Prevent Damage
|
||||
const string preventDamageKeywords[] = { "preventallcombatdamage", "preventallnoncombatdamage", "preventalldamage", "fog" };
|
||||
const int preventDamageTypes[] = {0, 2, 1, 0}; //TODO enum ?
|
||||
@@ -3314,6 +3323,8 @@ GameObserver * g=g->GetInstance();
|
||||
return 0;
|
||||
if(source->exileEffects && game->isInExile(source))
|
||||
return 0;
|
||||
if(this->forcedAlive == 1)
|
||||
return 0;
|
||||
if (!game->isInPlay(source))
|
||||
return 1;
|
||||
if (target && !game->isInPlay((MTGCardInstance *) target))
|
||||
|
||||
Reference in New Issue
Block a user