mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
- refactoring related to #8375 "L/M/N/O/P/Q/R/S" cards
This commit is contained in:
parent
d42ca9767a
commit
8db2ba470b
41 changed files with 116 additions and 145 deletions
|
@ -120,7 +120,8 @@ class AdarkarValkyrieDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((ZoneChangeEvent) event).isDiesEvent()
|
||||
&& mor.refersTo(((ZoneChangeEvent) event).getTarget(), game)) {
|
||||
&& mor.refersTo(((ZoneChangeEvent) event).getTarget(), game)
|
||||
&& game.getState().getZone(event.getTargetId()) == Zone.GRAVEYARD) { // must be in the graveyard
|
||||
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
return true;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -80,14 +79,14 @@ class MammothHarnessTriggeredAbility extends BlocksOrBecomesBlockedSourceTrigger
|
|||
if (event.getSourceId().equals(attachedTo.getId())) {
|
||||
Permanent blocked = game.getPermanent(event.getTargetId());
|
||||
if (blocked != null && filter.match(blocked, game)) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (event.getTargetId().equals(attachedTo.getId())) {
|
||||
Permanent blocker = game.getPermanent(event.getSourceId());
|
||||
if (blocker != null) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId(), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,11 +88,11 @@ class MassMutinyEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn);
|
||||
effect1.setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
effect1.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
|
||||
game.addEffect(effect1, source);
|
||||
|
||||
ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect2.setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
effect2.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
|
||||
game.addEffect(effect2, source);
|
||||
|
||||
targetCreature.untap(game);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -26,7 +25,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class MobRule extends CardImpl {
|
||||
|
||||
public MobRule(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{R}");
|
||||
|
||||
// Choose one
|
||||
// Gain control of all creatures with power 4 or greater until end of turn. Untap those creatures. They gain haste until end of turn.
|
||||
|
@ -83,7 +82,7 @@ class MobRuleEffect extends OneShotEffect {
|
|||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(filter, game);
|
||||
for (Permanent creature : creatures) {
|
||||
ContinuousEffect effect = new MobRuleControlAllEffect(source.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
applied = true;
|
||||
}
|
||||
|
@ -93,7 +92,7 @@ class MobRuleEffect extends OneShotEffect {
|
|||
}
|
||||
for (Permanent creature : creatures) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
applied = true;
|
||||
}
|
||||
|
|
|
@ -100,11 +100,11 @@ class MoltenPrimordialEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(target.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn);
|
||||
effect1.setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
effect1.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
|
||||
game.addEffect(effect1, source);
|
||||
|
||||
ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect2.setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
effect2.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
|
||||
game.addEffect(effect2, source);
|
||||
|
||||
targetCreature.untap(game);
|
||||
|
|
|
@ -81,7 +81,7 @@ class MyrBattlesphereTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent source = game.getPermanent(event.getSourceId());
|
||||
if (source != null && source.getId().equals(this.getSourceId())) {
|
||||
UUID defenderId = game.getCombat().getDefenderId(event.getSourceId());
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defenderId));
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defenderId, game));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -88,7 +88,7 @@ class MysticReflectionEffect extends OneShotEffect {
|
|||
// The zone is ALL because if the targeted permanent leaves the battlefield, the replacement effect still applies.
|
||||
SimpleStaticAbility staticAbilityOnCard = new SimpleStaticAbility(Zone.ALL, new MysticReflectionReplacementEffect(watcher.getEnteredThisTurn(), source.getSourceId().toString()));
|
||||
MysticReflectionGainAbilityEffect gainAbilityEffect = new MysticReflectionGainAbilityEffect(staticAbilityOnCard);
|
||||
gainAbilityEffect.setTargetPointer(new FixedTarget(targetedPermanent.getMainCard().getId()));
|
||||
gainAbilityEffect.setTargetPointer(new FixedTarget(targetedPermanent.getMainCard().getId(), game));
|
||||
game.addEffect(gainAbilityEffect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import mage.MageObject;
|
||||
|
@ -88,13 +87,14 @@ class NecromanticSelectionEffect extends OneShotEffect {
|
|||
}
|
||||
filter.add(Predicates.or(cardIdPredicates));
|
||||
Target target = new TargetCardInGraveyard(filter);
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
target.setNotTarget(true);
|
||||
if (controller.chooseTarget(Outcome.Benefit, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
ContinuousEffect effect = new BecomesBlackZombieAdditionEffect();
|
||||
effect.setText("It's a black Zombie in addition to its other colors and types");
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -17,7 +16,6 @@ import mage.counters.CounterType;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -28,10 +26,9 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class NecropolisRegent extends CardImpl {
|
||||
|
||||
public NecropolisRegent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
|
||||
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
|
@ -79,7 +76,7 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (creature != null && creature.isControlledBy(controllerId)) {
|
||||
this.getEffects().clear();
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
this.addEffect(effect);
|
||||
return true;
|
||||
}
|
||||
|
@ -91,4 +88,4 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
return "Whenever a creature you control deals combat damage to a player, put that many +1/+1 counters on it.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -102,7 +101,7 @@ class NettlingImpDelayedDestroyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
DestroyTargetEffect effect = new DestroyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility
|
||||
= new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.ALL, effect, TargetController.ANY, new InvertCondition(TargetAttackedThisTurnCondition.instance));
|
||||
delayedAbility.getDuration();
|
||||
|
|
|
@ -102,7 +102,7 @@ class NorrittDelayedDestroyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
DestroyTargetEffect effect = new DestroyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility
|
||||
= new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.ALL, effect, TargetController.ANY, new InvertCondition(TargetAttackedThisTurnCondition.instance));
|
||||
delayedAbility.getDuration();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
* @author fireshoes
|
||||
*/
|
||||
public final class NoyanDarRoilShaper extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("instant or sorcery card");
|
||||
|
||||
static {
|
||||
|
@ -43,7 +42,7 @@ public final class NoyanDarRoilShaper extends CardImpl {
|
|||
}
|
||||
|
||||
public NoyanDarRoilShaper(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{U}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.MERFOLK);
|
||||
this.subtype.add(SubType.ALLY);
|
||||
|
@ -90,8 +89,8 @@ class NoyanDarEffect extends OneShotEffect {
|
|||
targetId = target.getFirstTarget();
|
||||
}
|
||||
if (targetId != null) {
|
||||
FixedTarget fixedTarget = new FixedTarget(targetId);
|
||||
ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.Custom);
|
||||
FixedTarget fixedTarget = new FixedTarget(targetId, game);
|
||||
ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.EndOfGame);
|
||||
continuousEffect.setTargetPointer(fixedTarget);
|
||||
game.addEffect(continuousEffect, source);
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3));
|
||||
|
@ -102,7 +101,6 @@ class NoyanDarEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class AwakenElementalToken extends TokenImpl {
|
||||
|
||||
public AwakenElementalToken() {
|
||||
|
@ -115,6 +113,7 @@ class AwakenElementalToken extends TokenImpl {
|
|||
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
}
|
||||
|
||||
public AwakenElementalToken(final AwakenElementalToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
|
|
@ -66,9 +66,9 @@ class OracleEnVecEffect extends OneShotEffect {
|
|||
|
||||
OracleEnVecEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Target opponent chooses any number of creatures they control. During that player's next turn, " +
|
||||
"the chosen creatures attack if able, and other creatures can't attack. At the beginning of that turn's end step, " +
|
||||
"destroy each of the chosen creatures that didn't attack this turn";
|
||||
this.staticText = "Target opponent chooses any number of creatures they control. During that player's next turn, "
|
||||
+ "the chosen creatures attack if able, and other creatures can't attack. At the beginning of that turn's end step, "
|
||||
+ "destroy each of the chosen creatures that didn't attack this turn";
|
||||
}
|
||||
|
||||
OracleEnVecEffect(final OracleEnVecEffect effect) {
|
||||
|
@ -270,7 +270,7 @@ class OracleEnVecDestroyEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null && !watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game))) {
|
||||
Effect effect = new DestroyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetId));
|
||||
effect.setTargetPointer(new FixedTarget(targetId, game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -116,7 +115,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
|||
Permanent creature = game.getPermanent(entry.getValue());
|
||||
if (creature != null) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, player.getId());
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" gains control of ").append(creature.getName()).toString());
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -66,12 +65,13 @@ class PacksDisdainEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
|
||||
if (player != null && player.choose(Outcome.UnboostCreature, typeChoice, game)) {
|
||||
if (player != null
|
||||
&& player.choose(Outcome.UnboostCreature, typeChoice, game)) {
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());
|
||||
DynamicValue negativePermanentsCount = new PermanentsOnBattlefieldCount(filter, -1);
|
||||
ContinuousEffect effect = new BoostTargetEffect(negativePermanentsCount, negativePermanentsCount, Duration.EndOfTurn, true);
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class ParoxysmEffect extends OneShotEffect {
|
|||
creatureAttachedTo.destroy(source, game, false);
|
||||
} else {
|
||||
ContinuousEffect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creatureAttachedTo.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creatureAttachedTo.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -99,9 +98,10 @@ class PatronOfTheVeinCreatureDiesTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
|
||||
Card creature = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||
if (creature != null && creature.isCreature(game)) {
|
||||
if (creature != null
|
||||
&& creature.isCreature(game)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class PatronOfTheVeinExileCreatureEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if(controller == null){
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
|
@ -149,7 +149,7 @@ class PatronOfTheVeinExileCreatureEffect extends OneShotEffect {
|
|||
|
||||
if (card != null) {
|
||||
Effect effect = new ExileTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
import mage.filter.predicate.mageobject.ToughnessPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
@ -88,15 +87,15 @@ class PhantasmalMountEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
game.addEffect(effect, source);
|
||||
Effect sacrificeCreatureEffect = new SacrificeTargetEffect();
|
||||
Effect sacrificePhantasmalMountEffect = new SacrificeTargetEffect();
|
||||
ContinuousEffect gainAbility = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
|
||||
gainAbility.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
gainAbility.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
game.addEffect(gainAbility, source);
|
||||
sacrificeCreatureEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
sacrificePhantasmalMountEffect.setTargetPointer(new FixedTarget(source.getSourceId()));
|
||||
sacrificeCreatureEffect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
sacrificePhantasmalMountEffect.setTargetPointer(new FixedTarget(source.getSourceId(), game));
|
||||
DelayedTriggeredAbility dTA = new PhantasmalMountDelayedTriggeredAbility(
|
||||
sacrificeCreatureEffect,
|
||||
source.getSourceId());
|
||||
|
|
|
@ -80,7 +80,7 @@ class PreacherEffect extends OneShotEffect {
|
|||
new GainControlTargetEffect(Duration.Custom),
|
||||
sourceTappedCondition,
|
||||
"Gain control of target creature of an opponent's choice that they control for as long as {this} remains tapped");
|
||||
effect.setTargetPointer(new FixedTarget(targetPermanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(targetPermanent.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -18,7 +16,6 @@ import mage.constants.SuperType;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
|
@ -28,8 +25,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class RafiqOfTheMany extends CardImpl {
|
||||
|
||||
public RafiqOfTheMany(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}{U}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}");
|
||||
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
|
@ -77,10 +73,10 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.isActivePlayer(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)));
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0), game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ class RagingRiverEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
RestrictionEffect effect = new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfCombat);
|
||||
effect.setTargetPointer(new FixedTarget(attacker.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(attacker.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,8 +86,8 @@ class RichesEffect extends OneShotEffect {
|
|||
// Has to be done as a separate loop in case there's a situation where one creature's
|
||||
// controller depends on another creatures controller.
|
||||
for (UUID target : creaturesToSteal) {
|
||||
GainControlTargetEffect eff = new GainControlTargetEffect(Duration.Custom, true);
|
||||
eff.setTargetPointer(new FixedTarget(target));
|
||||
GainControlTargetEffect eff = new GainControlTargetEffect(Duration.EndOfGame, true);
|
||||
eff.setTargetPointer(new FixedTarget(target, game));
|
||||
game.addEffect(eff, source);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -12,7 +11,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -23,8 +21,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class RakingCanopy extends CardImpl {
|
||||
|
||||
public RakingCanopy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}{G}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}");
|
||||
|
||||
// Whenever a creature with flying attacks you, Raking Canopy deals 4 damage to it.
|
||||
this.addAbility(new RakingCanopyTriggeredAbility());
|
||||
|
@ -63,12 +60,13 @@ class RakingCanopyTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent attacker = game.getPermanent(event.getSourceId());
|
||||
if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
if (attacker == null
|
||||
|| !attacker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
return false;
|
||||
}
|
||||
if (event.getTargetId().equals(this.getControllerId())) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(attacker.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(attacker.getId(), game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -32,7 +31,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class ReinsOfPower extends CardImpl {
|
||||
|
||||
public ReinsOfPower(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
|
||||
|
||||
// Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn.
|
||||
this.getSpellAbility().addEffect(new ReinsOfPowerEffect());
|
||||
|
@ -50,21 +49,21 @@ public final class ReinsOfPower extends CardImpl {
|
|||
}
|
||||
|
||||
class ReinsOfPowerEffect extends OneShotEffect {
|
||||
|
||||
|
||||
ReinsOfPowerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn";
|
||||
}
|
||||
|
||||
|
||||
ReinsOfPowerEffect(final ReinsOfPowerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ReinsOfPowerEffect copy() {
|
||||
return new ReinsOfPowerEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID opponentId = this.getTargetPointer().getFirst(game, source);
|
||||
|
@ -73,7 +72,7 @@ class ReinsOfPowerEffect extends OneShotEffect {
|
|||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(Predicates.or(new ControllerIdPredicate(source.getControllerId()), new ControllerIdPredicate(opponentId)));
|
||||
new UntapAllEffect(filter).apply(game, source);
|
||||
|
||||
|
||||
// You and that opponent each gain control of all creatures the other controls until end of turn.
|
||||
Set<UUID> yourCreatures = new HashSet<>();
|
||||
Set<UUID> opponentCreatures = new HashSet<>();
|
||||
|
@ -87,18 +86,18 @@ class ReinsOfPowerEffect extends OneShotEffect {
|
|||
}
|
||||
for (UUID creatureId : yourCreatures) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, opponentId);
|
||||
effect.setTargetPointer(new FixedTarget(creatureId));
|
||||
effect.setTargetPointer(new FixedTarget(creatureId, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
for (UUID creatureId : opponentCreatures) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creatureId));
|
||||
effect.setTargetPointer(new FixedTarget(creatureId, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
|
||||
|
||||
// Those creatures gain haste until end of turn.
|
||||
game.addEffect(new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.EndOfTurn, filter), source);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -59,7 +58,6 @@ enum LostLifeCondition implements Condition {
|
|||
|
||||
instance;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class);
|
||||
|
@ -92,7 +90,7 @@ class RevengeEffect extends OneShotEffect {
|
|||
Permanent target = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (target != null && target.isCreature(game)) {
|
||||
ContinuousEffect effect = new BoostTargetEffect(4, 0, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(target.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(target.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -34,8 +33,7 @@ public final class RideDown extends CardImpl {
|
|||
}
|
||||
|
||||
public RideDown(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{W}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{W}");
|
||||
|
||||
// Destroy target blocking creature. Creatures that were blocked by that creature this combat gain trample until end of turn.
|
||||
this.getSpellAbility().addEffect(new RideDownEffect());
|
||||
|
@ -77,9 +75,9 @@ class RideDownEffect extends OneShotEffect {
|
|||
if (blockingCreature != null) {
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (combatGroup.getBlockers().contains(blockingCreature.getId())) {
|
||||
for (UUID attackerId: combatGroup.getAttackers()) {
|
||||
for (UUID attackerId : combatGroup.getAttackers()) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(attackerId));
|
||||
effect.setTargetPointer(new FixedTarget(attackerId, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -11,7 +11,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -67,7 +66,7 @@ class RighteousIndignationTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (blocked != null) {
|
||||
if (blocked.getColor(game).contains(ObjectColor.BLACK)
|
||||
|| blocked.getColor(game).contains(ObjectColor.RED)) {
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId(), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -72,21 +71,25 @@ class RiskyMoveGetControlEffect extends OneShotEffect {
|
|||
MageObject sourceObject = source.getSourceObject(game);
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Player newController = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) {
|
||||
if (newController != null
|
||||
&& controller != null
|
||||
&& sourceObject != null
|
||||
&& sourceObject.equals(sourcePermanent)) {
|
||||
// remove old control effects of the same player
|
||||
for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {
|
||||
if (effect instanceof GainControlTargetEffect) {
|
||||
UUID checkId = (UUID) effect.getValue("RiskyMoveSourceId");
|
||||
UUID controllerId = (UUID) effect.getValue("RiskyMoveControllerId");
|
||||
if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) {
|
||||
if (source.getSourceId().equals(checkId)
|
||||
&& newController.getId().equals(controllerId)) {
|
||||
effect.discard();
|
||||
}
|
||||
}
|
||||
}
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId());
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true, newController.getId());
|
||||
effect.setValue("RiskyMoveSourceId", source.getSourceId());
|
||||
effect.setValue("RiskyMoveControllerId", newController.getId());
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game));
|
||||
effect.setText("and gains control of it");
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
|
@ -122,11 +125,10 @@ class RiskyMoveTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "When you gain control of {this} from another player, " ;
|
||||
return "When you gain control of {this} from another player, ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class RiskyMoveFlipCoinEffect extends OneShotEffect {
|
||||
|
||||
public RiskyMoveFlipCoinEffect() {
|
||||
|
@ -149,14 +151,18 @@ class RiskyMoveFlipCoinEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Target target1 = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true);
|
||||
Target target2 = new TargetOpponent(true);
|
||||
|
||||
|
||||
if (target1.canChoose(source.getSourceId(), controller.getId(), game)) {
|
||||
while (!target1.isChosen() && target1.canChoose(source.getSourceId(), controller.getId(), game) && controller.canRespond()) {
|
||||
while (!target1.isChosen()
|
||||
&& target1.canChoose(source.getSourceId(), controller.getId(), game)
|
||||
&& controller.canRespond()) {
|
||||
controller.chooseTarget(outcome, target1, source, game);
|
||||
}
|
||||
}
|
||||
if (target2.canChoose(source.getSourceId(), controller.getId(), game)) {
|
||||
while (!target2.isChosen() && target2.canChoose(source.getSourceId(), controller.getId(), game) && controller.canRespond()) {
|
||||
while (!target2.isChosen()
|
||||
&& target2.canChoose(source.getSourceId(), controller.getId(), game)
|
||||
&& controller.canRespond()) {
|
||||
controller.chooseTarget(outcome, target2, source, game);
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +170,7 @@ class RiskyMoveFlipCoinEffect extends OneShotEffect {
|
|||
Player chosenOpponent = game.getPlayer(target2.getFirstTarget());
|
||||
if (!controller.flipCoin(source, game, true)) {
|
||||
if (permanent != null && chosenOpponent != null) {
|
||||
ContinuousEffect effect = new RiskyMoveCreatureGainControlEffect(Duration.Custom, chosenOpponent.getId());
|
||||
ContinuousEffect effect = new RiskyMoveCreatureGainControlEffect(Duration.EndOfGame, chosenOpponent.getId());
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
game.informPlayers(chosenOpponent.getLogName() + " has gained control of " + permanent.getLogName());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -30,7 +29,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class SereneMaster extends CardImpl {
|
||||
|
||||
public SereneMaster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.MONK);
|
||||
|
||||
|
@ -83,10 +82,10 @@ class SereneMasterEffect extends OneShotEffect {
|
|||
int newSourcePower = attackingCreature.getPower().getValue();
|
||||
int newAttackerPower = sourceCreature.getPower().getValue();
|
||||
ContinuousEffect effect = new SetPowerToughnessTargetEffect(newSourcePower, sourceCreature.getToughness().getValue(), Duration.EndOfCombat);
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), game));
|
||||
game.addEffect(effect, source);
|
||||
effect = new SetPowerToughnessTargetEffect(newAttackerPower, attackingCreature.getToughness().getValue(), Duration.EndOfCombat);
|
||||
effect.setTargetPointer(new FixedTarget(attackingCreature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(attackingCreature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -71,7 +70,7 @@ class MayRemoveM1M1CouterTargetEffect extends OneShotEffect {
|
|||
if (target.getCounters(game).getCount(CounterType.M1M1) > 0) {
|
||||
if (controller.chooseUse(outcome, "Remove a -1/-1 counter from " + target.getIdName() + "?", source, game)) {
|
||||
Effect effect = new RemoveCounterTargetEffect(CounterType.M1M1.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(target.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(target.getId(), game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
|
@ -84,4 +83,3 @@ class MayRemoveM1M1CouterTargetEffect extends OneShotEffect {
|
|||
return new MayRemoveM1M1CouterTargetEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -91,7 +90,7 @@ class ShowOfDominanceEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (selectedCreature != null) {
|
||||
FixedTarget target = new FixedTarget(selectedCreature.getId());
|
||||
FixedTarget target = new FixedTarget(selectedCreature.getId(), game);
|
||||
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(4));
|
||||
effect.setTargetPointer(target);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -14,7 +13,6 @@ import mage.constants.Zone;
|
|||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -25,12 +23,10 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class SigilCaptain extends CardImpl {
|
||||
|
||||
public SigilCaptain(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{W}");
|
||||
this.subtype.add(SubType.RHINO);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
|
||||
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
|
@ -73,7 +69,7 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& permanent.getPower().getValue() == 1
|
||||
&& permanent.getToughness().getValue() == 1) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class SigilOfValor extends CardImpl {
|
||||
|
||||
public SigilOfValor(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
|
||||
// Whenever equipped creature attacks alone, it gets +1/+1 until end of turn for each other creature you control.
|
||||
|
@ -81,7 +80,7 @@ class SigilOfValorTriggeredAbility extends TriggeredAbilityImpl {
|
|||
UUID attackerId = game.getCombat().getAttackers().get(0);
|
||||
if (equipment != null
|
||||
&& equipment.isAttachedTo(attackerId)) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(attackerId));
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(attackerId, game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
|
|||
|| object.isSorcery(game)) {
|
||||
if (getTargets().isEmpty()) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -102,7 +102,7 @@ class SkyfireKirinEffect extends OneShotEffect {
|
|||
}
|
||||
if (targetCreature != null) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(targetCreature.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -94,8 +93,8 @@ class SokenzanRenegadeEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (newController != null) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, newController.getId());
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, newController.getId());
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
if (!source.isControlledBy(newController.getId())) {
|
||||
game.informPlayers(newController.getLogName() + " got control of " + sourcePermanent.getLogName());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
|
@ -71,7 +70,7 @@ class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl {
|
|||
Permanent toGetCounters = game.getPermanent(event.getTargetId());
|
||||
if (toGetCounters != null) {
|
||||
AddCountersTargetEffect addCounters = new AddCountersTargetEffect(CounterType.M1M1.createInstance(), StaticValue.get(event.getAmount()));
|
||||
addCounters.setTargetPointer(new FixedTarget(toGetCounters.getId()));
|
||||
addCounters.setTargetPointer(new FixedTarget(toGetCounters.getId(), game));
|
||||
addCounters.apply(game, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class CreatureControlledAttacksAloneTriggeredAbility extends TriggeredAbilityImp
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.isActivePlayer(this.controllerId)) {
|
||||
if (game.getCombat().attacksAlone()) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -17,7 +16,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
@ -30,7 +28,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class SpinalGraft extends CardImpl {
|
||||
|
||||
public SpinalGraft(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
|
@ -38,10 +36,10 @@ public final class SpinalGraft extends CardImpl {
|
|||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
|
||||
|
||||
// Enchanted creature gets +3/+3.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));
|
||||
|
||||
|
||||
// When enchanted creature becomes the target of a spell or ability, destroy that creature. It can't be regenerated.
|
||||
this.addAbility(new SpinalGraftTriggeredAbility());
|
||||
}
|
||||
|
@ -57,15 +55,15 @@ public final class SpinalGraft extends CardImpl {
|
|||
}
|
||||
|
||||
class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
public SpinalGraftTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DestroyTargetEffect(true));
|
||||
}
|
||||
|
||||
|
||||
public SpinalGraftTriggeredAbility(final SpinalGraftTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SpinalGraftTriggeredAbility copy() {
|
||||
return new SpinalGraftTriggeredAbility(this);
|
||||
|
@ -75,20 +73,20 @@ class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.TARGETED;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
UUID enchanted = enchantment.getAttachedTo();
|
||||
if (event.getTargetId().equals(enchanted)) {
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(enchanted));
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(enchanted, game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When enchanted creature becomes the target of a spell or ability, destroy that creature. It can't be regenerated.";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -52,7 +51,7 @@ public final class Sporogenesis extends CardImpl {
|
|||
this.addAbility(new SporogenesisTriggeredAbility());
|
||||
|
||||
// When Sporogenesis leaves the battlefield, remove all fungus counters from all creatures.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SporogenesisRemoveCountersEffect(), false));
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SporogenesisRemoveCountersEffect(), false));
|
||||
}
|
||||
|
||||
private Sporogenesis(final Sporogenesis card) {
|
||||
|
@ -94,7 +93,7 @@ class SporogenesisTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& permanent.isCreature(game)
|
||||
&& permanent.getCounters(game).containsKey(CounterType.FUNGUS)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -71,7 +70,7 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (equipment != null
|
||||
&& equipment.getAttachedTo() != null
|
||||
&& event.getSourceId().equals(equipment.getAttachedTo())) {
|
||||
getEffects().setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -79,7 +78,7 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever equipped creature deals damage to a creature, " ;
|
||||
return "Whenever equipped creature deals damage to a creature, ";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue