mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed Dearly Departed
This commit is contained in:
parent
eea1aa3c52
commit
649fb13734
3 changed files with 21 additions and 13 deletions
|
@ -28,7 +28,6 @@
|
||||||
package mage.sets.innistrad;
|
package mage.sets.innistrad;
|
||||||
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Constants;
|
import mage.Constants;
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
|
@ -36,6 +35,7 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
@ -44,6 +44,8 @@ import mage.counters.CounterType;
|
||||||
import mage.filter.Filter;
|
import mage.filter.Filter;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
|
@ -51,6 +53,8 @@ public class DearlyDeparted extends CardImpl<DearlyDeparted> {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent("Human creatures");
|
private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent("Human creatures");
|
||||||
|
|
||||||
|
private static final String ruleText = "As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterHuman.getSubtype().add("Human");
|
filterHuman.getSubtype().add("Human");
|
||||||
filterHuman.setScopeSubtype(Filter.ComparisonScope.Any);
|
filterHuman.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||||
|
@ -68,8 +72,10 @@ public class DearlyDeparted extends CardImpl<DearlyDeparted> {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it.
|
// As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it.
|
||||||
Ability ability0 = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)));
|
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)));
|
||||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.GRAVEYARD, new GainAbilityControlledEffect(ability0, Constants.Duration.OneUse, filterHuman)));
|
ContinuousEffect effect = new GainAbilityControlledEffect(ability, Constants.Duration.WhileInGraveyard, filterHuman);
|
||||||
|
effect.overrideRuleText(ruleText);
|
||||||
|
this.addAbility(new SimpleStaticAbility(Constants.Zone.GRAVEYARD, effect));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DearlyDeparted(final DearlyDeparted card) {
|
public DearlyDeparted(final DearlyDeparted card) {
|
||||||
|
|
|
@ -28,13 +28,14 @@
|
||||||
|
|
||||||
package mage.abilities.effects;
|
package mage.abilities.effects;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import mage.Constants.Duration;
|
import mage.Constants.Duration;
|
||||||
import mage.Constants.Layer;
|
import mage.Constants.Layer;
|
||||||
import mage.Constants.SubLayer;
|
import mage.Constants.SubLayer;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -52,4 +53,5 @@ public interface ContinuousEffect<T extends ContinuousEffect<T>> extends Effect<
|
||||||
public void init(Ability source, Game game);
|
public void init(Ability source, Game game);
|
||||||
public Layer getLayer();
|
public Layer getLayer();
|
||||||
public SubLayer getSublayer();
|
public SubLayer getSublayer();
|
||||||
|
public void overrideRuleText(String text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,20 +28,14 @@
|
||||||
|
|
||||||
package mage.abilities.effects;
|
package mage.abilities.effects;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import mage.Constants.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.Constants.Duration;
|
|
||||||
import mage.Constants.EffectType;
|
|
||||||
import mage.Constants.Layer;
|
|
||||||
import mage.Constants.Outcome;
|
|
||||||
import mage.Constants.SubLayer;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.ActivatedAbility;
|
import mage.abilities.ActivatedAbility;
|
||||||
import mage.abilities.TriggeredAbility;
|
import mage.abilities.TriggeredAbility;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -55,6 +49,7 @@ public abstract class ContinuousEffectImpl<T extends ContinuousEffectImpl<T>> ex
|
||||||
protected boolean used = false;
|
protected boolean used = false;
|
||||||
protected boolean affectedObjectsSet = false;
|
protected boolean affectedObjectsSet = false;
|
||||||
protected List<UUID> objects = new ArrayList<UUID>();
|
protected List<UUID> objects = new ArrayList<UUID>();
|
||||||
|
protected Map<UUID, Integer> metadata = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
public ContinuousEffectImpl(Duration duration, Outcome outcome) {
|
public ContinuousEffectImpl(Duration duration, Outcome outcome) {
|
||||||
super(outcome);
|
super(outcome);
|
||||||
|
@ -157,4 +152,9 @@ public abstract class ContinuousEffectImpl<T extends ContinuousEffectImpl<T>> ex
|
||||||
return sublayer;
|
return sublayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void overrideRuleText(String text) {
|
||||||
|
this.staticText = text;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue