mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixes #512
This commit is contained in:
parent
7ddd36af0f
commit
5ede7221c8
199 changed files with 637 additions and 557 deletions
|
@ -27,17 +27,17 @@
|
|||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
@ -45,6 +45,8 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -83,7 +85,7 @@ public class Anathemancer extends CardImpl {
|
|||
class AnathemancerCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility.getFirstTarget() == null) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -27,20 +27,21 @@
|
|||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -75,7 +76,7 @@ public class DemonspineWhip extends CardImpl {
|
|||
class XPaid implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int paid = sourceAbility.getManaCostsToPay().getX();
|
||||
return paid;
|
||||
}
|
||||
|
|
|
@ -101,13 +101,13 @@ class LavalancheEffect extends OneShotEffect {
|
|||
if (targetPlayer == null) {
|
||||
return false;
|
||||
}
|
||||
targetPlayer.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
targetPlayer.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
|
||||
FilterPermanent filter = new FilterPermanent("and each creature he or she controls");
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent: permanents) {
|
||||
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class DamageOpponentsEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -27,20 +27,22 @@
|
|||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
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.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -74,7 +76,7 @@ public class LordOfExtinction extends CardImpl {
|
|||
class LordOfExtinctionDynamicCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (UUID playerId : game.getPlayer(sourceAbility.getControllerId()).getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -41,6 +41,8 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.watchers.common.PlayerLostLifeWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -77,7 +79,7 @@ public class TaintedSigil extends CardImpl {
|
|||
class AllPlayersLostLifeCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return this.calculate(game, sourceAbility.getControllerId());
|
||||
}
|
||||
|
||||
|
@ -107,4 +109,4 @@ class AllPlayersLostLifeCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "the total life lost by all players this turn";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class HelmOfObedienceEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
int max = amount.calculate(game, source);
|
||||
int max = amount.calculate(game, source, this);
|
||||
if(max != 0){
|
||||
int numberOfCard = 0;
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class BurnAtTheStakeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = (new GetXValue()).calculate(game, source) * 3;
|
||||
int amount = (new GetXValue()).calculate(game, source, this) * 3;
|
||||
|
||||
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class FettergeistUnlessPaysEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 1);
|
||||
int count = amount.calculate(game, source);
|
||||
int count = amount.calculate(game, source, this);
|
||||
if (count == 0) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class KillingWaveEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
int amount = (new ManacostVariableValue()).calculate(game, source);
|
||||
int amount = (new ManacostVariableValue()).calculate(game, source, this);
|
||||
if (amount > 0) {
|
||||
LinkedList<Permanent> sacrifices = new LinkedList<Permanent>();
|
||||
HashMap<UUID, Integer> lifePaidAmounts = new HashMap<UUID, Integer>();
|
||||
|
|
|
@ -27,15 +27,16 @@
|
|||
*/
|
||||
package mage.sets.avacynrestored;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
@ -76,7 +77,7 @@ public class Malignus extends CardImpl {
|
|||
|
||||
class HighestLifeTotalAmongOpponentsCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller != null) {
|
||||
|
|
|
@ -27,18 +27,13 @@
|
|||
*/
|
||||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
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.LoyaltyAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
|
@ -49,6 +44,7 @@ import mage.abilities.effects.common.continious.MaximumHandSizeControllerEffect.
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
|
@ -61,6 +57,8 @@ import mage.target.TargetPermanent;
|
|||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -112,7 +110,7 @@ class TappedCreaturesControlledByTargetCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return game.getBattlefield().countAll(filter, sourceAbility.getFirstTarget(), game);
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ class TibaltTheFiendBloodedControlEffect extends ContinuousEffectImpl {
|
|||
class CardsInTargetHandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
Player player = game.getPlayer(sourceAbility.getFirstTarget());
|
||||
if (player != null) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class DisruptingShoalCounterTargetEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
DynamicValue amount = new ExileFromHandCostCardConvertedMana();
|
||||
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
|
||||
if (spell != null && spell.getConvertedManaCost() == amount.calculate(game, source)) {
|
||||
if (spell != null && spell.getConvertedManaCost() == amount.calculate(game, source, this)) {
|
||||
return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -111,7 +111,7 @@ class ShiningShoalPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
this.amount = dynamicAmount.calculate(game, source);
|
||||
this.amount = dynamicAmount.calculate(game, source, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -93,7 +93,7 @@ class AcolytesRewardEffect extends PreventionEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
amount = new DevotionCount(ColoredManaSymbol.W).calculate(game, source);
|
||||
amount = new DevotionCount(ColoredManaSymbol.W).calculate(game, source, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.bornofthegods;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -48,6 +47,8 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -95,7 +96,7 @@ public class ChampionOfStraySouls extends CardImpl {
|
|||
if (ability instanceof SimpleActivatedAbility) {
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
||||
int xValue = new GetXValue().calculate(game, ability);
|
||||
int xValue = new GetXValue().calculate(game, ability, null);
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class HeroesPodiumLegendaryCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game);
|
||||
if (value > 0) {
|
||||
value--;
|
||||
|
|
|
@ -99,7 +99,7 @@ class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return blocker.getPower().getValue() >= dynamicValue.calculate(game, source);
|
||||
return blocker.getPower().getValue() >= dynamicValue.calculate(game, source, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -90,7 +90,7 @@ class MarshmistTitanCostReductionEffect extends CostModificationEffectImpl {
|
|||
SpellAbility spellAbility = (SpellAbility)abilityToModify;
|
||||
Mana mana = spellAbility.getManaCostsToPay().getMana();
|
||||
if (mana.getColorless() > 0) {
|
||||
int count = new DevotionCount(ColoredManaSymbol.B).calculate(game, source);
|
||||
int count = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this);
|
||||
int newCount = mana.getColorless() - count;
|
||||
if (newCount < 0) {
|
||||
newCount = 0;
|
||||
|
|
|
@ -28,24 +28,25 @@
|
|||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -114,7 +115,7 @@ class ZuberasDiedWatcher extends Watcher {
|
|||
class ZuberasDiedDynamicValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
ZuberasDiedWatcher watcher = (ZuberasDiedWatcher) game.getState().getWatchers().get("ZuberasDied");
|
||||
return watcher.zuberasDiedThisTurn;
|
||||
}
|
||||
|
@ -133,4 +134,4 @@ class ZuberasDiedDynamicValue implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "Zubera that died this turn";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,8 +140,8 @@ class KondasBannerTypeBoostEffect extends BoostAllEffect {
|
|||
for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (CardUtil.shareSubtypes(perm, equipedCreature) || perm.getAbilities().contains(ChangelingAbility.getInstance())) {
|
||||
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
||||
perm.addPower(power.calculate(game, source));
|
||||
perm.addToughness(toughness.calculate(game, source));
|
||||
perm.addPower(power.calculate(game, source, this));
|
||||
perm.addToughness(toughness.calculate(game, source, this));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -183,8 +183,8 @@ class KondasBannerColorBoostEffect extends BoostAllEffect {
|
|||
for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (equipedCreature.getColor().shares(perm.getColor())) {
|
||||
if (!this.affectedObjectsSet || objects.contains(perm.getId())) {
|
||||
perm.addPower(power.calculate(game, source));
|
||||
perm.addToughness(toughness.calculate(game, source));
|
||||
perm.addPower(power.calculate(game, source, this));
|
||||
perm.addToughness(toughness.calculate(game, source, this));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -199,4 +199,4 @@ class KondasBannerColorBoostEffect extends BoostAllEffect {
|
|||
return new KondasBannerColorBoostEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,18 +28,19 @@
|
|||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
|
@ -73,7 +74,7 @@ public class SilentChantZubera extends CardImpl {
|
|||
class SilentChantZuberaDynamicValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
ZuberasDiedWatcher watcher = (ZuberasDiedWatcher) game.getState().getWatchers().get("ZuberasDied");
|
||||
return watcher.zuberasDiedThisTurn * 2;
|
||||
}
|
||||
|
@ -92,4 +93,4 @@ class SilentChantZuberaDynamicValue implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "Zubera that died this turn";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,25 +28,20 @@
|
|||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.BushidoAbility;
|
||||
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.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -121,7 +116,7 @@ class TakenoSamuraiGeneralEffect extends ContinuousEffectImpl {
|
|||
if (!perm.getId().equals(source.getSourceId())) {
|
||||
for (Ability ability : perm.getAbilities()) {
|
||||
if (ability instanceof BushidoAbility) {
|
||||
int value = ((BushidoAbility) ability).getValue(source, game);
|
||||
int value = ((BushidoAbility) ability).getValue(source, game, this);
|
||||
perm.addPower(value);
|
||||
perm.addToughness(value);
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class LightningStormCountCondition implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Spell spell = game.getStack().getSpell(sourceAbility.getSourceId());
|
||||
if (spell != null) {
|
||||
return spell.getCounters().getCount(counter) + 3;
|
||||
|
|
|
@ -27,22 +27,18 @@
|
|||
*/
|
||||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -50,6 +46,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -121,7 +119,7 @@ class SewerNemesisChoosePlayerEffect extends OneShotEffect {
|
|||
|
||||
class CardsInTargetOpponentsGraveyardCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + "_player");
|
||||
Player chosenPlayer = game.getPlayer(playerId);
|
||||
|
|
|
@ -100,7 +100,7 @@ class TheMimeoplasmEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source) >= 2) {
|
||||
if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) {
|
||||
TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of"));
|
||||
TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card for additional +1/+1 counters"));
|
||||
|
@ -125,4 +125,4 @@ class TheMimeoplasmEffect extends OneShotEffect {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,17 +27,16 @@
|
|||
*/
|
||||
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.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -55,6 +54,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -158,7 +159,7 @@ class VishKalBloodArbiterDynamicValue implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
for(Cost cost : source.getCosts()){
|
||||
if(cost instanceof VishKalBloodArbiterCost){
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.commander2013;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
@ -57,6 +56,8 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -159,7 +160,7 @@ class MarathWillOfTheWildCreateTokenEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
int amount = new ManacostVariableValue().calculate(game, source);
|
||||
int amount = new ManacostVariableValue().calculate(game, source, this);
|
||||
Token token = new MarathWillOfTheWildElementalToken();
|
||||
token.getPower().initValue(amount);
|
||||
token.getToughness().initValue(amount);
|
||||
|
@ -203,7 +204,7 @@ class MarathWillOfTheWildRemoveCountersCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
int amount = new ManacostVariableValue().calculate(game, ability);
|
||||
int amount = new ManacostVariableValue().calculate(game, ability, null);
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null && permanent.getCounters().getCount(CounterType.P1P1) >= amount) {
|
||||
permanent.removeCounters(CounterType.P1P1.getName(), amount, game);
|
||||
|
|
|
@ -113,7 +113,7 @@ class SpringjackPastureEffect extends OneShotEffect {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
|
||||
if (you != null && choice != null) {
|
||||
int count = new GetXValue().calculate(game, source);
|
||||
int count = new GetXValue().calculate(game, source, this);
|
||||
if (choice.getColor().isBlack()) {
|
||||
you.getManaPool().addMana(new Mana(0, 0, 0, 0, count, 0, 0), game, source);
|
||||
} else if (choice.getColor().isBlue()) {
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
*/
|
||||
package mage.sets.commander2013;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -43,6 +43,8 @@ import mage.game.Game;
|
|||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -76,7 +78,7 @@ public class TerraRavager extends CardImpl {
|
|||
class TerraRavagerLandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
for (CombatGroup group :game.getCombat().getGroups()) {
|
||||
if (group.getAttackers().contains(sourceAbility.getSourceId())) {
|
||||
UUID defenderId = group.getDefenderId();
|
||||
|
|
|
@ -93,7 +93,7 @@ class WarCadenceReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null) {
|
||||
int amount = xCosts.calculate(game, source);
|
||||
int amount = xCosts.calculate(game, source, this);
|
||||
if (amount > 0) {
|
||||
String mana = new StringBuilder("{").append(amount).append("}").toString();
|
||||
ManaCostsImpl cost = new ManaCostsImpl(mana);
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
|
@ -37,11 +36,7 @@ import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
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.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
@ -50,6 +45,8 @@ import mage.game.stack.Spell;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -94,7 +91,7 @@ class testCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = (Spell) game.getStack().getStackObject(source.getSourceId());
|
||||
if (spell != null) {
|
||||
return (xValue.calculate(game, spell.getSpellAbility()) >= limit);
|
||||
return (xValue.calculate(game, spell.getSpellAbility(), null) >= limit);
|
||||
}
|
||||
return false;
|
||||
|
||||
|
|
|
@ -27,26 +27,24 @@
|
|||
*/
|
||||
package mage.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
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.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -120,7 +118,7 @@ class ChooseOpponent extends OneShotEffect {
|
|||
class CardsInChosenPlayerHandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + "_player");
|
||||
Player chosenPlayer = game.getPlayer(playerId);
|
||||
|
@ -145,4 +143,4 @@ class CardsInChosenPlayerHandCount implements DynamicValue {
|
|||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
*/
|
||||
package mage.sets.conflux;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -42,10 +38,15 @@ import mage.abilities.effects.common.DevourEffect.DevourFactor;
|
|||
import mage.abilities.keyword.DevourAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -86,14 +87,14 @@ public class VoraciousDragon extends CardImpl {
|
|||
class TwiceDevouredGoblins implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent sourcePermanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
for (Ability ability : sourcePermanent.getAbilities()) {
|
||||
if (ability instanceof DevourAbility) {
|
||||
for (Effect effect: ability.getEffects()) {
|
||||
if (effect instanceof DevourEffect) {
|
||||
DevourEffect devourEffect = (DevourEffect) effect;
|
||||
for (Effect abilityEffect: ability.getEffects()) {
|
||||
if (abilityEffect instanceof DevourEffect) {
|
||||
DevourEffect devourEffect = (DevourEffect) abilityEffect;
|
||||
int amountGoblins = 0;
|
||||
for (ArrayList<String> subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) {
|
||||
if (subtypesItem.contains("Goblin")) {
|
||||
|
|
|
@ -94,7 +94,7 @@ class WorldlyCounselEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
Cards cards = new CardsImpl(Zone.PICK);
|
||||
int count = (new DomainValue()).calculate(game, source);
|
||||
int count = (new DomainValue()).calculate(game, source, this);
|
||||
count = Math.min(player.getLibrary().size(), count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
|
|
|
@ -83,7 +83,7 @@ class ArchangelsLightEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
DynamicValue value = new CardsInControllerGraveyardCount();
|
||||
if (player != null) {
|
||||
player.gainLife(value.calculate(game, source) * 2, game);
|
||||
player.gainLife(value.calculate(game, source, this) * 2, game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
player.shuffleLibrary(game);
|
||||
|
@ -97,4 +97,4 @@ class ArchangelsLightEffect extends OneShotEffect {
|
|||
return new ArchangelsLightEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,18 +27,17 @@
|
|||
*/
|
||||
package mage.sets.darkascension;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -47,6 +46,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -125,7 +126,7 @@ class CursesAttachedCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
Permanent enchantment = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
|
|
|
@ -27,11 +27,6 @@
|
|||
*/
|
||||
package mage.sets.dragonsmaze;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
@ -40,12 +35,18 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -119,7 +120,7 @@ class LoseLifeControllerAttachedEffect extends OneShotEffect {
|
|||
if (creature != null) {
|
||||
Player player = game.getPlayer(creature.getControllerId());
|
||||
if (player != null) {
|
||||
player.loseLife(amount.calculate(game, source), game);
|
||||
player.loseLife(amount.calculate(game, source, this), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ToilTrouble extends SplitCard {
|
|||
class TargetPlayerCardsInHandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player targetPlayer = game.getPlayer(sourceAbility.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
return targetPlayer.getHand().size();
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
*/
|
||||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
|
@ -44,6 +44,8 @@ import mage.constants.Rarity;
|
|||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -86,7 +88,7 @@ class ChromaHeartlashCinderCount implements DynamicValue {
|
|||
private int chroma;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
chroma = 0;
|
||||
for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) {
|
||||
chroma += card.getManaCost().getMana().getRed();
|
||||
|
@ -108,4 +110,4 @@ class ChromaHeartlashCinderCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,8 +108,8 @@ class LightFromWithinEffect extends ContinuousEffectImpl {
|
|||
if (creature != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
creature.addPower(new ChromaLightFromWithinCount(creature).calculate(game, source));
|
||||
creature.addToughness(new ChromaLightFromWithinCount(creature).calculate(game, source));
|
||||
creature.addPower(new ChromaLightFromWithinCount(creature).calculate(game, source, this));
|
||||
creature.addToughness(new ChromaLightFromWithinCount(creature).calculate(game, source, this));
|
||||
boosted = true;
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class ChromaLightFromWithinCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int chroma = 0;
|
||||
chroma += permanent.getManaCost().getMana().getWhite();
|
||||
return chroma;
|
||||
|
|
|
@ -109,7 +109,7 @@ class NightmareIncursionEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (controller != null && targetPlayer != null) {
|
||||
int amount = new PermanentsOnBattlefieldCount(filter).calculate(game, source);
|
||||
int amount = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard());
|
||||
if (controller.searchLibrary(target, game, targetPlayer.getId())) {
|
||||
List<UUID> targetId = target.getTargets();
|
||||
|
|
|
@ -83,7 +83,7 @@ class ChromaOutrageShamanCount implements DynamicValue {
|
|||
private int chroma;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
chroma = 0;
|
||||
for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) {
|
||||
chroma += card.getManaCost().getMana().getRed();
|
||||
|
@ -105,4 +105,4 @@ class ChromaOutrageShamanCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class ChromaPrimalcruxCount implements DynamicValue {
|
|||
private int chroma;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
chroma = 0;
|
||||
for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) {
|
||||
chroma += card.getManaCost().getMana().getGreen();
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*/
|
||||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -43,6 +43,8 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -98,7 +100,7 @@ class SanityGrindingEffect extends OneShotEffect {
|
|||
}
|
||||
you.revealCards("Sanity Grinding", revealed, game);
|
||||
if (targetOpponent != null) {
|
||||
amount = (Math.min(targetOpponent.getLibrary().size(), new ChromaSanityGrindingCount(revealed).calculate(game, source)));
|
||||
amount = (Math.min(targetOpponent.getLibrary().size(), new ChromaSanityGrindingCount(revealed).calculate(game, source, this)));
|
||||
for (int i = 0; i < amount; i++) {
|
||||
targetOpponent.getLibrary().removeFromTop(game).moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
}
|
||||
|
@ -125,7 +127,7 @@ class ChromaSanityGrindingCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int chroma = 0;
|
||||
for (Card card : revealed.getCards(game)) {
|
||||
chroma += card.getManaCost().getMana().getBlue();
|
||||
|
|
|
@ -80,7 +80,7 @@ public class SpringjackShepherd extends CardImpl {
|
|||
class ChromaSpringjackShepherdCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int chroma = 0;
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) {
|
||||
chroma += permanent.getManaCost().getMana().getWhite();
|
||||
|
@ -114,4 +114,4 @@ class GoatToken extends Token {
|
|||
power = new MageInt(0);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ class ChromaUmbraStalkerCount implements DynamicValue {
|
|||
private int chroma;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
chroma = 0;
|
||||
Player you = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (you == null) {
|
||||
|
|
|
@ -27,25 +27,26 @@
|
|||
*/
|
||||
package mage.sets.exodus;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -123,7 +124,7 @@ class ChooseOpponent extends OneShotEffect {
|
|||
|
||||
class CardsInTargetPlayerHandCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + "_player");
|
||||
Player chosenPlayer = game.getPlayer(playerId);
|
||||
|
@ -148,4 +149,4 @@ class CardsInTargetPlayerHandCount implements DynamicValue {
|
|||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,27 +27,24 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -138,7 +135,7 @@ class CardsInOpponentsGraveyardsCount implements DynamicValue {
|
|||
super();
|
||||
}
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (UUID playerUUID : game.getOpponents(sourceAbility.getControllerId())) {
|
||||
Player player = game.getPlayer(playerUUID);
|
||||
|
|
|
@ -27,20 +27,16 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
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.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
|
@ -49,6 +45,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -99,7 +97,7 @@ class CardsInEnchantedCreaturesControllerGraveyardCount implements DynamicValue
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent attachment = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (attachment != null) {
|
||||
Permanent creature = game.getPermanent(attachment.getAttachedTo());
|
||||
|
|
|
@ -27,21 +27,22 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continious.MaximumHandSizeControllerEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.turn.Step;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -75,7 +76,7 @@ public class EnterTheInfinite extends CardImpl {
|
|||
|
||||
class CardsInControllerLibraryCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller != null) {
|
||||
|
@ -161,4 +162,4 @@ class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect{
|
|||
public MaximumHandSizeEffect copy() {
|
||||
return new MaximumHandSizeEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
|
@ -37,6 +34,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CountersCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
||||
import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect;
|
||||
|
@ -44,6 +42,7 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
|
@ -52,6 +51,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -97,7 +98,7 @@ class PermanentsTargetOpponentControlsCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility.getFirstTarget() != null) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(sourceAbility.getFirstTarget()));
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
|
@ -44,6 +44,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -81,18 +83,17 @@ public class MurderInvestigation extends CardImpl {
|
|||
class AttachedPermanentPowerCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent attachmentPermanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (attachmentPermanent == null) {
|
||||
attachmentPermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (attachmentPermanent != null && attachmentPermanent.getAttachedTo() != null) {
|
||||
Permanent attached = game.getPermanent(attachmentPermanent.getAttachedTo());
|
||||
if (attached == null) {
|
||||
attached = (Permanent) game.getLastKnownInformation(attachmentPermanent.getAttachedTo(), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (attached != null) {
|
||||
return attached.getPower().getValue();
|
||||
if (effect.getValue("attachedTo") != null) {
|
||||
Permanent attached = (Permanent)effect.getValue("attachedTo");
|
||||
if (attached != null) {
|
||||
return attached.getPower().getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -71,7 +71,7 @@ public class PredatorsRapport extends CardImpl {
|
|||
class TargetPermanentPowerPlusToughnessCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent sourcePermanent = game.getPermanent(sourceAbility.getFirstTarget());
|
||||
if (sourcePermanent != null) {
|
||||
return sourcePermanent.getPower().getValue() + sourcePermanent.getToughness().getValue();
|
||||
|
|
|
@ -28,23 +28,25 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -84,7 +86,7 @@ class greatestPowerCount implements DynamicValue {
|
|||
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int value = 0;
|
||||
for(Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)){
|
||||
if(creature != null && creature.getPower().getValue() > value && !sourceAbility.getSourceId().equals(creature.getId())){
|
||||
|
@ -108,4 +110,4 @@ class greatestPowerCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "greatest power among other creatures you control";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,18 +27,17 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -46,6 +45,8 @@ import mage.game.stack.StackObject;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -96,7 +97,7 @@ class SpellRuptureCounterUnlessPaysEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (player != null && controller != null && sourceObject != null) {
|
||||
int amount = new greatestPowerCountCreatureYouControl().calculate(game, source);
|
||||
int amount = new greatestPowerCountCreatureYouControl().calculate(game, source, this);
|
||||
GenericManaCost cost = new GenericManaCost(amount);
|
||||
StringBuilder sb = new StringBuilder("Pay {").append(amount).append("}? (otherwise ").append(spell.getName()).append(" will be countered)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
|
@ -123,7 +124,7 @@ class SpellRuptureCounterUnlessPaysEffect extends OneShotEffect {
|
|||
class greatestPowerCountCreatureYouControl implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int value = 0;
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)) {
|
||||
if (creature != null && creature.getPower().getValue() > value) {
|
||||
|
@ -147,4 +148,4 @@ class greatestPowerCountCreatureYouControl implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "greatest power among creatures you control";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,23 +27,24 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -93,7 +94,7 @@ class CardsInOpponentGraveyardsCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (UUID playerUUID : game.getOpponents(sourceAbility.getControllerId())) {
|
||||
Player player = game.getPlayer(playerUUID);
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.sets.iceage;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -41,6 +38,7 @@ import mage.abilities.effects.ReplacementEffectImpl;
|
|||
import mage.abilities.effects.common.PreventAllDamageToControllerEffect;
|
||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
@ -51,6 +49,8 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -112,7 +112,7 @@ class SacrificeControllerEffect extends OneShotEffect{
|
|||
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
|
||||
int amount = count.calculate(game, source);
|
||||
int amount = count.calculate(game, source, this);
|
||||
int realCount = game.getBattlefield().countAll(filter, player.getId(), game);
|
||||
amount = Math.min(amount, realCount);
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -41,6 +41,8 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -79,7 +81,7 @@ class HalfZombiesCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = game.getBattlefield().countAll(filter, sourceAbility.getControllerId(), game) / 2;
|
||||
return amount;
|
||||
}
|
||||
|
@ -98,4 +100,4 @@ class HalfZombiesCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "half the number of Zombies you control, rounded down";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
@ -41,6 +41,7 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
@ -105,7 +106,7 @@ public class GarrukTheVeilCursed extends CardImpl {
|
|||
class GarrukTheVeilCursedValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player != null) {
|
||||
return player.getGraveyard().getCards(new FilterCreatureCard(), game).size();
|
||||
|
|
|
@ -27,22 +27,18 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -52,6 +48,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -167,7 +165,7 @@ class GutterGrimeCounters implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent p = game.getPermanent(sourceId);
|
||||
if (p != null) {
|
||||
return p.getCounters().getCount(CounterType.SLIME);
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
@ -85,7 +86,7 @@ public class RunechantersPike extends CardImpl {
|
|||
class RunechantersPikeValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player != null) {
|
||||
return player.getGraveyard().getCards(RunechantersPike.filterCard, game).size();
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.invasion;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -35,6 +34,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
|
@ -51,6 +51,8 @@ import mage.filter.predicate.permanent.PermanentIdPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SaprolingToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -103,7 +105,7 @@ class GetKickerXValue implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
|
|
|
@ -110,7 +110,7 @@ class NessianGameWardenEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
Cards cards = new CardsImpl();
|
||||
int count = new PermanentsOnBattlefieldCount(filter).calculate(game, source);
|
||||
int count = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
|
||||
count = Math.min(player.getLibrary().size(), count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
|
|
|
@ -27,11 +27,10 @@
|
|||
*/
|
||||
package mage.sets.limitedalpha;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
|
@ -43,6 +42,8 @@ import mage.game.Game;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author KholdFuzion
|
||||
|
@ -86,7 +87,7 @@ class HalfForestsDownCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = game.getBattlefield().countAll(filter, sourceAbility.getControllerId(), game) / 2;
|
||||
return amount;
|
||||
}
|
||||
|
@ -116,7 +117,7 @@ class HalfForestsUpCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = (int) Math.ceil(game.getBattlefield().countAll(filter, sourceAbility.getControllerId(), game) / 2f);
|
||||
return amount;
|
||||
}
|
||||
|
|
|
@ -28,19 +28,20 @@
|
|||
|
||||
package mage.sets.magic2010;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayVariableLoyaltyCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
@ -94,7 +95,7 @@ class ChandraNalaarXValue implements DynamicValue {
|
|||
private static final ChandraNalaarXValue defaultValue = new ChandraNalaarXValue();
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
for (Cost cost : sourceAbility.getCosts()) {
|
||||
if (cost instanceof PayVariableLoyaltyCost) {
|
||||
return ((PayVariableLoyaltyCost)cost).getAmount();
|
||||
|
|
|
@ -102,7 +102,7 @@ class JaceMemoryAdeptEffect extends DrawCardTargetEffect {
|
|||
for (UUID target : targetPointer.getTargets(game, source)) {
|
||||
Player player = game.getPlayer(target);
|
||||
if (player != null) {
|
||||
player.drawCards(amount.calculate(game, source), game);
|
||||
player.drawCards(amount.calculate(game, source, this), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
*/
|
||||
package mage.sets.magic2012;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -143,7 +144,7 @@ class SuturedGhoulPowerCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
Permanent permanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (permanent != null) {
|
||||
|
@ -185,7 +186,7 @@ class SuturedGhoulToughnessCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
Permanent permanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (permanent != null) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class BoundlessRealmsEffect extends OneShotEffect {
|
|||
FilterLandPermanent filter = new FilterLandPermanent();
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
|
||||
int amount = new PermanentsOnBattlefieldCount(filter).calculate(game, source);
|
||||
int amount = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterBasicLandCard());
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
|
|
@ -87,7 +87,7 @@ class DiabolicRevelationEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = new ManacostVariableValue().calculate(game, source);
|
||||
int amount = new ManacostVariableValue().calculate(game, source, this);
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard());
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
|
|
@ -102,7 +102,7 @@ class ShieldOfTheAvatarPreventionEffect extends PreventionEffectImpl {
|
|||
boolean result = false;
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
int numberOfCreaturesControlled = new PermanentsOnBattlefieldCount(filter).calculate(game, source);
|
||||
int numberOfCreaturesControlled = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
|
||||
int toPrevent = Math.min(numberOfCreaturesControlled, event.getAmount());
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, equipment.getAttachedTo(), source.getSourceId(), source.getControllerId(), toPrevent, false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
|
|
|
@ -32,6 +32,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -78,7 +79,7 @@ class GolemSkinGauntletsAttachedCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (equipment != null) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
|
@ -53,6 +52,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -128,7 +129,7 @@ class TezzeretAgentOfBolasEffect2 extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
DynamicValue value = new PermanentsOnBattlefieldCount(filter);
|
||||
int count = value.calculate(game, source) * 2;
|
||||
int count = value.calculate(game, source, this) * 2;
|
||||
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
|
|
|
@ -27,17 +27,17 @@
|
|||
*/
|
||||
package mage.sets.newphyrexia;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
@ -45,6 +45,8 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.game.permanent.token.BeastToken;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -114,7 +116,7 @@ class FreshMeatWatcher extends Watcher {
|
|||
class FreshMeatDynamicValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
FreshMeatWatcher watcher = (FreshMeatWatcher) game.getState().getWatchers().get("YourCreaturesDied", sourceAbility.getControllerId());
|
||||
if (watcher != null) {
|
||||
return watcher.getCreaturesCount();
|
||||
|
|
|
@ -27,22 +27,24 @@
|
|||
*/
|
||||
package mage.sets.newphyrexia;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
|
@ -75,7 +77,7 @@ public class IchorExplosion extends CardImpl {
|
|||
|
||||
class IchorExplosionDynamicValue implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Card sourceCard = game.getCard(sourceAbility.getSourceId());
|
||||
if (sourceCard != null) {
|
||||
for (Object cost: sourceAbility.getCosts()) {
|
||||
|
|
|
@ -27,23 +27,25 @@
|
|||
*/
|
||||
package mage.sets.newphyrexia;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.InfectAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.token.InsectInfectToken;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -78,7 +80,7 @@ public class PhyrexianSwarmlord extends CardImpl {
|
|||
class OpponentsPoisonCountersCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
Set<UUID> playerList = game.getOpponents(sourceAbility.getControllerId());
|
||||
for (UUID playerUUID : playerList) {
|
||||
|
|
|
@ -27,12 +27,10 @@
|
|||
*/
|
||||
package mage.sets.odyssey;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -46,6 +44,8 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -134,8 +134,8 @@ class SkeletalScryingEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if ( controller != null ) {
|
||||
controller.drawCards(amount.calculate(game, source), game);
|
||||
controller.loseLife(amount.calculate(game, source), game);
|
||||
controller.drawCards(amount.calculate(game, source, this), game);
|
||||
controller.loseLife(amount.calculate(game, source, this), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,17 +27,16 @@
|
|||
*/
|
||||
package mage.sets.onslaught;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
@ -45,6 +44,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -78,7 +79,7 @@ public class SoullessOne extends CardImpl {
|
|||
class SoullessOneDynamicCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
FilterPermanent zombiesBattlefield = new FilterPermanent("Zombies on the battlefield");
|
||||
FilterCard zombiesInGraveyard = new FilterCard("Zombie cards in all graveyards");
|
||||
zombiesBattlefield.add(new SubtypePredicate("Zombie"));
|
||||
|
|
|
@ -27,30 +27,27 @@
|
|||
*/
|
||||
package mage.sets.ravnika;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.TopLibraryCardTypeCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.players.Player;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.effects.common.continious.PlayWithTheTopCardRevealedEffect;
|
||||
import static mage.abilities.condition.common.TopLibraryCardTypeCondition.CheckType.*;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.TopLibraryCardTypeCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continious.PlayWithTheTopCardRevealedEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import static mage.abilities.condition.common.TopLibraryCardTypeCondition.CheckType.CREATURE;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -108,8 +105,8 @@ class CrownOfConvergenceColorBoostEffect extends BoostAllEffect {
|
|||
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (permanent.getColor().shares(topCard.getColor()) && !permanent.getColor().isColorless()) {
|
||||
if (!this.affectedObjectsSet || objects.contains(permanent.getId())) {
|
||||
permanent.addPower(power.calculate(game, source));
|
||||
permanent.addToughness(toughness.calculate(game, source));
|
||||
permanent.addPower(power.calculate(game, source, this));
|
||||
permanent.addToughness(toughness.calculate(game, source, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,20 +26,21 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.returntoravnica;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -77,7 +78,7 @@ class CivicSaberColorCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (equipment != null) {
|
||||
|
|
|
@ -91,7 +91,7 @@ class CryptbornHorrorEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
OpponentsLostLifeCount dynamicValue = new OpponentsLostLifeCount();
|
||||
if (dynamicValue != null) {
|
||||
int oll = dynamicValue.calculate(game, source);
|
||||
int oll = dynamicValue.calculate(game, source, this);
|
||||
if (oll > 0) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(oll), game);
|
||||
}
|
||||
|
@ -105,4 +105,4 @@ class CryptbornHorrorEffect extends OneShotEffect {
|
|||
public CryptbornHorrorEffect copy() {
|
||||
return new CryptbornHorrorEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ class RakdosLordOfRiotsCantCastEffect extends ContinuousRuleModifiyingEffectImpl
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) {
|
||||
if (new OpponentsLostLifeCount().calculate(game, source) == 0) {
|
||||
if (new OpponentsLostLifeCount().calculate(game, source, this) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class RakdosLordOfRiotsCostReductionEffect extends CostModificationEffectImpl {
|
|||
Ability spellAbility = (SpellAbility) abilityToModify;
|
||||
if (spellAbility != null) {
|
||||
OpponentsLostLifeCount dynamicValue = new OpponentsLostLifeCount();
|
||||
int amount = dynamicValue.calculate(game, source);
|
||||
int amount = dynamicValue.calculate(game, source, this);
|
||||
if (amount > 0) {
|
||||
CardUtil.reduceCost(spellAbility, amount);
|
||||
return true;
|
||||
|
|
|
@ -28,28 +28,25 @@
|
|||
|
||||
package mage.sets.returntoravnica;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -91,7 +88,7 @@ public class RighteousAuthority extends CardImpl {
|
|||
|
||||
class CardsInEnchantedControllerHandCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility != null) {
|
||||
Permanent attachment = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (attachment != null && attachment.getAttachedTo() != null) {
|
||||
|
@ -121,4 +118,4 @@ class CardsInEnchantedControllerHandCount implements DynamicValue {
|
|||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class SphereOfSafetyReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if ( player != null ) {
|
||||
int ce = countEnchantments.calculate(game, source);
|
||||
int ce = countEnchantments.calculate(game, source, this);
|
||||
ManaCostsImpl safetyCosts = new ManaCostsImpl("{"+ ce +"}");
|
||||
if ( safetyCosts.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {"+ ce +"} to declare attacker?", game) )
|
||||
|
@ -137,4 +137,4 @@ class SphereOfSafetyReplacementEffect extends ReplacementEffectImpl {
|
|||
return new SphereOfSafetyReplacementEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,8 +85,8 @@ class DevastatingSummonsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
|
||||
token.getPower().initValue(new GetXValue().calculate(game, source));
|
||||
token.getToughness().initValue(new GetXValue().calculate(game, source));
|
||||
token.getPower().initValue(new GetXValue().calculate(game, source, this));
|
||||
token.getToughness().initValue(new GetXValue().calculate(game, source, this));
|
||||
|
||||
token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
|
|
|
@ -28,21 +28,20 @@
|
|||
|
||||
package mage.sets.scarsofmirrodin;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
|
@ -52,6 +51,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
|
@ -129,7 +130,7 @@ class SameNameAsExiledCountValue implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int value = 0;
|
||||
Permanent permanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (permanent != null && permanent.getImprinted().size() > 0) {
|
||||
|
|
|
@ -28,21 +28,23 @@
|
|||
*/
|
||||
package mage.sets.scourge;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Backfir3
|
||||
|
@ -75,7 +77,7 @@ public class AncientOoze extends CardImpl {
|
|||
class AncientOozePowerToughnessValue implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int value = 0;
|
||||
for(Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)){
|
||||
if(creature != null && !sourceAbility.getSourceId().equals(creature.getId())){
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SuddenImpact extends CardImpl {
|
|||
class TargetPlayerCardsInHandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player targetPlayer = game.getPlayer(sourceAbility.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
return targetPlayer.getHand().size();
|
||||
|
|
|
@ -27,18 +27,20 @@
|
|||
*/
|
||||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -70,7 +72,7 @@ public class ViciousShadows extends CardImpl {
|
|||
class TargetPlayerCardsInHandCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player targetPlayer = game.getPlayer(sourceAbility.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
return targetPlayer.getHand().size();
|
||||
|
@ -93,4 +95,4 @@ class TargetPlayerCardsInHandCount implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "target player's cards in hand";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class KindleCardsInAllGraveyardsCount implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
PlayerList playerList = game.getPlayerList();
|
||||
for (UUID playerUUID : playerList) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class DiscipleOfPhenaxEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int devotion = new DevotionCount(ColoredManaSymbol.B).calculate(game, source);
|
||||
int devotion = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this);
|
||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (devotion > 0 && targetPlayer != null) {
|
||||
Cards revealedCards = new CardsImpl(Zone.PICK);
|
||||
|
|
|
@ -91,7 +91,7 @@ class GrayMerchantOfAsphodelEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int lifeLost = 0;
|
||||
int damage = new DevotionCount(ColoredManaSymbol.B).calculate(game, source);
|
||||
int damage = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this);
|
||||
if (damage > 0) {
|
||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.theros;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -43,6 +42,8 @@ import mage.constants.Rarity;
|
|||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -73,7 +74,7 @@ public class MogissMarauder extends CardImpl {
|
|||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
||||
ability.getTargets().clear();
|
||||
int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability);
|
||||
int numbTargets = new DevotionCount(ColoredManaSymbol.B).calculate(game, ability, null);
|
||||
if (numbTargets > 0) {
|
||||
ability.addTarget(new TargetCreaturePermanent(0,numbTargets));
|
||||
}
|
||||
|
|
|
@ -136,15 +136,15 @@ class NykthosDynamicManaEffect extends ManaEffect {
|
|||
if (choice != null && choice instanceof ChoiceColor && choice.getChoice() != null) {
|
||||
String color = choice.getChoice();
|
||||
if (color.equals("Red")) {
|
||||
computedMana.setRed(new DevotionCount(ColoredManaSymbol.R).calculate(game, source));
|
||||
computedMana.setRed(new DevotionCount(ColoredManaSymbol.R).calculate(game, source, this));
|
||||
} else if (color.equals("Blue")) {
|
||||
computedMana.setBlue(new DevotionCount(ColoredManaSymbol.U).calculate(game, source));
|
||||
computedMana.setBlue(new DevotionCount(ColoredManaSymbol.U).calculate(game, source, this));
|
||||
} else if (color.equals("White")) {
|
||||
computedMana.setWhite(new DevotionCount(ColoredManaSymbol.W).calculate(game, source));
|
||||
computedMana.setWhite(new DevotionCount(ColoredManaSymbol.W).calculate(game, source, this));
|
||||
} else if (color.equals("Black")) {
|
||||
computedMana.setBlack(new DevotionCount(ColoredManaSymbol.B).calculate(game, source));
|
||||
computedMana.setBlack(new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this));
|
||||
} else if (color.equals("Green")) {
|
||||
computedMana.setGreen(new DevotionCount(ColoredManaSymbol.G).calculate(game, source));
|
||||
computedMana.setGreen(new DevotionCount(ColoredManaSymbol.G).calculate(game, source, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
*/
|
||||
package mage.sets.timespiral;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -41,6 +41,8 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.watchers.common.PlayerLostLifeWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -77,7 +79,7 @@ public class ChildrenOfKorlis extends CardImpl {
|
|||
class SourceControllerLostLifeCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
|
||||
if (watcher != null) {
|
||||
return watcher.getLiveLost(sourceAbility.getControllerId());
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.torment;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.DiscardXTargetCost;
|
||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||
|
@ -42,6 +41,8 @@ import mage.game.Game;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -71,7 +72,7 @@ public class NostalgicDreams extends CardImpl {
|
|||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
int xValue = new GetXValue().calculate(game, ability);
|
||||
int xValue = new GetXValue().calculate(game, ability, null);
|
||||
// if (xValue > 0) {
|
||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCard("card from your graveyard"));
|
||||
ability.addTarget(target);
|
||||
|
|
|
@ -27,16 +27,18 @@
|
|||
*/
|
||||
package mage.sets.urzaslegacy;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -66,7 +68,7 @@ public class BlessedReversal extends CardImpl {
|
|||
class BlessedReversalCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (combatGroup.getDefenderId().equals(sourceAbility.getControllerId())) {
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
*/
|
||||
package mage.sets.urzaslegacy;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -39,9 +35,12 @@ import mage.abilities.costs.CostImpl;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
|
@ -49,6 +48,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -148,7 +149,7 @@ class MotltenHydraDynamicValue implements DynamicValue {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
for(Cost cost : source.getCosts()){
|
||||
if(cost instanceof RemoveAllCountersSourceCost){
|
||||
|
|
|
@ -27,22 +27,23 @@
|
|||
*/
|
||||
package mage.sets.urzaslegacy;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.keyword.ShroudAbility;
|
||||
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.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -77,7 +78,7 @@ public class MultaniMaroSorcerer extends CardImpl {
|
|||
|
||||
class CardsInHandCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (UUID playerId: game.getPlayer(sourceAbility.getControllerId()).getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue