mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
made many dynamicvalues into singleton enums
This commit is contained in:
parent
1d4b0895b4
commit
fd7b8f29ca
390 changed files with 507 additions and 509 deletions
|
|
@ -12,29 +12,29 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author MTGfan
|
||||
*/
|
||||
public class AttachedPermanentToughnessValue implements DynamicValue {
|
||||
|
||||
public enum AttachedPermanentToughnessValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo());
|
||||
return enchanted.getToughness().getValue();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AttachedPermanentToughnessValue copy(){
|
||||
return new AttachedPermanentToughnessValue();
|
||||
public AttachedPermanentToughnessValue copy() {
|
||||
return AttachedPermanentToughnessValue.instance;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "equal to";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "that creature's toughness";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,29 +7,24 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
import mage.watchers.common.PlayersAttackedThisTurnWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class AttackedThisTurnOpponentsCount implements DynamicValue {
|
||||
public enum AttackedThisTurnOpponentsCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return this.calculate(game, sourceAbility.getControllerId());
|
||||
}
|
||||
|
||||
public int calculate(Game game, UUID controllerId) {
|
||||
PlayersAttackedThisTurnWatcher watcher = game.getState().getWatcher(PlayersAttackedThisTurnWatcher.class);
|
||||
if (watcher != null) {
|
||||
return watcher.getAttackedOpponentsCount(controllerId);
|
||||
return watcher.getAttackedOpponentsCount(sourceAbility.getControllerId());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttackedThisTurnOpponentsCount copy() {
|
||||
return new AttackedThisTurnOpponentsCount();
|
||||
return AttackedThisTurnOpponentsCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class CardsInAllHandsCount implements DynamicValue {
|
||||
|
||||
public enum CardsInAllHandsCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (UUID playerId : game.getState().getPlayersInRange(sourceAbility.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null)
|
||||
{
|
||||
if (player != null) {
|
||||
count += player.getHand().size();
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ public class CardsInAllHandsCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public CardsInAllHandsCount copy() {
|
||||
return new CardsInAllHandsCount();
|
||||
return CardsInAllHandsCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public class CardsInControllerHandCount implements DynamicValue {
|
||||
public enum CardsInControllerHandCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -21,7 +22,7 @@ public class CardsInControllerHandCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public CardsInControllerHandCount copy() {
|
||||
return new CardsInControllerHandCount();
|
||||
return CardsInControllerHandCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public class CardsInTargetHandCount implements DynamicValue {
|
||||
public enum CardsInTargetHandCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -21,7 +22,7 @@ public class CardsInTargetHandCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new CardsInTargetHandCount();
|
||||
return CardsInTargetHandCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cbrianhill
|
||||
*/
|
||||
public class CardsInTargetPlayerHandCount implements DynamicValue {
|
||||
public enum CardsInTargetPlayerHandCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -23,7 +23,7 @@ public class CardsInTargetPlayerHandCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public CardsInTargetPlayerHandCount copy() {
|
||||
return new CardsInTargetPlayerHandCount();
|
||||
return CardsInTargetPlayerHandCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public class ControllerLifeCount implements DynamicValue {
|
||||
public enum ControllerLifeCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -19,7 +20,7 @@ public class ControllerLifeCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public ControllerLifeCount copy() {
|
||||
return new ControllerLifeCount();
|
||||
return ControllerLifeCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import mage.watchers.common.CreaturesDiedWatcher;
|
|||
/**
|
||||
* @author LoneFox
|
||||
*/
|
||||
public class CreaturesDiedThisTurnCount implements DynamicValue {
|
||||
public enum CreaturesDiedThisTurnCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -23,7 +24,7 @@ public class CreaturesDiedThisTurnCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public CreaturesDiedThisTurnCount copy() {
|
||||
return new CreaturesDiedThisTurnCount();
|
||||
return CreaturesDiedThisTurnCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ import mage.game.Game;
|
|||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DiscardCostCardConvertedMana implements DynamicValue {
|
||||
public enum DiscardCostCardConvertedMana implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -26,7 +27,7 @@ public class DiscardCostCardConvertedMana implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public DiscardCostCardConvertedMana copy() {
|
||||
return new DiscardCostCardConvertedMana();
|
||||
return DiscardCostCardConvertedMana.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ import mage.game.Game;
|
|||
* cost. If no card was exiled the getManaCostsToPay().getX() will be used as
|
||||
* value.
|
||||
*
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ExileFromHandCostCardConvertedMana implements DynamicValue {
|
||||
public enum ExileFromHandCostCardConvertedMana implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -35,7 +35,7 @@ public class ExileFromHandCostCardConvertedMana implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public ExileFromHandCostCardConvertedMana copy() {
|
||||
return new ExileFromHandCostCardConvertedMana();
|
||||
return ExileFromHandCostCardConvertedMana.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,14 +8,15 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class GetXValue implements DynamicValue {
|
||||
public enum GetXValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (VariableCost cost: sourceAbility.getCosts().getVariableCosts()) {
|
||||
for (VariableCost cost : sourceAbility.getCosts().getVariableCosts()) {
|
||||
amount += cost.getAmount();
|
||||
}
|
||||
return amount;
|
||||
|
|
@ -23,7 +24,7 @@ public class GetXValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public GetXValue copy() {
|
||||
return new GetXValue();
|
||||
return GetXValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
||||
public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -32,7 +32,7 @@ public class GreatestPowerAmongControlledCreaturesValue implements DynamicValue
|
|||
|
||||
@Override
|
||||
public GreatestPowerAmongControlledCreaturesValue copy() {
|
||||
return new GreatestPowerAmongControlledCreaturesValue();
|
||||
return GreatestPowerAmongControlledCreaturesValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,13 +10,10 @@ import mage.game.Game;
|
|||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ManaSpentToCastCount implements DynamicValue {
|
||||
|
||||
public ManaSpentToCastCount() {
|
||||
}
|
||||
public enum ManaSpentToCastCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
|
|
@ -36,7 +33,7 @@ public class ManaSpentToCastCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public ManaSpentToCastCount copy() {
|
||||
return new ManaSpentToCastCount();
|
||||
return ManaSpentToCastCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ import mage.abilities.dynamicvalue.DynamicValue;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
|
||||
public class ManacostVariableValue implements DynamicValue {
|
||||
public enum ManacostVariableValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -14,7 +15,7 @@ public class ManacostVariableValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public ManacostVariableValue copy() {
|
||||
return new ManacostVariableValue();
|
||||
return ManacostVariableValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MorphManacostVariableValue implements DynamicValue {
|
||||
public enum MorphManacostVariableValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -27,7 +27,7 @@ public class MorphManacostVariableValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public MorphManacostVariableValue copy() {
|
||||
return new MorphManacostVariableValue();
|
||||
return MorphManacostVariableValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,20 +9,17 @@ import mage.cards.Card;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MultikickerCount implements DynamicValue {
|
||||
|
||||
public MultikickerCount() {
|
||||
}
|
||||
public enum MultikickerCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
int count = 0;
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
for (Ability ability: card.getAbilities()) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof KickerAbility) {
|
||||
count += ((KickerAbility) ability).getKickedCounter(game, source);
|
||||
}
|
||||
|
|
@ -33,7 +30,7 @@ public class MultikickerCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public MultikickerCount copy() {
|
||||
return new MultikickerCount();
|
||||
return MultikickerCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ import mage.game.Game;
|
|||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class OpponentsCount implements DynamicValue {
|
||||
public enum OpponentsCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -17,7 +18,7 @@ public class OpponentsCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public OpponentsCount copy() {
|
||||
return new OpponentsCount();
|
||||
return OpponentsCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import mage.players.Player;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class OpponentsPoisonCountersCount implements DynamicValue {
|
||||
public enum OpponentsPoisonCountersCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -27,7 +28,7 @@ public class OpponentsPoisonCountersCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new OpponentsPoisonCountersCount();
|
||||
return OpponentsPoisonCountersCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
public class PermanentsYouOwnThatOpponentsControlCount implements DynamicValue {
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public enum PermanentsYouOwnThatOpponentsControlCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -28,7 +30,7 @@ public class PermanentsYouOwnThatOpponentsControlCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public PermanentsYouOwnThatOpponentsControlCount copy() {
|
||||
return new PermanentsYouOwnThatOpponentsControlCount();
|
||||
return PermanentsYouOwnThatOpponentsControlCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class RemovedCountersForCostValue implements DynamicValue {
|
||||
public enum RemovedCountersForCostValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -35,7 +35,7 @@ public class RemovedCountersForCostValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public RemovedCountersForCostValue copy() {
|
||||
return new RemovedCountersForCostValue();
|
||||
return RemovedCountersForCostValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class RevealTargetFromHandCostCount implements DynamicValue {
|
||||
public enum RevealTargetFromHandCostCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -35,7 +35,7 @@ public class RevealTargetFromHandCostCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public RevealTargetFromHandCostCount copy() {
|
||||
return new RevealTargetFromHandCostCount();
|
||||
return RevealTargetFromHandCostCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import mage.game.Game;
|
|||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SacrificeCostCreaturesPower implements DynamicValue {
|
||||
|
||||
public enum SacrificeCostCreaturesPower implements DynamicValue {
|
||||
instance;
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
for (Cost cost : sourceAbility.getCosts()) {
|
||||
|
|
@ -26,7 +26,7 @@ public class SacrificeCostCreaturesPower implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public SacrificeCostCreaturesPower copy() {
|
||||
return new SacrificeCostCreaturesPower();
|
||||
return SacrificeCostCreaturesPower.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import mage.game.Game;
|
|||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SacrificeCostCreaturesToughness implements DynamicValue {
|
||||
public enum SacrificeCostCreaturesToughness implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -25,7 +26,7 @@ public class SacrificeCostCreaturesToughness implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public SacrificeCostCreaturesToughness copy() {
|
||||
return new SacrificeCostCreaturesToughness();
|
||||
return SacrificeCostCreaturesToughness.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,14 +10,10 @@ import mage.game.stack.Spell;
|
|||
import mage.game.stack.StackObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Nicolas
|
||||
*/
|
||||
public class SunburstCount implements DynamicValue {
|
||||
|
||||
public SunburstCount() {
|
||||
|
||||
}
|
||||
public enum SunburstCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
|
|
@ -48,7 +44,7 @@ public class SunburstCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public SunburstCount copy() {
|
||||
return new SunburstCount();
|
||||
return SunburstCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import mage.cards.Card;
|
|||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class TargetConvertedManaCost implements DynamicValue {
|
||||
public enum TargetConvertedManaCost implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
|
|
@ -24,7 +24,7 @@ public class TargetConvertedManaCost implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public TargetConvertedManaCost copy() {
|
||||
return new TargetConvertedManaCost();
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class TargetPermanentPowerCount implements DynamicValue {
|
||||
public enum TargetPermanentPowerCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -29,7 +29,7 @@ public class TargetPermanentPowerCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public TargetPermanentPowerCount copy() {
|
||||
return new TargetPermanentPowerCount();
|
||||
return TargetPermanentPowerCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,20 +9,21 @@ import mage.watchers.common.ZuberasDiedWatcher;
|
|||
/**
|
||||
* Created by Eric on 9/24/2016.
|
||||
*/
|
||||
public class ZuberasDiedDynamicValue implements DynamicValue {
|
||||
public enum ZuberasDiedDynamicValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
ZuberasDiedWatcher watcher = game.getState().getWatcher(ZuberasDiedWatcher.class);
|
||||
if(watcher == null){
|
||||
if (watcher == null) {
|
||||
return 0;
|
||||
}
|
||||
return watcher.getZuberasDiedThisTurn();
|
||||
return watcher.getZuberasDiedThisTurn();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZuberasDiedDynamicValue copy() {
|
||||
return new ZuberasDiedDynamicValue();
|
||||
return ZuberasDiedDynamicValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class SunburstAbility extends EntersBattlefieldAbility {
|
|||
|
||||
class SunburstEffect extends OneShotEffect {
|
||||
|
||||
private static final DynamicValue amount = new SunburstCount();
|
||||
private static final DynamicValue amount = SunburstCount.instance;
|
||||
|
||||
public SunburstEffect() {
|
||||
super(Outcome.Benefit);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public final class ObNixilisOfTheBlackOathEmblem extends Emblem {
|
|||
// You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
|
||||
public ObNixilisOfTheBlackOathEmblem() {
|
||||
this.setName("Emblem Nixilis");
|
||||
DynamicValue xValue = new SacrificeCostCreaturesPower();
|
||||
DynamicValue xValue = SacrificeCostCreaturesPower.instance;
|
||||
Effect effect = new GainLifeEffect(xValue);
|
||||
effect.setText("You gain X life");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}"));
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class FeedingGroundsPlane extends Plane {
|
|||
this.getAbilities().add(ability);
|
||||
|
||||
// Active player can roll the planar die: Whenever you roll {CHAOS}, target red or green creature gets X +1/+1 counters
|
||||
Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), new TargetConvertedManaCost());
|
||||
Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), TargetConvertedManaCost.instance);
|
||||
Target chaosTarget = new TargetCreaturePermanent(1, 1, filter, false);
|
||||
|
||||
List<Effect> chaosEffects = new ArrayList<Effect>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue