* Fixed some wrong rule text of Oubliette and Tawnos's Coffin.

This commit is contained in:
LevelX2 2016-04-25 23:30:56 +02:00
parent 213107f835
commit e81f5cbb32
2 changed files with 83 additions and 76 deletions

View file

@ -29,7 +29,6 @@ package mage.sets.antiquities;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SkipUntapOptionalAbility; import mage.abilities.common.SkipUntapOptionalAbility;
@ -77,11 +76,8 @@ public class TawnossCoffin extends CardImpl {
ability.addCost(new ManaCostsImpl("{3}")); ability.addCost(new ManaCostsImpl("{3}"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
//When Tawnos's Coffin leaves the battlefield... //When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent.
Ability ability2 = new LeavesBattlefieldTriggeredAbility(new TawnossCoffinReturnEffect(), false); Ability ability3 = new TawnossCoffinTriggeredAbility(new TawnossCoffinReturnEffect(), false);
this.addAbility(ability2);
//or becomes untapped, return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent.
Ability ability3 = new BecomesUnTappedSourceTriggeredAbility(new TawnossCoffinReturnEffect(), false);
this.addAbility(ability3); this.addAbility(ability3);
} }
@ -94,42 +90,42 @@ public class TawnossCoffin extends CardImpl {
return new TawnossCoffin(this); return new TawnossCoffin(this);
} }
} }
class BecomesUnTappedSourceTriggeredAbility extends TriggeredAbilityImpl {
public BecomesUnTappedSourceTriggeredAbility(Effect effect, boolean isOptional) { class TawnossCoffinTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
super(Zone.BATTLEFIELD, effect, isOptional);
public TawnossCoffinTriggeredAbility(Effect effect, boolean isOptional) {
super(effect, isOptional);
} }
public BecomesUnTappedSourceTriggeredAbility(Effect effect) { public TawnossCoffinTriggeredAbility(final TawnossCoffinTriggeredAbility ability) {
super(Zone.BATTLEFIELD, effect);
}
public BecomesUnTappedSourceTriggeredAbility(final BecomesUnTappedSourceTriggeredAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public BecomesUnTappedSourceTriggeredAbility copy() { public TawnossCoffinTriggeredAbility copy() {
return new BecomesUnTappedSourceTriggeredAbility(this); return new TawnossCoffinTriggeredAbility(this);
} }
@Override @Override
public boolean checkEventType(GameEvent event, Game game) { public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.UNTAPPED; return super.checkEventType(event, game) || event.getType().equals(GameEvent.EventType.UNTAPPED);
} }
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType().equals(GameEvent.EventType.UNTAPPED)) {
return event.getTargetId().equals(sourceId); return event.getTargetId().equals(sourceId);
} else {
return super.checkTrigger(event, game);
}
} }
@Override @Override
public String getRule() { public String getRule() {
return "When {this} becomes untapped, " + super.getRule(); return "When {this} leaves the battlefield or becomes untapped, " + super.getRule();
} }
} }
class TawnossCoffinEffect extends OneShotEffect { class TawnossCoffinEffect extends OneShotEffect {
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent(); private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent();
@ -140,7 +136,7 @@ class TawnossCoffinEffect extends OneShotEffect {
public TawnossCoffinEffect() { public TawnossCoffinEffect() {
super(Outcome.Detriment); super(Outcome.Detriment);
this.staticText = "Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature. When TawnossCoffin leaves the battlefield, return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent."; this.staticText = "exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature";
} }
public TawnossCoffinEffect(final TawnossCoffinEffect effect) { public TawnossCoffinEffect(final TawnossCoffinEffect effect) {
@ -161,8 +157,9 @@ class TawnossCoffinEffect extends OneShotEffect {
} }
UUID targetId = source.getFirstTarget(); UUID targetId = source.getFirstTarget();
if (targetId==null) return false; // if previous scan somehow failed, simply quit if (targetId == null) {
return false; // if previous scan somehow failed, simply quit
}
if (enchantment != null) { //back to code (mostly) copied from Flickerform if (enchantment != null) { //back to code (mostly) copied from Flickerform
Permanent enchantedCreature = game.getPermanent(targetId); Permanent enchantedCreature = game.getPermanent(targetId);
if (enchantedCreature != null) { if (enchantedCreature != null) {
@ -203,10 +200,9 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
filterAura.add(new SubtypePredicate("Aura")); filterAura.add(new SubtypePredicate("Aura"));
} }
public TawnossCoffinReturnEffect() { public TawnossCoffinReturnEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
this.staticText = "return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent."; this.staticText = "return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent";
} }
@ -227,7 +223,9 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
//There should be only 1 there, but the for each loop seems the most practical to get to it //There should be only 1 there, but the for each loop seems the most practical to get to it
for (Card enchantedCard : exileZone.getCards(filter, game)) { for (Card enchantedCard : exileZone.getCards(filter, game)) {
if (enchantedCard == null) continue; if (enchantedCard == null) {
continue;
}
enchantedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantedCard.getOwnerId()); enchantedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantedCard.getOwnerId());
Permanent newPermanent = game.getPermanent(enchantedCard.getId()); Permanent newPermanent = game.getPermanent(enchantedCard.getId());
if (newPermanent != null) { if (newPermanent != null) {
@ -255,9 +253,13 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
} }
} }
Card oubliette = game.getCard(source.getSourceId()); Card oubliette = game.getCard(source.getSourceId());
if (oubliette == null) return false;//1st stab at getting those counters back if (oubliette == null) {
return false;//1st stab at getting those counters back
}
for (Counter c : ((TawnossCoffin) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field for (Counter c : ((TawnossCoffin) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field
if(c!=null) newPermanent.getCounters(game).addCounter(c); if (c != null) {
newPermanent.getCounters(game).addCounter(c);
}
} }
} }

