mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Some conditions renamend.
This commit is contained in:
parent
4433f46dfd
commit
624fde3d8b
8 changed files with 23 additions and 15 deletions
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToACreatureAttachedTriggeredAbility;
|
||||
import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentOnBattelfieldCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattelfieldCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalReplacementEffect;
|
||||
import mage.abilities.effects.ReplacementEffect;
|
||||
|
@ -59,7 +59,7 @@ public class NekoTe extends CardImpl<NekoTe> {
|
|||
// Whenever equipped creature deals damage to a creature, tap that creature. That creature doesn't untap during its controller's untap step for as long as Neko-Te remains on the battlefield.
|
||||
ReplacementEffect skipUntapEffect = new SkipUntapTargetEffect(Duration.WhileOnBattlefield);
|
||||
skipUntapEffect.setText("That creature doesn't untap during its controller's untap step for as long as {this} remains on the battlefield");
|
||||
ConditionalReplacementEffect effect = new ConditionalReplacementEffect(skipUntapEffect, new PermanentOnBattelfieldCondition(), false);
|
||||
ConditionalReplacementEffect effect = new ConditionalReplacementEffect(skipUntapEffect, new SourceOnBattelfieldCondition(), false);
|
||||
Ability ability = new DealsDamageToACreatureAttachedTriggeredAbility(new TapTargetEffect("that creature"), false, "equipped creature", false, true);
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentOnBattelfieldCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattelfieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentOnBattelfieldCondition;
|
||||
import mage.abilities.condition.common.PermanentOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattelfieldCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
|
@ -67,7 +67,7 @@ public class SowerOfTemptation extends CardImpl<SowerOfTemptation> {
|
|||
// remains on the battlefield, even if a different player gains control of Sower of Temptation itself.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new GainControlTargetEffect(Duration.Custom, true),
|
||||
new PermanentOnBattelfieldCondition(),
|
||||
new SourceOnBattelfieldCondition(),
|
||||
"gain control of target creature for as long as {this} remains on the battlefield");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
@ -105,7 +105,7 @@ class SowerOfTemptationGainControlEffect extends OneShotEffect<SowerOfTemptation
|
|||
public boolean apply(Game game, Ability source) {
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new GainControlTargetEffect(Duration.Custom),
|
||||
new PermanentOnBattelfieldCondition(),
|
||||
new SourceOnBattelfieldCondition(),
|
||||
"gain control of target creature for as long as Sower of Temptation remains on the battlefield");
|
||||
game.addEffect(effect, source);
|
||||
return false;
|
||||
|
|
|
@ -36,7 +36,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -73,7 +73,7 @@ public class AegisAngel extends CardImpl<AegisAngel> {
|
|||
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.Custom),
|
||||
new PermanentOnBattlefieldControlUnchangedCondition(),
|
||||
new SourceOnBattlefieldControlUnchangedCondition(),
|
||||
"another target permanent is indestructible for as long as you control Aegis Angel");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
Target target = new TargetPermanent(filter);
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -65,7 +65,7 @@ public class MasterThief extends CardImpl<MasterThief> {
|
|||
// When Master Thief enters the battlefield, gain control of target artifact for as long as you control Master Thief.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new GainControlTargetEffect(Duration.Custom),
|
||||
new PermanentOnBattlefieldControlUnchangedCondition(),
|
||||
new SourceOnBattlefieldControlUnchangedCondition(),
|
||||
"gain control of target artifact for as long as you control Master Thief");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
|
|
|
@ -50,6 +50,7 @@ public class ControlsPermanentCondition implements Condition {
|
|||
private Condition condition;
|
||||
private CountType type;
|
||||
private int count;
|
||||
private boolean onlyControlled;
|
||||
|
||||
/**
|
||||
* Applies a filter and delegates creation to
|
||||
|
@ -72,9 +73,14 @@ public class ControlsPermanentCondition implements Condition {
|
|||
* @param count
|
||||
*/
|
||||
public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count ) {
|
||||
this(filter, type, count, true);
|
||||
}
|
||||
|
||||
public ControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, boolean onlyControlled ) {
|
||||
this.filter = filter;
|
||||
this.type = type;
|
||||
this.count = count;
|
||||
this.count = count;
|
||||
this.onlyControlled = onlyControlled;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,7 +104,9 @@ public class ControlsPermanentCondition implements Condition {
|
|||
boolean conditionApplies = false;
|
||||
|
||||
FilterPermanent localFilter = filter.copy();
|
||||
localFilter.add(new ControllerIdPredicate(source.getControllerId()));
|
||||
if (onlyControlled) {
|
||||
localFilter.add(new ControllerIdPredicate(source.getControllerId()));
|
||||
}
|
||||
|
||||
switch ( this.type ) {
|
||||
case FEWER_THAN:
|
||||
|
|
|
@ -38,7 +38,7 @@ import mage.game.Game;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PermanentOnBattelfieldCondition implements Condition {
|
||||
public class SourceOnBattelfieldCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
|
@ -40,7 +40,7 @@ import mage.game.permanent.Permanent;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PermanentOnBattlefieldControlUnchangedCondition implements Condition {
|
||||
public class SourceOnBattlefieldControlUnchangedCondition implements Condition {
|
||||
|
||||
private UUID controllerId;
|
||||
|
Loading…
Reference in a new issue