mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
Removed deprecated AdjustingSourceCosts interface.
This commit is contained in:
parent
7c96171359
commit
da9f24e008
11 changed files with 148 additions and 248 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -7,18 +6,19 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.CostModificationType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ public final class AvatarOfFury extends CardImpl {
|
||||||
this.toughness = new MageInt(6);
|
this.toughness = new MageInt(6);
|
||||||
|
|
||||||
// If an opponent controls seven or more lands, Avatar of Fury costs {6} less to cast.
|
// If an opponent controls seven or more lands, Avatar of Fury costs {6} less to cast.
|
||||||
this.addAbility(new AvatarOfFuryAdjustingCostsAbility());
|
this.addAbility(new SimpleStaticAbility(Zone.ALL, new AvatarOfFuryAdjustingCostsEffect()));
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
// {R}: Avatar of Fury gets +1/+0 until end of turn.
|
// {R}: Avatar of Fury gets +1/+0 until end of turn.
|
||||||
|
|
@ -53,36 +53,39 @@ public final class AvatarOfFury extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AvatarOfFuryAdjustingCostsAbility extends SimpleStaticAbility implements AdjustingSourceCosts {
|
class AvatarOfFuryAdjustingCostsEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
public AvatarOfFuryAdjustingCostsAbility() {
|
AvatarOfFuryAdjustingCostsEffect() {
|
||||||
super(Zone.OUTSIDE, null /*new AvatarOfFuryAdjustingCostsEffect()*/);
|
super(Duration.EndOfGame, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||||
|
staticText = "If an opponent controls seven or more lands, {this} costs {6} less to cast";
|
||||||
}
|
}
|
||||||
|
|
||||||
public AvatarOfFuryAdjustingCostsAbility(final AvatarOfFuryAdjustingCostsAbility ability) {
|
AvatarOfFuryAdjustingCostsEffect(AvatarOfFuryAdjustingCostsEffect effect) {
|
||||||
super(ability);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SimpleStaticAbility copy() {
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
return new AvatarOfFuryAdjustingCostsAbility(this);
|
CardUtil.reduceCost(abilityToModify, 6);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
return "If an opponent controls seven or more lands, Avatar of Fury costs {6} less to cast";
|
if (abilityToModify.getSourceId().equals(source.getSourceId())
|
||||||
|
&& (abilityToModify instanceof SpellAbility)) {
|
||||||
|
for (UUID playerId : game.getOpponents(abilityToModify.getControllerId())) {
|
||||||
|
if (game.getBattlefield().countAll(StaticFilters.FILTER_LAND, playerId, game) > 6) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
public AvatarOfFuryAdjustingCostsEffect copy() {
|
||||||
if (ability instanceof SpellAbility) { // Prevent adjustment of activated ability
|
return new AvatarOfFuryAdjustingCostsEffect(this);
|
||||||
FilterPermanent filter = new FilterLandPermanent();
|
|
||||||
for (UUID playerId : game.getOpponents(ability.getControllerId())) {
|
|
||||||
if (game.getBattlefield().countAll(filter, playerId, game) > 6) {
|
|
||||||
CardUtil.adjustCost((SpellAbility) ability, 6);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
|
||||||
import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect;
|
import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect;
|
||||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
|
@ -32,7 +29,7 @@ public final class AvatarOfHope extends CardImpl {
|
||||||
this.toughness = new MageInt(9);
|
this.toughness = new MageInt(9);
|
||||||
|
|
||||||
// If you have 3 or less life, Avatar of Hope costs {6} less to cast.
|
// If you have 3 or less life, Avatar of Hope costs {6} less to cast.
|
||||||
this.addAbility(new AdjustingCostsAbility());
|
this.addAbility(new SimpleStaticAbility(Zone.ALL, new AvatarOfHopeAdjustingCostsEffect()));
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
// Avatar of Hope can block any number of creatures.
|
// Avatar of Hope can block any number of creatures.
|
||||||
|
|
@ -49,76 +46,39 @@ public final class AvatarOfHope extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AdjustingCostsAbility extends SimpleStaticAbility implements AdjustingSourceCosts {
|
class AvatarOfHopeAdjustingCostsEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
public AdjustingCostsAbility() {
|
AvatarOfHopeAdjustingCostsEffect() {
|
||||||
super(Zone.OUTSIDE, new AdjustingCostsEffect());
|
super(Duration.EndOfGame, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||||
|
staticText = "If you have 3 or less life, {this} costs {6} less to cast";
|
||||||
}
|
}
|
||||||
|
|
||||||
public AdjustingCostsAbility(final AdjustingCostsAbility ability) {
|
AvatarOfHopeAdjustingCostsEffect(AvatarOfHopeAdjustingCostsEffect effect) {
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SimpleStaticAbility copy() {
|
|
||||||
return new AdjustingCostsAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "If you have 3 or less life, {this} costs {6} less to cast";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
if (ability.getAbilityType() == AbilityType.SPELL) {
|
|
||||||
Player player = game.getPlayer(ability.getControllerId());
|
|
||||||
if (player != null && player.getLife() < 4) {
|
|
||||||
CardUtil.adjustCost((SpellAbility) ability, 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AdjustingCostsEffect extends CostModificationEffectImpl {
|
|
||||||
|
|
||||||
public AdjustingCostsEffect() {
|
|
||||||
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdjustingCostsEffect(final AdjustingCostsEffect effect) {
|
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
CardUtil.reduceCost(abilityToModify, 6);
|
||||||
Mana mana = spellAbility.getManaCostsToPay().getMana();
|
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
|
||||||
|
|
||||||
if (mana.getGeneric() > 0 && player != null && player.getLife() < 4) {
|
|
||||||
int newCount = mana.getGeneric() - 6;
|
|
||||||
if (newCount < 0) {
|
|
||||||
newCount = 0;
|
|
||||||
}
|
|
||||||
mana.setGeneric(newCount);
|
|
||||||
spellAbility.getManaCostsToPay().load(mana.toString());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
if ((abilityToModify instanceof SpellAbility)
|
if (abilityToModify.getSourceId().equals(source.getSourceId())
|
||||||
&& abilityToModify.getSourceId().equals(source.getSourceId())) {
|
&& (abilityToModify instanceof SpellAbility)) {
|
||||||
|
Player player = game.getPlayer(abilityToModify.getControllerId());
|
||||||
|
if (player != null && player.getLife() < 4) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdjustingCostsEffect copy() {
|
public AvatarOfHopeAdjustingCostsEffect copy() {
|
||||||
return new AdjustingCostsEffect(this);
|
return new AvatarOfHopeAdjustingCostsEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -7,12 +6,15 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.common.MorbidCondition;
|
import mage.abilities.condition.common.MorbidCondition;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
import mage.abilities.keyword.DeathtouchAbility;
|
import mage.abilities.keyword.DeathtouchAbility;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.CostModificationType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -33,7 +35,7 @@ public final class BonePicker extends CardImpl {
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
// Bone Picker costs {3} less to cast if a creature died this turn.
|
// Bone Picker costs {3} less to cast if a creature died this turn.
|
||||||
this.addAbility(new BonePickerCostAdjustmentAbility(), new MorbidWatcher());
|
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BonePickerAdjustingCostsEffect()), new MorbidWatcher());
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
@ -53,32 +55,37 @@ public final class BonePicker extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BonePickerCostAdjustmentAbility extends SimpleStaticAbility implements AdjustingSourceCosts {
|
class BonePickerAdjustingCostsEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
public BonePickerCostAdjustmentAbility() {
|
BonePickerAdjustingCostsEffect() {
|
||||||
super(Zone.OUTSIDE, null);
|
super(Duration.EndOfGame, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||||
|
staticText = "{this} costs {3} less to cast if a creature died this turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
public BonePickerCostAdjustmentAbility(final BonePickerCostAdjustmentAbility ability) {
|
BonePickerAdjustingCostsEffect(BonePickerAdjustingCostsEffect effect) {
|
||||||
super(ability);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SimpleStaticAbility copy() {
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
return new BonePickerCostAdjustmentAbility(this);
|
CardUtil.reduceCost(abilityToModify, 3);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
return "If a creature died this turn, {this} costs {3} less to cast.";
|
if (abilityToModify.getSourceId().equals(source.getSourceId())
|
||||||
|
&& (abilityToModify instanceof SpellAbility)) {
|
||||||
|
if (MorbidCondition.instance.apply(game, abilityToModify)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
public BonePickerAdjustingCostsEffect copy() {
|
||||||
if (ability instanceof SpellAbility) { // Prevent adjustment of activated ability
|
return new BonePickerAdjustingCostsEffect(this);
|
||||||
if (MorbidCondition.instance.apply(game, ability)) {
|
|
||||||
CardUtil.adjustCost((SpellAbility) ability, 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -7,8 +6,8 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.GainLifeTargetEffect;
|
import mage.abilities.effects.common.GainLifeTargetEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||||
|
|
@ -39,7 +38,7 @@ public final class LaquatussChampion extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// When Laquatus's Champion enters the battlefield, target player loses 6 life.
|
// When Laquatus's Champion enters the battlefield, target player loses 6 life.
|
||||||
Ability ability = new LaquatussChampionEntersBattlefieldTriggeredAbility();
|
Ability ability = new LaquatussChampionEntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(6));
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
// When Laquatus's Champion leaves the battlefield, that player gains 6 life.
|
// When Laquatus's Champion leaves the battlefield, that player gains 6 life.
|
||||||
|
|
@ -58,29 +57,33 @@ public final class LaquatussChampion extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LaquatussChampionEntersBattlefieldTriggeredAbility extends EntersBattlefieldTriggeredAbility implements AdjustingSourceCosts {
|
class LaquatussChampionEntersBattlefieldTriggeredAbility extends EntersBattlefieldTriggeredAbility {
|
||||||
|
|
||||||
public LaquatussChampionEntersBattlefieldTriggeredAbility() {
|
public LaquatussChampionEntersBattlefieldTriggeredAbility(Effect effect) {
|
||||||
super(new LoseLifeTargetEffect(6), false);
|
super(effect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LaquatussChampionEntersBattlefieldTriggeredAbility(LaquatussChampionEntersBattlefieldTriggeredAbility ability) {
|
public LaquatussChampionEntersBattlefieldTriggeredAbility(final LaquatussChampionEntersBattlefieldTriggeredAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean activate(Game game, boolean noMana) {
|
||||||
|
if (super.activate(game, noMana)) {
|
||||||
|
Player player = game.getPlayer(getFirstTarget());
|
||||||
|
if (player != null) {
|
||||||
|
String key = CardUtil.getCardZoneString("targetPlayer", getSourceId(), game);
|
||||||
|
game.getState().setValue(key, player.getId());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LaquatussChampionEntersBattlefieldTriggeredAbility copy() {
|
public LaquatussChampionEntersBattlefieldTriggeredAbility copy() {
|
||||||
return new LaquatussChampionEntersBattlefieldTriggeredAbility(this);
|
return new LaquatussChampionEntersBattlefieldTriggeredAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
Player player = game.getPlayer(ability.getFirstTarget());
|
|
||||||
if (player != null) {
|
|
||||||
String key = CardUtil.getCardZoneString("targetPlayer", this.getSourceId(), game);
|
|
||||||
game.getState().setValue(key, player.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LaquatussChampionLeavesBattlefieldTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
class LaquatussChampionLeavesBattlefieldTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -6,7 +5,6 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.GainLifeTargetEffect;
|
import mage.abilities.effects.common.GainLifeTargetEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||||
|
|
@ -29,7 +27,7 @@ import mage.util.CardUtil;
|
||||||
public final class SoulScourge extends CardImpl {
|
public final class SoulScourge extends CardImpl {
|
||||||
|
|
||||||
public SoulScourge(UUID ownerId, CardSetInfo setInfo) {
|
public SoulScourge(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||||
this.subtype.add(SubType.NIGHTMARE);
|
this.subtype.add(SubType.NIGHTMARE);
|
||||||
this.subtype.add(SubType.HORROR);
|
this.subtype.add(SubType.HORROR);
|
||||||
|
|
||||||
|
|
@ -40,7 +38,7 @@ public final class SoulScourge extends CardImpl {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// When Soul Scourge enters the battlefield, target player loses 3 life.
|
// When Soul Scourge enters the battlefield, target player loses 3 life.
|
||||||
Ability ability = new SoulScourgeEntersBattlefieldTriggeredAbility();
|
Ability ability = new SoulScourgeEntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(3));
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
// When Soul Scourge leaves the battlefield, that player gains 3 life.
|
// When Soul Scourge leaves the battlefield, that player gains 3 life.
|
||||||
|
|
@ -57,29 +55,33 @@ public final class SoulScourge extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SoulScourgeEntersBattlefieldTriggeredAbility extends EntersBattlefieldTriggeredAbility implements AdjustingSourceCosts {
|
class SoulScourgeEntersBattlefieldTriggeredAbility extends EntersBattlefieldTriggeredAbility {
|
||||||
|
|
||||||
public SoulScourgeEntersBattlefieldTriggeredAbility() {
|
public SoulScourgeEntersBattlefieldTriggeredAbility(Effect effect) {
|
||||||
super(new LoseLifeTargetEffect(3), false);
|
super(effect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoulScourgeEntersBattlefieldTriggeredAbility(SoulScourgeEntersBattlefieldTriggeredAbility ability) {
|
public SoulScourgeEntersBattlefieldTriggeredAbility(final SoulScourgeEntersBattlefieldTriggeredAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean activate(Game game, boolean noMana) {
|
||||||
|
if (super.activate(game, noMana)) {
|
||||||
|
Player player = game.getPlayer(getFirstTarget());
|
||||||
|
if (player != null) {
|
||||||
|
String key = CardUtil.getCardZoneString("targetPlayer", getSourceId(), game);
|
||||||
|
game.getState().setValue(key, player.getId());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SoulScourgeEntersBattlefieldTriggeredAbility copy() {
|
public SoulScourgeEntersBattlefieldTriggeredAbility copy() {
|
||||||
return new SoulScourgeEntersBattlefieldTriggeredAbility(this);
|
return new SoulScourgeEntersBattlefieldTriggeredAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void adjustCosts(Ability ability, Game game) {
|
|
||||||
Player player = game.getPlayer(ability.getFirstTarget());
|
|
||||||
if (player != null) {
|
|
||||||
String key = CardUtil.getCardZoneString("targetPlayer", this.getSourceId(), game);
|
|
||||||
game.getState().setValue(key, player.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SoulScourgeLeavesBattlefieldTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
class SoulScourgeLeavesBattlefieldTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ public class LaquatussChampionTest extends CardTestPlayerBase {
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 7);
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 7);
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||||
addCard(Zone.HAND, playerA, "Laquatus's Champion");
|
addCard(Zone.HAND, playerA, "Laquatus's Champion");
|
||||||
|
// Destroy target creature. It can't be regenerated.
|
||||||
addCard(Zone.HAND, playerA, "Terminate");
|
addCard(Zone.HAND, playerA, "Terminate");
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Laquatus's Champion");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Laquatus's Champion");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.CostAdjuster;
|
import mage.abilities.costs.CostAdjuster;
|
||||||
|
|
@ -23,10 +26,6 @@ import mage.target.Targets;
|
||||||
import mage.target.targetadjustment.TargetAdjuster;
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Practically everything in the game is started from an Ability. This interface
|
* Practically everything in the game is started from an Ability. This interface
|
||||||
* describes what an Ability is composed of at the highest level.
|
* describes what an Ability is composed of at the highest level.
|
||||||
|
|
@ -47,8 +46,10 @@ public interface Ability extends Controllable, Serializable {
|
||||||
*
|
*
|
||||||
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
* @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility)
|
* @see
|
||||||
* @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility)
|
* mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility)
|
||||||
|
* @see
|
||||||
|
* mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility)
|
||||||
*/
|
*/
|
||||||
void newId();
|
void newId();
|
||||||
|
|
||||||
|
|
@ -57,8 +58,10 @@ public interface Ability extends Controllable, Serializable {
|
||||||
*
|
*
|
||||||
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
* @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility)
|
* @see
|
||||||
* @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility)
|
* mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility)
|
||||||
|
* @see
|
||||||
|
* mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility)
|
||||||
*/
|
*/
|
||||||
void newOriginalId();
|
void newOriginalId();
|
||||||
|
|
||||||
|
|
@ -272,7 +275,8 @@ public interface Ability extends Controllable, Serializable {
|
||||||
* mage.game.Game, boolean)
|
* mage.game.Game, boolean)
|
||||||
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
* @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
* @see mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility,
|
* @see
|
||||||
|
* mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
*/
|
*/
|
||||||
boolean activate(Game game, boolean noMana);
|
boolean activate(Game game, boolean noMana);
|
||||||
|
|
@ -286,7 +290,8 @@ public interface Ability extends Controllable, Serializable {
|
||||||
*
|
*
|
||||||
* @param game The {@link Game} for which this ability resolves within.
|
* @param game The {@link Game} for which this ability resolves within.
|
||||||
* @return Whether or not this ability successfully resolved.
|
* @return Whether or not this ability successfully resolved.
|
||||||
* @see mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility,
|
* @see
|
||||||
|
* mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
* @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction,
|
* @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction,
|
||||||
* mage.game.Game)
|
* mage.game.Game)
|
||||||
|
|
@ -461,15 +466,6 @@ public interface Ability extends Controllable, Serializable {
|
||||||
*/
|
*/
|
||||||
String getGameLogMessage(Game game);
|
String getGameLogMessage(Game game);
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to deactivate cost modification logic of ability activation for some
|
|
||||||
* special handling (e.g. FlashbackAbility gets cost modifiaction twice
|
|
||||||
* because of how it's handled now)
|
|
||||||
*
|
|
||||||
* @param active execute no cost modification
|
|
||||||
*/
|
|
||||||
void setCostModificationActive(boolean active);
|
|
||||||
|
|
||||||
boolean activateAlternateOrAdditionalCosts(MageObject sourceObject, boolean noMana, Player controller, Game game);
|
boolean activateAlternateOrAdditionalCosts(MageObject sourceObject, boolean noMana, Player controller, Game game);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.costs.*;
|
import mage.abilities.costs.*;
|
||||||
|
|
@ -17,7 +21,6 @@ import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.SplitCard;
|
import mage.cards.SplitCard;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.filter.FilterMana;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.command.Emblem;
|
import mage.game.command.Emblem;
|
||||||
import mage.game.command.Plane;
|
import mage.game.command.Plane;
|
||||||
|
|
@ -35,11 +38,6 @@ import mage.util.ThreadLocalStringBuilder;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -66,7 +64,6 @@ public abstract class AbilityImpl implements Ability {
|
||||||
protected boolean ruleAtTheTop = false;
|
protected boolean ruleAtTheTop = false;
|
||||||
protected boolean ruleVisible = true;
|
protected boolean ruleVisible = true;
|
||||||
protected boolean ruleAdditionalCostsVisible = true;
|
protected boolean ruleAdditionalCostsVisible = true;
|
||||||
protected boolean costModificationActive = true;
|
|
||||||
protected boolean activated = false;
|
protected boolean activated = false;
|
||||||
protected boolean worksFaceDown = false;
|
protected boolean worksFaceDown = false;
|
||||||
protected int sourceObjectZoneChangeCounter;
|
protected int sourceObjectZoneChangeCounter;
|
||||||
|
|
@ -116,7 +113,6 @@ public abstract class AbilityImpl implements Ability {
|
||||||
this.ruleAtTheTop = ability.ruleAtTheTop;
|
this.ruleAtTheTop = ability.ruleAtTheTop;
|
||||||
this.ruleVisible = ability.ruleVisible;
|
this.ruleVisible = ability.ruleVisible;
|
||||||
this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible;
|
this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible;
|
||||||
this.costModificationActive = ability.costModificationActive;
|
|
||||||
this.worksFaceDown = ability.worksFaceDown;
|
this.worksFaceDown = ability.worksFaceDown;
|
||||||
this.abilityWord = ability.abilityWord;
|
this.abilityWord = ability.abilityWord;
|
||||||
this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter;
|
this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter;
|
||||||
|
|
@ -356,30 +352,9 @@ public abstract class AbilityImpl implements Ability {
|
||||||
}
|
}
|
||||||
|
|
||||||
//20101001 - 601.2e
|
//20101001 - 601.2e
|
||||||
if (costModificationActive) {
|
|
||||||
|
|
||||||
// TODO: replace all AdjustingSourceCosts abilities to continuus effect, see Affinity example
|
|
||||||
//20100716 - 601.2e
|
|
||||||
if (sourceObject != null) {
|
if (sourceObject != null) {
|
||||||
sourceObject.adjustCosts(this, game);
|
sourceObject.adjustCosts(this, game); // still needed
|
||||||
if (sourceObject instanceof Card) {
|
|
||||||
for (Ability ability : ((Card) sourceObject).getAbilities(game)) {
|
|
||||||
if (ability instanceof AdjustingSourceCosts) {
|
|
||||||
((AdjustingSourceCosts) ability).adjustCosts(this, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (Ability ability : sourceObject.getAbilities()) {
|
|
||||||
if (ability instanceof AdjustingSourceCosts) {
|
|
||||||
((AdjustingSourceCosts) ability).adjustCosts(this, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
game.getContinuousEffects().costModification(this, game);
|
game.getContinuousEffects().costModification(this, game);
|
||||||
} else {
|
|
||||||
costModificationActive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID activatorId = controllerId;
|
UUID activatorId = controllerId;
|
||||||
|
|
@ -542,9 +517,8 @@ public abstract class AbilityImpl implements Ability {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 601.2b If a cost that will be paid as the spell is being cast includes
|
* 601.2b If a cost that will be paid as the spell is being cast includes
|
||||||
* Phyrexian mana symbols, the player announces whether they intend to
|
* Phyrexian mana symbols, the player announces whether they intend to pay 2
|
||||||
* pay 2 life or the corresponding colored mana cost for each of those
|
* life or the corresponding colored mana cost for each of those symbols.
|
||||||
* symbols.
|
|
||||||
*/
|
*/
|
||||||
private void handlePhyrexianManaCosts(Game game, UUID sourceId, Player controller) {
|
private void handlePhyrexianManaCosts(Game game, UUID sourceId, Player controller) {
|
||||||
Iterator<ManaCost> costIterator = manaCostsToPay.iterator();
|
Iterator<ManaCost> costIterator = manaCostsToPay.iterator();
|
||||||
|
|
@ -1191,11 +1165,6 @@ public abstract class AbilityImpl implements Ability {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCostModificationActive(boolean active) {
|
|
||||||
this.costModificationActive = active;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getWorksFaceDown() {
|
public boolean getWorksFaceDown() {
|
||||||
return worksFaceDown;
|
return worksFaceDown;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
package mage.abilities.costs;
|
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.game.Game;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for abilities that adjust source and only source costs. For the
|
|
||||||
* cases when some permanent adjusts costs of other spells use
|
|
||||||
* {@link mage.abilities.effects.CostModificationEffect}.
|
|
||||||
* <p>
|
|
||||||
* Example of such source costs adjusting:
|
|
||||||
* {@link mage.abilities.keyword.AffinityForArtifactsAbility}
|
|
||||||
*
|
|
||||||
* @author nantuko
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
// replace all AdjustingSourceCosts with "extends CostModificationEffectImpl with zone.ALL" (see Affinity example)
|
|
||||||
@FunctionalInterface
|
|
||||||
public interface AdjustingSourceCosts {
|
|
||||||
|
|
||||||
void adjustCosts(Ability ability, Game game);
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
package mage.game.stack;
|
package mage.game.stack;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
|
|
@ -30,11 +34,6 @@ import mage.util.GameLog;
|
||||||
import mage.util.SubTypeList;
|
import mage.util.SubTypeList;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -481,11 +480,6 @@ public class StackAbility extends StackObjImpl implements Ability {
|
||||||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCostModificationActive(boolean active) {
|
|
||||||
throw new UnsupportedOperationException("Not supported. Only neede for flashbacked spells");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getWorksFaceDown() {
|
public boolean getWorksFaceDown() {
|
||||||
return this.ability.getWorksFaceDown();
|
return this.ability.getWorksFaceDown();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package mage.players;
|
package mage.players;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import mage.ConditionalMana;
|
import mage.ConditionalMana;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
|
|
@ -32,8 +35,8 @@ import mage.counters.Counters;
|
||||||
import mage.designations.Designation;
|
import mage.designations.Designation;
|
||||||
import mage.designations.DesignationType;
|
import mage.designations.DesignationType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.FilterPermanent;
|
|
||||||
import mage.filter.FilterMana;
|
import mage.filter.FilterMana;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.filter.common.FilterCreatureForCombat;
|
import mage.filter.common.FilterCreatureForCombat;
|
||||||
import mage.filter.common.FilterCreatureForCombatBlock;
|
import mage.filter.common.FilterCreatureForCombatBlock;
|
||||||
|
|
@ -65,10 +68,6 @@ import mage.util.GameLog;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
public abstract class PlayerImpl implements Player, Serializable {
|
public abstract class PlayerImpl implements Player, Serializable {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(PlayerImpl.class);
|
private static final Logger logger = Logger.getLogger(PlayerImpl.class);
|
||||||
|
|
@ -3045,18 +3044,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
if (available != null) {
|
if (available != null) {
|
||||||
game.getContinuousEffects().costModification(copy, game);
|
game.getContinuousEffects().costModification(copy, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
Card card = game.getCard(ability.getSourceId());
|
|
||||||
if (card != null) {
|
|
||||||
for (Ability ability0 : card.getAbilities()) {
|
|
||||||
if (ability0 instanceof AdjustingSourceCosts) {
|
|
||||||
// A workaround for Issue#457
|
|
||||||
if (!(ability0 instanceof ConvokeAbility)) {
|
|
||||||
((AdjustingSourceCosts) ability0).adjustCosts(copy, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean canBeCastRegularly = true;
|
boolean canBeCastRegularly = true;
|
||||||
if (copy instanceof SpellAbility && copy.getManaCosts().isEmpty() && copy.getCosts().isEmpty()) {
|
if (copy instanceof SpellAbility && copy.getManaCosts().isEmpty() && copy.getCosts().isEmpty()) {
|
||||||
// 117.6. Some mana costs contain no mana symbols. This represents an unpayable cost...
|
// 117.6. Some mana costs contain no mana symbols. This represents an unpayable cost...
|
||||||
|
|
@ -3094,7 +3081,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return canPlayCardByAlternateCost(card, available, ability, game);
|
return canPlayCardByAlternateCost(game.getCard(ability.getSourceId()), available, ability, game);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue