* Sunlit Hoplite - fixed not working +1/0 ability (#6288);

This commit is contained in:
Oleg Agafonov 2020-02-21 20:05:00 +04:00
parent d202df1649
commit 3047a8bd76
2 changed files with 10 additions and 12 deletions

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -17,23 +15,19 @@ import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class ScourgeOfTheNobilis extends CardImpl {
public ScourgeOfTheNobilis(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R/W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R/W}");
this.subtype.add(SubType.AURA);
@ -43,10 +37,14 @@ public final class ScourgeOfTheNobilis extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// As long as enchanted creature is red, it gets +1/+1 and has "{RW}: This creature gets +1/+0 until end of turn."
SimpleStaticAbility redAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.RED), "As long as enchanted creature is red, it gets +1/+1"));
redAbility.addEffect(new ConditionalContinuousEffect(new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R/W}")), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.RED), "and has \"{R/W}: This creature gets +1/+0 until end of turn.\""));
redAbility.addEffect(new ConditionalContinuousEffect(new GainAbilityAttachedEffect(
new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R/W}")), AttachmentType.AURA),
new EnchantedCreatureColorCondition(ObjectColor.RED), "and has \"{R/W}: This creature gets +1/+0 until end of turn.\""));
this.addAbility(redAbility);
// As long as enchanted creature is white, it gets +1/+1 and has lifelink.
SimpleStaticAbility whiteAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.WHITE), "As long as enchanted creature is white, it gets +1/+1"));
whiteAbility.addEffect(new ConditionalContinuousEffect(new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.WHITE), "and has lifelink"));

View file

@ -45,7 +45,7 @@ public final class SunlitHoplite extends CardImpl {
// Sunlit Hoplite gets +1/+0 as long as you control an Elspeth planeswalker.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield),
condition, "{this} gets +1/+0 as long as you control an Elspeth planeswalker"
)).addHint(new ConditionHint(condition, "You control an Elspeth planeswalker")));
}