Some improvements to rule text generation of BoostControlledEffect.

This commit is contained in:
LevelX2 2013-05-21 16:42:49 +02:00
parent cc31e1b9d9
commit c2aa574ea6
7 changed files with 24 additions and 18 deletions

View file

@ -57,7 +57,7 @@ public class BreakOfDay extends CardImpl<BreakOfDay> {
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
new IndestructibleAllEffect(new FilterControlledCreaturePermanent("creatures you control"), Duration.EndOfTurn),
FatefulHourCondition.getInstance(),
"If you have 5 or less life, those creatures also are indestructible this turn.", true));
"If you have 5 or less life, those creatures also are indestructible this turn", true));
}
public BreakOfDay(final BreakOfDay card) {

View file

@ -28,10 +28,10 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.Constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -57,7 +57,7 @@ public class CourtStreetDenizen extends CardImpl<CourtStreetDenizen> {
filter.add(new AnotherPredicate());
filter.add(new ColorPredicate(ObjectColor.WHITE));
filter.add(new ControllerPredicate(TargetController.YOU));
filterOpponentCreature.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
filterOpponentCreature.add(new ControllerPredicate(TargetController.OPPONENT));
}
public CourtStreetDenizen(UUID ownerId) {
super(ownerId, 8, "Court Street Denizen", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
@ -70,7 +70,7 @@ public class CourtStreetDenizen extends CardImpl<CourtStreetDenizen> {
this.toughness = new MageInt(2);
// Whenever another white creature enters the battlefield under your control, tap target creature an opponent controls.
Ability ability = new EntersBattlefieldAllTriggeredAbility(Constants.Zone.BATTLEFIELD, new TapTargetEffect(),filter,false);
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect(),filter,false,null, true);
ability.addTarget(new TargetCreaturePermanent(filterOpponentCreature));
this.addAbility(ability);
}

View file

@ -28,10 +28,11 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.Constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
@ -49,7 +50,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*/
public class FoundryStreetDenizen extends CardImpl<FoundryStreetDenizen> {
private static final FilterPermanent filter = new FilterCreaturePermanent("another red creature under your control");
private static final FilterPermanent filter = new FilterCreaturePermanent("another red creature");
static {
filter.add(new AnotherPredicate());
filter.add(new ControllerPredicate(TargetController.YOU));
@ -67,7 +68,7 @@ public class FoundryStreetDenizen extends CardImpl<FoundryStreetDenizen> {
this.toughness = new MageInt(1);
// Whenever another red creature enters the battlefield under your control, Foundry Street Denizen gets +1/+0 until end of turn.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Constants.Duration.EndOfTurn), filter, false));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), filter, false, null, true));
}
public FoundryStreetDenizen(final FoundryStreetDenizen card) {

View file

@ -28,9 +28,9 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -49,7 +49,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class IvyLaneDenizen extends CardImpl<IvyLaneDenizen> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another green creature under your control");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another green creature");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
filter.add(new AnotherPredicate());
@ -67,9 +67,9 @@ public class IvyLaneDenizen extends CardImpl<IvyLaneDenizen> {
// Whenever another green creature enters the battlefield under your control, put a +1/+1 counter on target creature.
Ability ability = new EntersBattlefieldAllTriggeredAbility(
Constants.Zone.BATTLEFIELD,
Zone.BATTLEFIELD,
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
filter, false);
filter, false, null, true);
ability.addTarget(new TargetCreaturePermanent(true));
this.addAbility(ability);
}

View file

@ -28,8 +28,8 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
@ -50,7 +50,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class ShadowAlleyDenizen extends CardImpl<ShadowAlleyDenizen> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another black creature under your control");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another black creature");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
@ -71,8 +71,8 @@ public class ShadowAlleyDenizen extends CardImpl<ShadowAlleyDenizen> {
// Whenever another black creature enters the battlefield under your control, target creature gains intimidate until end of turn.
Ability ability = new EntersBattlefieldAllTriggeredAbility(
Zone.BATTLEFIELD,
new GainAbilityTargetEffect(IntimidateAbility.getInstance(), Constants.Duration.EndOfTurn),
filter, false);
new GainAbilityTargetEffect(IntimidateAbility.getInstance(), Duration.EndOfTurn),
filter, false, null, true);
ability.addTarget(new TargetCreaturePermanent(true));
this.addAbility(ability);
}

View file

@ -34,6 +34,7 @@ import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
@ -44,6 +45,8 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public class WildBeastmaster extends CardImpl<WildBeastmaster> {
private static final String EFFECT_TEXT ="each other creature you control gets +X/+X until end of turn, where X is {this}'s power";
public WildBeastmaster(UUID ownerId) {
super(ownerId, 139, "Wild Beastmaster", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "RTR";
@ -55,7 +58,9 @@ public class WildBeastmaster extends CardImpl<WildBeastmaster> {
// Whenever Wild Beastmaster attacks, each other creature you control gets +X/+X until end of turn, where X is Wild Beastmaster's power.
SourcePermanentPowerCount creaturePower = new SourcePermanentPowerCount();
this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(creaturePower, creaturePower, Duration.EndOfTurn, new FilterCreaturePermanent(),true, true), false));
Effect effect = new BoostControlledEffect(creaturePower, creaturePower, Duration.EndOfTurn, new FilterCreaturePermanent(),true, true);
effect.setText(EFFECT_TEXT);
this.addAbility(new AttacksTriggeredAbility(effect, false));
}
public WildBeastmaster(final WildBeastmaster card) {

View file

@ -136,10 +136,10 @@ public class BoostControlledEffect extends ContinuousEffectImpl<BoostControlledE
String message = null;
StringBuilder sb = new StringBuilder();
if (excludeSource) {
sb.append("each other ");
sb.append("Other ");
}
sb.append(filter.getMessage());
sb.append(" you control gets ");
sb.append(" you control get ");
String p = power.toString();
if(!p.startsWith("-")) {