mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Some fixes for Possibility Storm.
This commit is contained in:
@@ -524,7 +524,9 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
for (SpellAbility spell : spells) {
|
||||
if (tgtC.isInZone(ZoneType.Exile)) {
|
||||
final SpellAbilityStackInstance si = game.getStack().getInstanceFromSpellAbility(spell);
|
||||
game.getStack().remove(si);
|
||||
if (si != null) {
|
||||
game.getStack().remove(si);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
// get basic spells (no flashback, etc.)
|
||||
ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
|
||||
for (SpellAbility s : tgtCard.getBasicSpells()) {
|
||||
final SpellAbility newSA = s.copy();
|
||||
final Spell newSA = (Spell) s.copy();
|
||||
newSA.setActivatingPlayer(controller);
|
||||
SpellAbilityRestriction res = new SpellAbilityRestriction();
|
||||
// timing restrictions still apply
|
||||
@@ -216,7 +216,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
res.setZone(null);
|
||||
newSA.setRestrictions(res);
|
||||
// timing restrictions still apply
|
||||
if (res.checkTimingRestrictions(tgtCard, newSA)) {
|
||||
if (res.checkTimingRestrictions(tgtCard, newSA) && newSA.checkOtherRestrictions()) {
|
||||
sas.add(newSA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,20 +101,26 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
|
||||
}
|
||||
}
|
||||
|
||||
return checkOtherRestrictions();
|
||||
} // canPlay()
|
||||
|
||||
public boolean checkOtherRestrictions() {
|
||||
final Card source = this.getSourceCard();
|
||||
Player activator = getActivatingPlayer();
|
||||
final Game game = activator.getGame();
|
||||
// CantBeCast static abilities
|
||||
final List<Card> allp = new ArrayList<Card>(game.getCardsIn(ZoneType.listValueOf("Battlefield,Command")));
|
||||
allp.add(card);
|
||||
allp.add(source);
|
||||
for (final Card ca : allp) {
|
||||
final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
|
||||
for (final StaticAbility stAb : staticAbilities) {
|
||||
if (stAb.applyAbility("CantBeCast", card, activator)) {
|
||||
if (stAb.applyAbility("CantBeCast", source, activator)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} // canPlay()
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
|
||||
@@ -316,10 +316,9 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
//GuiDisplayUtil.updateGUI();
|
||||
} else {
|
||||
for (OptionalCost s : sp.getOptionalCosts()) {
|
||||
|
||||
sp.getSourceCard().addOptionalCostPaid(s);
|
||||
}
|
||||
if (sp.getSourceCard().isCopiedSpell()) {
|
||||
if (sp.isCopied()) {
|
||||
si = this.push(sp);
|
||||
} else {
|
||||
if (sp.isMultiKicker()) {
|
||||
@@ -474,7 +473,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
game.getPhaseHandler().setPriority(sp.getActivatingPlayer());
|
||||
}
|
||||
|
||||
if (sp.isSpell() && !sp.getSourceCard().isCopiedSpell()) {
|
||||
if (sp.isSpell() && !sp.isCopied()) {
|
||||
this.thisTurnCast.add(sp.getSourceCard());
|
||||
|
||||
final Game game = sp.getActivatingPlayer().getGame();
|
||||
|
||||
Reference in New Issue
Block a user