mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
ChangeZoneEffect: special Facedown rules for Tezzeret
This commit is contained in:
@@ -153,6 +153,7 @@ public class GameAction {
|
|||||||
// up on the wrong card state etc.).
|
// up on the wrong card state etc.).
|
||||||
if (c.isFaceDown() && (fromBattlefield || (toHand && zoneFrom.is(ZoneType.Exile)))) {
|
if (c.isFaceDown() && (fromBattlefield || (toHand && zoneFrom.is(ZoneType.Exile)))) {
|
||||||
c.setState(CardStateName.Original, true);
|
c.setState(CardStateName.Original, true);
|
||||||
|
c.runFaceupCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the temporary Dash SVar when the Dashed card leaves the battlefield
|
// Clean up the temporary Dash SVar when the Dashed card leaves the battlefield
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import com.google.common.collect.Iterables;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import forge.GameCommand;
|
||||||
import forge.card.CardStateName;
|
import forge.card.CardStateName;
|
||||||
|
import forge.card.CardType;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.GameEntity;
|
import forge.game.GameEntity;
|
||||||
import forge.game.GameObject;
|
import forge.game.GameObject;
|
||||||
@@ -32,6 +34,7 @@ import forge.util.collect.*;
|
|||||||
import forge.util.Lang;
|
import forge.util.Lang;
|
||||||
import forge.util.MessageUtil;
|
import forge.util.MessageUtil;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -1101,11 +1104,49 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// need to be facedown before it hits the battlefield in case of Replacement Effects or Trigger
|
||||||
|
if (sa.hasParam("FaceDown") && ZoneType.Battlefield.equals(destination)) {
|
||||||
|
c.setState(CardStateName.FaceDown, true);
|
||||||
|
|
||||||
|
// set New Pt doesn't work because this values need to be copyable for clone effects
|
||||||
|
if (sa.hasParam("FaceDownPower") || sa.hasParam("FaceDownToughness")) {
|
||||||
|
if (sa.hasParam("FaceDownPower")) {
|
||||||
|
c.setBasePower(AbilityUtils.calculateAmount(
|
||||||
|
source, sa.getParam("FaceDownPower"), sa));
|
||||||
|
}
|
||||||
|
if (sa.hasParam("FaceDownToughness")) {
|
||||||
|
c.setBaseToughness(AbilityUtils.calculateAmount(
|
||||||
|
source, sa.getParam("FaceDownToughness"), sa));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sa.hasParam("FaceDownAddType")) {
|
||||||
|
CardType t = new CardType(c.getCurrentState().getType());
|
||||||
|
t.addAll(Arrays.asList(sa.getParam("FaceDownAddType").split(",")));
|
||||||
|
c.getCurrentState().setType(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sa.hasParam("FaceDownPower") || sa.hasParam("FaceDownToughness")
|
||||||
|
|| sa.hasParam("FaceDownAddType")) {
|
||||||
|
final GameCommand unanimate = new GameCommand() {
|
||||||
|
private static final long serialVersionUID = 8853789549297846163L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
c.clearStates(CardStateName.FaceDown, true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
c.addFaceupCommand(unanimate);
|
||||||
|
}
|
||||||
|
}
|
||||||
movedCard = game.getAction().moveTo(c.getController().getZone(destination), c, sa, null);
|
movedCard = game.getAction().moveTo(c.getController().getZone(destination), c, sa, null);
|
||||||
if (sa.hasParam("Tapped")) {
|
if (sa.hasParam("Tapped")) {
|
||||||
movedCard.setTapped(true);
|
movedCard.setTapped(true);
|
||||||
}
|
}
|
||||||
if (sa.hasParam("FaceDown")) {
|
|
||||||
|
// need to do that again?
|
||||||
|
if (sa.hasParam("FaceDown") && !ZoneType.Battlefield.equals(destination)) {
|
||||||
movedCard.setState(CardStateName.FaceDown, true);
|
movedCard.setState(CardStateName.FaceDown, true);
|
||||||
}
|
}
|
||||||
movedCard.setTimestamp(ts);
|
movedCard.setTimestamp(ts);
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
private final List<GameCommand> untapCommandList = Lists.newArrayList();
|
private final List<GameCommand> untapCommandList = Lists.newArrayList();
|
||||||
private final List<GameCommand> changeControllerCommandList = Lists.newArrayList();
|
private final List<GameCommand> changeControllerCommandList = Lists.newArrayList();
|
||||||
private final List<GameCommand> unattachCommandList = Lists.newArrayList();
|
private final List<GameCommand> unattachCommandList = Lists.newArrayList();
|
||||||
|
private final List<GameCommand> faceupCommandList = Lists.newArrayList();
|
||||||
private final List<Object[]> staticCommandList = Lists.newArrayList();
|
private final List<Object[]> staticCommandList = Lists.newArrayList();
|
||||||
|
|
||||||
private final static ImmutableList<String> storableSVars = ImmutableList.of("ChosenX");
|
private final static ImmutableList<String> storableSVars = ImmutableList.of("ChosenX");
|
||||||
@@ -589,6 +590,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean result = setState(preFaceDownState, true);
|
boolean result = setState(preFaceDownState, true);
|
||||||
|
// need to run faceup commands, currently
|
||||||
|
// it does cleanup the modified facedown state
|
||||||
|
if (result) {
|
||||||
|
runFaceupCommands();
|
||||||
|
}
|
||||||
|
|
||||||
if (result && runTriggers) {
|
if (result && runTriggers) {
|
||||||
// Run replacement effects
|
// Run replacement effects
|
||||||
Map<String, Object> repParams = Maps.newHashMap();
|
Map<String, Object> repParams = Maps.newHashMap();
|
||||||
@@ -2390,12 +2397,22 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
unattachCommandList.add(c);
|
unattachCommandList.add(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void addFaceupCommand(final GameCommand c) {
|
||||||
|
faceupCommandList.add(c);
|
||||||
|
}
|
||||||
|
|
||||||
public final void runUnattachCommands() {
|
public final void runUnattachCommands() {
|
||||||
for (final GameCommand c : unattachCommandList) {
|
for (final GameCommand c : unattachCommandList) {
|
||||||
c.run();
|
c.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void runFaceupCommands() {
|
||||||
|
for (final GameCommand c : faceupCommandList) {
|
||||||
|
c.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final void addChangeControllerCommand(final GameCommand c) {
|
public final void addChangeControllerCommand(final GameCommand c) {
|
||||||
changeControllerCommandList.add(c);
|
changeControllerCommandList.add(c);
|
||||||
}
|
}
|
||||||
|
|||||||
9
forge-gui/res/cardsfolder/t/tezzeret_cruel_machinist.txt
Normal file
9
forge-gui/res/cardsfolder/t/tezzeret_cruel_machinist.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:Tezzeret, Cruel Machinist
|
||||||
|
ManaCost:4 U U
|
||||||
|
Loyalty:4
|
||||||
|
Types:Legendary Planeswalker Tezzeret
|
||||||
|
A:AB$ Draw | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | NumCards$ 1 | Defined$ You | SpellDescription$ Draw a card.
|
||||||
|
A:AB$ Animate | Cost$ AddCounter<0/LOYALTY> | ValidTgts$ Artifact.YouCtrl | TgtPrompt$ Select target artifact you control | Power$ 5 | Toughness$ 5 | Types$ Artifact | SpellDescription$ Until your next turn, target artifact you control becomes a 5/5 creature in addition to its other types.
|
||||||
|
A:AB$ ChangeZone | Cost$ SubCounter<7/LOYALTY> | Planeswalker$ True | Ultimate$ True | Origin$ Hand | Destination$ Battlefield | ChangeType$ Card | ChangeNum$ X | References$ X | FaceDown$ True | FaceDownPower$ 5 | FaceDownToughness$ 5 | FaceDownAddType$ Artifact,Creature | StackDescription$ SpellDescription | SpellDescription$ Put any number of cards from your hand onto the battlefield face down. They're 5/5 artifact creatures.
|
||||||
|
SVar:X:Count$InYourHand
|
||||||
|
Oracle:[+1]: Draw a card.\n[0]: Until your next turn, target artifact you control becomes a 5/5 creature in addition to its other types.\n[-7]: Put any number of cards from your hand onto the battlefield face down. They're 5/5 artifact creatures.
|
||||||
Reference in New Issue
Block a user