* Soulbond - Reworked to two triggerd abilities (fixes #1882).

This commit is contained in:
LevelX2 2016-04-16 02:43:52 +02:00
parent 3b98d0714d
commit 1dbba3f7a9
32 changed files with 374 additions and 285 deletions

View file

@ -58,7 +58,7 @@ public class DeadeyeNavigator extends CardImpl {
this.toughness = new MageInt(5);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Deadeye Navigator is paired with another creature, each of those creatures has "{1}{U}: Exile this creature, then return it to the battlefield under your control."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new ManaCostsImpl("{1}{U}"));

View file

@ -64,7 +64,7 @@ public class DiregrafEscort extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Diregraf Escort is paired with another creature, both creatures have protection from Zombies.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(new ProtectionAbility(filter), ruleText)));

View file

@ -55,7 +55,7 @@ public class DruidsFamiliar extends CardImpl {
this.toughness = new MageInt(2);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Druid's Familiar is paired with another creature, each of those creatures gets +2/+2.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostPairedEffect(2, 2, ruleText)));

View file

@ -55,7 +55,7 @@ public class ElgaudShieldmate extends CardImpl {
this.toughness = new MageInt(3);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Elgaud Shieldmate is paired with another creature, both creatures have hexproof.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(HexproofAbility.getInstance(), ruleText)));

View file

@ -27,21 +27,20 @@
*/
package mage.sets.avacynrestored;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.SoulbondAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author noxx
*/
@ -83,17 +82,26 @@ class FloweringLumberknotEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
if (permanent.getPairedCard() == null) {
return true; // not paired => can't attack or block
if (permanent.getPairedCard() != null) {
Permanent paired = permanent.getPairedCard().getPermanent(game);
if (paired != null) {
boolean found = false;
for (Ability ability : paired.getAbilities(game)) {
if (ability instanceof SoulbondAbility) {
found = true;
break;
}
}
if (found) {
return false;// paired => can attack or block
}
}
}
Permanent paired = game.getPermanent(permanent.getPairedCard());
if (paired != null && paired.getAbilities().contains(SoulbondAbility.getInstance())) {
return false; // paired => can attack or block
}
// can't attack or block otherwise
// can't attack or block
return true;
}
return false;
}
@Override

View file

@ -58,7 +58,7 @@ public class GalvanicAlchemist extends CardImpl {
this.toughness = new MageInt(4);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Galvanic Alchemist is paired with another creature, each of those creatures has "{2}{U}: Untap this creature."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{2}{U}"));

View file

@ -55,7 +55,7 @@ public class GeistTrappers extends CardImpl {
this.toughness = new MageInt(5);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Geist Trappers is paired with another creature, both creatures have reach.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(ReachAbility.getInstance(), ruleText)));

View file

@ -55,7 +55,7 @@ public class HanweirLancer extends CardImpl {
this.toughness = new MageInt(2);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Hanweir Lancer is paired with another creature, both creatures have first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(FirstStrikeAbility.getInstance(), ruleText)));

View file

@ -27,21 +27,21 @@
*/
package mage.sets.avacynrestored;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author noxx
*/
@ -51,7 +51,6 @@ public class JointAssault extends CardImpl {
super(ownerId, 183, "Joint Assault", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
this.expansionSetCode = "AVR";
// Target creature gets +2/+2 until end of turn. If it's paired with a creature, that creature also gets +2/+2 until end of turn.
this.getSpellAbility().addEffect(new JointAssaultBoostTargetEffect(2, 2, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
@ -69,9 +68,9 @@ public class JointAssault extends CardImpl {
class JointAssaultBoostTargetEffect extends ContinuousEffectImpl {
private int power;
private int toughness;
private UUID paired;
private final int power;
private final int toughness;
private MageObjectReference paired;
public JointAssaultBoostTargetEffect(int power, int toughness, Duration duration) {
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
@ -116,10 +115,10 @@ class JointAssaultBoostTargetEffect extends ContinuousEffectImpl {
}
if (this.paired != null) {
Permanent paired = game.getPermanent(this.paired);
if (paired != null) {
paired.addPower(power);
paired.addToughness(toughness);
Permanent pairedPermanent = this.paired.getPermanent(game);
if (pairedPermanent != null) {
pairedPermanent.addPower(power);
pairedPermanent.addToughness(toughness);
affectedTargets++;
}
}

View file

@ -57,7 +57,7 @@ public class LightningMauler extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Lightning Mauler is paired with another creature, both creatures have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(HasteAbility.getInstance(), ruleText)));

View file

@ -55,7 +55,7 @@ public class NearheathPilgrim extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(LifelinkAbility.getInstance(), ruleText)));

View file

@ -55,7 +55,7 @@ public class NightshadePeddler extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Nightshade Peddler is paired with another creature, both creatures have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(DeathtouchAbility.getInstance(), ruleText)));

View file

@ -54,7 +54,7 @@ public class PathbreakerWurm extends CardImpl {
this.toughness = new MageInt(4);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Pathbreaker Wurm is paired with another creature, both creatures have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(TrampleAbility.getInstance(), ruleText)));

View file

@ -55,7 +55,7 @@ public class SilverbladePaladin extends CardImpl {
this.toughness = new MageInt(2);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Silverblade Paladin is paired with another creature, both creatures have double strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(DoubleStrikeAbility.getInstance(), ruleText)));

View file

@ -55,7 +55,7 @@ public class SpectralGateguards extends CardImpl {
this.toughness = new MageInt(5);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Spectral Gateguards is paired with another creature, both creatures have vigilance.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(VigilanceAbility.getInstance(), ruleText)));

View file

@ -59,7 +59,7 @@ public class SternMentor extends CardImpl {
this.toughness = new MageInt(2);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Stern Mentor is paired with another creature, each of those creatures has "{T}: Target player puts the top two cards of his or her library into his or her graveyard."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2), new TapSourceCost());

View file

@ -59,7 +59,7 @@ public class Stonewright extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Stonewright is paired with another creature, each of those creatures has "{R}: This creature gets +1/+0 until end of turn."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"));

View file

@ -57,7 +57,7 @@ public class TandemLookout extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Tandem Lookout is paired with another creature, each of those creatures has "Whenever this creature deals damage to an opponent, draw a card."
Ability ability = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1));

View file

@ -54,7 +54,7 @@ public class TrustedForcemage extends CardImpl {
this.toughness = new MageInt(2);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Trusted Forcemage is paired with another creature, each of those creatures gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostPairedEffect(1, 1, ruleText)));

View file

@ -57,7 +57,7 @@ public class Wingcrafter extends CardImpl {
this.toughness = new MageInt(1);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Wingcrafter is paired with another creature, both creatures have flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(FlyingAbility.getInstance(), ruleText)));

View file

@ -54,7 +54,7 @@ public class WolfirSilverheart extends CardImpl {
this.toughness = new MageInt(4);
// Soulbond
this.addAbility(SoulbondAbility.getInstance());
this.addAbility(new SoulbondAbility());
// As long as Wolfir Silverheart is paired with another creature, each of those creatures gets +4/+4.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostPairedEffect(4, 4, ruleText)));

View file

@ -28,12 +28,12 @@
package mage.sets.magic2012;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.common.BecomesTargetTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
@ -50,6 +50,7 @@ public class PhantasmalBear extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Phantasmal Bear becomes the target of a spell or ability, sacrifice it.
this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()));
}