- 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

View File

@@ -45,6 +45,7 @@ lifeforce.txt
living_lands.txt
lord_of_the_pit.txt
lord_of_the_pit2.txt
orcish_lumberjack.txt
paralysis.txt
paralysis2.txt
resurrection.txt

View File

@@ -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]

View File

@@ -643,6 +643,7 @@ class AManaProducer: public MTGAbility{
public:
AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL ):MTGAbility(id, card){
LOG("==Creating ManaProducer Object");
if (!_cost) OutputDebugString("NO COST???\n");
cost = _cost;
output=_output;
x1 = 10;
@@ -722,9 +723,22 @@ class AManaProducer: public MTGAbility{
int reactToClick(MTGCardInstance * _card){
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;
currentlyTapping++;
if (cost) GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost);
animation = 1.f;
CardGui * cardg = game->mLayers->playLayer()->getByCard(source);
if (cardg){

View File

@@ -512,9 +512,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (dryMode) return BAKA_EFFECT_GOOD;
ManaCost * input = ManaCost::parseManaCost(s.substr(0,found));
ManaCost * output = ManaCost::parseManaCost(s.substr(found));
if (input->getConvertedCost() || doTap){
if (!input->isNull() || doTap){
SAFE_DELETE(cost); //erk
if (!input->getConvertedCost()){
if (input->isNull()){
SAFE_DELETE(input);
}
MTGAbility * a = NEW AManaProducer(id, target, output, input);