mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
LandAbility: do extra ability class, so it can use mayPlay
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.LandAbility;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.model.FModel;
|
||||
import forge.player.GamePlayerUtil;
|
||||
@@ -162,7 +163,7 @@ public class InputPassPriority extends InputSyncronizedBase {
|
||||
if (sa.isSpell()) {
|
||||
return "cast spell";
|
||||
}
|
||||
if (sa == card.getGame().PLAY_LAND_SURROGATE) {
|
||||
if (sa instanceof LandAbility) {
|
||||
return "play land";
|
||||
}
|
||||
return "activate ability";
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.game.cost.*;
|
||||
import forge.game.spellability.LandAbility;
|
||||
import forge.game.spellability.OptionalCostValue;
|
||||
import forge.game.spellability.Spell;
|
||||
import forge.util.TextUtil;
|
||||
@@ -66,8 +67,11 @@ public class HumanPlay {
|
||||
public final static boolean playSpellAbility(final PlayerControllerHuman controller, final Player p, SpellAbility sa) {
|
||||
FThreads.assertExecutedByEdt(false);
|
||||
|
||||
if (sa == controller.getGame().PLAY_LAND_SURROGATE) {
|
||||
p.playLand(sa.getHostCard(), false);
|
||||
if (sa instanceof LandAbility) {
|
||||
sa.setActivatingPlayer(p);
|
||||
if (sa.canPlay()) {
|
||||
sa.resolve();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user