mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
Fixed bug #3777
This commit is contained in:
parent
12cedf945d
commit
c61651da69
2 changed files with 12 additions and 4 deletions
|
|
@ -32,7 +32,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.AttacksAttachedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.DevotionCount;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
|
|
@ -53,10 +52,9 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class ThunderousMight extends CardImpl {
|
||||
|
||||
public ThunderousMight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
|
|
@ -65,8 +63,9 @@ public class ThunderousMight extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Whenever enchanted creature attacks, it gets +X/+0 until end of turn, where X is your devotion to red.
|
||||
Effect effect = new BoostEnchantedEffect(new DevotionCount(ColoredManaSymbol.R), new StaticValue(0), Duration.EndOfTurn);
|
||||
BoostEnchantedEffect effect = new BoostEnchantedEffect(new DevotionCount(ColoredManaSymbol.R), new StaticValue(0), Duration.EndOfTurn);
|
||||
effect.setText("it gets +X/+0 until end of turn, where X is your devotion to red");
|
||||
effect.setLockedIn(true);
|
||||
this.addAbility(new AttacksAttachedTriggeredAbility(effect, AttachmentType.AURA, false));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
|
|||
|
||||
private DynamicValue power;
|
||||
private DynamicValue toughness;
|
||||
private boolean lockedIn = false;
|
||||
|
||||
public BoostEnchantedEffect(int power, int toughness) {
|
||||
this(power, toughness, Duration.WhileOnBattlefield);
|
||||
|
|
@ -81,6 +82,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (lockedIn) {
|
||||
power = new StaticValue(power.calculate(game, source, this));
|
||||
toughness = new StaticValue(toughness.calculate(game, source, this));
|
||||
}
|
||||
if (affectedObjectsSet) {
|
||||
// Added boosts of activated or triggered abilities exist independent from the source they are created by
|
||||
// so a continuous effect for the permanent itself with the attachment is created
|
||||
|
|
@ -113,6 +118,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setLockedIn(boolean lockedIn) {
|
||||
this.lockedIn = lockedIn;
|
||||
}
|
||||
|
||||
private void setText() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Enchanted creature gets ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue