mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Some minor formatting.
This commit is contained in:
parent
f01692f804
commit
fe1043e77a
2 changed files with 12 additions and 7 deletions
|
@ -41,6 +41,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
|
||||||
|
@ -56,10 +57,12 @@ public class VengefulRebirth extends CardImpl<VengefulRebirth> {
|
||||||
this.color.setRed(true);
|
this.color.setRed(true);
|
||||||
this.color.setGreen(true);
|
this.color.setGreen(true);
|
||||||
// Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player
|
// Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard());
|
Target target = new TargetCardInYourGraveyard();
|
||||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
target.setRequired(true);
|
||||||
|
this.getSpellAbility().addTarget(target);
|
||||||
|
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true));
|
||||||
this.getSpellAbility().addEffect(new VengefulRebirthEffect());
|
this.getSpellAbility().addEffect(new VengefulRebirthEffect());
|
||||||
|
// Exile Vengeful Rebirth.
|
||||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ public class DetentionSphere extends CardImpl<DetentionSphere> {
|
||||||
// target nonland permanent not named Detention Sphere and all
|
// target nonland permanent not named Detention Sphere and all
|
||||||
// other permanents with the same name as that permanent.
|
// other permanents with the same name as that permanent.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DetentionSphereEntersEffect(), true);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new DetentionSphereEntersEffect(), true);
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(filter, true));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,11 +108,12 @@ class DetentionSphereEntersEffect extends OneShotEffect<DetentionSphereEntersEff
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
UUID exileId = source.getSourceId();
|
UUID exileId = source.getSourceId();
|
||||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (exileId != null && targetPermanent != null) {
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (exileId != null && targetPermanent != null && controller != null) {
|
||||||
String name = targetPermanent.getName();
|
String name = targetPermanent.getName();
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||||
if (permanent != null && permanent.getName().equals(name)) {
|
if (permanent != null && permanent.getName().equals(name)) {
|
||||||
permanent.moveToExile(exileId, "Detention Sphere", source.getId(), game);
|
controller.moveCardToExileWithInfo(permanent, exileId, "Detention Sphere", source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -144,7 +146,7 @@ class DetentionSphereLeavesEffect extends OneShotEffect<DetentionSphereLeavesEff
|
||||||
exile = exile.copy();
|
exile = exile.copy();
|
||||||
for (UUID cardId : exile) {
|
for (UUID cardId : exile) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
card.putOntoBattlefield(game, Zone.EXILED, source.getId(), card.getOwnerId());
|
card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), card.getOwnerId());
|
||||||
}
|
}
|
||||||
game.getExile().getExileZone(exileId).clear();
|
game.getExile().getExileZone(exileId).clear();
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue