mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- A different approach to remedying the broken Play Effect problem (uses a dedicated SVar on a SpellAbility).
This commit is contained in:
@@ -107,13 +107,16 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
|
|||||||
|| this.getRestrictions().isInstantSpeed()
|
|| this.getRestrictions().isInstantSpeed()
|
||||||
|| activator.hasKeyword("You may cast nonland cards as though they had flash.")
|
|| activator.hasKeyword("You may cast nonland cards as though they had flash.")
|
||||||
|| card.hasStartOfKeyword("You may cast CARDNAME as though it had flash.")
|
|| card.hasStartOfKeyword("You may cast CARDNAME as though it had flash.")
|
||||||
|
|| this.hasSVar("IsCastFromPlayEffect")
|
||||||
|| (card.isFaceDown() && !card.getZone().is(ZoneType.Battlefield) && card.getState(CardStateName.Original).getType().isInstant()))) {
|
|| (card.isFaceDown() && !card.getZone().is(ZoneType.Battlefield) && card.getState(CardStateName.Original).getType().isInstant()))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.getRestrictions().canPlay(card, this)) {
|
if (!this.getRestrictions().canPlay(card, this)) {
|
||||||
|
if (!this.hasSVar("IsCastFromPlayEffect")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// for uncastables like lotus bloom, check if manaCost is blank (except for morph spells)
|
// for uncastables like lotus bloom, check if manaCost is blank (except for morph spells)
|
||||||
if (!isCastFaceDown() && isBasicSpell() && card.getState(card.isFaceDown() ? CardStateName.Original : card.getCurrentStateName()).getManaCost().isNoCost()) {
|
if (!isCastFaceDown() && isBasicSpell() && card.getState(card.isFaceDown() ? CardStateName.Original : card.getCurrentStateName()).getManaCost().isNoCost()) {
|
||||||
|
|||||||
@@ -63,10 +63,6 @@ public class HumanPlay {
|
|||||||
* a {@link forge.game.spellability.SpellAbility} object.
|
* a {@link forge.game.spellability.SpellAbility} object.
|
||||||
*/
|
*/
|
||||||
public final static boolean playSpellAbility(final PlayerControllerHuman controller, final Player p, SpellAbility sa) {
|
public final static boolean playSpellAbility(final PlayerControllerHuman controller, final Player p, SpellAbility sa) {
|
||||||
return playSpellAbility(controller, p, sa, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final static boolean playSpellAbility(final PlayerControllerHuman controller, final Player p, SpellAbility sa, boolean fromPlayEffect) {
|
|
||||||
FThreads.assertExecutedByEdt(false);
|
FThreads.assertExecutedByEdt(false);
|
||||||
|
|
||||||
if (sa == controller.getGame().PLAY_LAND_SURROGATE) {
|
if (sa == controller.getGame().PLAY_LAND_SURROGATE) {
|
||||||
@@ -87,7 +83,7 @@ public class HumanPlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// extra play check (unless the card is cast from a play effect)
|
// extra play check (unless the card is cast from a play effect)
|
||||||
if (!(fromPlayEffect || sa.canPlay())) {
|
if (!sa.canPlay()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1506,7 +1506,8 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean playSaFromPlayEffect(final SpellAbility tgtSA) {
|
public boolean playSaFromPlayEffect(final SpellAbility tgtSA) {
|
||||||
return HumanPlay.playSpellAbility(this, player, tgtSA, true);
|
tgtSA.setSVar("IsCastFromPlayEffect", "True");
|
||||||
|
return HumanPlay.playSpellAbility(this, player, tgtSA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user