mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
* Finished to change ReplacementEffects for UNTAP event to ContinuousRuleModifyingEffect.
This commit is contained in:
parent
ea1a098300
commit
1f51d243ec
74 changed files with 309 additions and 244 deletions
|
|
@ -147,7 +147,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast a card with that name (" + mageObject.getLogName() + " in play).";
|
||||
|
|
@ -156,7 +156,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class CavernOfSoulsCantCounterEffect extends ContinuousRuleModifiyingEffectImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return "This spell can't be countered because a colored mana from " + sourceObject.getName() + " was spent to cast it.";
|
||||
|
|
@ -240,7 +240,7 @@ class CavernOfSoulsCantCounterEffect extends ContinuousRuleModifiyingEffectImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.COUNTER) {
|
||||
CavernOfSoulsWatcher watcher = (CavernOfSoulsWatcher) game.getState().getWatchers().get("ManaPaidFromCavernOfSoulsWatcher");
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifiyingEff
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return "This spell can't be countered by spells or abilities (" + sourceObject.getName() + ").";
|
||||
|
|
@ -159,7 +159,7 @@ class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifiyingEff
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.COUNTER) {
|
||||
BoseijuWhoSheltersAllWatcher watcher = (BoseijuWhoSheltersAllWatcher) game.getState().getWatchers().get("ManaPaidFromBoseijuWhoSheltersAllWatcher");
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class DosanTheFallingLeafEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CAST_SPELL && !game.getActivePlayerId().equals(event.getPlayerId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class BasandraBattleSeraphEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& game.getPhase().getType() == TurnPhase.COMBAT) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class IllusionistsGambitEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
|
||||
if (game.getTurn().getStepType().equals(PhaseStep.DECLARE_BLOCKERS)) {
|
||||
return !game.getOpponents(source.getControllerId()).contains(game.getActivePlayerId());
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class BanefireCantCounterEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.COUNTER) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class CurseOfExhaustionEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
|
|
|
|||
|
|
@ -27,29 +27,32 @@
|
|||
*/
|
||||
package mage.sets.darkascension;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.*;
|
||||
import mage.constants.Zone;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
|
@ -93,10 +96,10 @@ public class DungeonGeists extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class DungeonGeistsEffect extends ReplacementEffectImpl {
|
||||
class DungeonGeistsEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||
|
||||
public DungeonGeistsEffect() {
|
||||
super(Duration.OneUse, Outcome.Detriment);
|
||||
super(Duration.Custom, Outcome.Detriment, false, false);
|
||||
this.staticText = "That creature doesn't untap during its controller's untap step for as long as you control {this}";
|
||||
}
|
||||
|
||||
|
|
@ -114,11 +117,6 @@ class DungeonGeistsEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
|
|
@ -131,19 +129,18 @@ class DungeonGeistsEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) {
|
||||
if (event.getTargetId().equals(targetPointer.getFirst(game, source))) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class GrafdiggersCageEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifiyingEffe
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast a card with that name (" + mageObject.getLogName() + " in play).";
|
||||
|
|
@ -167,7 +167,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifiyingEffe
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class RenderSilentEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast spells this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -147,7 +147,7 @@ class RenderSilentEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL ) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MoonholdEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't play land cards this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -113,7 +113,7 @@ class MoonholdEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.PLAY_LAND
|
||||
&& event.getPlayerId().equals(source.getFirstTarget())) {
|
||||
return true;
|
||||
|
|
@ -143,7 +143,7 @@ class MoonholdEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't play creature cards this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -152,7 +152,7 @@ class MoonholdEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& event.getPlayerId().equals(source.getFirstTarget())) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class TalarasBattalionEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& event.getSourceId().equals(source.getSourceId())) {
|
||||
CastGreenSpellThisTurnCondition condition = new CastGreenSpellThisTurnCondition();
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class WardOfBonesEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't play the land or cast the spell (" + mageObject.getLogName() + " in play).";
|
||||
|
|
@ -104,7 +104,7 @@ class WardOfBonesEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.PLAY_LAND
|
||||
|| event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")";
|
||||
|
|
@ -179,7 +179,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL ) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class NevermoreEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class SpinalEmbraceEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
|
||||
return !game.getTurn().getPhaseType().equals(TurnPhase.COMBAT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class GodsendRuleModifyingEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast this spell because a card with the same name is exiled by " + mageObject.getLogName() + ".";
|
||||
|
|
@ -231,7 +231,7 @@ class GodsendRuleModifyingEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null) {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class ResetReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
|
||||
if (game.getTurn().getStepType().equals(PhaseStep.UNTAP)
|
||||
|| game.getTurn().getStepType().equals(PhaseStep.UPKEEP)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class BerserkReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
|
||||
CombatDamageStepStartedWatcher watcher = (CombatDamageStepStartedWatcher) game.getState().getWatchers().get("CombatDamageStepStarted");
|
||||
return watcher == null || watcher.conditionMet();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class GaddockTeegReplacementEffect4 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && !card.getCardType().contains(CardType.CREATURE) && card.getManaCost().convertedManaCost() >= 4) {
|
||||
|
|
@ -132,7 +132,7 @@ class GaddockTeegReplacementEffectX extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && !card.getCardType().contains(CardType.CREATURE) && card.getManaCost().getText().contains("X")) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class SilenceEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast spells this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -95,7 +95,7 @@ class SilenceEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ class AngelicArbiterEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
Watcher watcher = game.getState().getWatchers().get("OpponentAttacked", source.getControllerId());
|
||||
if (watcher != null && watcher.conditionMet()) {
|
||||
|
|
|
|||
|
|
@ -58,8 +58,11 @@ public class FrostTitan extends CardImpl {
|
|||
this.color.setBlue(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
|
||||
// Whenever Frost Titan becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays 2.
|
||||
this.addAbility(new FrostTitanAbility1());
|
||||
|
||||
// Whenever Frost Titan enters the battlefield or attacks, tap target permanent. It doesn't untap during its controller's next untap step.
|
||||
this.addAbility(new FrostTitanAbility2());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class GrandAbolisherEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (activePlayer != null && mageObject != null) {
|
||||
|
|
@ -106,7 +106,7 @@ class GrandAbolisherEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
boolean spell = event.getType() == GameEvent.EventType.CAST_SPELL;
|
||||
boolean activated = event.getType() == GameEvent.EventType.ACTIVATE_ABILITY;
|
||||
if ((spell || activated) && game.getActivePlayerId().equals(source.getControllerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class GroundSealEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.TARGET) {
|
||||
Card targetCard = game.getCard(event.getTargetId());
|
||||
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
return sourcePermanent.getLogName() + " can't be the target of black or red spells opponents control";
|
||||
|
|
@ -115,7 +115,7 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.TARGET) {
|
||||
Card targetCard = game.getCard(event.getTargetId());
|
||||
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class SavageSummoningCantCounterEffect extends ContinuousRuleModifiyingEffectImp
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return "This creature spell can't be countered (" + sourceObject.getName() + ").";
|
||||
|
|
@ -266,7 +266,7 @@ class SavageSummoningCantCounterEffect extends ContinuousRuleModifiyingEffectImp
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.COUNTER) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && watcher.isSpellCastWithThisSavageSummoning(spell.getId(), source.getSourceId(), zoneChangeCounter)) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -98,10 +98,10 @@ public class TidebinderMage extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class TidebinderMageEffect extends ReplacementEffectImpl {
|
||||
class TidebinderMageEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||
|
||||
public TidebinderMageEffect() {
|
||||
super(Duration.OneUse, Outcome.Detriment);
|
||||
super(Duration.OneUse, Outcome.Detriment, false, false);
|
||||
this.staticText = "That creature doesn't untap during its controller's untap step for as long as you control {this}";
|
||||
}
|
||||
|
||||
|
|
@ -119,11 +119,6 @@ class TidebinderMageEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
|
|
@ -131,19 +126,19 @@ class TidebinderMageEffect extends ReplacementEffectImpl {
|
|||
// event will happen before this effect is applied ever)
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class AggressiveMiningEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getType().equals(GameEvent.EventType.PLAY_LAND) && event.getPlayerId().equals(source.getControllerId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class PhyrexianRevokerEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't activate sources with that name (" + mageObject.getLogName() + " in play).";
|
||||
|
|
@ -154,7 +154,7 @@ class PhyrexianRevokerEffect2 extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode ,Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.ACTIVATE_ABILITY) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifiyingEffectImp
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
|
|||
|
||||
private int turn;
|
||||
private boolean applies;
|
||||
private static final HashSet<String> choice = new HashSet<String>();
|
||||
private static final HashSet<String> choice = new HashSet<>();
|
||||
static{
|
||||
choice.add(CardType.ARTIFACT.toString());
|
||||
choice.add(CardType.CREATURE.toString());
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class CeaseFireEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast creature spells this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -111,7 +111,7 @@ class CeaseFireEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getPlayerId().equals(source.getFirstTarget())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (filter.match((Spell) object, game)) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PardicMinerEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't play lands this turn (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -107,7 +107,7 @@ class PardicMinerEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.PLAY_LAND && event.getPlayerId().equals(source.getFirstTarget())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifiyingEffect
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast a card with that name (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -155,7 +155,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifiyingEffect
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class IllusoryAngelEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) {
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
|
||||
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) == 0) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class OrimsChantCantCastEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL ) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class RakdosLordOfRiotsCantCastEffect extends ContinuousRuleModifiyingEffectImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) {
|
||||
if (new OpponentsLostLifeCount().calculate(game, source) == 0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -105,11 +105,13 @@ public class VraskaTheUnseen extends CardImpl {
|
|||
class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl {
|
||||
|
||||
protected Ability ability;
|
||||
protected int startingTurn;
|
||||
|
||||
public VraskaTheUnseenGainAbilityEffect(Ability ability) {
|
||||
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
this.ability = ability;
|
||||
staticText = "Until your next turn, whenever a creature deals combat damage to {this}, destroy that creature";
|
||||
startingTurn = 0;
|
||||
}
|
||||
|
||||
public VraskaTheUnseenGainAbilityEffect(final VraskaTheUnseenGainAbilityEffect effect) {
|
||||
|
|
@ -117,6 +119,12 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl {
|
|||
this.ability = effect.ability.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game); //To change body of generated methods, choose Tools | Templates.
|
||||
startingTurn = game.getTurnNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VraskaTheUnseenGainAbilityEffect copy() {
|
||||
return new VraskaTheUnseenGainAbilityEffect(this);
|
||||
|
|
@ -134,7 +142,7 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE)
|
||||
if (startingTurn != 0 && game.getTurnNum() != startingTurn)
|
||||
{
|
||||
if (game.getActivePlayerId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
|
|
@ -187,7 +195,7 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Until your next turn, whenever a creature deals combat damage to Vraska the Unseen, destroy that creature";
|
||||
return "Until your next turn, whenever a creature deals combat damage to {this}, destroy that creature";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ class XantidSwarmReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL ) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class VexingShusherCantCounterTargetEffect extends ContinuousRuleModifiyingEffec
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return "This spell can't be countered by spells or abilities (" + sourceObject.getName() + ").";
|
||||
|
|
@ -113,7 +113,7 @@ class VexingShusherCantCounterTargetEffect extends ContinuousRuleModifiyingEffec
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getType() == EventType.COUNTER && event.getTargetId().equals(targetPointer.getFirst(game, source));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import mage.target.common.TargetCreatureOrPlayer;
|
|||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class AjaniVengeant extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("lands");
|
||||
|
||||
static {
|
||||
|
|
@ -66,11 +67,12 @@ public class AjaniVengeant extends CardImpl {
|
|||
this.color.setWhite(true);
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
|
||||
|
||||
// +1: Target permanent doesn't untap during its controller's next untap step.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new SkipNextUntapTargetEffect(), 1);
|
||||
ability1.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability1);
|
||||
|
||||
// −2: Ajani Vengeant deals 3 damage to target creature or player and you gain 3 life.
|
||||
Effects effects1 = new Effects();
|
||||
effects1.add(new DamageTargetEffect(3));
|
||||
effects1.add(new GainLifeEffect(3));
|
||||
|
|
@ -78,6 +80,7 @@ public class AjaniVengeant extends CardImpl {
|
|||
ability2.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability2);
|
||||
|
||||
// −7: Destroy all lands target player controls.
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new DestroyAllControlledTargetEffect(filter), -7);
|
||||
ability3.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability3);
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class EtherswornCanonistReplacementEffect extends ContinuousRuleModifiyingEffect
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
EtherswornCanonistWatcher watcher = (EtherswornCanonistWatcher)game.getState().getWatchers().get("EtherswornCanonistWatcher");
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CantCounterEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.COUNTER) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getCardType().contains(CardType.CREATURE)) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class SteelGolemEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getPlayerId().equals(source.getControllerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object.getCardType().contains(CardType.CREATURE)) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.MonstrosityAbility;
|
||||
|
|
@ -84,10 +85,10 @@ public class ShipbreakerKraken extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class ShipbreakerKrakenReplacementEffect extends ReplacementEffectImpl {
|
||||
class ShipbreakerKrakenReplacementEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||
|
||||
public ShipbreakerKrakenReplacementEffect() {
|
||||
super(Duration.OneUse, Outcome.Detriment);
|
||||
super(Duration.Custom, Outcome.Detriment);
|
||||
this.staticText = "Those creatures don't untap during their controllers' untap steps for as long as you control {this}";
|
||||
}
|
||||
|
||||
|
|
@ -105,11 +106,6 @@ class ShipbreakerKrakenReplacementEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
|
|
@ -117,19 +113,19 @@ class ShipbreakerKrakenReplacementEffect extends ReplacementEffectImpl {
|
|||
// event will happen before this effect is applied ever)
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(source.getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
|
||||
this.used = true;
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class UnderworldCerberusEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.TARGET) {
|
||||
Card targetCard = game.getCard(event.getTargetId());
|
||||
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class CantCastSerraAvengerEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
// it can be cast on other players turn 1 - 3 if some effect let allow you to do this
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class TeferiMageOfZhalfirReplacementEffect extends ContinuousRuleModifiyingEffec
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can cast spells only any time you could cast a sorcery (" + mageObject.getLogName() + ").";
|
||||
|
|
@ -154,7 +154,7 @@ class TeferiMageOfZhalfirReplacementEffect extends ContinuousRuleModifiyingEffec
|
|||
return null;
|
||||
}
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) {
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class LlawanCephalidRuleModifyingEffect extends ContinuousRuleModifiyingEffectIm
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast blue creature spells (" + mageObject.getLogName() + " in play).";
|
||||
|
|
@ -133,7 +133,7 @@ class LlawanCephalidRuleModifyingEffect extends ContinuousRuleModifiyingEffectIm
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && game.isOpponent(controller, event.getPlayerId())) {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifiyingEffect
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, Game game) {
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null && chosenColor != null) {
|
||||
|
|
@ -140,7 +140,7 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifiyingEffect
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId()) ) {
|
||||
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ public class KorHookmaster extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Kor Hookmaster enters the battlefield, tap target creature an opponent controls.
|
||||
// That creature doesn't untap during its controller's next untap step.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
|
||||
ability.addEffect(new SkipNextUntapTargetEffect());
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
|
|
|
|||
|
|
@ -36,18 +36,17 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.SkipNextUntapTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -111,7 +110,9 @@ class LorthosTheTideMakerEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target);
|
||||
if (permanent != null) {
|
||||
permanent.tap(game);
|
||||
game.addEffect(new LorthosTheTideMakerEffect2(permanent.getId()), source);
|
||||
ContinuousEffect effect = new SkipNextUntapTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -121,44 +122,3 @@ class LorthosTheTideMakerEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class LorthosTheTideMakerEffect2 extends ReplacementEffectImpl {
|
||||
|
||||
protected UUID permanentId;
|
||||
|
||||
public LorthosTheTideMakerEffect2(UUID permanentId) {
|
||||
super(Duration.OneUse, Outcome.Detriment);
|
||||
this.permanentId = permanentId;
|
||||
}
|
||||
|
||||
public LorthosTheTideMakerEffect2(final LorthosTheTideMakerEffect2 effect) {
|
||||
super(effect);
|
||||
permanentId = effect.permanentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LorthosTheTideMakerEffect2 copy() {
|
||||
return new LorthosTheTideMakerEffect2(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
used = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getTurn().getStepType() == PhaseStep.UNTAP
|
||||
&& event.getType() == GameEvent.EventType.UNTAP
|
||||
&& event.getTargetId().equals(permanentId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue