added stack check, modified life check
if activating ability, playing a land or casting sorcery spell at sorcery level(timing restriction), if the stack is not empty, don't allow it. Modified the life state check, if any of the players would lose the game, allow the gamestateeffects to check... added reduceto:value for ali from cairo...
This commit is contained in:
@@ -688,6 +688,13 @@ private:
|
||||
{
|
||||
intValue = target->controller()->opponent()->game->hand->nb_cards;
|
||||
}
|
||||
else if (s == "worshipped")//Worship
|
||||
{
|
||||
if(card->controller()->game->battlefield->hasType("creature"))
|
||||
intValue = card->controller()->life;
|
||||
else
|
||||
intValue = 0;
|
||||
}
|
||||
else if (s == "pancientooze")//Ancient Ooze
|
||||
{
|
||||
intValue = 0;
|
||||
@@ -5997,6 +6004,37 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
//Reduce to .. Ali from Cairo...
|
||||
class AReduceToAbility: public MTGAbility
|
||||
{
|
||||
public:
|
||||
string life_s;
|
||||
|
||||
AReduceToAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _life_s) :
|
||||
MTGAbility(observer, _id, _source)
|
||||
{
|
||||
life_s = _life_s;
|
||||
}
|
||||
int receiveEvent(WEvent * event)
|
||||
{
|
||||
if(WEventDamage * isDamaged = dynamic_cast<WEventDamage *> (event))
|
||||
{
|
||||
if (isDamaged->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||
{
|
||||
Player * p = (Player *) isDamaged->damage->target;
|
||||
WParsedInt lifetoset(life_s, NULL, source);
|
||||
if(p && p == source->controller() && p->life <= lifetoset.getValue())
|
||||
p->life = lifetoset.getValue();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
AReduceToAbility * clone() const
|
||||
{
|
||||
return NEW AReduceToAbility(*this);
|
||||
}
|
||||
};
|
||||
|
||||
//flanking ability
|
||||
class AFlankerAbility: public MTGAbility
|
||||
{
|
||||
|
||||
@@ -234,9 +234,9 @@ public:
|
||||
void revertbaseP();
|
||||
void revertbaseT();
|
||||
int getCurrentPower();
|
||||
int getCurrentToughness();
|
||||
int LKIpower;
|
||||
int LKItoughness;
|
||||
int getCurrentToughness();
|
||||
void cdaPT(int p = 0, int t = 0);
|
||||
bool isCDA;
|
||||
void switchPT(bool apply = false);
|
||||
@@ -248,6 +248,7 @@ public:
|
||||
bool discarded;
|
||||
int copiedID;
|
||||
int modifiedbAbi;
|
||||
bool StackIsEmptyandSorcerySpeed();
|
||||
|
||||
void eventattacked();
|
||||
void eventattackedAlone();
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
ManaPool * getManaPool();
|
||||
void takeMulligan();
|
||||
void serumMulligan();
|
||||
bool DeadLifeState();
|
||||
bool DeadLifeState(bool check = false);
|
||||
ManaCost * doesntEmpty;
|
||||
ManaCost * poolDoesntEmpty;
|
||||
void cleanupPhase();
|
||||
|
||||
Reference in New Issue
Block a user