mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
* Fixed some wrong rule text of Oubliette and Tawnos's Coffin.
This commit is contained in:
parent
213107f835
commit
e81f5cbb32
2 changed files with 83 additions and 76 deletions
|
@ -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;
|
||||||
|
@ -64,7 +63,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class TawnossCoffin extends CardImpl {
|
public class TawnossCoffin extends CardImpl {
|
||||||
|
|
||||||
public Counters godHelpMe=null;
|
public Counters godHelpMe = null;
|
||||||
|
|
||||||
public TawnossCoffin(UUID ownerId) {
|
public TawnossCoffin(UUID ownerId) {
|
||||||
super(ownerId, 33, "Tawnos's Coffin", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
|
super(ownerId, 33, "Tawnos's Coffin", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||||
|
@ -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) {
|
||||||
return event.getTargetId().equals(sourceId);
|
if (event.getType().equals(GameEvent.EventType.UNTAPPED)) {
|
||||||
|
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) {
|
||||||
|
@ -159,10 +155,11 @@ class TawnossCoffinEffect extends OneShotEffect {
|
||||||
if (enchantment == null) {
|
if (enchantment == null) {
|
||||||
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
@ -176,7 +173,7 @@ class TawnossCoffinEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
//((TawnossCoffin)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
|
//((TawnossCoffin)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
|
||||||
((TawnossCoffin)game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
|
((TawnossCoffin) game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
|
||||||
|
|
||||||
if (!(enchantedCreature instanceof Token)) {
|
if (!(enchantedCreature instanceof Token)) {
|
||||||
|
|
||||||
|
@ -184,7 +181,7 @@ class TawnossCoffinEffect extends OneShotEffect {
|
||||||
/*LeavesBattlefieldTriggeredAbility triggeredAbility = new LeavesBattlefieldTriggeredAbility(
|
/*LeavesBattlefieldTriggeredAbility triggeredAbility = new LeavesBattlefieldTriggeredAbility(
|
||||||
new TawnossCoffinReturnEffect(), false);
|
new TawnossCoffinReturnEffect(), false);
|
||||||
enchantment.addAbility(triggeredAbility, source.getSourceId(), game);
|
enchantment.addAbility(triggeredAbility, source.getSourceId(), game);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,8 +222,10 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
|
||||||
FilterCard filter = new FilterCard();
|
FilterCard filter = new FilterCard();
|
||||||
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) {
|
||||||
for(Counter c : ((TawnossCoffin)oubliette).godHelpMe.values()){ //would be nice if could just use that copy function to set the whole field
|
return false;//1st stab at getting those counters back
|
||||||
if(c!=null) newPermanent.getCounters(game).addCounter(c);
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class Oubliette extends CardImpl {
|
public class Oubliette extends CardImpl {
|
||||||
|
|
||||||
public Counters godHelpMe=null;
|
public Counters godHelpMe = null;
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature");
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
@ -117,10 +116,11 @@ class OublietteEffect extends OneShotEffect {
|
||||||
if (enchantment == null) {
|
if (enchantment == null) {
|
||||||
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
@ -134,7 +134,7 @@ class OublietteEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
//((Oubliette)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
|
//((Oubliette)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
|
||||||
((Oubliette)game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
|
((Oubliette) game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
|
||||||
/*
|
/*
|
||||||
if (!(enchantedCreature instanceof Token)) {
|
if (!(enchantedCreature instanceof Token)) {
|
||||||
|
|
||||||
|
@ -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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,8 +186,10 @@ class OublietteReturnEffect extends OneShotEffect {
|
||||||
FilterCard filter = new FilterCard();
|
FilterCard filter = new FilterCard();
|
||||||
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) {
|
||||||
for(Counter c : ((Oubliette)oubliette).godHelpMe.values()){ //would be nice if could just use that copy function to set the whole field
|
return false;//1st stab at getting those counters back
|
||||||
if(c!=null) newPermanent.getCounters(game).addCounter(c);
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue