- fixed a bug with orcish lumberjack (sacrifice)
This commit is contained in:
wagic.the.homebrew
2009-02-02 12:02:52 +00:00
parent 51a4a32231
commit 16b9b09515
4 changed files with 36 additions and 3 deletions
+1
View File
@@ -45,6 +45,7 @@ lifeforce.txt
living_lands.txt living_lands.txt
lord_of_the_pit.txt lord_of_the_pit.txt
lord_of_the_pit2.txt lord_of_the_pit2.txt
orcish_lumberjack.txt
paralysis.txt paralysis.txt
paralysis2.txt paralysis2.txt
resurrection.txt resurrection.txt
@@ -0,0 +1,18 @@
#Testing Sacrifice with orcish lumberjack (Sacrifice a forest to add 3 green mana)
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:2646,2747
[PLAYER2]
[DO]
2646
choice 0
2747
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:2646
graveyard:2747
manapool:{G}{G}{G}
[PLAYER2]
[END]
+15 -1
View File
@@ -643,6 +643,7 @@ class AManaProducer: public MTGAbility{
public: public:
AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL ):MTGAbility(id, card){ AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL ):MTGAbility(id, card){
LOG("==Creating ManaProducer Object"); LOG("==Creating ManaProducer Object");
if (!_cost) OutputDebugString("NO COST???\n");
cost = _cost; cost = _cost;
output=_output; output=_output;
x1 = 10; x1 = 10;
@@ -722,9 +723,22 @@ class AManaProducer: public MTGAbility{
int reactToClick(MTGCardInstance * _card){ int reactToClick(MTGCardInstance * _card){
if (!isReactingToClick( _card)) return 0; if (!isReactingToClick( _card)) return 0;
OutputDebugString("React To click 1\n");
if (cost){
cost->setExtraCostsAction(this, _card);
OutputDebugString("React To click 2\n");
if (!cost->isExtraPaymentSet()){
OutputDebugString("React To click 3\n");
GameObserver::GetInstance()->waitForExtraPayment = cost->extraCosts;
return 0;
}
GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost);
cost->doPayExtra();
}
source->tapped = 1; source->tapped = 1;
currentlyTapping++; currentlyTapping++;
if (cost) GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost);
animation = 1.f; animation = 1.f;
CardGui * cardg = game->mLayers->playLayer()->getByCard(source); CardGui * cardg = game->mLayers->playLayer()->getByCard(source);
if (cardg){ if (cardg){
+2 -2
View File
@@ -512,9 +512,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (dryMode) return BAKA_EFFECT_GOOD; if (dryMode) return BAKA_EFFECT_GOOD;
ManaCost * input = ManaCost::parseManaCost(s.substr(0,found)); ManaCost * input = ManaCost::parseManaCost(s.substr(0,found));
ManaCost * output = ManaCost::parseManaCost(s.substr(found)); ManaCost * output = ManaCost::parseManaCost(s.substr(found));
if (input->getConvertedCost() || doTap){ if (!input->isNull() || doTap){
SAFE_DELETE(cost); //erk SAFE_DELETE(cost); //erk
if (!input->getConvertedCost()){ if (input->isNull()){
SAFE_DELETE(input); SAFE_DELETE(input);
} }
MTGAbility * a = NEW AManaProducer(id, target, output, input); MTGAbility * a = NEW AManaProducer(id, target, output, input);