View file

@ -87,7 +87,6 @@ public class Oubliette extends CardImpl {
} }
} }
class OublietteEffect extends OneShotEffect { class OublietteEffect extends OneShotEffect {
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent(); private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent();
@ -98,7 +97,7 @@ class OublietteEffect extends OneShotEffect {
public OublietteEffect() { public OublietteEffect() {
super(Outcome.Detriment); super(Outcome.Detriment);
this.staticText = "Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature. When Oubliette leaves the battlefield, return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent."; this.staticText = "exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature";
} }
public OublietteEffect(final OublietteEffect effect) { public OublietteEffect(final OublietteEffect effect) {
@ -119,8 +118,9 @@ class OublietteEffect extends OneShotEffect {
} }
UUID targetId = source.getFirstTarget(); UUID targetId = source.getFirstTarget();
if (targetId==null) return false; // if previous scan somehow failed, simply quit if (targetId == null) {
return false; // if previous scan somehow failed, simply quit
}
if (enchantment != null) { //back to code (mostly) copied from Flickerform if (enchantment != null) { //back to code (mostly) copied from Flickerform
Permanent enchantedCreature = game.getPermanent(targetId); Permanent enchantedCreature = game.getPermanent(targetId);
if (enchantedCreature != null) { if (enchantedCreature != null) {
@ -164,10 +164,9 @@ class OublietteReturnEffect extends OneShotEffect {
filterAura.add(new SubtypePredicate("Aura")); filterAura.add(new SubtypePredicate("Aura"));
} }
public OublietteReturnEffect() { public OublietteReturnEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
this.staticText = "return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent."; this.staticText = "return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent";
} }
@ -188,7 +187,9 @@ class OublietteReturnEffect extends OneShotEffect {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
//There should be only 1 there, but the for each loop seems the most practical to get to it //There should be only 1 there, but the for each loop seems the most practical to get to it
for (Card enchantedCard : exileZone.getCards(filter, game)) { for (Card enchantedCard : exileZone.getCards(filter, game)) {
if (enchantedCard == null) continue; if (enchantedCard == null) {
continue;
}
enchantedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantedCard.getOwnerId()); enchantedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantedCard.getOwnerId());
Permanent newPermanent = game.getPermanent(enchantedCard.getId()); Permanent newPermanent = game.getPermanent(enchantedCard.getId());
if (newPermanent != null) { if (newPermanent != null) {
@ -216,9 +217,13 @@ class OublietteReturnEffect extends OneShotEffect {
} }
} }
Card oubliette = game.getCard(source.getSourceId()); Card oubliette = game.getCard(source.getSourceId());
if (oubliette == null) return false;//1st stab at getting those counters back if (oubliette == null) {
return false;//1st stab at getting those counters back
}
for (Counter c : ((Oubliette) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field for (Counter c : ((Oubliette) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field
if(c!=null) newPermanent.getCounters(game).addCounter(c); if (c != null) {
newPermanent.getCounters(game).addCounter(c);
}
} }
} }