1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-13 01:09:53 -09:00

Fixed Mistbind Clique and Engeered Plague

This commit is contained in:
Plopman 2013-06-13 18:57:23 +02:00
parent 537f826607
commit c304b4e6da
2 changed files with 35 additions and 11 deletions
Mage.Sets/src/mage/sets

View file

@ -93,7 +93,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility<MistbindCliqueAbi
public MistbindCliqueAbility() { public MistbindCliqueAbility() {
super(Zone.BATTLEFIELD, Zone.EXILED, new MistbindCliqueTapEffect(), "When a Faerie is championed with {this}, ", false); super(Zone.BATTLEFIELD, Zone.EXILED, new MistbindCliqueTapEffect(), "When a Faerie is championed with {this}, ", false);
this.addTarget(new TargetPlayer()); this.addTarget(new TargetPlayer(true));
} }
public MistbindCliqueAbility(MistbindCliqueAbility ability) { public MistbindCliqueAbility(MistbindCliqueAbility ability) {

View file

@ -41,7 +41,6 @@ import mage.cards.repository.CardRepository;
import mage.choices.Choice; import mage.choices.Choice;
import mage.choices.ChoiceImpl; import mage.choices.ChoiceImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -58,11 +57,10 @@ public class EngineeredPlague extends CardImpl<EngineeredPlague> {
this.color.setBlack(true); this.color.setBlack(true);
FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures of the chosen type");
// As Engineered Plague enters the battlefield, choose a creature type. // As Engineered Plague enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new EngineeredPlagueEntersBattlefieldEffect(filter), "choose a creature type")); this.addAbility(new AsEntersBattlefieldAbility(new EngineeredPlagueEntersBattlefieldEffect(), "choose a creature type"));
// All creatures of the chosen type get -1/-1. // All creatures of the chosen type get -1/-1.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Constants.Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Constants.Duration.WhileOnBattlefield, new FilterEngineeredPlague(), false)));
} }
public EngineeredPlague(final EngineeredPlague card) { public EngineeredPlague(final EngineeredPlague card) {
@ -76,16 +74,13 @@ public class EngineeredPlague extends CardImpl<EngineeredPlague> {
class EngineeredPlagueEntersBattlefieldEffect extends OneShotEffect<EngineeredPlagueEntersBattlefieldEffect> { class EngineeredPlagueEntersBattlefieldEffect extends OneShotEffect<EngineeredPlagueEntersBattlefieldEffect> {
private FilterCreaturePermanent filter; public EngineeredPlagueEntersBattlefieldEffect() {
public EngineeredPlagueEntersBattlefieldEffect(FilterCreaturePermanent filter) {
super(Constants.Outcome.Benefit); super(Constants.Outcome.Benefit);
this.filter = filter;
staticText = "As {this} enters the battlefield, choose a creature type"; staticText = "As {this} enters the battlefield, choose a creature type";
} }
public EngineeredPlagueEntersBattlefieldEffect(final EngineeredPlagueEntersBattlefieldEffect effect) { public EngineeredPlagueEntersBattlefieldEffect(final EngineeredPlagueEntersBattlefieldEffect effect) {
super(effect); super(effect);
this.filter = effect.filter;
} }
@Override @Override
@ -100,7 +95,7 @@ public class EngineeredPlague extends CardImpl<EngineeredPlague> {
game.debugMessage("player canceled choosing type. retrying."); game.debugMessage("player canceled choosing type. retrying.");
} }
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice()); game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
filter.add(new SubtypePredicate(typeChoice.getChoice())); game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice().toString());
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice() + "</i>"); permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice() + "</i>");
} }
return false; return false;
@ -113,6 +108,35 @@ public class EngineeredPlague extends CardImpl<EngineeredPlague> {
} }
class FilterEngineeredPlague extends FilterCreaturePermanent {
public FilterEngineeredPlague() {
super("All creatures of the chosen type");
}
public FilterEngineeredPlague(final FilterEngineeredPlague filter) {
super(filter);
}
@Override
public FilterEngineeredPlague copy() {
return new FilterEngineeredPlague(this);
}
@Override
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if(super.match(permanent, sourceId, playerId, game)){
String subtype = (String) game.getState().getValue(sourceId + "_type");
if(subtype != null && !subtype.equals("") && permanent.hasSubtype(subtype)){
return true;
}
}
return false;
}
}
} }