diff --git a/projects/mtg/bin/Res/sets/RAV/_cards.dat b/projects/mtg/bin/Res/sets/RAV/_cards.dat index d6f171eff..e5abf8a5c 100644 --- a/projects/mtg/bin/Res/sets/RAV/_cards.dat +++ b/projects/mtg/bin/Res/sets/RAV/_cards.dat @@ -338,7 +338,7 @@ subtype=Aura [card] text=Until end of turn, permanents you control gain "{T}: This permanent deals 1 damage to target creature or player." id=83912 -auto=lord(creature|myBattlefield) {T}:damage:1 target(*) +auto=lord(creature|myBattlefield) {T}:damage:1 target(creature,player) name=Flame Fusillade rarity=R type=Sorcery diff --git a/projects/mtg/bin/Res/test/bugs/flame_fusillade_i265.txt b/projects/mtg/bin/Res/test/bugs/flame_fusillade_i265.txt new file mode 100644 index 000000000..2c30dcaa7 --- /dev/null +++ b/projects/mtg/bin/Res/test/bugs/flame_fusillade_i265.txt @@ -0,0 +1,21 @@ +#Bug: Flame Fusillade +[INIT] +FIRSTMAIN +[PLAYER1] +hand:Flame fusillade +inplay:grizzly bears +manapool:{3}{R} +[PLAYER2] +inplay:raging goblin +[DO] +flame fusillade +grizzly bears +raging goblin +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:Flame fusillade +inplay:grizzly bears +[PLAYER2] +graveyard:raging goblin +[END] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 69015149d..f7ea6778a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1926,8 +1926,8 @@ AADamager(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * } int resolve(){ - if(target){ - Damageable * _target = (Damageable *) getTarget(); + Damageable * _target = (Damageable *) getTarget(); + if(_target){ game->mLayers->stackLayer()->addDamage(source,_target, damage->getValue()); game->mLayers->stackLayer()->resolve(); return 1; diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index 8de3123e3..951a3c614 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -176,6 +176,12 @@ int AIAction::getEfficiency(){ case MTGAbility::DAMAGER: { AADamager * aad = (AADamager *) a; + if (!target){ + Targetable * _t = aad->getTarget(); + if (_t == p->opponent()) efficiency = 90; + else efficiency = 0; + break; + } if ( p == target->controller()){ efficiency = 0; }else if (aad->damage->getValue() >= target->toughness){ @@ -215,6 +221,10 @@ int AIAction::getEfficiency(){ break; } if (p->game->hand->nb_cards == 0) efficiency = (int) ((float) efficiency * 1.3); //increase chance of using ability if hand is empty + if (ability->cost){ + ExtraCosts * ec = ability->cost->extraCosts; + if (ec) efficiency = efficiency / 3; //Decrease chance of using ability if there is an extra cost to use the ability + } return efficiency; } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index de0b87c76..252397592 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -952,7 +952,8 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card, int MTGAbility * a = v[i]; if (dryMode){ result = abilityEfficiency(a, card->controller(),mode,tc); - SAFE_DELETE(a); + for (size_t i = 0; i < v.size(); ++i) + SAFE_DELETE(v[i]); return result; }