forked from External/mage
fix Seasinger, Serendib Djinn
This commit is contained in:
parent
34b671bc83
commit
1e834368af
2 changed files with 8 additions and 7 deletions
|
|
@ -16,6 +16,7 @@ import mage.constants.*;
|
|||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -30,13 +31,11 @@ import java.util.UUID;
|
|||
public final class Seasinger extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterPermanent("Island");
|
||||
= new FilterLandPermanent(SubType.ISLAND, "no Islands");
|
||||
private static final FilterPermanent filter2
|
||||
= new FilterCreaturePermanent("creature whose controller controls an Island");
|
||||
|
||||
static {
|
||||
filter.add(SubType.ISLAND.getPredicate());
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
filter2.add(SeasingerPredicate.instance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -25,6 +25,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class SerendibDjinn extends CardImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("no lands");
|
||||
|
||||
public SerendibDjinn(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
this.subtype.add(SubType.DJINN);
|
||||
|
|
@ -37,7 +39,7 @@ public final class SerendibDjinn extends CardImpl {
|
|||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SerendibDjinnEffect(), TargetController.YOU, false));
|
||||
// When you control no lands, sacrifice Serendib Djinn.
|
||||
this.addAbility(new ControlsPermanentsControllerTriggeredAbility(
|
||||
StaticFilters.FILTER_LANDS, ComparisonType.EQUAL_TO, 0,
|
||||
filter, ComparisonType.EQUAL_TO, 0,
|
||||
new SacrificeSourceEffect()));
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +57,7 @@ class SerendibDjinnEffect extends OneShotEffect {
|
|||
|
||||
public SerendibDjinnEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "sacrifice a Land. If it is an Island {this} deals 3 damage to you";
|
||||
this.staticText = "sacrifice a land. If you sacrifice an Island this way, {this} deals 3 damage to you";
|
||||
}
|
||||
|
||||
private SerendibDjinnEffect(final SerendibDjinnEffect effect) {
|
||||
|
|
@ -71,7 +73,7 @@ class SerendibDjinnEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Target target = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true);
|
||||
Target target = new TargetControlledPermanent(1, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND, true);
|
||||
if (target.canChoose(controller.getId(), source, game)) {
|
||||
controller.choose(Outcome.Sacrifice, target, source, game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue