mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Effects: add gameCardState check with equalWithTimestamp
This commit is contained in:
@@ -100,6 +100,7 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
// Test to see if the card we're trying to add is in the expected state
|
// Test to see if the card we're trying to add is in the expected state
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
dest = cur;
|
||||||
|
|
||||||
int csum = 0;
|
int csum = 0;
|
||||||
|
|
||||||
@@ -194,15 +195,15 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
Map<String, Object> params = Maps.newHashMap();
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
params.put("CounterType", cType);
|
params.put("CounterType", cType);
|
||||||
params.put("Source", source);
|
params.put("Source", source);
|
||||||
params.put("Target", dest);
|
params.put("Target", cur);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Put how many ").append(cType.getName()).append(" counters on ").append(dest).append("?");
|
sb.append("Put how many ").append(cType.getName()).append(" counters on ").append(cur).append("?");
|
||||||
int cnum = player.getController().chooseNumber(sa, sb.toString(), 0, source.getCounters(cType), params);
|
int cnum = player.getController().chooseNumber(sa, sb.toString(), 0, source.getCounters(cType), params);
|
||||||
|
|
||||||
if (cnum > 0) {
|
if (cnum > 0) {
|
||||||
source.subtractCounter(cType, cnum);
|
source.subtractCounter(cType, cnum);
|
||||||
dest.addCounter(cType, cnum, player, true);
|
cur.addCounter(cType, cnum, player, true);
|
||||||
game.updateLastStateForCard(dest);
|
game.updateLastStateForCard(cur);
|
||||||
updateSource = true;
|
updateSource = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,7 +246,7 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!"Any".matches(counterName)) {
|
if (!"Any".matches(counterName)) {
|
||||||
if (!dest.canReceiveCounters(cType)) {
|
if (!cur.canReceiveCounters(cType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
Map<String, Object> params = Maps.newHashMap();
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
params.put("CounterType", cType);
|
params.put("CounterType", cType);
|
||||||
params.put("Source", source);
|
params.put("Source", source);
|
||||||
params.put("Target", dest);
|
params.put("Target", cur);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Take how many ").append(cType.getName());
|
sb.append("Take how many ").append(cType.getName());
|
||||||
sb.append(" counters from ").append(source).append("?");
|
sb.append(" counters from ").append(source).append("?");
|
||||||
@@ -262,8 +263,8 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
if (source.getCounters(cType) >= cntToMove) {
|
if (source.getCounters(cType) >= cntToMove) {
|
||||||
source.subtractCounter(cType, cntToMove);
|
source.subtractCounter(cType, cntToMove);
|
||||||
dest.addCounter(cType, cntToMove, player, true);
|
cur.addCounter(cType, cntToMove, player, true);
|
||||||
game.updateLastStateForCard(dest);
|
game.updateLastStateForCard(cur);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// any counterType currently only Leech Bonder
|
// any counterType currently only Leech Bonder
|
||||||
|
|||||||
@@ -135,9 +135,10 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
for (final GameObject obj : tgtObjects) {
|
for (final GameObject obj : tgtObjects) {
|
||||||
// check if the object is still in game or if it was moved
|
// check if the object is still in game or if it was moved
|
||||||
|
Card gameCard = null;
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
Card tgtCard = (Card) obj;
|
Card tgtCard = (Card) obj;
|
||||||
Card gameCard = game.getCardState(tgtCard, null);
|
gameCard = game.getCardState(tgtCard, null);
|
||||||
// gameCard is LKI in that case, the card is not in game anymore
|
// gameCard is LKI in that case, the card is not in game anymore
|
||||||
// or the timestamp did change
|
// or the timestamp did change
|
||||||
// this should check Self too
|
// this should check Self too
|
||||||
@@ -164,7 +165,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
((Player) obj).addCounter(ct, counterAmount, placer, true);
|
((Player) obj).addCounter(ct, counterAmount, placer, true);
|
||||||
}
|
}
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
((Card) obj).addCounter(ct, counterAmount, placer, true);
|
gameCard.addCounter(ct, counterAmount, placer, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -185,7 +186,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
Card tgtCard = (Card) obj;
|
Card tgtCard = gameCard;
|
||||||
counterAmount = sa.usesTargeting() && sa.hasParam("DividedAsYouChoose") ? sa.getTargetRestrictions().getDividedValue(tgtCard) : counterAmount;
|
counterAmount = sa.usesTargeting() && sa.hasParam("DividedAsYouChoose") ? sa.getTargetRestrictions().getDividedValue(tgtCard) : counterAmount;
|
||||||
if (!sa.usesTargeting() || tgtCard.canBeTargetedBy(sa)) {
|
if (!sa.usesTargeting() || tgtCard.canBeTargetedBy(sa)) {
|
||||||
if (max != -1) {
|
if (max != -1) {
|
||||||
|
|||||||
@@ -65,16 +65,16 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
|||||||
if (gameCard == null || !tgtCard.equalsWithTimestamp(gameCard)) {
|
if (gameCard == null || !tgtCard.equalsWithTimestamp(gameCard)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!sa.usesTargeting() || tgtCard.canBeTargetedBy(sa)) {
|
if (!sa.usesTargeting() || gameCard.canBeTargetedBy(sa)) {
|
||||||
if (tgtCard.hasCounters()) {
|
if (gameCard.hasCounters()) {
|
||||||
if (sa.hasParam("EachExistingCounter")) {
|
if (sa.hasParam("EachExistingCounter")) {
|
||||||
for (CounterType listType : Lists.newArrayList(tgtCard.getCounters().keySet())) {
|
for (CounterType listType : Lists.newArrayList(gameCard.getCounters().keySet())) {
|
||||||
addOrRemoveCounter(sa, tgtCard, listType, counterAmount);
|
addOrRemoveCounter(sa, gameCard, listType, counterAmount);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addOrRemoveCounter(sa, tgtCard, ctype, counterAmount);
|
addOrRemoveCounter(sa, gameCard, ctype, counterAmount);
|
||||||
}
|
}
|
||||||
game.updateLastStateForCard(tgtCard);
|
game.updateLastStateForCard(gameCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,27 +115,27 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
|||||||
if (gameCard == null || !tgtCard.equalsWithTimestamp(gameCard)) {
|
if (gameCard == null || !tgtCard.equalsWithTimestamp(gameCard)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!sa.usesTargeting() || tgtCard.canBeTargetedBy(sa)) {
|
if (!sa.usesTargeting() || gameCard.canBeTargetedBy(sa)) {
|
||||||
final Zone zone = game.getZoneOf(gameCard);
|
final Zone zone = game.getZoneOf(gameCard);
|
||||||
if (type.equals("All")) {
|
if (type.equals("All")) {
|
||||||
for (Map.Entry<CounterType, Integer> e : tgtCard.getCounters().entrySet()) {
|
for (Map.Entry<CounterType, Integer> e : gameCard.getCounters().entrySet()) {
|
||||||
tgtCard.subtractCounter(e.getKey(), e.getValue());
|
gameCard.subtractCounter(e.getKey(), e.getValue());
|
||||||
}
|
}
|
||||||
game.updateLastStateForCard(tgtCard);
|
game.updateLastStateForCard(gameCard);
|
||||||
continue;
|
continue;
|
||||||
} else if (num.equals("All")) {
|
} else if (num.equals("All")) {
|
||||||
cntToRemove = tgtCard.getCounters(counterType);
|
cntToRemove = gameCard.getCounters(counterType);
|
||||||
} else if (sa.getParam("CounterNum").equals("Remembered")) {
|
} else if (sa.getParam("CounterNum").equals("Remembered")) {
|
||||||
cntToRemove = tgtCard.getCountersAddedBy(card, counterType);
|
cntToRemove = gameCard.getCountersAddedBy(card, counterType);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerController pc = sa.getActivatingPlayer().getController();
|
PlayerController pc = sa.getActivatingPlayer().getController();
|
||||||
|
|
||||||
if (type.equals("Any")) {
|
if (type.equals("Any")) {
|
||||||
while (cntToRemove > 0 && tgtCard.hasCounters()) {
|
while (cntToRemove > 0 && gameCard.hasCounters()) {
|
||||||
final Map<CounterType, Integer> tgtCounters = tgtCard.getCounters();
|
final Map<CounterType, Integer> tgtCounters = gameCard.getCounters();
|
||||||
Map<String, Object> params = Maps.newHashMap();
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
params.put("Target", tgtCard);
|
params.put("Target", gameCard);
|
||||||
|
|
||||||
String prompt = "Select type of counters to remove";
|
String prompt = "Select type of counters to remove";
|
||||||
CounterType chosenType = pc.chooseCounterType(
|
CounterType chosenType = pc.chooseCounterType(
|
||||||
@@ -143,13 +143,13 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
|||||||
prompt = "Select the number of " + chosenType.getName() + " counters to remove";
|
prompt = "Select the number of " + chosenType.getName() + " counters to remove";
|
||||||
int max = Math.min(cntToRemove, tgtCounters.get(chosenType));
|
int max = Math.min(cntToRemove, tgtCounters.get(chosenType));
|
||||||
params = Maps.newHashMap();
|
params = Maps.newHashMap();
|
||||||
params.put("Target", tgtCard);
|
params.put("Target", gameCard);
|
||||||
params.put("CounterType", chosenType);
|
params.put("CounterType", chosenType);
|
||||||
int chosenAmount = pc.chooseNumber(sa, prompt, 1, max, params);
|
int chosenAmount = pc.chooseNumber(sa, prompt, 1, max, params);
|
||||||
|
|
||||||
if (chosenAmount > 0) {
|
if (chosenAmount > 0) {
|
||||||
tgtCard.subtractCounter(chosenType, chosenAmount);
|
gameCard.subtractCounter(chosenType, chosenAmount);
|
||||||
game.updateLastStateForCard(tgtCard);
|
game.updateLastStateForCard(gameCard);
|
||||||
if (rememberRemoved) {
|
if (rememberRemoved) {
|
||||||
for (int i = 0; i < chosenAmount; i++) {
|
for (int i = 0; i < chosenAmount; i++) {
|
||||||
card.addRemembered(Pair.of(chosenType, i));
|
card.addRemembered(Pair.of(chosenType, i));
|
||||||
@@ -159,12 +159,12 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cntToRemove = Math.min(cntToRemove, tgtCard.getCounters(counterType));
|
cntToRemove = Math.min(cntToRemove, gameCard.getCounters(counterType));
|
||||||
|
|
||||||
if (zone.is(ZoneType.Battlefield) || zone.is(ZoneType.Exile)) {
|
if (zone.is(ZoneType.Battlefield) || zone.is(ZoneType.Exile)) {
|
||||||
if (sa.hasParam("UpTo")) {
|
if (sa.hasParam("UpTo")) {
|
||||||
Map<String, Object> params = Maps.newHashMap();
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
params.put("Target", tgtCard);
|
params.put("Target", gameCard);
|
||||||
params.put("CounterType", type);
|
params.put("CounterType", type);
|
||||||
String title = "Select the number of " + type + " counters to remove";
|
String title = "Select the number of " + type + " counters to remove";
|
||||||
cntToRemove = pc.chooseNumber(sa, title, 0, cntToRemove, params);
|
cntToRemove = pc.chooseNumber(sa, title, 0, cntToRemove, params);
|
||||||
@@ -172,13 +172,13 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (cntToRemove > 0) {
|
if (cntToRemove > 0) {
|
||||||
tgtCard.subtractCounter(counterType, cntToRemove);
|
gameCard.subtractCounter(counterType, cntToRemove);
|
||||||
if (rememberRemoved) {
|
if (rememberRemoved) {
|
||||||
for (int i = 0; i < cntToRemove; i++) {
|
for (int i = 0; i < cntToRemove; i++) {
|
||||||
card.addRemembered(Pair.of(counterType, i));
|
card.addRemembered(Pair.of(counterType, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game.updateLastStateForCard(tgtCard);
|
game.updateLastStateForCard(gameCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package forge.game.ability.effects;
|
package forge.game.ability.effects;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
|
import forge.game.Game;
|
||||||
import forge.game.GameObject;
|
import forge.game.GameObject;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -68,6 +70,7 @@ public class DamageDealEffect extends DamageBaseEffect {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
final Card hostCard = sa.getHostCard();
|
final Card hostCard = sa.getHostCard();
|
||||||
|
final Game game = hostCard.getGame();
|
||||||
|
|
||||||
final String damage = sa.getParam("NumDmg");
|
final String damage = sa.getParam("NumDmg");
|
||||||
int dmg = AbilityUtils.calculateAmount(hostCard, damage, sa);
|
int dmg = AbilityUtils.calculateAmount(hostCard, damage, sa);
|
||||||
@@ -176,7 +179,12 @@ public class DamageDealEffect extends DamageBaseEffect {
|
|||||||
dmg = (sa.usesTargeting() && sa.hasParam("DividedAsYouChoose")) ? sa.getTargetRestrictions().getDividedValue(o) : dmg;
|
dmg = (sa.usesTargeting() && sa.hasParam("DividedAsYouChoose")) ? sa.getTargetRestrictions().getDividedValue(o) : dmg;
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
if (c.isInPlay() && (!targeted || c.canBeTargetedBy(sa))) {
|
final Card gc = game.getCardState(c, null);
|
||||||
|
if (gc == null || !c.equalsWithTimestamp(gc) || !gc.isInPlay()) {
|
||||||
|
// timestamp different or not in play
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!targeted || c.canBeTargetedBy(sa)) {
|
||||||
if (removeDamage) {
|
if (removeDamage) {
|
||||||
c.setDamage(0);
|
c.setDamage(0);
|
||||||
c.setHasBeenDealtDeathtouchDamage(false);
|
c.setHasBeenDealtDeathtouchDamage(false);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class FightEffect extends DamageBaseEffect {
|
|||||||
defined.addAll(AbilityUtils.getDefinedCards(host, sa.getParam("ExtraDefined"), sa));
|
defined.addAll(AbilityUtils.getDefinedCards(host, sa.getParam("ExtraDefined"), sa));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Card> remove = Lists.newArrayList();
|
List<Card> newDefined = Lists.newArrayList();
|
||||||
for (final Card d : defined) {
|
for (final Card d : defined) {
|
||||||
final Card g = game.getCardState(d, null);
|
final Card g = game.getCardState(d, null);
|
||||||
// 701.12b If a creature instructed to fight is no longer on the battlefield or is no longer a creature,
|
// 701.12b If a creature instructed to fight is no longer on the battlefield or is no longer a creature,
|
||||||
@@ -94,10 +94,12 @@ public class FightEffect extends DamageBaseEffect {
|
|||||||
// for a resolving spell or ability that instructs it to fight, no damage is dealt.
|
// for a resolving spell or ability that instructs it to fight, no damage is dealt.
|
||||||
if (g == null || !g.equalsWithTimestamp(d) || !d.isInPlay() || !d.isCreature()) {
|
if (g == null || !g.equalsWithTimestamp(d) || !d.isInPlay() || !d.isCreature()) {
|
||||||
// Test to see if the card we're trying to add is in the expected state
|
// Test to see if the card we're trying to add is in the expected state
|
||||||
remove.add(d);
|
continue;
|
||||||
}
|
}
|
||||||
|
newDefined.add(g);
|
||||||
}
|
}
|
||||||
defined.removeAll(remove);
|
// replace with new List using CardState
|
||||||
|
defined = newDefined;
|
||||||
|
|
||||||
if (!defined.isEmpty()) {
|
if (!defined.isEmpty()) {
|
||||||
if (defined.size() > 1 && fighter1 == null) {
|
if (defined.size() > 1 && fighter1 == null) {
|
||||||
|
|||||||
@@ -31,32 +31,40 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
final int a, final int d, final List<String> keywords,
|
final int a, final int d, final List<String> keywords,
|
||||||
final long timestamp) {
|
final long timestamp) {
|
||||||
final Card host = sa.getHostCard();
|
final Card host = sa.getHostCard();
|
||||||
|
final Game game = host.getGame();
|
||||||
//if host is not on the battlefield don't apply
|
//if host is not on the battlefield don't apply
|
||||||
// Suspend should does Affect the Stack
|
// Suspend should does Affect the Stack
|
||||||
if (sa.hasParam("UntilLoseControlOfHost")
|
if (sa.hasParam("UntilLoseControlOfHost")
|
||||||
&& !(host.isInPlay() || host.isInZone(ZoneType.Stack))) {
|
&& !(host.isInPlay() || host.isInZone(ZoneType.Stack))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Game game = sa.getActivatingPlayer().getGame();
|
|
||||||
|
// do Game Check there in case of LKI
|
||||||
|
final Card gameCard = game.getCardState(applyTo, null);
|
||||||
|
if (gameCard == null || !applyTo.equalsWithTimestamp(gameCard)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final List<String> kws = Lists.newArrayList();
|
final List<String> kws = Lists.newArrayList();
|
||||||
|
|
||||||
boolean redrawPT = false;
|
boolean redrawPT = false;
|
||||||
for (String kw : keywords) {
|
for (String kw : keywords) {
|
||||||
if (kw.startsWith("HIDDEN")) {
|
if (kw.startsWith("HIDDEN")) {
|
||||||
applyTo.addHiddenExtrinsicKeyword(kw);
|
gameCard.addHiddenExtrinsicKeyword(kw);
|
||||||
redrawPT |= kw.contains("CARDNAME's power and toughness are switched");
|
redrawPT |= kw.contains("CARDNAME's power and toughness are switched");
|
||||||
} else {
|
} else {
|
||||||
kws.add(kw);
|
kws.add(kw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applyTo.addTempPowerBoost(a);
|
gameCard.addTempPowerBoost(a);
|
||||||
applyTo.addTempToughnessBoost(d);
|
gameCard.addTempToughnessBoost(d);
|
||||||
applyTo.addChangedCardKeywords(kws, Lists.<String>newArrayList(), false, false, timestamp);
|
gameCard.addChangedCardKeywords(kws, Lists.<String>newArrayList(), false, false, timestamp);
|
||||||
if (redrawPT) { applyTo.updatePowerToughnessForView(); }
|
if (redrawPT) {
|
||||||
|
gameCard.updatePowerToughnessForView();
|
||||||
|
}
|
||||||
|
|
||||||
if (sa.hasParam("LeaveBattlefield")) {
|
if (sa.hasParam("LeaveBattlefield")) {
|
||||||
addLeaveBattlefieldReplacement(applyTo, sa, sa.getParam("LeaveBattlefield"));
|
addLeaveBattlefieldReplacement(gameCard, sa, sa.getParam("LeaveBattlefield"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sa.hasParam("Permanent")) {
|
if (!sa.hasParam("Permanent")) {
|
||||||
@@ -66,8 +74,8 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
applyTo.addTempPowerBoost(-1 * a);
|
gameCard.addTempPowerBoost(-1 * a);
|
||||||
applyTo.addTempToughnessBoost(-1 * d);
|
gameCard.addTempToughnessBoost(-1 * d);
|
||||||
|
|
||||||
if (keywords.size() > 0) {
|
if (keywords.size() > 0) {
|
||||||
boolean redrawPT = false;
|
boolean redrawPT = false;
|
||||||
@@ -75,16 +83,16 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
for (String kw : keywords) {
|
for (String kw : keywords) {
|
||||||
redrawPT |= kw.contains("CARDNAME's power and toughness are switched");
|
redrawPT |= kw.contains("CARDNAME's power and toughness are switched");
|
||||||
if (kw.startsWith("HIDDEN")) {
|
if (kw.startsWith("HIDDEN")) {
|
||||||
applyTo.removeHiddenExtrinsicKeyword(kw);
|
gameCard.removeHiddenExtrinsicKeyword(kw);
|
||||||
if (redrawPT) {
|
if (redrawPT) {
|
||||||
applyTo.updatePowerToughnessForView();
|
gameCard.updatePowerToughnessForView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
applyTo.removeChangedCardKeywords(timestamp);
|
gameCard.removeChangedCardKeywords(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
game.fireEvent(new GameEventCardStatsChanged(applyTo));
|
game.fireEvent(new GameEventCardStatsChanged(gameCard));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (sa.hasParam("UntilEndOfCombat")) {
|
if (sa.hasParam("UntilEndOfCombat")) {
|
||||||
@@ -107,7 +115,7 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
game.getEndOfTurn().addUntil(untilEOT);
|
game.getEndOfTurn().addUntil(untilEOT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game.fireEvent(new GameEventCardStatsChanged(applyTo));
|
game.fireEvent(new GameEventCardStatsChanged(gameCard));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyPump(final SpellAbility sa, final Player p,
|
private static void applyPump(final SpellAbility sa, final Player p,
|
||||||
@@ -218,7 +226,6 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
public void resolve(final SpellAbility sa) {
|
public void resolve(final SpellAbility sa) {
|
||||||
|
|
||||||
final List<Card> untargetedCards = Lists.newArrayList();
|
final List<Card> untargetedCards = Lists.newArrayList();
|
||||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
|
||||||
final Game game = sa.getActivatingPlayer().getGame();
|
final Game game = sa.getActivatingPlayer().getGame();
|
||||||
final Card host = sa.getHostCard();
|
final Card host = sa.getHostCard();
|
||||||
final long timestamp = game.getNextTimestamp();
|
final long timestamp = game.getNextTimestamp();
|
||||||
@@ -350,7 +357,7 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if pump is a target, make sure we can still target now
|
// if pump is a target, make sure we can still target now
|
||||||
if ((tgt != null) && !tgtC.canBeTargetedBy(sa)) {
|
if (sa.usesTargeting() && !tgtC.canBeTargetedBy(sa)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user