mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Fixed Djinn of Wishes not being able to play lands.
This commit is contained in:
@@ -196,8 +196,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
// lands will be played
|
// lands will be played
|
||||||
if (tgtCard.isLand()) {
|
if (tgtCard.isLand()) {
|
||||||
controller.playLand(tgtCard);
|
if (controller.playLand(tgtCard, true) && remember) {
|
||||||
if (remember && controller.canPlayLand(tgtCard)) {
|
|
||||||
source.addRemembered(tgtCard);
|
source.addRemembered(tgtCard);
|
||||||
}
|
}
|
||||||
tgtCards.remove(tgtCard);
|
tgtCards.remove(tgtCard);
|
||||||
|
|||||||
@@ -884,7 +884,7 @@ public class AiController {
|
|||||||
while(landsWannaPlay != null && !landsWannaPlay.isEmpty() && player.canPlayLand(null)) {
|
while(landsWannaPlay != null && !landsWannaPlay.isEmpty() && player.canPlayLand(null)) {
|
||||||
Card land = chooseBestLandToPlay(landsWannaPlay);
|
Card land = chooseBestLandToPlay(landsWannaPlay);
|
||||||
landsWannaPlay.remove(land);
|
landsWannaPlay.remove(land);
|
||||||
player.playLand(land);
|
player.playLand(land, false);
|
||||||
game.getPhaseHandler().setPriority(player);
|
game.getPhaseHandler().setPriority(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class HumanPlay {
|
|||||||
*/
|
*/
|
||||||
public static void playSpellAbility(Player p, Card c, SpellAbility ab) {
|
public static void playSpellAbility(Player p, Card c, SpellAbility ab) {
|
||||||
if (ab == Ability.PLAY_LAND_SURROGATE)
|
if (ab == Ability.PLAY_LAND_SURROGATE)
|
||||||
p.playLand(c);
|
p.playLand(c, false);
|
||||||
else {
|
else {
|
||||||
HumanPlay.playSpellAbility(p, ab);
|
HumanPlay.playSpellAbility(p, ab);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1786,9 +1786,9 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
* @param land
|
* @param land
|
||||||
* a {@link forge.Card} object.
|
* a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public final void playLand(final Card land) {
|
public final boolean playLand(final Card land, final boolean ignoreTiming) {
|
||||||
FThreads.assertExecutedByEdt(false);
|
FThreads.assertExecutedByEdt(false);
|
||||||
if (this.canPlayLand(land)) {
|
if (this.canPlayLand(land, ignoreTiming)) {
|
||||||
land.setController(this, 0);
|
land.setController(this, 0);
|
||||||
game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land);
|
game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land);
|
||||||
CardFactoryUtil.playLandEffects(land);
|
CardFactoryUtil.playLandEffects(land);
|
||||||
@@ -1808,9 +1808,12 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||||
runParams.put("Card", land);
|
runParams.put("Card", land);
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false);
|
||||||
|
game.getStack().unfreezeStack();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.getStack().unfreezeStack();
|
game.getStack().unfreezeStack();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1820,9 +1823,19 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
*
|
*
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean canPlayLand(Card land) {
|
public final boolean canPlayLand(final Card land) {
|
||||||
|
return canPlayLand(land, false);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* canPlayLand.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean canPlayLand(Card land, final boolean ignoreTiming) {
|
||||||
|
|
||||||
if (!this.canCastSorcery()) {
|
if (!ignoreTiming && !this.canCastSorcery()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user