mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
setPriority to human player moved from Input and CField to Player.playSpellAbility (that both sources call)
InputProxy.selectCard no longer requires PlayerZone (it can be derived from card by those who needed it) ComputerUtil - rem imports
This commit is contained in:
@@ -85,7 +85,6 @@ public class InputPassPriority extends Input {
|
|||||||
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(card, player));
|
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(card, player));
|
||||||
if ( null != ab) {
|
if ( null != ab) {
|
||||||
player.playSpellAbility(card, ab);
|
player.playSpellAbility(card, ab);
|
||||||
Singletons.getModel().getGame().getPhaseHandler().setPriority(player);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);
|
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);
|
||||||
|
|||||||
@@ -36,11 +36,8 @@ import forge.card.ability.ApiType;
|
|||||||
import forge.card.ability.effects.CharmEffect;
|
import forge.card.ability.effects.CharmEffect;
|
||||||
import forge.card.cardfactory.CardFactoryUtil;
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
import forge.card.cost.CostPart;
|
|
||||||
import forge.card.cost.CostPartMana;
|
|
||||||
import forge.card.cost.CostPayment;
|
import forge.card.cost.CostPayment;
|
||||||
import forge.card.cost.CostUtil;
|
import forge.card.cost.CostUtil;
|
||||||
import forge.card.mana.ManaCost;
|
|
||||||
import forge.card.spellability.AbilityStatic;
|
import forge.card.spellability.AbilityStatic;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
|
|||||||
@@ -2994,10 +2994,12 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
|||||||
* @param ab
|
* @param ab
|
||||||
*/
|
*/
|
||||||
public void playSpellAbility(Card c, SpellAbility ab) {
|
public void playSpellAbility(Card c, SpellAbility ab) {
|
||||||
if (ab == Ability.PLAY_LAND_SURROGATE) {
|
if (ab == Ability.PLAY_LAND_SURROGATE)
|
||||||
this.playLand(c);
|
this.playLand(c);
|
||||||
} else
|
else {
|
||||||
game.getActionPlay().playSpellAbility(ab, this);
|
game.getActionPlay().playSpellAbility(ab, this);
|
||||||
|
}
|
||||||
|
game.getPhaseHandler().setPriority(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import forge.Card;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.input.Input;
|
import forge.control.input.Input;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.PlayerZone;
|
|
||||||
import forge.view.ButtonUtil;
|
import forge.view.ButtonUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,7 +101,7 @@ public class InputProxy implements Observer {
|
|||||||
* @param zone
|
* @param zone
|
||||||
* a {@link forge.game.zone.PlayerZone} object.
|
* a {@link forge.game.zone.PlayerZone} object.
|
||||||
*/
|
*/
|
||||||
public final void selectCard(final Card card, final PlayerZone zone) {
|
public final void selectCard(final Card card) {
|
||||||
this.getInput().selectCard(card);
|
this.getInput().selectCard(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class CCommand implements ICDoc {
|
|||||||
|
|
||||||
if (c != null && c.isInZone(ZoneType.Command)) {
|
if (c != null && c.isInZone(ZoneType.Command)) {
|
||||||
//TODO: Cast commander/activate avatar/roll planar dice here.
|
//TODO: Cast commander/activate avatar/roll planar dice here.
|
||||||
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c, player.getZone(ZoneType.Command));
|
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,6 @@ public class CField implements ICDoc {
|
|||||||
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(c, player));
|
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(c, player));
|
||||||
if ( null != ab) {
|
if ( null != ab) {
|
||||||
player.playSpellAbility(c, ab);
|
player.playSpellAbility(c, ab);
|
||||||
game.getPhaseHandler().setPriority(player);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.actionPerformed(null);
|
}.actionPerformed(null);
|
||||||
|
|||||||
@@ -108,8 +108,7 @@ public class CHand implements ICDoc {
|
|||||||
public void mousePressed(final MouseEvent e) {
|
public void mousePressed(final MouseEvent e) {
|
||||||
if (e.getButton() != MouseEvent.BUTTON1) { return; }
|
if (e.getButton() != MouseEvent.BUTTON1) { return; }
|
||||||
|
|
||||||
CMessage.SINGLETON_INSTANCE.getInputControl()
|
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(cardobj);
|
||||||
.selectCard(cardobj, Singletons.getControl().getPlayer().getZone(ZoneType.Hand));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -184,7 +183,7 @@ public class CHand implements ICDoc {
|
|||||||
}
|
}
|
||||||
final Card c = view.getHandArea().getHoveredCard(e);
|
final Card c = view.getHandArea().getHoveredCard(e);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c, Singletons.getControl().getPlayer().getZone(ZoneType.Hand));
|
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user