mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Merge branch 'master' into orcish-mine
This commit is contained in:
commit
0f615d49fa
756 changed files with 6843 additions and 1653 deletions
|
|
@ -155,7 +155,7 @@ class AbandonedSarcophagusReplacementEffect extends ReplacementEffectImpl {
|
|||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null
|
||||
&& watcher != null
|
||||
&& card.getOwnerId().equals(controller.getId())) {
|
||||
&& card.isOwnedBy(controller.getId())) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof CyclingAbility) {
|
||||
cardHasCycling = true;
|
||||
|
|
@ -199,7 +199,7 @@ class AbandonedSarcophagusWatcher extends Watcher {
|
|||
Player controller = game.getPlayer(event.getPlayerId());
|
||||
if (card != null
|
||||
&& controller != null
|
||||
&& card.getOwnerId().equals(controller.getId())) {
|
||||
&& card.isOwnedBy(controller.getId())) {
|
||||
Cards c = getCardsCycledThisTurn(event.getPlayerId());
|
||||
c.add(card);
|
||||
cycledCardsThisTurn.put(event.getPlayerId(), c);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class AbbotOfKeralKeepCastFromExileEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.getControllerId().equals(affectedControllerId)
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& objectId.equals(getTargetPointer().getFirst(game, source));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class AcidicSoilEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
int amount = 0;
|
||||
for (Permanent permanent : permanents) {
|
||||
if (permanent.getControllerId().equals(playerId)) {
|
||||
if (permanent.isControlledBy(playerId)) {
|
||||
amount++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public final class AegisOfTheHeavens extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// Target creature gets +1/+7 until end of turn.
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(1, 7, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class AerialCaravanCastFromExileEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.getControllerId().equals(affectedControllerId)
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& objectId.equals(getTargetPointer().getFirst(game, source));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game)
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("damageSource", event.getTargetId());
|
||||
return true;
|
||||
|
|
|
|||
50
Mage.Sets/src/mage/cards/a/AetherflameWall.java
Normal file
50
Mage.Sets/src/mage/cards/a/AetherflameWall.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CanBlockAsThoughtItHadShadowEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class AetherflameWall extends CardImpl {
|
||||
|
||||
public AetherflameWall(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.WALL);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
// Aetherflame Wall can block creatures with shadow as though they didn’t have shadow.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAsThoughtItHadShadowEffect(Duration.WhileOnBattlefield)));
|
||||
|
||||
// {R}: Aetherflame Wall gets +1/+0 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
|
||||
}
|
||||
|
||||
public AetherflameWall(final AetherflameWall card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherflameWall copy() {
|
||||
return new AetherflameWall(this);
|
||||
}
|
||||
}
|
||||
98
Mage.Sets/src/mage/cards/a/Aetherplasm.java
Normal file
98
Mage.Sets/src/mage/cards/a/Aetherplasm.java
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BlocksTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class Aetherplasm extends CardImpl {
|
||||
|
||||
public Aetherplasm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.ILLUSION);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Aetherplasm blocks a creature, you may return Aetherplasm to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature.
|
||||
this.addAbility(new BlocksTriggeredAbility
|
||||
(new DoIfCostPaid(new AetherplasmEffect(), new ReturnToHandFromBattlefieldSourceCost()), false, true));
|
||||
}
|
||||
|
||||
public Aetherplasm(final Aetherplasm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Aetherplasm copy() {
|
||||
return new Aetherplasm(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AetherplasmEffect extends OneShotEffect {
|
||||
|
||||
public AetherplasmEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "you may put a creature card from your hand onto the battlefield blocking that creature";
|
||||
}
|
||||
|
||||
public AetherplasmEffect(AetherplasmEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent blockedCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand onto the battlefield?", source, game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A);
|
||||
if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
if(player.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null)
|
||||
&& game.getCombat() != null && blockedCreature != null){
|
||||
CombatGroup attacker = game.getCombat().findGroup(blockedCreature.getId());
|
||||
Permanent putIntoPlay = game.getPermanent(target.getFirstTarget());
|
||||
if (putIntoPlay != null && putIntoPlay.isCreature() &&attacker != null) {
|
||||
game.getCombat().findGroup(blockedCreature.getId()).addBlocker(putIntoPlay.getId(), source.getControllerId(), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherplasmEffect copy() {
|
||||
return new AetherplasmEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ class AetherspoutsEffect extends OneShotEffect {
|
|||
List<Permanent> permanentsToTop = new ArrayList<>();
|
||||
List<Permanent> permanentsToBottom = new ArrayList<>();
|
||||
for (Permanent permanent:game.getState().getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source.getSourceId(), game)) {
|
||||
if (permanent.getOwnerId().equals(player.getId())) {
|
||||
if (permanent.isOwnedBy(player.getId())) {
|
||||
if (player.chooseUse(outcome, "Put " + permanent.getLogName() + " to the top? (else it goes to bottom)", source, game)) {
|
||||
permanentsToTop.add(permanent);
|
||||
game.informPlayers(permanent.getLogName() + " goes to the top of " + player.getLogName() + "'s library");
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class AjanisLastStandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
if (zEvent.getTarget().getControllerId().equals(controllerId)
|
||||
if (zEvent.getTarget().isControlledBy(controllerId)
|
||||
&& (zEvent.getTarget().isCreature()
|
||||
|| zEvent.getTarget().isPlaneswalker())) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
return permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.controllerId);
|
||||
return permanent != null && permanent.isLand() && permanent.isControlledBy(this.controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null
|
||||
&& permanent.isLand()
|
||||
&& permanent.getControllerId().equals(getControllerId())) {
|
||||
&& permanent.isControlledBy(getControllerId())) {
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
for (Effect effect : getEffects()) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,6 @@ class AladdinsLampEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return source.getControllerId().equals(event.getPlayerId());
|
||||
return source.isControlledBy(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
if (game.getActivePlayerId().equals(event.getPlayerId())
|
||||
if (game.isActivePlayer(event.getPlayerId())
|
||||
&& game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName());
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class AlurenRuleEffect extends ContinuousEffectImpl {
|
|||
|
||||
public AlurenRuleEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Any player may play creature cards with converted mana cost 3 or less without paying their mana cost";
|
||||
staticText = "Any player may cast creature cards with converted mana cost 3 or less without paying their mana cost";
|
||||
}
|
||||
|
||||
public AlurenRuleEffect(final AlurenRuleEffect effect) {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class AmbuscadeShamanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent.getControllerId().equals(this.controllerId)
|
||||
if (permanent.isControlledBy(this.controllerId)
|
||||
&& permanent.isCreature()) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(permanent, game));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class AmuletOfVigorTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent p = game.getPermanent(event.getTargetId());
|
||||
if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) {
|
||||
if (p != null && p.isTapped() && p.isControlledBy(this.controllerId)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class AngelicArbiterCantAttackTargetEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (game.getActivePlayerId().equals(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
|
||||
if (game.isActivePlayer(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
|
||||
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(permanent.getControllerId()) > 0) {
|
||||
return true;
|
||||
|
|
@ -113,7 +113,7 @@ class AngelicArbiterEffect2 extends ContinuousRuleModifyingEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
if (game.isActivePlayer(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
PlayerAttackedWatcher watcher = (PlayerAttackedWatcher) game.getState().getWatchers().get(PlayerAttackedWatcher.class.getSimpleName());
|
||||
if (watcher != null && watcher.getNumberOfAttackersCurrentTurn(event.getPlayerId()) > 0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class AngelicBenedictionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getActivePlayerId().equals(this.controllerId)) {
|
||||
if (game.isActivePlayer(this.controllerId)) {
|
||||
if (game.getCombat().attacksAlone()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature()
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
this.getEffects().get(0).setValue("lifeSource", event.getTargetId());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class AnimarCostReductionEffect extends CostModificationEffectImpl {
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
if (abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
if (abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
|
||||
if (spell != null) {
|
||||
return spell.isCreature();
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class AnimationModuleTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (permanent == null) {
|
||||
permanent = game.getPermanentEntering(event.getTargetId());
|
||||
}
|
||||
return permanent != null && permanent.getControllerId().equals(this.getControllerId());
|
||||
return permanent != null && permanent.isControlledBy(this.getControllerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class ApexOfPowerCastFromExileEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.getControllerId().equals(affectedControllerId)
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& objectId.equals(getTargetPointer().getFirst(game, source));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ConspyEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
// in Library (e.g. for Mystical Teachings)
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.hasSubtype(subType, game)) {
|
||||
if (card.isOwnedBy(controller.getId()) && card.isCreature() && !card.hasSubtype(subType, game)) {
|
||||
game.getState().getCreateCardAttribute(card, game).getSubtype().add(subType);
|
||||
}
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ class ConspyEffect extends ContinuousEffectImpl {
|
|||
for (Iterator<StackObject> iterator = game.getStack().iterator(); iterator.hasNext();) {
|
||||
StackObject stackObject = iterator.next();
|
||||
if (stackObject instanceof Spell
|
||||
&& stackObject.getControllerId().equals(source.getControllerId())
|
||||
&& stackObject.isControlledBy(source.getControllerId())
|
||||
&& stackObject.isCreature()
|
||||
&& !stackObject.hasSubtype(subType, game)) {
|
||||
Card card = ((Spell) stackObject).getCard();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getControllerId().equals(getControllerId())
|
||||
if (permanent.isControlledBy(getControllerId())
|
||||
&& permanent.isCreature()
|
||||
&& (permanent.getId().equals(getSourceId())
|
||||
|| (permanent.getAbilities().contains(FlyingAbility.getInstance())))) {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class ArchonOfValorsReachChoice extends ChoiceImpl {
|
|||
return CardType.INSTANT;
|
||||
case "Sorcery":
|
||||
return CardType.SORCERY;
|
||||
case "Planewswalker":
|
||||
case "Planeswalker":
|
||||
return CardType.PLANESWALKER;
|
||||
default:
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent aura = game.getPermanent(this.getSourceId());
|
||||
return aura != null && aura.getAttachedTo() != null && aura.getAttachedTo().equals(event.getSourceId());
|
||||
return aura != null && aura.isAttachedTo(event.getSourceId());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class AsLuckWouldHaveItTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
|
||||
if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setValue("rolled", event.getAmount());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ enum AshenGhoulCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (!game.getStep().getType().equals(PhaseStep.UPKEEP)
|
||||
|| !game.getActivePlayerId().equals(source.getControllerId())) {
|
||||
if (game.getStep().getType() != PhaseStep.UPKEEP
|
||||
|| !game.isActivePlayer(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
if (controller != null) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class AsmiraHolyAvengerWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (card != null && ((Card) card).getOwnerId().equals(this.controllerId) && card.isCreature()) {
|
||||
if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) {
|
||||
creaturesCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ public final class AssaultSuit extends CardImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SACRIFICE_PERMANENT) {
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
return equipment.getAttachedTo().equals(event.getTargetId());
|
||||
if (equipment != null) {
|
||||
return equipment.isAttachedTo(event.getTargetId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public final class AvariceAmulet extends CardImpl {
|
|||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
||||
// When equipped creature dies, target opponent gains control of Avarice Amulet.
|
||||
// Whenever equipped creature dies, target opponent gains control of Avarice Amulet.
|
||||
ability = new DiesAttachedTriggeredAbility(new AvariceAmuletChangeControlEffect(), "equipped creature", false);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class AzorTheLawbringerCantCastEffect extends ContinuousRuleModifyingEffectImpl
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
UUID opponentId = getTargetPointer().getFirst(game, source);
|
||||
if (game.getActivePlayerId().equals(opponentId)) {
|
||||
if (game.isActivePlayer(opponentId)) {
|
||||
if (playersNextTurn == 0) {
|
||||
playersNextTurn = game.getTurnNum();
|
||||
}
|
||||
|
|
|
|||
57
Mage.Sets/src/mage/cards/a/AzoriusPloy.java
Normal file
57
Mage.Sets/src/mage/cards/a/AzoriusPloy.java
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.AbilityImpl;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.PreventCombatDamageBySourceEffect;
|
||||
import mage.abilities.effects.common.PreventDamageByTargetEffect;
|
||||
import mage.abilities.effects.common.PreventDamageToTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class AzoriusPloy extends CardImpl {
|
||||
|
||||
public AzoriusPloy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}{W}{U}");
|
||||
|
||||
|
||||
// Prevent all combat damage target creature would deal this turn.
|
||||
Effect effect = new PreventDamageByTargetEffect( Duration.EndOfTurn, true);
|
||||
effect.setText("Prevent all combat damage target creature would deal this turn.");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("first creature"));
|
||||
this.getSpellAbility().addTarget(target);
|
||||
|
||||
// Prevent all combat damage that would be dealt to target creature this turn.
|
||||
Effect effect2 = new PreventDamageToTargetEffect(Duration.EndOfTurn, true);
|
||||
effect2.setText("<br></br>Prevent all combat damage that would be dealt to target creature this turn.");
|
||||
effect2.setTargetPointer(SecondTargetPointer.getInstance());
|
||||
this.getSpellAbility().addEffect(effect2);
|
||||
target = new TargetCreaturePermanent(new FilterCreaturePermanent("second creature (can be the same as the first)"));
|
||||
this.getSpellAbility().addTarget(target);
|
||||
|
||||
}
|
||||
|
||||
public AzoriusPloy(final AzoriusPloy card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AzoriusPloy copy() {
|
||||
return new AzoriusPloy(this);
|
||||
}
|
||||
}
|
||||
89
Mage.Sets/src/mage/cards/b/BalduvianFallen.java
Normal file
89
Mage.Sets/src/mage/cards/b/BalduvianFallen.java
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ManaEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class BalduvianFallen extends CardImpl {
|
||||
|
||||
public BalduvianFallen(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Cumulative upkeep {1}
|
||||
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
|
||||
|
||||
// Whenever Balduvian Fallen's cumulative upkeep is paid, it gets +1/+0 until end of turn for each {B} or {R} spent this way.
|
||||
this.addAbility(new BalduvianFallenAbility());
|
||||
}
|
||||
|
||||
public BalduvianFallen(final BalduvianFallen card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BalduvianFallen copy() {
|
||||
return new BalduvianFallen(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BalduvianFallenAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public BalduvianFallenAbility() {
|
||||
super(Zone.BATTLEFIELD, null, false);
|
||||
}
|
||||
|
||||
public BalduvianFallenAbility(final BalduvianFallenAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BalduvianFallenAbility copy() {
|
||||
return new BalduvianFallenAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.PAID_CUMULATIVE_UPKEEP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
this.getEffects().clear();
|
||||
if(event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()) && event instanceof ManaEvent) {
|
||||
ManaEvent manaEvent = (ManaEvent) event;
|
||||
int total = manaEvent.getMana().getBlack() + manaEvent.getMana().getRed();
|
||||
if (total > 0) {
|
||||
this.getEffects().add(new BoostSourceEffect(total, 0, Duration.EndOfTurn));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this}'s cumulative upkeep is paid, it gets +1/+0 until end of turn for each {B} or {R} spent this way";
|
||||
}
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if ((abilityToModify instanceof SpellAbility)
|
||||
&& abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
&& abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
|
||||
return spell != null && StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY.match(spell, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class BattlegraceAngelAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getActivePlayerId().equals(this.controllerId) ) {
|
||||
if (game.isActivePlayer(this.controllerId) ) {
|
||||
if (game.getCombat().attacksAlone()) {
|
||||
for (Effect effect: this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class BidentOfThassaTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.getControllerId().equals(controllerId)) {
|
||||
if (creature != null && creature.isControlledBy(controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect {
|
|||
if (source.getTargets().size() > 1) {
|
||||
toPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
}
|
||||
if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) {
|
||||
if (fromPermanent == null || toPermanent == null || !fromPermanent.isControlledBy(toPermanent.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
int amountCounters = fromPermanent.getCounters(game).getCount(CounterType.P1P1);
|
||||
|
|
@ -114,7 +114,7 @@ class SameControllerPredicate implements ObjectSourcePlayerPredicate<ObjectSourc
|
|||
source.getStackAbility().getTargets().get(0).getTargets().get(0));
|
||||
Permanent inputPermanent = game.getPermanent(input.getObject().getId());
|
||||
if (firstTarget != null && inputPermanent != null) {
|
||||
return firstTarget.getControllerId().equals(inputPermanent.getControllerId());
|
||||
return firstTarget.isControlledBy(inputPermanent.getControllerId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (getControllerId().equals(game.getControllerId(event.getSourceId()))) {
|
||||
if (isControlledBy(game.getControllerId(event.getSourceId()))) {
|
||||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
if (damageSource != null) {
|
||||
if (damageSource.isInstant()|| damageSource.isSorcery()) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class BlindingBeamEffect2 extends ContinuousRuleModifyingEffectImpl {
|
|||
public boolean isInactive(Ability source, Game game) {
|
||||
// the PRE step part is directly after the UNTAP events for permanents
|
||||
if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
|
||||
if (game.getActivePlayerId().equals(targetPlayerId) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) {
|
||||
if (game.isActivePlayer(targetPlayerId) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ class BlindingBeamEffect2 extends ContinuousRuleModifyingEffectImpl {
|
|||
// prevent untap event of creatures of target player
|
||||
if (game.getTurn().getStepType() == PhaseStep.UNTAP) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(targetPlayerId) && filter.match(permanent, game)) {
|
||||
if (permanent != null && permanent.isControlledBy(targetPlayerId) && filter.match(permanent, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class BloodOathEffect extends OneShotEffect {
|
|||
if (player != null && opponent != null && sourceObject != null) {
|
||||
Choice choiceImpl = new ChoiceImpl();
|
||||
choiceImpl.setChoices(choice);
|
||||
if (!player.choose(Outcome.Neutral, choiceImpl, game)) {
|
||||
if (player.choose(Outcome.Neutral, choiceImpl, game)) {
|
||||
CardType type = null;
|
||||
String choosenType = choiceImpl.getChoice();
|
||||
|
||||
|
|
|
|||
|
|
@ -72,12 +72,7 @@ class BloodSunEffect extends ContinuousEffectImpl {
|
|||
for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, player.getId(), source.getSourceId(), game)) {
|
||||
switch (layer) {
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
for (Iterator<Ability> it = permanent.getAbilities().iterator(); it.hasNext();) {
|
||||
Ability ability = it.next();
|
||||
if (!ability.getAbilityType().equals(AbilityType.MANA)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
permanent.getAbilities().removeIf(ability -> ability.getAbilityType() != AbilityType.MANA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class BloodsporeThrinaxEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
return creature != null && creature.isControlledBy(source.getControllerId())
|
||||
&& creature.isCreature()
|
||||
&& !event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class BloodstoneGoblinTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getControllerId().equals(controllerId)) {
|
||||
if (spell != null && spell.isControlledBy(controllerId)) {
|
||||
for (Ability ability : spell.getAbilities()) {
|
||||
if (ability instanceof KickerAbility && ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()) > 0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class DiesWhileInGraveyardTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
for (Zone z : Zone.values()) {
|
||||
if (game.getShortLivingLKI(sourceId, z) && !z.equals(Zone.GRAVEYARD)) {
|
||||
if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class BosskTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.getControllerId())) {
|
||||
if (permanent != null && permanent.isLand() && permanent.isControlledBy(this.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class BottledCloisterReturnEffect extends OneShotEffect {
|
|||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone != null) {
|
||||
for (Card card: exileZone.getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId())) {
|
||||
if (card.isOwnedBy(controller.getId())) {
|
||||
numberOfCards++;
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
card.setFaceDown(false, game);
|
||||
|
|
|
|||
|
|
@ -141,6 +141,6 @@ class DeterminedEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && !spell.getSourceId().equals(source.getSourceId()) && spell.getControllerId().equals(source.getControllerId());
|
||||
return spell != null && !spell.getSourceId().equals(source.getSourceId()) && spell.isControlledBy(source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class BowerPassageEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (attacker != null && attacker.getControllerId().equals(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
if (attacker != null && attacker.isControlledBy(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
return creature != null && creature.isControlledBy(source.getControllerId())
|
||||
&& creature.isCreature()
|
||||
&& creature.hasSubtype(SubType.WARRIOR, game)
|
||||
&& !event.getTargetId().equals(source.getSourceId());
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class BreathOfFuryAbility extends TriggeredAbilityImpl {
|
|||
Permanent enchantment = game.getPermanent(getSourceId());
|
||||
if (damageEvent.isCombatDamage()
|
||||
&& enchantment != null
|
||||
&& enchantment.getAttachedTo().equals(event.getSourceId())) {
|
||||
&& enchantment.isAttachedTo(event.getSourceId())) {
|
||||
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (creature != null) {
|
||||
for (Effect effect : getEffects()) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((DamagedEvent) event).isCombatDamage()) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) {
|
||||
if (creature != null && creature.isControlledBy(getControllerId()) && creature.getCounters(game).getCount(CounterType.P1P1) > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import mage.constants.SubType;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetSpell;
|
||||
|
|
@ -30,7 +32,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public final class BrineShaman extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("noncreature spell");
|
||||
private static final FilterSpell filter = new FilterSpell("creature spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
|
|
@ -54,7 +56,7 @@ public final class BrineShaman extends CardImpl {
|
|||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(),
|
||||
new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||
ability.addCost(new ManaCostsImpl("{1}{U}{U}"));
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
ability.addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_CREATURE));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class BroodingSaurianControlEffect extends ContinuousEffectImpl {
|
|||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent creature = it.next().getPermanent(game);
|
||||
if (creature != null) {
|
||||
if (!creature.getControllerId().equals(creature.getOwnerId())) {
|
||||
if (!creature.isControlledBy(creature.getOwnerId())) {
|
||||
creature.changeControllerId(creature.getOwnerId(), game);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class BrutalHordechiefTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent source = game.getPermanent(event.getSourceId());
|
||||
if (source != null && source.getControllerId().equals(controllerId)) {
|
||||
if (source != null && source.isControlledBy(controllerId)) {
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game);
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class BuildersBaneEffect extends OneShotEffect {
|
|||
if (permanent.destroy(source.getSourceId(), game, false)) {
|
||||
game.applyEffects();
|
||||
if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId())
|
||||
&& !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
|
||||
&& game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) {
|
||||
// A replacement effect has moved the card to another zone as grvayard
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class BurnAwayDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.isDiesEvent() && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
|
||||
this.getTargets().clear(); // else spell fizzels because target creature died
|
||||
this.getTargets().clear(); // else spell fizzles because target creature died
|
||||
Target target = new TargetPlayer();
|
||||
target.add(zEvent.getTarget().getControllerId(), game);
|
||||
this.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -18,40 +18,41 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*
|
||||
* @author ayratn
|
||||
*/
|
||||
public final class BurntheImpure extends CardImpl {
|
||||
public final class BurnTheImpure extends CardImpl {
|
||||
|
||||
public BurntheImpure(UUID ownerId, CardSetInfo setInfo) {
|
||||
public BurnTheImpure(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}");
|
||||
|
||||
// Burn the Impure deals 3 damage to target creature. If that creature has infect, Burn the Impure deals 3 damage to that creature’s controller.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new BurntheImpureEffect());
|
||||
this.getSpellAbility().addEffect(new BurnTheImpureEffect());
|
||||
}
|
||||
|
||||
public BurntheImpure(final BurntheImpure card) {
|
||||
public BurnTheImpure(final BurnTheImpure card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BurntheImpure copy() {
|
||||
return new BurntheImpure(this);
|
||||
public BurnTheImpure copy() {
|
||||
return new BurnTheImpure(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class BurntheImpureEffect extends OneShotEffect {
|
||||
class BurnTheImpureEffect extends OneShotEffect {
|
||||
|
||||
public BurntheImpureEffect() {
|
||||
public BurnTheImpureEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "{this} deals 3 damage to target creature. If that creature has infect, {this} deals 3 damage to that creature's controller.";
|
||||
}
|
||||
|
||||
public BurntheImpureEffect(final BurntheImpureEffect effect) {
|
||||
public BurnTheImpureEffect(final BurnTheImpureEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BurntheImpureEffect copy() {
|
||||
return new BurntheImpureEffect(this);
|
||||
public BurnTheImpureEffect copy() {
|
||||
return new BurnTheImpureEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -28,9 +27,9 @@ public final class CabalCoffers extends CardImpl {
|
|||
}
|
||||
|
||||
public CabalCoffers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// {2}, {tap}: Add {B} for each Swamp you control.
|
||||
// {2}, {T}: Add {B} for each Swamp you control.
|
||||
Ability ability = new DynamicManaAbility(Mana.BlackMana(1), new PermanentsOnBattlefieldCount(filter), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class CallerOfTheClawWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
Permanent card = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (card != null && card.getOwnerId().equals(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) {
|
||||
if (card != null && card.isOwnedBy(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) {
|
||||
creaturesCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class CampaignOfVengeanceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent source = game.getPermanent(event.getSourceId());
|
||||
if (source != null && source.getControllerId().equals(controllerId)) {
|
||||
if (source != null && source.isControlledBy(controllerId)) {
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game);
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class GainReboundEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
for (Iterator<StackObject> iterator = game.getStack().iterator(); iterator.hasNext();) {
|
||||
StackObject stackObject = iterator.next();
|
||||
if (stackObject instanceof Spell && stackObject.getControllerId().equals(source.getControllerId())) {
|
||||
if (stackObject instanceof Spell && stackObject.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = (Spell) stackObject;
|
||||
Card card = spell.getCard();
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class CatalystStoneCostReductionEffect extends CostModificationEffectImpl {
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
if (abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
if (abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
return SpellAbilityCastMode.FLASHBACK.equals(((SpellAbility) abilityToModify).getSpellAbilityCastMode());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,13 +122,13 @@ class CelestialDawnToWhiteEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
// Stack
|
||||
for (MageObject object : game.getStack()) {
|
||||
if (object instanceof Spell && ((Spell) object).getControllerId().equals(controller.getId())) {
|
||||
if (object instanceof Spell && ((Spell) object).isControlledBy(controller.getId())) {
|
||||
setColor(object.getColor(game), game);
|
||||
}
|
||||
}
|
||||
// Exile
|
||||
for (Card card : game.getExile().getAllCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId())) {
|
||||
if (card.isOwnedBy(controller.getId())) {
|
||||
setColor(card.getColor(game), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class ChainsOfMephistophelesReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||
if (game.isActivePlayer(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName());
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class ChampionOfLambholtEffect extends RestrictionEffect {
|
|||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null && attacker.getControllerId().equals(sourcePermanent.getControllerId())) {
|
||||
if (sourcePermanent != null && attacker.isControlledBy(sourcePermanent.getControllerId())) {
|
||||
return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue();
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class ChanceEncounterTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return this.getControllerId().equals(event.getPlayerId()) && event.getFlag();
|
||||
return this.isControlledBy(event.getPlayerId()) && event.getFlag();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class ChancellorOfTheTangleDelayedTriggeredAbility extends DelayedTriggeredAbili
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return game.getActivePlayerId().equals(controllerId);
|
||||
return game.isActivePlayer(controllerId);
|
||||
}
|
||||
@Override
|
||||
public ChancellorOfTheTangleDelayedTriggeredAbility copy() {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class ChandraPyromasterTarget extends TargetPermanent {
|
|||
}
|
||||
UUID firstTarget = player.getId();
|
||||
Permanent permanent = game.getPermanent(id);
|
||||
if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) {
|
||||
if (firstTarget != null && permanent != null && permanent.isControlledBy(firstTarget)) {
|
||||
return super.canTarget(id, source, game);
|
||||
}
|
||||
return false;
|
||||
|
|
@ -142,7 +142,7 @@ class ChandraPyromasterTarget extends TargetPermanent {
|
|||
if (player != null) {
|
||||
for (UUID targetId : availablePossibleTargets) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null && permanent.getControllerId().equals(player.getId())) {
|
||||
if (permanent != null && permanent.isControlledBy(player.getId())) {
|
||||
possibleTargets.add(targetId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ class ChannelHarmEffect extends PreventionEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game)) {
|
||||
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
||||
if ((targetPermanent != null && targetPermanent.getControllerId().equals(source.getControllerId()))
|
||||
if ((targetPermanent != null && targetPermanent.isControlledBy(source.getControllerId()))
|
||||
|| event.getTargetId().equals(source.getControllerId())) {
|
||||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
if (damageSource instanceof Controllable) {
|
||||
return !((Controllable) damageSource).getControllerId().equals(source.getControllerId());
|
||||
return !((Controllable) damageSource).isControlledBy(source.getControllerId());
|
||||
}
|
||||
else if (damageSource instanceof Card) {
|
||||
return !((Card) damageSource).getOwnerId().equals(source.getControllerId());
|
||||
return !((Card) damageSource).isOwnedBy(source.getControllerId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,14 +82,16 @@ class ChaosWandEffect extends OneShotEffect {
|
|||
break;
|
||||
}
|
||||
opponent.moveCards(card, Zone.EXILED, source, game);
|
||||
controller.revealCards(source, new CardsImpl(card), game);
|
||||
if (card.isInstant() || card.isSorcery()) {
|
||||
if (!controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game)
|
||||
|| !controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
||||
cardsToShuffle.add(card);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
cardsToShuffle.add(card);
|
||||
}
|
||||
cardsToShuffle.add(card);
|
||||
}
|
||||
return opponent.putCardsOnBottomOfLibrary(cardsToShuffle, game, source, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ChickenALaKingTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
|
||||
if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) {
|
||||
// event.getData holds the num of sides of the die to roll
|
||||
String data = event.getData();
|
||||
if (data != null) {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class ChitteringDoomTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
|
||||
if (this.isControlledBy(event.getPlayerId()) && event.getFlag()) {
|
||||
if (event.getAmount() >= 4) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,10 +72,9 @@ class ChronicFloodingAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent source = game.getPermanent(this.sourceId);
|
||||
if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
|
||||
if (source != null && source.isAttachedTo(event.getTargetId())) {
|
||||
Permanent attached = game.getPermanent(source.getAttachedTo());
|
||||
if (attached != null) {
|
||||
|
||||
for (Effect e : getEffects()) {
|
||||
e.setTargetPointer(new FixedTarget(attached.getControllerId()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class CinderCloudEffect extends OneShotEffect {
|
|||
if (permanent != null && permanent.destroy(source.getSourceId(), game, false) && permanent.getColor(game).equals(ObjectColor.WHITE)) {
|
||||
game.applyEffects();
|
||||
if (permanent.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(permanent.getId())
|
||||
&& !game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
|
||||
&& game.getState().getZone(permanent.getId()) != Zone.GRAVEYARD) {
|
||||
// A replacement effect has moved the card to another zone as grvayard
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
youOrYourPlaneswalker = permanent != null
|
||||
&& permanent.isPlaneswalker()
|
||||
&& permanent.getControllerId().equals(this.getControllerId());
|
||||
&& permanent.isControlledBy(this.getControllerId());
|
||||
}
|
||||
if (youOrYourPlaneswalker) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CityOfSolitudeEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return !game.getActivePlayerId().equals(event.getPlayerId());
|
||||
return !game.isActivePlayer(event.getPlayerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return land.isLand()
|
||||
&& land.getControllerId().equals(this.controllerId)
|
||||
&& land.isControlledBy(this.controllerId)
|
||||
&& !Objects.equals(event.getTargetId(), this.getSourceId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class CleansingMeditationEffect extends OneShotEffect {
|
|||
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (permanent != null && permanent.destroy(source.getSourceId(), game, false)) {
|
||||
if (threshold && controller != null && permanent.getOwnerId().equals(controller.getId())) {
|
||||
if (threshold && controller != null && permanent.isOwnedBy(controller.getId())) {
|
||||
cardsToBattlefield.add(permanent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class CloudCoverAbility extends TriggeredAbilityImpl {
|
|||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Player controller = game.getPlayer(this.getControllerId());
|
||||
if (permanent != null
|
||||
&& permanent.getControllerId().equals(getControllerId())
|
||||
&& permanent.isControlledBy(getControllerId())
|
||||
&& !permanent.getId().equals(this.getSourceId())
|
||||
&& controller != null
|
||||
&& controller.hasOpponent(event.getPlayerId(), game)) {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class CloudKeyCostModificationEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
if (abilityToModify instanceof SpellAbility && abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
Spell spell = game.getStack().getSpell(abilityToModify.getSourceId());
|
||||
if (spell != null && spell.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class CoastalPiracyTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (((DamagedPlayerEvent) event).isCombatDamage()
|
||||
&& game.getOpponents(this.controllerId).contains(((DamagedPlayerEvent) event).getPlayerId())) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.getControllerId().equals(controllerId)) {
|
||||
if (creature != null && creature.isControlledBy(controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class ComeuppanceEffect extends PreventionEffectImpl {
|
|||
MageObject damageDealingObject = game.getObject(event.getSourceId());
|
||||
UUID objectControllerId = null;
|
||||
if (damageDealingObject instanceof Permanent) {
|
||||
if (((Permanent) damageDealingObject).isCreature()) {
|
||||
if (damageDealingObject.isCreature()) {
|
||||
((Permanent) damageDealingObject).damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
objectControllerId = ((Permanent) damageDealingObject).getControllerId();
|
||||
|
|
@ -102,7 +102,7 @@ class ComeuppanceEffect extends PreventionEffectImpl {
|
|||
} else {
|
||||
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
||||
if (targetPermanent != null &&
|
||||
targetPermanent.getControllerId().equals(source.getControllerId()) &&
|
||||
targetPermanent.isControlledBy(source.getControllerId()) &&
|
||||
targetPermanent.isPlaneswalker()) {
|
||||
catched = true;
|
||||
}
|
||||
|
|
@ -110,11 +110,11 @@ class ComeuppanceEffect extends PreventionEffectImpl {
|
|||
if (catched) {
|
||||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
if (damageSource instanceof StackObject) {
|
||||
return !((StackObject) damageSource).getControllerId().equals(source.getControllerId());
|
||||
return !((StackObject) damageSource).isControlledBy(source.getControllerId());
|
||||
} else if (damageSource instanceof Permanent) {
|
||||
return !((Permanent) damageSource).getControllerId().equals(source.getControllerId());
|
||||
return !((Permanent) damageSource).isControlledBy(source.getControllerId());
|
||||
} else if (damageSource instanceof Card) {
|
||||
return !((Card) damageSource).getOwnerId().equals(source.getControllerId());
|
||||
return !((Card) damageSource).isOwnedBy(source.getControllerId());
|
||||
}
|
||||
Logger.getLogger(Comeuppance.class).error("Comeuppance: could not define source objects controller - " + (damageSource != null ? damageSource.getName(): "null"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
|
|||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
|
||||
if (game.getActivePlayerId().equals(source.getControllerId())) {
|
||||
if (game.isActivePlayer(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.getControllerId().equals(affectedControllerId)
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& getTargetPointer().getTargets(game, source).contains(sourceId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ConcussiveBoltRestrictionEffect extends RestrictionEffect {
|
|||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (metalcraft && permanent.getControllerId().equals(player.getId())) {
|
||||
if (metalcraft && permanent.isControlledBy(player.getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
85
Mage.Sets/src/mage/cards/c/ConjurersBan.java
Normal file
85
Mage.Sets/src/mage/cards/c/ConjurersBan.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class ConjurersBan extends CardImpl {
|
||||
|
||||
public ConjurersBan(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{B}");
|
||||
|
||||
|
||||
// Choose a card name. Until your next turn, spells with the chosen name can’t be cast and lands with the chosen name can’t be played.
|
||||
this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL));
|
||||
this.getSpellAbility().addEffect(new ConjurersBanEffect());
|
||||
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
|
||||
}
|
||||
|
||||
public ConjurersBan(final ConjurersBan card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConjurersBan copy() {
|
||||
return new ConjurersBan(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ConjurersBanEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
public ConjurersBanEffect() {
|
||||
super(Duration.UntilYourNextTurn, Outcome.Detriment, true, false);
|
||||
this.staticText = "spells with the chosen name can't be cast and lands with the chosen name can't be played";
|
||||
}
|
||||
|
||||
public ConjurersBanEffect(final ConjurersBanEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConjurersBanEffect copy() {
|
||||
return new ConjurersBanEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL || event.getType() == GameEvent.EventType.PLAY_LAND) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
return object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
String namedCard = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||
String playerName = game.getPlayer(source.getControllerId()).getName();
|
||||
if (namedCard == null || playerName == null || source.getSourceObject(game) == null){
|
||||
return super.getInfoMessage(source, event, game);
|
||||
}
|
||||
return "Until "+playerName+"'s next turn, spells named "+namedCard+" can't be cast and lands named "+namedCard+" can't be played ("+source.getSourceObject(game).getIdName()+").";
|
||||
}
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ class ConquerorsFlailEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
}
|
||||
}
|
||||
|
||||
if (isAttached && game.getActivePlayerId().equals(source.getControllerId())
|
||||
if (isAttached && game.isActivePlayer(source.getControllerId())
|
||||
&& game.getPlayer(source.getControllerId()).hasOpponent(event.getPlayerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,13 +85,13 @@ class ConspiracyEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
// in Exile
|
||||
for (Card card : game.getState().getExile().getAllCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) {
|
||||
if (card.isOwnedBy(controller.getId()) && card.isCreature()) {
|
||||
setCreatureSubtype(card, subType, game);
|
||||
}
|
||||
}
|
||||
// in Library (e.g. for Mystical Teachings)
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) {
|
||||
if (card.isOwnedBy(controller.getId()) && card.isCreature()) {
|
||||
setCreatureSubtype(card, subType, game);
|
||||
}
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
|
|||
for (Iterator<StackObject> iterator = game.getStack().iterator(); iterator.hasNext();) {
|
||||
StackObject stackObject = iterator.next();
|
||||
if (stackObject instanceof Spell
|
||||
&& stackObject.getControllerId().equals(source.getControllerId())
|
||||
&& stackObject.isControlledBy(source.getControllerId())
|
||||
&& stackObject.isCreature()) {
|
||||
Card card = ((Spell) stackObject).getCard();
|
||||
setCreatureSubtype(card, subType, game);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl {
|
|||
if (permanent == null) {
|
||||
permanent = game.getPermanentEntering(event.getTargetId());
|
||||
}
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())
|
||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())
|
||||
&& permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,8 +175,8 @@ class CorrosiveOozeCombatWatcher extends Watcher {
|
|||
}
|
||||
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) {
|
||||
if (game.getTurn() != null && TurnPhase.COMBAT.equals(game.getTurn().getPhaseType())) {
|
||||
if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
|
||||
if (game.getTurn() != null && TurnPhase.COMBAT == game.getTurn().getPhaseType()) {
|
||||
// Check if a previous blocked or blocked by creatures is leaving the battlefield
|
||||
for (Map.Entry<MageObjectReference, HashSet<MageObjectReference>> entry : oozeBlocksOrBlocked.entrySet()) {
|
||||
for (MageObjectReference mor : entry.getValue()) {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if ((abilityToModify instanceof SpellAbility)
|
||||
&& abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
&& abilityToModify.isControlledBy(source.getControllerId())) {
|
||||
Card card = game.getCard(abilityToModify.getSourceId());
|
||||
return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -28,7 +27,7 @@ import mage.target.common.TargetNonlandPermanent;
|
|||
public final class CouncilsJudgment extends CardImpl {
|
||||
|
||||
public CouncilsJudgment(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");
|
||||
|
||||
// Will of the council - Starting with you, each player votes for a nonland permanent you don't control. Exile each permanent with the most votes or tied for most votes.
|
||||
this.getSpellAbility().addEffect(new CouncilsJudgmentEffect());
|
||||
|
|
@ -89,7 +88,7 @@ class CouncilsJudgmentEffect extends OneShotEffect {
|
|||
}
|
||||
chosenCards.put(permanent, 1);
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " has chosen: " + permanent.getName());
|
||||
game.informPlayers(player.getLogName() + " has chosen: " + permanent.getLogName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class CounterfluxEffect extends OneShotEffect {
|
|||
|
||||
List<Spell> spellsToCounter = new LinkedList<>();
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
if (stackObject instanceof Spell && !stackObject.getControllerId().equals(source.getControllerId())) {
|
||||
if (stackObject instanceof Spell && !stackObject.isControlledBy(source.getControllerId())) {
|
||||
spellsToCounter.add((Spell) stackObject);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
102
Mage.Sets/src/mage/cards/c/CoverOfWinter.java
Normal file
102
Mage.Sets/src/mage/cards/c/CoverOfWinter.java
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.PreventionEffectData;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SuperType;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class CoverOfWinter extends CardImpl {
|
||||
|
||||
public CoverOfWinter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
this.addSuperType(SuperType.SNOW);
|
||||
|
||||
// Cumulative upkeep {S}
|
||||
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{S}")));
|
||||
|
||||
// If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on Cover of Winter.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CoverOfWinterEffect()));
|
||||
|
||||
// {S}: Put an age counter on Cover of Winter.
|
||||
this.addAbility(new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.AGE.createInstance()), new ManaCostsImpl("{S}")));
|
||||
}
|
||||
|
||||
public CoverOfWinter(final CoverOfWinter card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoverOfWinter copy() {
|
||||
return new CoverOfWinter(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CoverOfWinterEffect extends PreventionEffectImpl {
|
||||
|
||||
public CoverOfWinterEffect() {
|
||||
super(Duration.WhileOnBattlefield, -1, true);
|
||||
this.staticText = "If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on {this}";
|
||||
}
|
||||
|
||||
public CoverOfWinterEffect(CoverOfWinterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER || event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PreventionEffectData preventDamageAction(GameEvent event, Ability source, Game game) {
|
||||
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (sourcePermanent != null) {
|
||||
return game.preventDamage(event, source, game, sourcePermanent.getCounters(game).getCount(CounterType.AGE));
|
||||
} else {
|
||||
this.discard();
|
||||
return game.preventDamage(event, source, game, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||
&& event.getTargetId().equals(source.getControllerId())) {
|
||||
return super.applies(event, source, game);
|
||||
}
|
||||
|
||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
|
||||
return super.applies(event, source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoverOfWinterEffect copy() {
|
||||
return new CoverOfWinterEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ class CowedByWisdomayCostToAttackBlockEffect extends PayCostToAttackBlockEffectI
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
return enchantment != null && enchantment.getAttachedTo().equals(event.getSourceId());
|
||||
return enchantment != null && enchantment.isAttachedTo(event.getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Set<CardType> cardType = card.getCardType();
|
||||
|
||||
if (cardOwnerId != null
|
||||
&& card.getOwnerId().equals(getControllerId())
|
||||
&& card.isOwnedBy(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.isLand()) {
|
||||
game.getState().setValue("usedOnTurn" + getControllerId() + getOriginalId(), game.getTurnNum());
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class CruelRealityTriggeredAbiilty extends TriggeredAbilityImpl {
|
|||
&& enchantment.getAttachedTo() != null) {
|
||||
Player cursedPlayer = game.getPlayer(enchantment.getAttachedTo());
|
||||
if (cursedPlayer != null
|
||||
&& game.getActivePlayerId().equals(cursedPlayer.getId())) {
|
||||
&& game.isActivePlayer(cursedPlayer.getId())) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(cursedPlayer.getId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
|
|
@ -16,14 +15,15 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.TargetPlayer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public final class CurseOfBloodletting extends CardImpl {
|
||||
|
||||
public CurseOfBloodletting(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||
|
||||
|
||||
|
|
@ -71,10 +71,9 @@ class CurseOfBloodlettingEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment != null &&
|
||||
enchantment.getAttachedTo() != null &&
|
||||
event.getTargetId().equals(enchantment.getAttachedTo())) {
|
||||
return true;
|
||||
if (enchantment != null &&
|
||||
enchantment.isAttachedTo(event.getTargetId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
Player player = game.getPlayer(enchantment.getAttachedTo());
|
||||
if (player != null && spell.getControllerId().equals(player.getId())) {
|
||||
if (player != null && spell.isControlledBy(player.getId())) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue