mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
*Tweaked DigUntil to allow digging through Planar & Scheme decks.
*Many tweaks to planechase handling. *Made MagicStack.peekAbility synchronized. *Fixed(?) ConcurrentModificationException. in VStack. *Added phenomenon: Spatial Merging.
This commit is contained in:
@@ -97,13 +97,14 @@ public class DigUntilEffect extends SpellAbilityEffect {
|
||||
final int foundLibPos = AbilityUtils.calculateAmount(host, sa.getParam("FoundLibraryPosition"), sa);
|
||||
final ZoneType revealedDest = ZoneType.smartValueOf(sa.getParam("RevealedDestination"));
|
||||
final int revealedLibPos = AbilityUtils.calculateAmount(host, sa.getParam("RevealedLibraryPosition"), sa);
|
||||
|
||||
final ZoneType digSite = sa.hasParam("DigZone") ? ZoneType.smartValueOf(sa.getParam("DigZone")) : ZoneType.Library;
|
||||
|
||||
for (final Player p : getTargetPlayers(sa)) {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
final List<Card> found = new ArrayList<Card>();
|
||||
final List<Card> revealed = new ArrayList<Card>();
|
||||
|
||||
final PlayerZone library = p.getZone(ZoneType.Library);
|
||||
final PlayerZone library = p.getZone(digSite);
|
||||
|
||||
final int maxToDig = maxRevealed != null ? maxRevealed : library.size();
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ public class PlaneswalkEffect extends SpellAbilityEffect {
|
||||
public void resolve(SpellAbility sa) {
|
||||
GameState game = sa.getActivatingPlayer().getGame();
|
||||
|
||||
System.out.println("AF Planeswalking!");
|
||||
|
||||
for(Player p : game.getPlayers())
|
||||
{
|
||||
p.leaveCurrentPlane();
|
||||
|
||||
@@ -736,6 +736,8 @@ public class GameAction {
|
||||
case Exile: return this.exile(c);
|
||||
case Ante: return this.moveTo(c.getOwner().getZone(ZoneType.Ante), c);
|
||||
case Command: return this.moveTo(c.getOwner().getZone(ZoneType.Command), c);
|
||||
case PlanarDeck: return this.moveTo(c.getOwner().getZone(ZoneType.PlanarDeck), c);
|
||||
case SchemeDeck: return this.moveTo(c.getOwner().getZone(ZoneType.SchemeDeck), c);
|
||||
default: return this.moveToStack(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2954,7 +2954,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
* Then runs triggers.
|
||||
*/
|
||||
public void planeswalk()
|
||||
{
|
||||
{
|
||||
planeswalkTo(Arrays.asList(getZone(ZoneType.PlanarDeck).get(0)));
|
||||
}
|
||||
|
||||
@@ -2966,12 +2966,18 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
*/
|
||||
public void planeswalkTo(final List<Card> destinations)
|
||||
{
|
||||
currentPlanes = destinations;
|
||||
System.out.println(this.getName() + ": planeswalk to " + destinations.toString());
|
||||
currentPlanes.addAll(destinations);
|
||||
|
||||
for(Card c : currentPlanes) {
|
||||
getZone(ZoneType.PlanarDeck).remove(c);
|
||||
getZone(ZoneType.Command).add(c);
|
||||
}
|
||||
}
|
||||
|
||||
//DBG
|
||||
//System.out.println("CurrentPlanes: " + currentPlanes);
|
||||
//System.out.println("ActivePlanes: " + game.getActivePlanes());
|
||||
//System.out.println("CommandPlanes: " + getZone(ZoneType.Command).getCards());
|
||||
|
||||
game.setActivePlanes(currentPlanes);
|
||||
//Run PlaneswalkedTo triggers here.
|
||||
@@ -2985,7 +2991,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
* Puts my currently active planes, if any, at the bottom of my planar deck.
|
||||
*/
|
||||
public void leaveCurrentPlane()
|
||||
{
|
||||
{
|
||||
if(!currentPlanes.isEmpty())
|
||||
{
|
||||
//Run PlaneswalkedFrom triggers here.
|
||||
@@ -2994,12 +3000,17 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedFrom, runParams,false);
|
||||
|
||||
for(Card c : currentPlanes) {
|
||||
getZone(ZoneType.Command).remove(c);
|
||||
game.getZoneOf(c).remove(c);
|
||||
c.clearControllers();
|
||||
getZone(ZoneType.PlanarDeck).add(c);
|
||||
}
|
||||
currentPlanes.clear();
|
||||
}
|
||||
|
||||
//DBG
|
||||
//System.out.println("CurrentPlanes: " + currentPlanes);
|
||||
//System.out.println("ActivePlanes: " + game.getActivePlanes());
|
||||
//System.out.println("CommandPlanes: " + getZone(ZoneType.Command).getCards());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -869,7 +869,9 @@ public class MagicStack extends MyObservable implements Iterable<SpellAbilitySta
|
||||
* @return a {@link forge.card.spellability.SpellAbility} object.
|
||||
*/
|
||||
public final SpellAbility peekAbility() {
|
||||
return this.getStack().peek().getSpellAbility();
|
||||
synchronized(this.stack) {
|
||||
return this.getStack().peek().getSpellAbility();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -684,6 +684,12 @@ public final class GuiDisplayUtil {
|
||||
if(res == null)
|
||||
return;
|
||||
|
||||
System.out.println("Rigging planar dice roll: " + res.toString());
|
||||
|
||||
//DBG
|
||||
//System.out.println("ActivePlanes: " + getGame().getActivePlanes());
|
||||
//System.out.println("CommandPlanes: " + getGame().getCardsIn(ZoneType.Command));
|
||||
|
||||
PlanarDice.roll(p, res);
|
||||
|
||||
FThreads.invokeInNewThread(new Runnable() {
|
||||
|
||||
@@ -137,7 +137,8 @@ public enum VStack implements IVDoc<CStack> {
|
||||
|
||||
stackTARs.clear();
|
||||
boolean isFirst = true;
|
||||
for (final SpellAbilityStackInstance spell : stack) {
|
||||
for (int i = 0;i<stack.size();i++) {
|
||||
final SpellAbilityStackInstance spell = stack.getStack().get(i);
|
||||
scheme = getSpellColor(spell);
|
||||
|
||||
String isOptional = spell.getSpellAbility().isOptionalTrigger() && spell.getSourceCard().getController().equals(viewer) ? "(OPTIONAL) " : "";
|
||||
|
||||
Reference in New Issue
Block a user