updated Searing Blaze et al

This commit is contained in:
Evan Kranzler 2018-04-20 11:15:33 -04:00
parent b5e49fb575
commit 33dff8199d
3 changed files with 59 additions and 37 deletions

View file

@ -57,7 +57,7 @@ import mage.game.stack.StackObject;
import mage.players.Player; import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponentOrPlaneswalker;
/** /**
* *
@ -85,7 +85,11 @@ public class RavagerOfTheFells extends CardImpl {
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ravager of the Fells. // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ravager of the Fells.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); this.addAbility(new ConditionalTriggeredAbility(
ability,
TwoOrMoreSpellsWereCastLastTurnCondition.instance,
TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE
));
} }
public RavagerOfTheFells(final RavagerOfTheFells card) { public RavagerOfTheFells(final RavagerOfTheFells card) {
@ -102,7 +106,7 @@ class RavagerOfTheFellsAbility extends TriggeredAbilityImpl {
public RavagerOfTheFellsAbility() { public RavagerOfTheFellsAbility() {
super(Zone.BATTLEFIELD, new RavagerOfTheFellsEffect(), false); super(Zone.BATTLEFIELD, new RavagerOfTheFellsEffect(), false);
Target target1 = new TargetOpponent(); Target target1 = new TargetOpponentOrPlaneswalker();
this.addTarget(target1); this.addTarget(target1);
this.addTarget(new RavagerOfTheFellsTarget()); this.addTarget(new RavagerOfTheFellsTarget());
} }
@ -134,7 +138,9 @@ class RavagerOfTheFellsAbility extends TriggeredAbilityImpl {
@Override @Override
public String getRule() { public String getRule() {
return "Whenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls."; return "Whenever this creature transforms into {this}, "
+ "it deals 2 damage to target opponent or planeswalker "
+ "and 2 damage to up to one target creature that player or that planeswalkers controller controls.";
} }
} }
@ -156,10 +162,7 @@ class RavagerOfTheFellsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); game.damagePlayerOrPlaneswalker(source.getTargets().get(0).getFirstTarget(), 2, source.getSourceId(), game, false, true);
if (player != null) {
player.damage(2, source.getSourceId(), game, false, true);
}
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (creature != null) { if (creature != null) {
creature.damage(2, source.getSourceId(), game, false, true); creature.damage(2, source.getSourceId(), game, false, true);
@ -181,7 +184,11 @@ class RavagerOfTheFellsTarget extends TargetPermanent {
@Override @Override
public boolean canTarget(UUID id, Ability source, Game game) { public boolean canTarget(UUID id, Ability source, Game game) {
UUID firstTarget = source.getFirstTarget(); Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget());
if (player == null) {
return false;
}
UUID firstTarget = player.getId();
Permanent permanent = game.getPermanent(id); Permanent permanent = game.getPermanent(id);
if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) {
return super.canTarget(id, source, game); return super.canTarget(id, source, game);
@ -206,13 +213,16 @@ class RavagerOfTheFellsTarget extends TargetPermanent {
if (object instanceof StackObject) { if (object instanceof StackObject) {
UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget(); UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget();
Player player = game.getPlayerOrPlaneswalkerController(playerId);
if (player != null) {
for (UUID targetId : availablePossibleTargets) { for (UUID targetId : availablePossibleTargets) {
Permanent permanent = game.getPermanent(targetId); Permanent permanent = game.getPermanent(targetId);
if (permanent != null && permanent.getControllerId().equals(playerId)) { if (permanent != null && permanent.getControllerId().equals(player.getId())) {
possibleTargets.add(targetId); possibleTargets.add(targetId);
} }
} }
} }
}
return possibleTargets; return possibleTargets;
} }

View file

@ -43,7 +43,7 @@ import mage.game.permanent.Permanent;
import mage.game.stack.StackObject; import mage.game.stack.StackObject;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.TargetPlayer; import mage.target.common.TargetPlayerOrPlaneswalker;
import mage.watchers.common.LandfallWatcher; import mage.watchers.common.LandfallWatcher;
/** /**
@ -54,11 +54,11 @@ import mage.watchers.common.LandfallWatcher;
public class SearingBlaze extends CardImpl { public class SearingBlaze extends CardImpl {
public SearingBlaze(UUID ownerId, CardSetInfo setInfo) { public SearingBlaze(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{R}");
// Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls. // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.
// Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead. // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addTarget(new SearingBlazeTarget()); this.getSpellAbility().addTarget(new SearingBlazeTarget());
this.getSpellAbility().addEffect(new SearingBlazeEffect()); this.getSpellAbility().addEffect(new SearingBlazeEffect());
this.getSpellAbility().addWatcher(new LandfallWatcher()); this.getSpellAbility().addWatcher(new LandfallWatcher());
@ -79,7 +79,7 @@ class SearingBlazeEffect extends OneShotEffect {
public SearingBlazeEffect() { public SearingBlazeEffect() {
super(Outcome.Damage); super(Outcome.Damage);
staticText = "{this} deals 1 damage to target player and 1 damage to target creature that player controls. \nLandfall - If you had a land enter the battlefield under your control this turn, {this} deals 3 damage to that player and 3 damage to that creature instead"; staticText = "{this} deals 1 damage to target player or planeswalker and 1 damage to target creature that player or that planeswalkers controller controls. \nLandfall - If you had a land enter the battlefield under your control this turn, {this} deals 3 damage to that player or planeswalker and 3 damage to that creature instead.";
} }
public SearingBlazeEffect(final SearingBlazeEffect effect) { public SearingBlazeEffect(final SearingBlazeEffect effect) {
@ -94,15 +94,12 @@ class SearingBlazeEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get(LandfallWatcher.class.getSimpleName()); LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get(LandfallWatcher.class.getSimpleName());
Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
int damage = 1; int damage = 1;
if (watcher != null && watcher.landPlayed(source.getControllerId())) { if (watcher != null && watcher.landPlayed(source.getControllerId())) {
damage = 3; damage = 3;
} }
if (player != null) { game.damagePlayerOrPlaneswalker(source.getTargets().get(0).getFirstTarget(), damage, source.getSourceId(), game, false, true);
player.damage(damage, source.getSourceId(), game, false, true);
}
if (creature != null) { if (creature != null) {
creature.damage(damage, source.getSourceId(), game, false, true); creature.damage(damage, source.getSourceId(), game, false, true);
} }
@ -123,7 +120,11 @@ class SearingBlazeTarget extends TargetPermanent {
@Override @Override
public boolean canTarget(UUID id, Ability source, Game game) { public boolean canTarget(UUID id, Ability source, Game game) {
UUID firstTarget = source.getFirstTarget(); Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget());
if (player == null) {
return false;
}
UUID firstTarget = player.getId();
Permanent permanent = game.getPermanent(id); Permanent permanent = game.getPermanent(id);
if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) {
return super.canTarget(id, source, game); return super.canTarget(id, source, game);
@ -138,13 +139,16 @@ class SearingBlazeTarget extends TargetPermanent {
MageObject object = game.getObject(sourceId); MageObject object = game.getObject(sourceId);
if (object instanceof StackObject) { if (object instanceof StackObject) {
UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget(); UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget();
Player player = game.getPlayerOrPlaneswalkerController(playerId);
if (player != null) {
for (UUID targetId : availablePossibleTargets) { for (UUID targetId : availablePossibleTargets) {
Permanent permanent = game.getPermanent(targetId); Permanent permanent = game.getPermanent(targetId);
if (permanent != null && permanent.getControllerId().equals(playerId)) { if (permanent != null && permanent.getControllerId().equals(player.getId())) {
possibleTargets.add(targetId); possibleTargets.add(targetId);
} }
} }
} }
}
return possibleTargets; return possibleTargets;
} }

View file

@ -50,7 +50,7 @@ import mage.game.permanent.Permanent;
import mage.game.stack.StackObject; import mage.game.stack.StackObject;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.TargetPlayer; import mage.target.common.TargetPlayerOrPlaneswalker;
/** /**
* @author noxx * @author noxx
@ -58,7 +58,7 @@ import mage.target.TargetPlayer;
public class SoulOfShandalar extends CardImpl { public class SoulOfShandalar extends CardImpl {
public SoulOfShandalar(UUID ownerId, CardSetInfo setInfo) { public SoulOfShandalar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
this.subtype.add(SubType.AVATAR); this.subtype.add(SubType.AVATAR);
this.power = new MageInt(6); this.power = new MageInt(6);
@ -69,14 +69,14 @@ public class SoulOfShandalar extends CardImpl {
// {3}{R}{R}: Soul of Shandalar deals 3 damage to target player and 3 damage to up to one target creature that player controls. // {3}{R}{R}: Soul of Shandalar deals 3 damage to target player and 3 damage to up to one target creature that player controls.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulOfShandalarEffect(), new ManaCostsImpl("{3}{R}{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulOfShandalarEffect(), new ManaCostsImpl("{3}{R}{R}"));
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayerOrPlaneswalker());
ability.addTarget(new SoulOfShandalarTarget()); ability.addTarget(new SoulOfShandalarTarget());
this.addAbility(ability); this.addAbility(ability);
// {3}{R}{R}, Exile Soul of Shandalar from your graveyard: Soul of Shandalar deals 3 damage to target player and 3 damage to up to one target creature that player controls. // {3}{R}{R}, Exile Soul of Shandalar from your graveyard: Soul of Shandalar deals 3 damage to target player and 3 damage to up to one target creature that player controls.
ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new SoulOfShandalarEffect(), new ManaCostsImpl("{3}{R}{R}")); ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new SoulOfShandalarEffect(), new ManaCostsImpl("{3}{R}{R}"));
ability.addCost(new ExileSourceFromGraveCost()); ability.addCost(new ExileSourceFromGraveCost());
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayerOrPlaneswalker());
ability.addTarget(new SoulOfShandalarTarget()); ability.addTarget(new SoulOfShandalarTarget());
this.addAbility(ability); this.addAbility(ability);
} }
@ -95,7 +95,8 @@ class SoulOfShandalarEffect extends OneShotEffect {
public SoulOfShandalarEffect() { public SoulOfShandalarEffect() {
super(Outcome.Damage); super(Outcome.Damage);
staticText = "Soul of Shandalar deals 3 damage to target player and 3 damage to up to one target creature that player controls"; staticText = "{this} deals 3 damage to target player or planeswalker "
+ "and 3 damage to up to one target creature that player or that planeswalkers controller controls";
} }
public SoulOfShandalarEffect(final SoulOfShandalarEffect effect) { public SoulOfShandalarEffect(final SoulOfShandalarEffect effect) {
@ -124,7 +125,7 @@ class SoulOfShandalarEffect extends OneShotEffect {
class SoulOfShandalarTarget extends TargetPermanent { class SoulOfShandalarTarget extends TargetPermanent {
public SoulOfShandalarTarget() { public SoulOfShandalarTarget() {
super(0, 1, new FilterCreaturePermanent("creature that the targeted player controls"), false); super(0, 1, new FilterCreaturePermanent("creature that the targeted player or planeswalker's controller controls"), false);
} }
public SoulOfShandalarTarget(final SoulOfShandalarTarget target) { public SoulOfShandalarTarget(final SoulOfShandalarTarget target) {
@ -133,7 +134,11 @@ class SoulOfShandalarTarget extends TargetPermanent {
@Override @Override
public boolean canTarget(UUID id, Ability source, Game game) { public boolean canTarget(UUID id, Ability source, Game game) {
UUID firstTarget = source.getFirstTarget(); Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget());
if (player == null) {
return false;
}
UUID firstTarget = player.getId();
Permanent permanent = game.getPermanent(id); Permanent permanent = game.getPermanent(id);
if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) { if (firstTarget != null && permanent != null && permanent.getControllerId().equals(firstTarget)) {
return super.canTarget(id, source, game); return super.canTarget(id, source, game);
@ -158,13 +163,16 @@ class SoulOfShandalarTarget extends TargetPermanent {
if (object instanceof StackObject) { if (object instanceof StackObject) {
UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget(); UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget();
Player player = game.getPlayerOrPlaneswalkerController(playerId);
if (player != null) {
for (UUID targetId : availablePossibleTargets) { for (UUID targetId : availablePossibleTargets) {
Permanent permanent = game.getPermanent(targetId); Permanent permanent = game.getPermanent(targetId);
if (permanent != null && permanent.getControllerId().equals(playerId)) { if (permanent != null && permanent.getControllerId().equals(player.getId())) {
possibleTargets.add(targetId); possibleTargets.add(targetId);
} }
} }
} }
}
return possibleTargets; return possibleTargets;
} }