mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
Merge branch 'master' of https://github.com/magefree/mage.git
This commit is contained in:
commit
8af9e334e0
39 changed files with 530 additions and 188 deletions
95
Mage.Sets/src/mage/sets/commander/BladewingTheRisen.java
Normal file
95
Mage.Sets/src/mage/sets/commander/BladewingTheRisen.java
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterPermanentCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BladewingTheRisen extends CardImpl<BladewingTheRisen> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dragon creatures");
|
||||
private static final FilterPermanentCard filterCard = new FilterPermanentCard("Dragon permanent card from your graveyard");
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Dragon"));
|
||||
filterCard.add(new SubtypePredicate("Dragon"));
|
||||
}
|
||||
|
||||
public BladewingTheRisen(UUID ownerId) {
|
||||
super(ownerId, 185, "Bladewing the Risen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{R}{R}");
|
||||
this.expansionSetCode = "CMD";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Dragon");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Bladewing the Risen enters the battlefield, you may return target Dragon permanent card from your graveyard to the battlefield.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), true);
|
||||
Target target = new TargetCardInYourGraveyard(filterCard);
|
||||
target.setRequired(true);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
// {B}{R}: Dragon creatures get +1/+1 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,1, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{B}{R}")));
|
||||
}
|
||||
|
||||
public BladewingTheRisen(final BladewingTheRisen card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BladewingTheRisen copy() {
|
||||
return new BladewingTheRisen(this);
|
||||
}
|
||||
}
|
||||
185
Mage.Sets/src/mage/sets/commander/VishKalBloodArbiter.java
Normal file
185
Mage.Sets/src/mage/sets/commander/VishKalBloodArbiter.java
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower;
|
||||
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class VishKalBloodArbiter extends CardImpl<VishKalBloodArbiter> {
|
||||
|
||||
public VishKalBloodArbiter(UUID ownerId) {
|
||||
super(ownerId, 234, "Vish Kal, Blood Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{B}{B}");
|
||||
this.expansionSetCode = "CMD";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Vampire");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
// Sacrifice a creature: Put X +1/+1 counters on Vish Kal, Blood Arbiter, where X is the sacrificed creature's power.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new SacrificeCostCreaturesPower(), true),
|
||||
new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), false))));
|
||||
// Remove all +1/+1 counters from Vish Kal: Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way.
|
||||
DynamicValue removedCounters = new SignInversionDynamicValue(new VishKalBloodArbiterDynamicValue());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(removedCounters, removedCounters, Duration.EndOfTurn), new VishKalBloodArbiterCost(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public VishKalBloodArbiter(final VishKalBloodArbiter card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VishKalBloodArbiter copy() {
|
||||
return new VishKalBloodArbiter(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VishKalBloodArbiterCost extends CostImpl<VishKalBloodArbiterCost> {
|
||||
|
||||
private int amount;
|
||||
private String name;
|
||||
|
||||
public VishKalBloodArbiterCost(Counter counter) {
|
||||
this.name = counter.getName();
|
||||
this.amount = counter.getCount();
|
||||
this.text = "Remove all " + name + " counters from {this}";
|
||||
}
|
||||
|
||||
public VishKalBloodArbiterCost(VishKalBloodArbiterCost cost) {
|
||||
super(cost);
|
||||
this.amount = cost.amount;
|
||||
this.name = cost.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null) {
|
||||
this.amount = permanent.getCounters().getCount(name);
|
||||
permanent.removeCounters(name, amount, game);
|
||||
this.paid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.amount = 0;
|
||||
}
|
||||
return paid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VishKalBloodArbiterCost copy() {
|
||||
return new VishKalBloodArbiterCost(this);
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class VishKalBloodArbiterDynamicValue implements DynamicValue {
|
||||
|
||||
|
||||
public VishKalBloodArbiterDynamicValue() {
|
||||
|
||||
}
|
||||
|
||||
public VishKalBloodArbiterDynamicValue(final VishKalBloodArbiterDynamicValue dynamicValue) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
int count = 0;
|
||||
for(Cost cost : source.getCosts()){
|
||||
if(cost instanceof VishKalBloodArbiterCost){
|
||||
count += ((VishKalBloodArbiterCost)cost).getAmount();
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VishKalBloodArbiterDynamicValue copy() {
|
||||
return new VishKalBloodArbiterDynamicValue(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the number of +1/+1 counters removed this way";
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class ClifftopRetreat extends CardImpl<ClifftopRetreat> {
|
|||
super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Mountain or a Plains";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new RedManaAbility());
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class HinterlandHarbor extends CardImpl<HinterlandHarbor> {
|
|||
super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tapped unless you control a Forest or an Island";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new GreenManaAbility());
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class IsolatedChapel extends CardImpl<IsolatedChapel> {
|
|||
super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Plains or a Swamp";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new WhiteManaAbility());
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import mage.MageInt;
|
|||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.InvertCondition;
|
||||
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
|
||||
import mage.abilities.condition.common.TransformedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
|
|
@ -46,6 +45,7 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class SulfurFalls extends CardImpl<SulfurFalls> {
|
|||
super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Island or a Mountain";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlueManaAbility());
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class WoodlandCemetery extends CardImpl<WoodlandCemetery> {
|
|||
super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Swamp or a Forest";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlackManaAbility());
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.MultikickerCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class DragonskullSummit extends CardImpl<DragonskullSummit> {
|
|||
super(ownerId, 223, "Dragonskull Summit", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Swamp or a Mountain";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlackManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class DrownedCatacomb extends CardImpl<DrownedCatacomb> {
|
|||
super(ownerId, 224, "Drowned Catacomb", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Island or a Swamp";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlackManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class GlacialFortress extends CardImpl<GlacialFortress> {
|
|||
super(ownerId, 226, "Glacial Fortress", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Plains or an Island";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlueManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class RootboundCrag extends CardImpl<RootboundCrag> {
|
|||
super(ownerId, 227, "Rootbound Crag", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Mountain or a Forest";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new RedManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
|
|
@ -60,7 +60,7 @@ public class SunpetalGrove extends CardImpl<SunpetalGrove> {
|
|||
super(ownerId, 228, "Sunpetal Grove", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Forest or a Plains";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new GreenManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.TriggeredAbility;
|
|||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.InvertCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.common.CastFromHandCondition;
|
||||
import mage.abilities.condition.common.InvertCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.ExileSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
|
|
|||
|
|
@ -29,16 +29,17 @@
|
|||
package mage.sets.planeshift;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -118,14 +119,16 @@ class OrimsChantCantCastEffect extends ReplacementEffectImpl<OrimsChantCantCastE
|
|||
class OrimsChantCantAttackEffect extends ReplacementEffectImpl<OrimsChantCantAttackEffect> {
|
||||
|
||||
private static final String effectText = "If Orim's Chant was kicked, creatures can't attack this turn";
|
||||
private Condition condition = new LockedInCondition(KickedCondition.getInstance());
|
||||
|
||||
OrimsChantCantAttackEffect ( ) {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit);
|
||||
staticText = effectText;
|
||||
}
|
||||
|
||||
OrimsChantCantAttackEffect ( OrimsChantCantAttackEffect effect ) {
|
||||
OrimsChantCantAttackEffect (final OrimsChantCantAttackEffect effect ) {
|
||||
super(effect);
|
||||
this.condition = effect.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -143,7 +146,7 @@ class OrimsChantCantAttackEffect extends ReplacementEffectImpl<OrimsChantCantAtt
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && KickedCondition.getInstance().apply(game, source)) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && condition.apply(game, source)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -54,7 +54,7 @@ public class BlackcleaveCliffs extends CardImpl<BlackcleaveCliffs> {
|
|||
super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
String abilityText = "tapped unless you control fewer than 3 lands";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlackManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
|
|
@ -55,7 +55,7 @@ public class CopperlineGorge extends CardImpl<CopperlineGorge> {
|
|||
this.expansionSetCode = "SOM";
|
||||
|
||||
// Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands.
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
String abilityText = "tapped unless you control two or fewer other lands";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new RedManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
|
|
@ -54,7 +54,7 @@ public class DarkslickShores extends CardImpl<DarkslickShores> {
|
|||
super(ownerId, 226, "Darkslick Shores", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
String abilityText = "tap it unless you control fewer than 3 lands";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlueManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
|
|
@ -54,7 +54,7 @@ public class RazorvergeThicket extends CardImpl<RazorvergeThicket> {
|
|||
super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
String abilityText = "tap it unless you control fewer than 3 lands";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new GreenManaAbility());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
|
@ -54,7 +54,7 @@ public class SeachromeCoast extends CardImpl<SeachromeCoast> {
|
|||
super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
|
||||
String abilityText = "tap it unless you control fewer than 3 lands";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new WhiteManaAbility());
|
||||
|
|
|
|||
52
Mage.Sets/src/mage/sets/scourge/BladewingTheRisen.java
Normal file
52
Mage.Sets/src/mage/sets/scourge/BladewingTheRisen.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.scourge;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BladewingTheRisen extends mage.sets.commander.BladewingTheRisen {
|
||||
|
||||
public BladewingTheRisen(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 136;
|
||||
this.expansionSetCode = "SCG";
|
||||
}
|
||||
|
||||
public BladewingTheRisen(final BladewingTheRisen card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BladewingTheRisen copy() {
|
||||
return new BladewingTheRisen(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -28,10 +28,9 @@
|
|||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -41,6 +40,9 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
|||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
||||
|
|
@ -50,19 +52,19 @@ import mage.game.Game;
|
|||
*/
|
||||
public class BoldDefense extends CardImpl<BoldDefense> {
|
||||
|
||||
private final String staticText = "If Bold Defense was kicked, instead creatures you control get +2/+2 and gain first strike until end of turn";
|
||||
private final String staticText = "If {this]} was kicked, instead creatures you control get +2/+2 and gain first strike until end of turn";
|
||||
|
||||
public BoldDefense(UUID ownerId) {
|
||||
super(ownerId, 3, "Bold Defense", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Kicker {3}{W} (You may pay an additional {3}{W} as you cast this spell.)
|
||||
this.addAbility(new KickerAbility("{3}{W}"));
|
||||
|
||||
// Creatures you control get +1/+1 until end of turn. If Bold Defense was kicked, instead creatures you control get +2/+2 and gain first strike until end of turn.
|
||||
DynamicValue dn = new BoldDefensePTCount();
|
||||
this.getSpellAbility().addEffect(new BoostControlledEffect(dn, dn, Duration.EndOfTurn));
|
||||
|
||||
|
||||
ContinuousEffect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false);
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(effect, KickedCondition.getInstance(), staticText, true));
|
||||
}
|
||||
|
|
@ -79,22 +81,28 @@ public class BoldDefense extends CardImpl<BoldDefense> {
|
|||
|
||||
class BoldDefensePTCount implements DynamicValue {
|
||||
|
||||
private Condition condition = new LockedInCondition(KickedCondition.getInstance());
|
||||
|
||||
public BoldDefensePTCount() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
if (KickedCondition.getInstance().apply(game, sourceAbility)) {
|
||||
if (condition.apply(game, sourceAbility)) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public BoldDefensePTCount(final BoldDefensePTCount dynamicValue) {
|
||||
this.condition = dynamicValue.condition;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new BoldDefensePTCount();
|
||||
return new BoldDefensePTCount(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -106,4 +114,4 @@ class BoldDefensePTCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@ public class BurstLightning extends CardImpl<BurstLightning> {
|
|||
this.expansionSetCode = "ZEN";
|
||||
this.color.setRed(true);
|
||||
|
||||
// Kicker {4} (You may pay an additional {4} as you cast this spell.)
|
||||
this.addAbility(new KickerAbility("{4}"));
|
||||
|
||||
// Burst Lightning deals 2 damage to target creature or player. If Burst Lightning was kicked, it deals 4 damage to that creature or player instead.
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(4),
|
||||
new DamageTargetEffect(2), KickedCondition.getInstance(), "{this} deals 2 damage to target creature or player. If {this} was kicked, it deals 4 damage to that creature or player instead"));
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -65,7 +66,7 @@ public class ElementalAppeal extends CardImpl<ElementalAppeal> {
|
|||
// If Elemental Appeal was kicked, that creature gets +7/+0 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
|
||||
new BoostTargetEffect(7, 0, Duration.EndOfTurn),
|
||||
KickedCondition.getInstance(),
|
||||
new LockedInCondition(KickedCondition.getInstance()),
|
||||
"If {this} was kicked, that creature gets +7/+0 until end of turn"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,22 +27,21 @@
|
|||
*/
|
||||
package mage.sets.zendikar;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author maurer.it_at_gmail.com
|
||||
|
|
@ -66,12 +65,12 @@ public class GatekeeperOfMalakir extends CardImpl<GatekeeperOfMalakir> {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Kicker {B} (You may pay an additional {B} as you cast this spell.)
|
||||
this.addAbility(new KickerAbility("{B}"));
|
||||
|
||||
|
||||
// When Gatekeeper of Malakir enters the battlefield, if it was kicked, target player sacrifices a creature.
|
||||
EntersBattlefieldTriggeredAbility ability =
|
||||
new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player"));
|
||||
|
||||
Ability conditionalAbility = new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature.");
|
||||
conditionalAbility.addTarget(new TargetPlayer());
|
||||
this.addAbility(conditionalAbility);
|
||||
|
|
|
|||
|
|
@ -28,18 +28,12 @@
|
|||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.StaticAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
|
|
@ -49,10 +43,15 @@ import mage.abilities.keyword.KickerAbility;
|
|||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
|
@ -83,7 +82,10 @@ public class Gigantiform extends CardImpl<Gigantiform> {
|
|||
// Enchanted creature is 8/8 and has trample.
|
||||
this.addAbility(new GigantiformAbility());
|
||||
// When Gigantiform enters the battlefield, if it was kicked, you may search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library.
|
||||
this.addAbility(new GigantiformTriggeredAbility());
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new GigantiformEffect(), true),
|
||||
KickedCondition.getInstance(),
|
||||
"When Gigantiform enters the battlefield, if it was kicked, you may search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library."));
|
||||
}
|
||||
|
||||
public Gigantiform(final Gigantiform card) {
|
||||
|
|
@ -119,39 +121,8 @@ class GigantiformAbility extends StaticAbility<GigantiformAbility> {
|
|||
}
|
||||
}
|
||||
|
||||
class GigantiformTriggeredAbility extends TriggeredAbilityImpl<GigantiformTriggeredAbility> {
|
||||
|
||||
public GigantiformTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new GigantiformEffect());
|
||||
}
|
||||
|
||||
public GigantiformTriggeredAbility(final GigantiformTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GigantiformTriggeredAbility copy() {
|
||||
return new GigantiformTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId())
|
||||
&& KickedCondition.getInstance().apply(game, this)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When Gigantiform enters the battlefield, if it was kicked, you may search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library.";
|
||||
}
|
||||
}
|
||||
|
||||
class GigantiformEffect extends OneShotEffect<GigantiformEffect> {
|
||||
|
||||
private static final String message = "Do you wish to search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library?";
|
||||
private static final FilterCard filter = new FilterCard("card named Gigantiform");
|
||||
|
||||
static {
|
||||
|
|
@ -175,7 +146,7 @@ class GigantiformEffect extends OneShotEffect<GigantiformEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player != null && player.chooseUse(Outcome.PutCardInPlay, message, game) && player.searchLibrary(target, game)) {
|
||||
if (player != null && player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.continious.BoostControlledEffect;
|
||||
|
|
@ -60,11 +61,10 @@ public class GoblinBushwhacker extends CardImpl<GoblinBushwhacker> {
|
|||
// Kicker {R} (You may pay an additional {R} as you cast this spell.)
|
||||
this.addAbility(new KickerAbility("{R}"));
|
||||
|
||||
|
||||
// When Goblin Bushwhacker enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn), false);
|
||||
ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn."));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new LockedInCondition(KickedCondition.getInstance()), "When {this} enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn."));
|
||||
}
|
||||
|
||||
public GoblinBushwhacker(final GoblinBushwhacker card) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
|
|
@ -64,7 +65,7 @@ public class KorAeronaut extends CardImpl<KorAeronaut> {
|
|||
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target creature gains flying until end of turn."));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new LockedInCondition(KickedCondition.getInstance()), "When {this} enters the battlefield, if it was kicked, target creature gains flying until end of turn."));
|
||||
}
|
||||
|
||||
public KorAeronaut(final KorAeronaut card) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DiscardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
|
|
@ -65,7 +65,7 @@ public class SphinxOfLostTruths extends CardImpl<SphinxOfLostTruths> {
|
|||
|
||||
// When Sphinx of Lost Truths enters the battlefield, draw three cards. Then if it wasn't kicked, discard three cards.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(3));
|
||||
ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new UnlessCondition(KickedCondition.getInstance()),
|
||||
ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new InvertCondition(KickedCondition.getInstance()),
|
||||
"Then if it wasn't kicked, discard three cards"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.TenOrLessLifeCondition;
|
||||
import mage.abilities.condition.common.UnlessCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -58,7 +58,7 @@ public class VampireLacerator extends CardImpl<VampireLacerator> {
|
|||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new ConditionalOneShotEffect(
|
||||
new LoseLifeSourceEffect(1),
|
||||
new UnlessCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ),
|
||||
new InvertCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ),
|
||||
"you lose 1 life unless an opponent has 10 or less life"), TargetController.YOU, false));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
|
|
@ -60,7 +61,7 @@ public class VampiresBite extends CardImpl<VampiresBite> {
|
|||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(3, 0, Duration.EndOfTurn));
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn);
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(effect, KickedCondition.getInstance(), "If {this} was kicked, that creature gains lifelink until end of turn"));
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(effect, new LockedInCondition(KickedCondition.getInstance()), "If {this} was kicked, that creature gains lifelink until end of turn"));
|
||||
}
|
||||
|
||||
public VampiresBite(final VampiresBite card) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
package mage.sets.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
|
|
@ -63,7 +64,7 @@ public class VinesOfVastwood extends CardImpl<VinesOfVastwood> {
|
|||
|
||||
// If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn),
|
||||
KickedCondition.getInstance(), staticText));
|
||||
new LockedInCondition(KickedCondition.getInstance()), staticText));
|
||||
}
|
||||
|
||||
public VinesOfVastwood(final VinesOfVastwood card) {
|
||||
|
|
|
|||
|
|
@ -26,10 +26,9 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.condition.common;
|
||||
package mage.abilities.condition;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
@ -25,26 +25,23 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.condition.common;
|
||||
package mage.abilities.condition;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* A simple {@link mage.abilities.condition.Condition} to invert a decorated conditions
|
||||
* {@link mage.abilities.condition.Condition#apply(mage.game.Game, mage.abilities.Ability) apply(mage.game.Game, mage.abilities.Ability)}
|
||||
* A simple {@link Condition} to invert a decorated conditions
|
||||
* {@link Condition#apply(mage.game.Game, mage.abilities.Ability) apply(mage.game.Game, mage.abilities.Ability)}
|
||||
* method invocation.
|
||||
*
|
||||
* The copy for {@link UnlessCondition}.
|
||||
*
|
||||
* @author noxx
|
||||
*
|
||||
* @author maurer.it_at_gmail.com
|
||||
*/
|
||||
public class InvertCondition implements Condition {
|
||||
|
||||
private Condition condition;
|
||||
|
||||
public InvertCondition(Condition condition) {
|
||||
public InvertCondition ( Condition condition ) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
|
|
@ -1,57 +1,61 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* A simple {@link Condition} to invert a decorated conditions
|
||||
* {@link Condition#apply(mage.game.Game, mage.abilities.Ability) apply(mage.game.Game, mage.abilities.Ability)}
|
||||
* method invocation.
|
||||
*
|
||||
* @author maurer.it_at_gmail.com
|
||||
*/
|
||||
public class UnlessCondition implements Condition {
|
||||
|
||||
private Condition condition;
|
||||
|
||||
public UnlessCondition ( Condition condition ) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
/*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return !condition.apply(game, source);
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.condition;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* A simple {@link Condition} to check the condition only one time at the start (result locked in).
|
||||
* All subsequent checks return the first result.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LockedInCondition implements Condition {
|
||||
|
||||
private boolean conditionChecked = false;
|
||||
private boolean result;
|
||||
private Condition condition;
|
||||
|
||||
public LockedInCondition ( Condition condition ) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
/*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if(!conditionChecked) {
|
||||
result = !condition.apply(game, source);
|
||||
conditionChecked = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ package mage.abilities.decorator;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.FixedCondition;
|
||||
import mage.abilities.condition.FixedCondition;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ import mage.players.Player;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -46,19 +49,32 @@ import mage.abilities.Mode;
|
|||
public class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffect> {
|
||||
|
||||
private Counter counter;
|
||||
private DynamicValue amount;
|
||||
|
||||
public AddCountersTargetEffect(Counter counter) {
|
||||
this(counter, Outcome.Benefit);
|
||||
}
|
||||
}
|
||||
|
||||
public AddCountersTargetEffect(Counter counter, Outcome outcome) {
|
||||
public AddCountersTargetEffect(Counter counter, DynamicValue amount) {
|
||||
this(counter, amount, Outcome.Benefit);
|
||||
}
|
||||
|
||||
public AddCountersTargetEffect(Counter counter, Outcome outcome) {
|
||||
this(counter, new StaticValue(0), outcome);
|
||||
}
|
||||
|
||||
public AddCountersTargetEffect(Counter counter, DynamicValue amount, Outcome outcome) {
|
||||
super(outcome);
|
||||
this.counter = counter;
|
||||
}
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public AddCountersTargetEffect(final AddCountersTargetEffect effect) {
|
||||
super(effect);
|
||||
this.counter = effect.counter.copy();
|
||||
if (effect.counter != null) {
|
||||
this.counter = effect.counter.copy();
|
||||
}
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -68,13 +84,17 @@ public class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffe
|
|||
Permanent permanent = game.getPermanent(uuid);
|
||||
if (permanent != null) {
|
||||
if (counter != null) {
|
||||
permanent.addCounters(counter.copy(), game);
|
||||
Counter newCounter = counter.copy();
|
||||
newCounter.add(amount.calculate(game, source));
|
||||
permanent.addCounters(newCounter, game);
|
||||
affectedTargets ++;
|
||||
}
|
||||
} else {
|
||||
Player player = game.getPlayer(uuid);
|
||||
if (player != null) {
|
||||
player.addCounters(counter.copy(), game);
|
||||
Counter newCounter = counter.copy();
|
||||
newCounter.add(amount.calculate(game, source));
|
||||
player.addCounters(newCounter, game);
|
||||
affectedTargets ++;
|
||||
}
|
||||
}
|
||||
|
|
@ -87,14 +107,18 @@ public class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffe
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("put ");
|
||||
if (counter.getCount() > 1) {
|
||||
sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters on target ");
|
||||
sb.append(CardUtil.numberToText(counter.getCount())).append(" ");
|
||||
} else {
|
||||
sb.append("a ");
|
||||
}
|
||||
else {
|
||||
sb.append("a ").append(counter.getName()).append(" counter on target ");
|
||||
}
|
||||
// TODO add normal text infrastructure for target pointers
|
||||
if (mode.getTargets().size() > 0)
|
||||
sb.append(counter.getName().toLowerCase()).append(" counter on target ");
|
||||
// TODO: add normal text infrastructure for target pointers
|
||||
if (mode.getTargets().size() > 0) {
|
||||
sb.append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
if (amount.getMessage().length() > 0) {
|
||||
sb.append(" for each ").append(amount.getMessage());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue