Merge branch 'master' into master

This commit is contained in:
Zzooouhh 2017-11-26 21:17:27 +01:00 committed by GitHub
commit 659e3d7015
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 764 additions and 187 deletions

View file

@ -190,8 +190,10 @@ class BestowEntersBattlefieldEffect extends ReplacementEffectImpl {
if (bestowPermanent != null) {
if (bestowPermanent.hasSubtype(SubType.AURA, game)) {
MageObject basicObject = bestowPermanent.getBasicMageObject(game);
basicObject.getSubtype(null).add(SubType.AURA);
basicObject.getCardType().remove(CardType.CREATURE);
if (basicObject != null && !basicObject.getSubtype(null).contains(SubType.AURA)) {
basicObject.getSubtype(null).add(SubType.AURA);
basicObject.getCardType().remove(CardType.CREATURE);
}
}
}
return false;

View file

@ -37,6 +37,8 @@ import mage.MageObjectImpl;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.*;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.RemoveVariableCountersTargetCost;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.cards.repository.PluginClassloaderRegistery;
@ -417,6 +419,19 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
ability.getTargets().add(new TargetCreaturePermanent(filter2));
}
break;
case SIMIC_MANIPULATOR: //Simic Manipulator only
xValue = 0;
for (Cost cost : ability.getCosts()) {
if (cost instanceof RemoveVariableCountersTargetCost) {
xValue = ((RemoveVariableCountersTargetCost) cost).getAmount();
break;
}
}
ability.getTargets().clear();
FilterCreaturePermanent newFilter = new FilterCreaturePermanent("creature with power less than or equal to " + xValue);
newFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
ability.addTarget(new TargetCreaturePermanent(newFilter));
break;
}
}

View file

@ -12,5 +12,6 @@ public enum TargetAdjustment {
X_POWER_LEQ, CHOSEN_NAME,
CHOSEN_COLOR,
VERSE_COUNTER_TARGETS,
TREASURE_COUNTER_POWER
TREASURE_COUNTER_POWER,
SIMIC_MANIPULATOR
}

View file

@ -27,6 +27,10 @@
*/
package mage.game.stack;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.Mana;
@ -60,11 +64,6 @@ import mage.players.Player;
import mage.util.GameLog;
import mage.util.SubTypeList;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -254,7 +253,9 @@ public class Spell extends StackObjImpl implements Card {
// Must be removed first time, after that will be removed by continous effect
// Otherwise effects like evolve trigger from creature comes into play event
card.getCardType().remove(CardType.CREATURE);
card.getSubtype(game).add(SubType.AURA);
if (!card.getSubtype(game).contains(SubType.AURA)) {
card.getSubtype(game).add(SubType.AURA);
}
}
if (controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null)) {
if (bestow) {
@ -263,7 +264,9 @@ public class Spell extends StackObjImpl implements Card {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null && permanent instanceof PermanentCard) {
permanent.setSpellAbility(ability); // otherwise spell ability without bestow will be set
card.addCardType(CardType.CREATURE);
if (!card.getCardType().contains(CardType.CREATURE)) {
card.addCardType(CardType.CREATURE);
}
card.getSubtype(game).remove(SubType.AURA);
}
}
@ -483,7 +486,9 @@ public class Spell extends StackObjImpl implements Card {
public SubTypeList getSubtype(Game game) {
if (this.getSpellAbility() instanceof BestowAbility) {
SubTypeList subtypes = card.getSubtype(game);
subtypes.add(SubType.AURA);
if (!subtypes.contains(SubType.AURA)) { // do it only once
subtypes.add(SubType.AURA);
}
return subtypes;
}
return card.getSubtype(game);
@ -493,7 +498,9 @@ public class Spell extends StackObjImpl implements Card {
public boolean hasSubtype(SubType subtype, Game game) {
if (this.getSpellAbility() instanceof BestowAbility) { // workaround for Bestow (don't like it)
SubTypeList subtypes = card.getSubtype(game);
subtypes.add(SubType.AURA);
if (!subtypes.contains(SubType.AURA)) { // do it only once
subtypes.add(SubType.AURA);
}
if (subtypes.contains(subtype)) {
return true;
}