From bf427b64023bea4c41eda25e32d6abe415357290 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sun, 6 Feb 2011 18:48:08 +0000 Subject: [PATCH] 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. --- projects/mtg/include/AllAbilities.h | 1 + projects/mtg/src/AllAbilities.cpp | 31 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 5da79447d..5736643a5 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3965,6 +3965,7 @@ public: int timeLeft; int amount; string counterName; + int next; AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap = 0, int restrictions = 0,int amount = 0,string counterName = ""); void Update(float dt); diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index f3964973a..30ae5e603 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -2786,6 +2786,7 @@ APreventDamageTypesUEOT::~APreventDamageTypesUEOT() 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) { + next = 0; for(int i = 0;i< amount;i++) source->counters->addCounter(counterName.c_str(),0,0); } @@ -2808,21 +2809,23 @@ void AVanishing::Update(float dt) else { timeLeft = 0; - WEvent * e = NEW WEventCardSacrifice(source); - GameObserver * game = GameObserver::GetInstance(); - game->receiveEvent(e); - source->controller()->game->putInGraveyard(source); + if(counterName.find("fade") != string::npos && next == 0) + { + next = 1; + } + else + { + next = 0; + } + if (newPhase == Constants::MTG_PHASE_UPKEEP && timeLeft <= 0 && next == 0) + { + WEvent * e = NEW WEventCardSacrifice(source); + GameObserver * game = GameObserver::GetInstance(); + game->receiveEvent(e); + source->controller()->game->putInGraveyard(source); + } } - } - else if (newPhase == Constants::MTG_PHASE_UPKEEP && timeLeft <= 0) - { - WEvent * e = NEW WEventCardSacrifice(source); - GameObserver * game = GameObserver::GetInstance(); - game->receiveEvent(e); - source->controller()->game->putInGraveyard(source); - } - } ActivatedAbility::Update(dt); } @@ -2835,7 +2838,7 @@ int AVanishing::resolve() const char * AVanishing::getMenuText() { -if(counterName.find("fading") != string::npos) +if(counterName.find("fade") != string::npos) return "Fading"; return "Vanishing"; }