mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
fixed Skulduggery and Consume Strength affecting creatures which leave and re-enter the battlefield on the same turn.
This commit is contained in:
parent
147bc413a7
commit
d90e2804b7
2 changed files with 28 additions and 21 deletions
|
|
@ -29,7 +29,9 @@ package mage.cards.c;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
|
@ -38,6 +40,7 @@ import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -46,17 +49,16 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class ConsumeStrength extends CardImpl {
|
||||
|
||||
public ConsumeStrength(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}{G}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{G}");
|
||||
|
||||
// Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConsumeStrengthEffect());
|
||||
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature to get +2/+2");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature to get -2/-2");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
|
|
@ -74,10 +76,10 @@ public class ConsumeStrength extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class ConsumeStrengthEffect extends ContinuousEffectImpl {
|
||||
class ConsumeStrengthEffect extends OneShotEffect {
|
||||
|
||||
public ConsumeStrengthEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn";
|
||||
}
|
||||
|
||||
|
|
@ -94,14 +96,16 @@ class ConsumeStrengthEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(2);
|
||||
permanent.addToughness(2);
|
||||
ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-2);
|
||||
permanent.addToughness(-2);
|
||||
ContinuousEffect effect = new BoostTargetEffect(-2, -2, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ package mage.cards.s;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
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.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
|
@ -44,6 +44,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -76,10 +77,10 @@ public class Skulduggery extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class SkulduggeryEffect extends ContinuousEffectImpl {
|
||||
class SkulduggeryEffect extends OneShotEffect {
|
||||
|
||||
public SkulduggeryEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Until end of turn, target creature you control gets +1/+1 and target creature an opponent controls gets -1/-1";
|
||||
}
|
||||
|
||||
|
|
@ -96,13 +97,15 @@ class SkulduggeryEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(1);
|
||||
permanent.addToughness(1);
|
||||
ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-1);
|
||||
permanent.addToughness(-1);
|
||||
ContinuousEffect effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue