mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Changed two play_land replacement effects to rule modifying effects.
This commit is contained in:
parent
f493d8ff99
commit
2106554bdb
2 changed files with 12 additions and 11 deletions
|
@ -33,6 +33,7 @@ import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
|
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
@ -76,7 +77,7 @@ public class AggressiveMining extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AggressiveMiningEffect extends ReplacementEffectImpl {
|
class AggressiveMiningEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||||
|
|
||||||
public AggressiveMiningEffect() {
|
public AggressiveMiningEffect() {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||||
|
@ -98,12 +99,7 @@ class AggressiveMiningEffect extends ReplacementEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
|
||||||
return event.getType().equals(GameEvent.EventType.PLAY_LAND) && event.getPlayerId().equals(source.getControllerId());
|
return event.getType().equals(GameEvent.EventType.PLAY_LAND) && event.getPlayerId().equals(source.getControllerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -75,7 +76,7 @@ public class PardicMiner extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PardicMinerEffect extends ReplacementEffectImpl {
|
class PardicMinerEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||||
|
|
||||||
public PardicMinerEffect() {
|
public PardicMinerEffect() {
|
||||||
super(Duration.EndOfTurn, Outcome.Detriment);
|
super(Duration.EndOfTurn, Outcome.Detriment);
|
||||||
|
@ -97,12 +98,16 @@ class PardicMinerEffect extends ReplacementEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public String getInfoMessage(Ability source, Game game) {
|
||||||
return true;
|
MageObject mageObject = game.getObject(source.getSourceId());
|
||||||
|
if (mageObject != null) {
|
||||||
|
return "You can't play lands this turn (" + mageObject.getLogName() + ").";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, boolean checkPlayableMode, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.PLAY_LAND && event.getPlayerId().equals(source.getFirstTarget())) {
|
if (event.getType() == GameEvent.EventType.PLAY_LAND && event.getPlayerId().equals(source.getFirstTarget())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue