Add description parameter to BecomesTappedAttachedTriggeredAbility. Use it and DestroyAttachedEffect for some existing cards. Fix several issues with Brink of Disaster. Implement card: Uncontrolled Infestation

This commit is contained in:
LoneFox 2015-09-12 11:31:57 +03:00
parent 05e7eedb65
commit a6aa484ea0
9 changed files with 118 additions and 168 deletions

View file

@ -41,16 +41,20 @@ import mage.game.permanent.Permanent;
*/
public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl {
public BecomesTappedAttachedTriggeredAbility(Effect effect, boolean isOptional) {
super(Zone.BATTLEFIELD, effect, isOptional);
private final String description;
public BecomesTappedAttachedTriggeredAbility(Effect effect, String description) {
this(effect, description, false);
}
public BecomesTappedAttachedTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect);
public BecomesTappedAttachedTriggeredAbility(Effect effect, String description, boolean isOptional) {
super(Zone.BATTLEFIELD, effect, isOptional);
this.description = description;
}
public BecomesTappedAttachedTriggeredAbility(final BecomesTappedAttachedTriggeredAbility ability) {
super(ability);
this.description = ability.description;
}
@Override
@ -75,6 +79,6 @@ public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl
@Override
public String getRule() {
return "Whenever enchanted creature becomes tapped, " + super.getRule();
return "Whenever " + description + " becomes tapped, " + super.getRule();
}
}