Merge pull request #8 from magefree/master

sync source
This commit is contained in:
Oleg Agafonov 2017-11-30 01:33:08 +04:00 committed by GitHub
commit ae0e4a3f15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 16 deletions

View file

@ -44,6 +44,7 @@ public class DuelCommander extends Commander {
banned.add("Eidolon of the Great Revel");
banned.add("Emrakul, the Aeons Torn");
banned.add("Entomb");
banned.add("Fastbond");
banned.add("Fireblast");
banned.add("Food Chain");
banned.add("Gaea's Cradle");

View file

@ -95,8 +95,11 @@ class InvasionPlansEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
Player blockController = game.getPlayer(game.getCombat().getAttackingPlayerId());
if (blockController != null) {
game.getCombat().selectBlockers(blockController, game);
return event.getPlayerId().equals(game.getCombat().getAttackingPlayerId());
// temporary workaround for AI bugging out while choosing blockers
if (blockController.isHuman()) {
game.getCombat().selectBlockers(blockController, game);
return event.getPlayerId().equals(game.getCombat().getAttackingPlayerId());
}
}
return false;
}

View file

@ -46,14 +46,12 @@ import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.other.CounterCardPredicate;
import mage.filter.predicate.other.OwnerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -149,7 +147,6 @@ class MairsilThePretenderGainAbilitiesEffect extends ContinuousEffectImpl {
static {
filter.add(new CounterCardPredicate(CounterType.CAGE));
filter.add(new OwnerPredicate(TargetController.YOU));
}
public MairsilThePretenderGainAbilitiesEffect() {
@ -164,21 +161,21 @@ class MairsilThePretenderGainAbilitiesEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Permanent perm = game.getPermanent(source.getSourceId());
if (perm != null) {
for (Card card : game.getExile().getAllCards(game)) {
if (filter.match(card, game)) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof ActivatedAbility) {
ActivatedAbilityImpl copyAbility = (ActivatedAbilityImpl) ability.copy();
copyAbility.setMaxActivationsPerTurn(1);
perm.addAbility(copyAbility, card.getId(), game);
}
if (perm == null) {
return false;
}
for (Card card : game.getExile().getAllCards(game)) {
if (filter.match(card, game) && card.getOwnerId() == perm.getControllerId()) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof ActivatedAbility) {
ActivatedAbilityImpl copyAbility = (ActivatedAbilityImpl) ability.copy();
copyAbility.setMaxActivationsPerTurn(1);
perm.addAbility(copyAbility, card.getId(), game);
}
}
}
return true;
}
return false;
return true;
}
@Override