Erwan
-fixed bug with elvish promenade (and various instants/sorceries) -Fixed bug with some auras that wouldn't go to graveyard in some conditions
This commit is contained in:
@@ -79,6 +79,7 @@ void AIPlayer::tapLandsForMana(ManaCost * potentialMana, ManaCost * cost){
|
||||
if (amp){
|
||||
MTGCardInstance * card = amp->source;
|
||||
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost()==1){
|
||||
used[card] = true;
|
||||
int doTap = 1;
|
||||
for (int i=Constants::MTG_NB_COLORS-1; i>= 0; i--){
|
||||
if (diff->getCost(i) && amp->output->getCost(i) ){
|
||||
@@ -90,7 +91,6 @@ void AIPlayer::tapLandsForMana(ManaCost * potentialMana, ManaCost * cost){
|
||||
if (doTap){
|
||||
AIAction * action = NEW AIAction(amp,card);
|
||||
clickstream.push(action);
|
||||
used[card] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,8 +147,8 @@ int AIAction::getEfficiency(){
|
||||
}
|
||||
|
||||
//Can't handle sacrifice costs that require a target yet :(
|
||||
if (a->cost){
|
||||
ExtraCosts * ec = a->cost->extraCosts;
|
||||
if (ability->cost){
|
||||
ExtraCosts * ec = ability->cost->extraCosts;
|
||||
if (ec){
|
||||
for (size_t i = 0; i < ec->costs.size(); i++){
|
||||
if (ec->costs[i]->tc) return 0;
|
||||
|
||||
@@ -790,12 +790,19 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
MTGCardInstance * card = spell->source;
|
||||
|
||||
|
||||
if (card->hasType("instant") || card->hasType("sorcery")){
|
||||
MTGPlayerCards * zones = card->controller()->game;
|
||||
zones->putInGraveyard(card);
|
||||
}
|
||||
|
||||
if (spell->cursor==1) card->target = spell->getNextCardTarget();
|
||||
_id = magicText(_id, spell);
|
||||
int putSourceInGraveyard = 0; //For spells that are not already InstantAbilities;
|
||||
|
||||
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
|
||||
|
||||
|
||||
int id = card->getId();
|
||||
if (card->alias) id = card->alias;
|
||||
switch (id){
|
||||
@@ -1804,17 +1811,16 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
|
||||
case 130369: // Soulblast
|
||||
{
|
||||
int damage = 0;
|
||||
Damageable * target = spell->getNextDamageableTarget();
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
for (int j = 0; j < card->controller()->game->inPlay->nb_cards; j++){
|
||||
MTGCardInstance * current = card->controller()->game->inPlay->cards[j];
|
||||
if (current->hasType("Creature")){
|
||||
card->controller()->game->putInGraveyard(current);
|
||||
damage+= current->power;
|
||||
}
|
||||
}
|
||||
game->mLayers->stackLayer()->addDamage(card, target, damage);
|
||||
int damage = 0;
|
||||
Damageable * target = spell->getNextDamageableTarget();
|
||||
for (int j = card->controller()->game->inPlay->nb_cards-1; j >=0 ; --j){
|
||||
MTGCardInstance * current = card->controller()->game->inPlay->cards[j];
|
||||
if (current->hasType("Creature")){
|
||||
card->controller()->game->putInGraveyard(current);
|
||||
damage+= current->power;
|
||||
}
|
||||
}
|
||||
game->mLayers->stackLayer()->addDamage(card, target, damage);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1944,16 +1950,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
|
||||
}
|
||||
|
||||
//Instants are put in the graveyard automatically if that's not already done
|
||||
if (!putSourceInGraveyard){
|
||||
if (card->hasType("instant") || card->hasType("sorcery")){
|
||||
putSourceInGraveyard = 1;
|
||||
}
|
||||
}
|
||||
if (putSourceInGraveyard == 1){
|
||||
MTGPlayerCards * zones = card->controller()->game;
|
||||
card = zones->putInGraveyard(card);
|
||||
}
|
||||
}
|
||||
|
||||
MTGAbility::MTGAbility(int id, MTGCardInstance * card):ActionElement(id){
|
||||
|
||||
@@ -349,16 +349,15 @@ int HUDDisplay::receiveEvent(WEvent * event){
|
||||
|
||||
WEventZoneChange * ezc = dynamic_cast<WEventZoneChange*>(event);
|
||||
if (ezc) {
|
||||
int ok = 0;
|
||||
for (int i = 0; i < 2 ; i++){
|
||||
Player * p = game->players[i];
|
||||
if (ezc->from == p->game->graveyard || ezc->to == p->game->graveyard ) ok = 1;
|
||||
if (ezc->to == p->game->graveyard ){
|
||||
char buffer[512];
|
||||
sprintf(buffer,_("%s goes to graveyard").c_str(), _(ezc->card->getName()).c_str());
|
||||
string s = buffer;
|
||||
return addEvent(s);
|
||||
}
|
||||
}
|
||||
if (!ok) return 0;
|
||||
char buffer[512];
|
||||
sprintf(buffer,_("%s goes to graveyard").c_str(), _(ezc->card->getName()).c_str());
|
||||
string s = buffer;
|
||||
return addEvent(s);
|
||||
}
|
||||
|
||||
WEventDamage * ed = dynamic_cast<WEventDamage*>(event);
|
||||
|
||||
Reference in New Issue
Block a user