Erwan
- fixed a bug with orcish lumberjack (sacrifice)
This commit is contained in:
@@ -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
|
||||
|
||||
18
projects/mtg/bin/Res/test/orcish_lumberjack.txt
Normal file
18
projects/mtg/bin/Res/test/orcish_lumberjack.txt
Normal 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]
|
||||
@@ -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){
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user