mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 11:49:56 -08:00
Improved rule text generation for effects using DynamicValue.
This commit is contained in:
parent
1ed3f1f4f8
commit
ca82485772
22 changed files with 143 additions and 164 deletions
|
|
@ -33,11 +33,11 @@ import java.util.UUID;
|
|||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.dynamicvalue.common.CreaturesOnBattlefieldCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -45,13 +45,17 @@ import mage.cards.CardImpl;
|
|||
*/
|
||||
public class BlunttheAssault extends CardImpl<BlunttheAssault> {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature on the battlefield");
|
||||
|
||||
static {
|
||||
filter.getCardType().add(Constants.CardType.CREATURE);
|
||||
}
|
||||
|
||||
public BlunttheAssault (UUID ownerId) {
|
||||
super(ownerId, 113, "Blunt the Assault", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}");
|
||||
this.expansionSetCode = "SOM";
|
||||
this.color.setGreen(true);
|
||||
GainLifeEffect effect = new GainLifeEffect(new CreaturesOnBattlefieldCount());
|
||||
effect.setStaticText("You gain 1 life for each creature on the battlefield");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
|
||||
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(Constants.Duration.EndOfTurn));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,15 +37,22 @@ import mage.MageInt;
|
|||
import mage.abilities.common.AttacksEachTurnStaticAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.dynamicvalue.common.ControlledArtifactsOnBattlefieldCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class DarksteelJuggernaut extends CardImpl<DarksteelJuggernaut> {
|
||||
private static final FilterPermanent filter = new FilterPermanent("artifacts you control");
|
||||
|
||||
static {
|
||||
filter.getCardType().add(Constants.CardType.ARTIFACT);
|
||||
filter.setTargetController(Constants.TargetController.YOU);
|
||||
}
|
||||
|
||||
public DarksteelJuggernaut (UUID ownerId) {
|
||||
super(ownerId, 150, "Darksteel Juggernaut", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
|
||||
|
|
@ -53,7 +60,9 @@ public class DarksteelJuggernaut extends CardImpl<DarksteelJuggernaut> {
|
|||
this.subtype.add("Juggernaut");
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new ControlledArtifactsOnBattlefieldCount(), new ControlledArtifactsOnBattlefieldCount(), Constants.Duration.EndOfGame);
|
||||
|
||||
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter);
|
||||
SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(value, value, Constants.Duration.EndOfGame);
|
||||
effect.setStaticText("Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control");
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, effect));
|
||||
this.addAbility(IndestructibleAbility.getInstance());
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class LandbindRitual extends CardImpl<LandbindRitual> {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Plains");
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Plains you control");
|
||||
|
||||
static {
|
||||
filter.getSubtype().add("Plains");
|
||||
|
|
@ -55,7 +55,7 @@ public class LandbindRitual extends CardImpl<LandbindRitual> {
|
|||
|
||||
this.color.setWhite(true);
|
||||
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter, 2)));
|
||||
}
|
||||
|
||||
public LandbindRitual(final LandbindRitual card) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import mage.target.TargetPlayer;
|
|||
*/
|
||||
public class MindSludge extends CardImpl<MindSludge> {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp");
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control");
|
||||
|
||||
static {
|
||||
filter.getSubtype().add("Swamp");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue