mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
* Fixed that effects created from attachments to the attached object by activated or triggered abilities did not exists independent from the attachment (fixes #1206).
This commit is contained in:
parent
d0f92ef64b
commit
c6e08a8872
7 changed files with 275 additions and 107 deletions
|
|
@ -29,19 +29,22 @@ package mage.sets.bornofthegods;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.SourceHasSubtypeCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.keyword.BestowAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -60,12 +63,7 @@ public class EverflameEidolon extends CardImpl {
|
|||
// Bestow {2}{R}
|
||||
this.addAbility(new BestowAbility(this, "{2}{R}"));
|
||||
// {R}: Everflame Eidolon gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
|
||||
new BoostEnchantedEffect(1, 0, Duration.EndOfTurn),
|
||||
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
|
||||
new SourceHasSubtypeCondition("Aura"),
|
||||
"{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead"),
|
||||
new ManaCostsImpl("{R}")));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EverflameEidolonEffect(), new ManaCostsImpl("{R}")));
|
||||
// Enchanted creature gets +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
|
@ -79,3 +77,34 @@ public class EverflameEidolon extends CardImpl {
|
|||
return new EverflameEidolon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EverflameEidolonEffect extends OneShotEffect {
|
||||
|
||||
public EverflameEidolonEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead";
|
||||
}
|
||||
|
||||
public EverflameEidolonEffect(final EverflameEidolonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverflameEidolonEffect copy() {
|
||||
return new EverflameEidolonEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
if (sourceObject.getSubtype().contains("Aura")) {
|
||||
new BoostEnchantedEffect(1, 0, Duration.EndOfTurn).apply(game, source);
|
||||
} else {
|
||||
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,12 +25,9 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2012;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ColoredManaCost;
|
||||
|
|
@ -38,6 +35,12 @@ import mage.abilities.effects.common.AttachEffect;
|
|||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -47,20 +50,23 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class Firebreathing extends CardImpl {
|
||||
|
||||
public Firebreathing (UUID ownerId) {
|
||||
public Firebreathing(UUID ownerId) {
|
||||
super(ownerId, 132, "Firebreathing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}");
|
||||
this.expansionSetCode = "M12";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {R}: Enchanted creature gets +1/+0 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R)));
|
||||
}
|
||||
|
||||
public Firebreathing (final Firebreathing card) {
|
||||
public Firebreathing(final Firebreathing card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue