mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
*Preliminary work to allow multiple planes.
*Fixed Panopticon triggering outside the Command zone.
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Panopticon
|
|||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Plane Mirrodin
|
Types:Plane Mirrodin
|
||||||
T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | TriggerZones$ Command | Execute$ PanopticonDraw | TriggerDescription$ When you planeswalk to CARDNAME, draw a card.
|
T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | TriggerZones$ Command | Execute$ PanopticonDraw | TriggerDescription$ When you planeswalk to CARDNAME, draw a card.
|
||||||
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | Execute$ PanopticonDraw | TriggerDescription$ At the beginning of your draw step, draw an additional card.
|
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | Execute$ PanopticonDraw | TriggerZones$ Command | TriggerDescription$ At the beginning of your draw step, draw an additional card.
|
||||||
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ PanopticonDraw | TriggerDescription$ Whenever you roll Chaos, draw a card.
|
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ PanopticonDraw | TriggerDescription$ Whenever you roll Chaos, draw a card.
|
||||||
SVar:PanopticonDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1
|
SVar:PanopticonDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/panopticon.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/panopticon.jpg
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package forge.card.ability.effects;
|
package forge.card.ability.effects;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.ability.SpellAbilityEffect;
|
import forge.card.ability.SpellAbilityEffect;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.game.GameState;
|
import forge.game.GameState;
|
||||||
@@ -24,7 +28,15 @@ public class PlaneswalkEffect extends SpellAbilityEffect {
|
|||||||
{
|
{
|
||||||
p.leaveCurrentPlane();
|
p.leaveCurrentPlane();
|
||||||
}
|
}
|
||||||
|
if(sa.hasParam("Defined")) {
|
||||||
|
List<Card> destinations = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa);
|
||||||
|
sa.getActivatingPlayer().planeswalkTo(destinations);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
sa.getActivatingPlayer().planeswalk();
|
sa.getActivatingPlayer().planeswalk();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package forge.card.trigger;
|
package forge.card.trigger;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
@@ -33,12 +34,15 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
|||||||
@Override
|
@Override
|
||||||
public boolean performTest(Map<String, Object> runParams2) {
|
public boolean performTest(Map<String, Object> runParams2) {
|
||||||
if (this.mapParams.containsKey("ValidCard")) {
|
if (this.mapParams.containsKey("ValidCard")) {
|
||||||
final Card moved = (Card) runParams2.get("Card");
|
for(Card moved : (ArrayList<Card>)runParams2.get("Card"))
|
||||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
{
|
||||||
|
if (moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||||
this.getHostCard())) {
|
this.getHostCard())) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package forge.card.trigger;
|
package forge.card.trigger;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
@@ -33,12 +34,15 @@ public class TriggerPlaneswalkedTo extends Trigger {
|
|||||||
@Override
|
@Override
|
||||||
public boolean performTest(Map<String, Object> runParams2) {
|
public boolean performTest(Map<String, Object> runParams2) {
|
||||||
if (this.mapParams.containsKey("ValidCard")) {
|
if (this.mapParams.containsKey("ValidCard")) {
|
||||||
final Card moved = (Card) runParams2.get("Card");
|
for(Card moved : (ArrayList<Card>)runParams2.get("Card"))
|
||||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
{
|
||||||
|
if (moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||||
this.getHostCard())) {
|
this.getHostCard())) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ public class GameState {
|
|||||||
private final List<Player> allPlayers;
|
private final List<Player> allPlayers;
|
||||||
private final List<Player> ingamePlayers = new ArrayList<Player>();
|
private final List<Player> ingamePlayers = new ArrayList<Player>();
|
||||||
|
|
||||||
private final List<Card> communalPlanarDeck = new ArrayList<Card>();
|
private List<Card> activePlanes = null;
|
||||||
private Card activePlane = null;
|
|
||||||
|
|
||||||
public final Cleanup cleanup;
|
public final Cleanup cleanup;
|
||||||
public final EndOfTurn endOfTurn;
|
public final EndOfTurn endOfTurn;
|
||||||
@@ -561,15 +560,15 @@ public class GameState {
|
|||||||
/**
|
/**
|
||||||
* @return the activePlane
|
* @return the activePlane
|
||||||
*/
|
*/
|
||||||
public Card getActivePlane() {
|
public List<Card> getActivePlanes() {
|
||||||
return activePlane;
|
return activePlanes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param activePlane0 the activePlane to set
|
* @param activePlane0 the activePlane to set
|
||||||
*/
|
*/
|
||||||
public void setActivePlane(Card activePlane0) {
|
public void setActivePlanes(List<Card> activePlane0) {
|
||||||
this.activePlane = activePlane0;
|
this.activePlanes = activePlane0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void archenemy904_10() {
|
public void archenemy904_10() {
|
||||||
|
|||||||
@@ -552,12 +552,14 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
|||||||
SDisplayUtil.showTab(nextField);
|
SDisplayUtil.showTab(nextField);
|
||||||
|
|
||||||
if (game.getType() == GameType.Planechase) {
|
if (game.getType() == GameType.Planechase) {
|
||||||
Card p = game.getActivePlane();
|
for(Card p :game.getActivePlanes())
|
||||||
|
{
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
p.setController(next, 0);
|
p.setController(next, 0);
|
||||||
game.getAction().controllerChangeZoneCorrection(p);
|
game.getAction().controllerChangeZoneCorrection(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
/** The zones. */
|
/** The zones. */
|
||||||
private final Map<ZoneType, PlayerZone> zones = new EnumMap<ZoneType, PlayerZone>(ZoneType.class);
|
private final Map<ZoneType, PlayerZone> zones = new EnumMap<ZoneType, PlayerZone>(ZoneType.class);
|
||||||
|
|
||||||
private Card currentPlane = null;
|
private List<Card> currentPlanes = new ArrayList<Card>();
|
||||||
|
|
||||||
private PlayerStatistics stats = new PlayerStatistics();
|
private PlayerStatistics stats = new PlayerStatistics();
|
||||||
protected PlayerController controller;
|
protected PlayerController controller;
|
||||||
@@ -2949,37 +2949,50 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
*/
|
*/
|
||||||
public void planeswalk()
|
public void planeswalk()
|
||||||
{
|
{
|
||||||
|
planeswalkTo(Arrays.asList(getZone(ZoneType.PlanarDeck).get(0)));
|
||||||
|
}
|
||||||
|
|
||||||
currentPlane = getZone(ZoneType.PlanarDeck).get(0);
|
/**
|
||||||
|
* Puts the planes in the argument and puts them face up in the command zone.
|
||||||
|
* Then runs triggers.
|
||||||
|
*
|
||||||
|
* @param destinations The planes to planeswalk to.
|
||||||
|
*/
|
||||||
|
public void planeswalkTo(final List<Card> destinations)
|
||||||
|
{
|
||||||
|
currentPlanes = destinations;
|
||||||
|
|
||||||
getZone(ZoneType.PlanarDeck).remove(currentPlane);
|
for(Card c : currentPlanes) {
|
||||||
getZone(ZoneType.Command).add(currentPlane);
|
getZone(ZoneType.PlanarDeck).remove(c);
|
||||||
|
getZone(ZoneType.Command).add(c);
|
||||||
|
}
|
||||||
|
|
||||||
game.setActivePlane(currentPlane);
|
game.setActivePlanes(currentPlanes);
|
||||||
//Run PlaneswalkedTo triggers here.
|
//Run PlaneswalkedTo triggers here.
|
||||||
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
||||||
runParams.put("Card", currentPlane);
|
runParams.put("Card", currentPlanes);
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedTo, runParams,false);
|
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedTo, runParams,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Puts my currently active plane, if any, at the bottom of my planar deck.
|
* Puts my currently active planes, if any, at the bottom of my planar deck.
|
||||||
*/
|
*/
|
||||||
public void leaveCurrentPlane()
|
public void leaveCurrentPlane()
|
||||||
{
|
{
|
||||||
if(currentPlane != null)
|
if(!currentPlanes.isEmpty())
|
||||||
{
|
{
|
||||||
//Run PlaneswalkedFrom triggers here.
|
//Run PlaneswalkedFrom triggers here.
|
||||||
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
||||||
runParams.put("Card", currentPlane);
|
runParams.put("Card", currentPlanes);
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedFrom, runParams,false);
|
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedFrom, runParams,false);
|
||||||
|
|
||||||
Zone com = game.getZoneOf(currentPlane);
|
for(Card c : currentPlanes) {
|
||||||
com.remove(currentPlane);
|
getZone(ZoneType.Command).remove(c);
|
||||||
currentPlane.clearControllers();
|
c.clearControllers();
|
||||||
getZone(ZoneType.PlanarDeck).add(currentPlane);
|
getZone(ZoneType.PlanarDeck).add(c);
|
||||||
currentPlane = null;
|
}
|
||||||
|
currentPlanes.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3000,13 +3013,13 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentPlane = firstPlane;
|
currentPlanes.add(firstPlane);
|
||||||
getZone(ZoneType.Command).add(firstPlane);
|
getZone(ZoneType.Command).add(firstPlane);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
game.setActivePlane(currentPlane);
|
game.setActivePlanes(currentPlanes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user