i actually misinterperated the fading rule...
the difference between vainshing and fading is... fading sac triggers the NEXT time you try to remove a fade counter but cant, vanishing sac triggers WHEN you remove the last counter.
This commit is contained in:
@@ -3965,6 +3965,7 @@ public:
|
|||||||
int timeLeft;
|
int timeLeft;
|
||||||
int amount;
|
int amount;
|
||||||
string counterName;
|
string counterName;
|
||||||
|
int next;
|
||||||
|
|
||||||
AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap = 0, int restrictions = 0,int amount = 0,string counterName = "");
|
AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap = 0, int restrictions = 0,int amount = 0,string counterName = "");
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
|
|||||||
@@ -2786,6 +2786,7 @@ APreventDamageTypesUEOT::~APreventDamageTypesUEOT()
|
|||||||
AVanishing::AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap, int restrictions, int amount, string counterName) :
|
AVanishing::AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap, int restrictions, int amount, string counterName) :
|
||||||
ActivatedAbility(_id, card, _cost, restrictions, _tap),amount(amount),counterName(counterName)
|
ActivatedAbility(_id, card, _cost, restrictions, _tap),amount(amount),counterName(counterName)
|
||||||
{
|
{
|
||||||
|
next = 0;
|
||||||
for(int i = 0;i< amount;i++)
|
for(int i = 0;i< amount;i++)
|
||||||
source->counters->addCounter(counterName.c_str(),0,0);
|
source->counters->addCounter(counterName.c_str(),0,0);
|
||||||
}
|
}
|
||||||
@@ -2808,21 +2809,23 @@ void AVanishing::Update(float dt)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
timeLeft = 0;
|
timeLeft = 0;
|
||||||
WEvent * e = NEW WEventCardSacrifice(source);
|
if(counterName.find("fade") != string::npos && next == 0)
|
||||||
GameObserver * game = GameObserver::GetInstance();
|
{
|
||||||
game->receiveEvent(e);
|
next = 1;
|
||||||
source->controller()->game->putInGraveyard(source);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
next = 0;
|
||||||
}
|
}
|
||||||
else if (newPhase == Constants::MTG_PHASE_UPKEEP && timeLeft <= 0)
|
if (newPhase == Constants::MTG_PHASE_UPKEEP && timeLeft <= 0 && next == 0)
|
||||||
{
|
{
|
||||||
WEvent * e = NEW WEventCardSacrifice(source);
|
WEvent * e = NEW WEventCardSacrifice(source);
|
||||||
GameObserver * game = GameObserver::GetInstance();
|
GameObserver * game = GameObserver::GetInstance();
|
||||||
game->receiveEvent(e);
|
game->receiveEvent(e);
|
||||||
source->controller()->game->putInGraveyard(source);
|
source->controller()->game->putInGraveyard(source);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ActivatedAbility::Update(dt);
|
ActivatedAbility::Update(dt);
|
||||||
}
|
}
|
||||||
@@ -2835,7 +2838,7 @@ int AVanishing::resolve()
|
|||||||
|
|
||||||
const char * AVanishing::getMenuText()
|
const char * AVanishing::getMenuText()
|
||||||
{
|
{
|
||||||
if(counterName.find("fading") != string::npos)
|
if(counterName.find("fade") != string::npos)
|
||||||
return "Fading";
|
return "Fading";
|
||||||
return "Vanishing";
|
return "Vanishing";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user